Repository navigation
Expand file tree
/
Copy pathcollections.po
More file actions
1948 lines (1706 loc) · 96.3 KB
/
Copy pathcollections.po
File metadata and controls
1948 lines (1706 loc) · 96.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2025, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Dmytro Kazanzhy, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-04-25 14:19+0000\n"
"PO-Revision-Date: 2021-06-28 00:56+0000\n"
"Last-Translator: Dmytro Kazanzhy, 2025\n"
"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/"
"uk/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: uk\n"
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != "
"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % "
"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || "
"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
msgid ":mod:`!collections` --- Container datatypes"
msgstr ""
msgid "**Source code:** :source:`Lib/collections/__init__.py`"
msgstr "**Вихідний код:** :source:`Lib/collections/__init__.py`"
msgid ""
"This module implements specialized container datatypes providing "
"alternatives to Python's general purpose built-in containers, :class:"
"`dict`, :class:`list`, :class:`set`, and :class:`tuple`."
msgstr ""
"Цей модуль реалізує спеціалізовані типи даних контейнерів, що є "
"альтернативою вбудованим контейнерам загального призначення Python, :class:"
"`dict`, :class:`list`, :class:`set` і :class:`tuple`."
msgid ":func:`namedtuple`"
msgstr ":func:`namedtuple`"
msgid "factory function for creating tuple subclasses with named fields"
msgstr "функція фабрики для створення підкласів кортежів з іменованими полями"
msgid ":class:`deque`"
msgstr ":class:`deque`"
msgid "list-like container with fast appends and pops on either end"
msgstr ""
"контейнер, схожий на список, із швидким додаванням і вискакуванням на обох "
"кінцях"
msgid ":class:`ChainMap`"
msgstr ":class:`ChainMap`"
msgid "dict-like class for creating a single view of multiple mappings"
msgstr "dict-подібний клас для створення єдиного перегляду кількох відображень"
msgid ":class:`Counter`"
msgstr ":class:`Counter`"
msgid "dict subclass for counting :term:`hashable` objects"
msgstr ""
msgid ":class:`OrderedDict`"
msgstr ":class:`OrderedDict`"
msgid "dict subclass that remembers the order entries were added"
msgstr "підклас dict, який запам’ятовує додані записи порядку"
msgid ":class:`defaultdict`"
msgstr ":class:`defaultdict`"
msgid "dict subclass that calls a factory function to supply missing values"
msgstr ""
"підклас dict, який викликає фабричну функцію для надання відсутніх значень"
msgid ":class:`UserDict`"
msgstr ":class:`UserDict`"
msgid "wrapper around dictionary objects for easier dict subclassing"
msgstr ""
"обгортка навколо об’єктів словника для легшого створення підкласів dict"
msgid ":class:`UserList`"
msgstr ":class:`UserList`"
msgid "wrapper around list objects for easier list subclassing"
msgstr ""
"обгортка навколо об'єктів списку для легшого створення підкласів списку"
msgid ":class:`UserString`"
msgstr ":class:`UserString`"
msgid "wrapper around string objects for easier string subclassing"
msgstr ""
"обгортка навколо рядкових об'єктів для легшого створення підкласів рядків"
msgid ":class:`ChainMap` objects"
msgstr ":class:`ChainMap` об'єкти"
msgid ""
"A :class:`ChainMap` class is provided for quickly linking a number of "
"mappings so they can be treated as a single unit. It is often much faster "
"than creating a new dictionary and running multiple :meth:`~dict.update` "
"calls."
msgstr ""
"Клас :class:`ChainMap` надається для швидкого зв’язування кількох "
"відображень, щоб їх можна було розглядати як єдине ціле. Часто це набагато "
"швидше, ніж створення нового словника та виконання кількох викликів :meth:"
"`~dict.update`."
msgid ""
"The class can be used to simulate nested scopes and is useful in templating."
msgstr ""
"Клас можна використовувати для імітації вкладених областей і корисний у "
"створенні шаблонів."
msgid ""
"A :class:`ChainMap` groups multiple dicts or other mappings together to "
"create a single, updateable view. If no *maps* are specified, a single "
"empty dictionary is provided so that a new chain always has at least one "
"mapping."
msgstr ""
":class:`ChainMap` групує кілька dicts або інших відображень разом, щоб "
"створити єдине оновлюване подання. Якщо *maps* не вказано, надається єдиний "
"порожній словник, щоб новий ланцюжок завжди мав принаймні одне відображення."
msgid ""
"The underlying mappings are stored in a list. That list is public and can "
"be accessed or updated using the *maps* attribute. There is no other state."
msgstr ""
"Базові відображення зберігаються в списку. Цей список є загальнодоступним, і "
"до нього можна отримати доступ або оновити за допомогою атрибута *maps*. "
"Іншої держави немає."
msgid ""
"Lookups search the underlying mappings successively until a key is found. "
"In contrast, writes, updates, and deletions only operate on the first "
"mapping."
msgstr ""
"Пошуки послідовно шукають базові відображення, доки не буде знайдено ключ. "
"Навпаки, записи, оновлення та видалення діють лише на першому відображенні."
msgid ""
"A :class:`ChainMap` incorporates the underlying mappings by reference. So, "
"if one of the underlying mappings gets updated, those changes will be "
"reflected in :class:`ChainMap`."
msgstr ""
":class:`ChainMap` включає базові відображення за посиланням. Отже, якщо одне "
"з базових відображень буде оновлено, ці зміни буде відображено в :class:"
"`ChainMap`."
msgid ""
"All of the usual dictionary methods are supported. In addition, there is a "
"*maps* attribute, a method for creating new subcontexts, and a property for "
"accessing all but the first mapping:"
msgstr ""
"Підтримуються всі звичайні словникові методи. Крім того, існує атрибут "
"*maps*, метод для створення нових підконтекстів і властивість для доступу до "
"всіх відображень, крім першого:"
msgid ""
"A user updateable list of mappings. The list is ordered from first-searched "
"to last-searched. It is the only stored state and can be modified to change "
"which mappings are searched. The list should always contain at least one "
"mapping."
msgstr ""
"Список відображень, який можна оновлювати користувачем. Список упорядковано "
"від першого до останнього. Це єдиний стан, який зберігається, і його можна "
"змінити, щоб змінити зіставлення, які шукаються. Список завжди повинен "
"містити принаймні одне зіставлення."
msgid ""
"Returns a new :class:`ChainMap` containing a new map followed by all of the "
"maps in the current instance. If ``m`` is specified, it becomes the new map "
"at the front of the list of mappings; if not specified, an empty dict is "
"used, so that a call to ``d.new_child()`` is equivalent to: ``ChainMap({}, "
"*d.maps)``. If any keyword arguments are specified, they update passed map "
"or new empty dict. This method is used for creating subcontexts that can be "
"updated without altering values in any of the parent mappings."
msgstr ""
"Повертає новий :class:`ChainMap`, який містить нову карту, за якою слідують "
"усі карти в поточному екземплярі. Якщо вказано ``m``, воно стає новою картою "
"на початку списку зіставлень; якщо не вказано, використовується порожній "
"dict, так що виклик ``d.new_child()`` еквівалентний: ``ChainMap({}, *d."
"maps)``. Якщо вказано будь-які аргументи ключового слова, вони оновлюють "
"передану карту або новий порожній dict. Цей метод використовується для "
"створення підконтекстів, які можна оновлювати без зміни значень у будь-якому "
"з батьківських відображень."
msgid "The optional ``m`` parameter was added."
msgstr "Додано необов’язковий параметр ``m``."
msgid "Keyword arguments support was added."
msgstr "Додано підтримку аргументів ключових слів."
msgid ""
"Property returning a new :class:`ChainMap` containing all of the maps in the "
"current instance except the first one. This is useful for skipping the "
"first map in the search. Use cases are similar to those for the :keyword:"
"`nonlocal` keyword used in :term:`nested scopes <nested scope>`. The use "
"cases also parallel those for the built-in :func:`super` function. A "
"reference to ``d.parents`` is equivalent to: ``ChainMap(*d.maps[1:])``."
msgstr ""
"Властивість, що повертає новий :class:`ChainMap`, що містить усі карти в "
"поточному екземплярі, крім першої. Це корисно для пропуску першої карти в "
"пошуку. Випадки використання схожі на випадки використання ключового слова :"
"keyword:`nonlocal`, що використовується у :term:`вкладених областях <nested "
"scope>`. Випадки використання також аналогічні використанню вбудованої "
"функції :func:`super`. Посилання на ``d.parents`` еквівалентне: "
"``ChainMap(*d.maps[1:])``."
msgid ""
"Note, the iteration order of a :class:`ChainMap` is determined by scanning "
"the mappings last to first::"
msgstr ""
msgid ""
">>> baseline = {'music': 'bach', 'art': 'rembrandt'}\n"
">>> adjustments = {'art': 'van gogh', 'opera': 'carmen'}\n"
">>> list(ChainMap(adjustments, baseline))\n"
"['music', 'art', 'opera']"
msgstr ""
msgid ""
"This gives the same ordering as a series of :meth:`dict.update` calls "
"starting with the last mapping::"
msgstr ""
"Це дає такий самий порядок, як і серія викликів :meth:`dict.update`, "
"починаючи з останнього відображення::"
msgid ""
">>> combined = baseline.copy()\n"
">>> combined.update(adjustments)\n"
">>> list(combined)\n"
"['music', 'art', 'opera']"
msgstr ""
msgid "Added support for ``|`` and ``|=`` operators, specified in :pep:`584`."
msgstr "Додано підтримку операторів ``|`` і ``|=``, указаних у :pep:`584`."
msgid ""
"The `MultiContext class <https://github.com/enthought/codetools/blob/4.0.0/"
"codetools/contexts/multi_context.py>`_ in the Enthought `CodeTools package "
"<https://github.com/enthought/codetools>`_ has options to support writing to "
"any mapping in the chain."
msgstr ""
"`MultiContext class <https://github.com/enthought/codetools/blob/4.0.0/"
"codetools/contexts/multi_context.py>`_ у пакеті Enthought `CodeTools "
"<https://github.com/enthought/codetools>`_ має опції для підтримки запису в "
"будь-яке відображення в ланцюжку."
msgid ""
"Django's `Context class <https://github.com/django/django/blob/main/django/"
"template/context.py>`_ for templating is a read-only chain of mappings. It "
"also features pushing and popping of contexts similar to the :meth:"
"`~collections.ChainMap.new_child` method and the :attr:`~collections."
"ChainMap.parents` property."
msgstr ""
"`Клас контексту Django <https://github.com/django/django/blob/main/django/"
"template/context.py>`_ для створення шаблонів — це ланцюжок відображень лише "
"для читання. Він також має функцію надсилання та витягування контекстів, "
"подібних до методу :meth:`~collections.ChainMap.new_child` і властивості :"
"attr:`~collections.ChainMap.parents`."
msgid ""
"The `Nested Contexts recipe <https://code.activestate.com/recipes/577434-"
"nested-contexts-a-chain-of-mapping-objects/>`_ has options to control "
"whether writes and other mutations apply only to the first mapping or to any "
"mapping in the chain."
msgstr ""
msgid ""
"A `greatly simplified read-only version of Chainmap <https://code."
"activestate.com/recipes/305268/>`_."
msgstr ""
"`Значно спрощена версія Chainmap тільки для читання <https://code."
"activestate.com/recipes/305268/>`_."
msgid ":class:`ChainMap` Examples and Recipes"
msgstr ":class:`ChainMap` Приклади та рецепти"
msgid "This section shows various approaches to working with chained maps."
msgstr ""
"У цьому розділі показано різні підходи до роботи з ланцюжковими картами."
msgid "Example of simulating Python's internal lookup chain::"
msgstr "Приклад симуляції внутрішнього ланцюжка пошуку Python::"
msgid ""
"import builtins\n"
"pylookup = ChainMap(locals(), globals(), vars(builtins))"
msgstr ""
msgid ""
"Example of letting user specified command-line arguments take precedence "
"over environment variables which in turn take precedence over default "
"values::"
msgstr ""
"Приклад надання переваги заданим користувачем аргументам командного рядка "
"над змінними середовища, які, у свою чергу, мають пріоритет над значеннями "
"за замовчуванням::"
msgid ""
"import os, argparse\n"
"\n"
"defaults = {'color': 'red', 'user': 'guest'}\n"
"\n"
"parser = argparse.ArgumentParser()\n"
"parser.add_argument('-u', '--user')\n"
"parser.add_argument('-c', '--color')\n"
"namespace = parser.parse_args()\n"
"command_line_args = {k: v for k, v in vars(namespace).items() if v is not "
"None}\n"
"\n"
"combined = ChainMap(command_line_args, os.environ, defaults)\n"
"print(combined['color'])\n"
"print(combined['user'])"
msgstr ""
msgid ""
"Example patterns for using the :class:`ChainMap` class to simulate nested "
"contexts::"
msgstr ""
"Приклади шаблонів використання класу :class:`ChainMap` для імітації "
"вкладених контекстів::"
msgid ""
"c = ChainMap() # Create root context\n"
"d = c.new_child() # Create nested child context\n"
"e = c.new_child() # Child of c, independent from d\n"
"e.maps[0] # Current context dictionary -- like Python's "
"locals()\n"
"e.maps[-1] # Root context -- like Python's globals()\n"
"e.parents # Enclosing context chain -- like Python's nonlocals\n"
"\n"
"d['x'] = 1 # Set value in current context\n"
"d['x'] # Get first key in the chain of contexts\n"
"del d['x'] # Delete from current context\n"
"list(d) # All nested values\n"
"k in d # Check all nested values\n"
"len(d) # Number of nested values\n"
"d.items() # All nested items\n"
"dict(d) # Flatten into a regular dictionary"
msgstr ""
msgid ""
"The :class:`ChainMap` class only makes updates (writes and deletions) to the "
"first mapping in the chain while lookups will search the full chain. "
"However, if deep writes and deletions are desired, it is easy to make a "
"subclass that updates keys found deeper in the chain::"
msgstr ""
"Клас :class:`ChainMap` лише оновлює (записує та видаляє) перше відображення "
"в ланцюжку, тоді як пошук шукатиме повний ланцюжок. Однак, якщо потрібні "
"глибокі записи та видалення, легко створити підклас, який оновлює ключі, "
"знайдені глибше в ланцюжку:"
msgid ""
"class DeepChainMap(ChainMap):\n"
" 'Variant of ChainMap that allows direct updates to inner scopes'\n"
"\n"
" def __setitem__(self, key, value):\n"
" for mapping in self.maps:\n"
" if key in mapping:\n"
" mapping[key] = value\n"
" return\n"
" self.maps[0][key] = value\n"
"\n"
" def __delitem__(self, key):\n"
" for mapping in self.maps:\n"
" if key in mapping:\n"
" del mapping[key]\n"
" return\n"
" raise KeyError(key)\n"
"\n"
">>> d = DeepChainMap({'zebra': 'black'}, {'elephant': 'blue'}, {'lion': "
"'yellow'})\n"
">>> d['lion'] = 'orange' # update an existing key two levels down\n"
">>> d['snake'] = 'red' # new keys get added to the topmost dict\n"
">>> del d['elephant'] # remove an existing key one level down\n"
">>> d # display result\n"
"DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})"
msgstr ""
msgid ":class:`Counter` objects"
msgstr ":class:`Counter` об'єкти"
msgid ""
"A counter tool is provided to support convenient and rapid tallies. For "
"example::"
msgstr ""
"Надається інструмент лічильника для зручного та швидкого підрахунку. "
"Наприклад::"
msgid ""
">>> # Tally occurrences of words in a list\n"
">>> cnt = Counter()\n"
">>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:\n"
"... cnt[word] += 1\n"
"...\n"
">>> cnt\n"
"Counter({'blue': 3, 'red': 2, 'green': 1})\n"
"\n"
">>> # Find the ten most common words in Hamlet\n"
">>> import re\n"
">>> words = re.findall(r'\\w+', open('hamlet.txt').read().lower())\n"
">>> Counter(words).most_common(10)\n"
"[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n"
" ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]"
msgstr ""
msgid ""
"A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` "
"objects. It is a collection where elements are stored as dictionary keys and "
"their counts are stored as dictionary values. Counts are allowed to be any "
"integer value including zero or negative counts. The :class:`Counter` class "
"is similar to bags or multisets in other languages."
msgstr ""
msgid ""
"Elements are counted from an *iterable* or initialized from another "
"*mapping* (or counter):"
msgstr ""
"Елементи підраховуються з *iterable* або ініціалізуються з іншого *mapping* "
"(або лічильника):"
msgid ""
"Counter objects have a dictionary interface except that they return a zero "
"count for missing items instead of raising a :exc:`KeyError`:"
msgstr ""
"Об’єкти лічильників мають інтерфейс словника, за винятком того, що вони "
"повертають нульову кількість для відсутніх елементів замість того, щоб "
"викликати :exc:`KeyError`:"
msgid ""
"Setting a count to zero does not remove an element from a counter. Use "
"``del`` to remove it entirely:"
msgstr ""
"Встановлення лічильника на нуль не видаляє елемент із лічильника. "
"Використовуйте ``del``, щоб видалити його повністю:"
msgid ""
"As a :class:`dict` subclass, :class:`Counter` inherited the capability to "
"remember insertion order. Math operations on *Counter* objects also "
"preserve order. Results are ordered according to when an element is first "
"encountered in the left operand and then by the order encountered in the "
"right operand."
msgstr ""
"Як підклас :class:`dict`, :class:`Counter` успадкував можливість "
"запам’ятовувати порядок вставки. Математичні операції над об’єктами "
"*Counter* також зберігають порядок. Результати впорядковуються відповідно до "
"того, коли елемент вперше зустрічається в лівому операнді, а потім у порядку "
"зустрічі в правому операнді."
msgid ""
"Counter objects support additional methods beyond those available for all "
"dictionaries:"
msgstr ""
"Об’єкти лічильників підтримують додаткові методи, окрім тих, що доступні для "
"всіх словників:"
msgid ""
"Return an iterator over elements repeating each as many times as its count. "
"Elements are returned in the order first encountered. If an element's count "
"is less than one, :meth:`elements` will ignore it."
msgstr ""
"Повертає ітератор над елементами, повторюючи кожен стільки разів, скільки "
"його кількість. Елементи повертаються в тому порядку, в якому вони "
"зустрічаються першими. Якщо кількість елемента менше одиниці, :meth:"
"`elements` проігнорує його."
msgid ""
"Return a list of the *n* most common elements and their counts from the most "
"common to the least. If *n* is omitted or ``None``, :meth:`most_common` "
"returns *all* elements in the counter. Elements with equal counts are "
"ordered in the order first encountered:"
msgstr ""
"Повертає список з *n* найпоширеніших елементів і їх підрахунок від найбільш "
"поширених до найменших. Якщо *n* пропущено або ``None``, :meth:`most_common` "
"повертає *всі* елементи в лічильнику. Елементи з рівною кількістю "
"впорядковуються в порядку, коли вони зустрічаються першими:"
msgid ""
"Elements are subtracted from an *iterable* or from another *mapping* (or "
"counter). Like :meth:`dict.update` but subtracts counts instead of "
"replacing them. Both inputs and outputs may be zero or negative."
msgstr ""
"Елементи віднімаються з *iterable* або з іншого *mapping* (або лічильника). "
"Подібно до :meth:`dict.update`, але кількість віднімає, а не замінює. І "
"входи, і виходи можуть бути нульовими або негативними."
msgid "Compute the sum of the counts."
msgstr "Обчисліть суму підрахунків."
msgid ""
"The usual dictionary methods are available for :class:`Counter` objects "
"except for two which work differently for counters."
msgstr ""
"Звичайні методи словника доступні для об’єктів :class:`Counter`, за винятком "
"двох, які працюють по-різному для лічильників."
msgid "This class method is not implemented for :class:`Counter` objects."
msgstr "Цей метод класу не реалізований для об’єктів :class:`Counter`."
msgid ""
"Elements are counted from an *iterable* or added-in from another *mapping* "
"(or counter). Like :meth:`dict.update` but adds counts instead of replacing "
"them. Also, the *iterable* is expected to be a sequence of elements, not a "
"sequence of ``(key, value)`` pairs."
msgstr ""
"Елементи підраховуються від *iterable* або add-in від іншого *mapping* (або "
"лічильника). Як :meth:`dict.update`, але додає лічильники замість їх заміни. "
"Крім того, очікується, що *iterable* буде послідовністю елементів, а не "
"послідовністю пар ``(ключ, значення)``."
msgid ""
"Counters support rich comparison operators for equality, subset, and "
"superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. All of "
"those tests treat missing elements as having zero counts so that "
"``Counter(a=1) == Counter(a=1, b=0)`` returns true."
msgstr ""
"Лічильники підтримують розширені оператори порівняння для зв’язків рівності, "
"підмножини та надмножини: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. Усі "
"ці тести розглядають відсутні елементи як такі, що мають нульову кількість, "
"тому ``Counter(a=1) == Counter(a=1, b=0)`` повертає true."
msgid "Rich comparison operations were added."
msgstr "Додано розширені операції порівняння."
msgid ""
"In equality tests, missing elements are treated as having zero counts. "
"Formerly, ``Counter(a=3)`` and ``Counter(a=3, b=0)`` were considered "
"distinct."
msgstr ""
"У тестах на рівність відсутні елементи розглядаються як такі, що мають "
"нульову кількість. Раніше ``Counter(a=3)`` і ``Counter(a=3, b=0)`` вважалися "
"різними."
msgid "Common patterns for working with :class:`Counter` objects::"
msgstr "Загальні шаблони для роботи з об'єктами :class:`Counter`::"
msgid ""
"c.total() # total of all counts\n"
"c.clear() # reset all counts\n"
"list(c) # list unique elements\n"
"set(c) # convert to a set\n"
"dict(c) # convert to a regular dictionary\n"
"c.items() # access the (elem, cnt) pairs\n"
"Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs\n"
"c.most_common()[:-n-1:-1] # n least common elements\n"
"+c # remove zero and negative counts"
msgstr ""
msgid ""
"Several mathematical operations are provided for combining :class:`Counter` "
"objects to produce multisets (counters that have counts greater than zero). "
"Addition and subtraction combine counters by adding or subtracting the "
"counts of corresponding elements. Intersection and union return the minimum "
"and maximum of corresponding counts. Equality and inclusion compare "
"corresponding counts. Each operation can accept inputs with signed counts, "
"but the output will exclude results with counts of zero or less."
msgstr ""
"Передбачено кілька математичних операцій для об’єднання об’єктів :class:"
"`Counter` для створення мультимножин (лічильників, які мають кількість, "
"більшу за нуль). Додавання та віднімання поєднують лічильники шляхом "
"додавання або віднімання підрахунків відповідних елементів. Перетин і "
"об’єднання повертають мінімальне та максимальне значення відповідних "
"підрахунків. Рівність і включення порівнюють відповідні підрахунки. Кожна "
"операція може приймати вхідні дані зі знаком підрахунків, але вихід "
"виключатиме результати з нульовими чи меншими значеннями."
msgid ""
">>> c = Counter(a=3, b=1)\n"
">>> d = Counter(a=1, b=2)\n"
">>> c + d # add two counters together: c[x] + d[x]\n"
"Counter({'a': 4, 'b': 3})\n"
">>> c - d # subtract (keeping only positive counts)\n"
"Counter({'a': 2})\n"
">>> c & d # intersection: min(c[x], d[x])\n"
"Counter({'a': 1, 'b': 1})\n"
">>> c | d # union: max(c[x], d[x])\n"
"Counter({'a': 3, 'b': 2})\n"
">>> c == d # equality: c[x] == d[x]\n"
"False\n"
">>> c <= d # inclusion: c[x] <= d[x]\n"
"False"
msgstr ""
msgid ""
"Unary addition and subtraction are shortcuts for adding an empty counter or "
"subtracting from an empty counter."
msgstr ""
"Унарне додавання та віднімання — це ярлики для додавання порожнього "
"лічильника або віднімання з порожнього лічильника."
msgid ""
"Added support for unary plus, unary minus, and in-place multiset operations."
msgstr ""
"Додано підтримку унарних операцій плюс, унарний мінус і мультимножинних "
"операцій на місці."
msgid ""
"Counters were primarily designed to work with positive integers to represent "
"running counts; however, care was taken to not unnecessarily preclude use "
"cases needing other types or negative values. To help with those use cases, "
"this section documents the minimum range and type restrictions."
msgstr ""
"Лічильники були в основному розроблені для роботи з позитивними цілими "
"числами для представлення поточних підрахунків; однак було вжито заходів для "
"того, щоб без потреби не виключити випадки використання, які потребують "
"інших типів або від’ємних значень. Щоб допомогти з цими випадками "
"використання, у цьому розділі описані мінімальні обмеження діапазону та типу."
msgid ""
"The :class:`Counter` class itself is a dictionary subclass with no "
"restrictions on its keys and values. The values are intended to be numbers "
"representing counts, but you *could* store anything in the value field."
msgstr ""
"Сам клас :class:`Counter` є підкласом словника без обмежень щодо його ключів "
"і значень. Значення мають бути числами, що представляють кількість, але ви "
"*можете* зберігати будь-що в полі значення."
msgid ""
"The :meth:`~Counter.most_common` method requires only that the values be "
"orderable."
msgstr ""
"Метод :meth:`~Counter.most_common` вимагає лише того, щоб значення можна "
"було впорядкувати."
msgid ""
"For in-place operations such as ``c[key] += 1``, the value type need only "
"support addition and subtraction. So fractions, floats, and decimals would "
"work and negative values are supported. The same is also true for :meth:"
"`~Counter.update` and :meth:`~Counter.subtract` which allow negative and "
"zero values for both inputs and outputs."
msgstr ""
"Для операцій на місці, таких як ``c[key] += 1``, тип значення потребує лише "
"підтримки додавання та віднімання. Отже, дроби, числа з плаваючою точкою та "
"десяткові дроби працюватимуть, а від’ємні значення підтримуються. Те ж саме "
"вірно для :meth:`~Counter.update` і :meth:`~Counter.subtract`, які "
"дозволяють від’ємні та нульові значення як для входів, так і для виходів."
msgid ""
"The multiset methods are designed only for use cases with positive values. "
"The inputs may be negative or zero, but only outputs with positive values "
"are created. There are no type restrictions, but the value type needs to "
"support addition, subtraction, and comparison."
msgstr ""
"Мультимножинні методи призначені лише для випадків використання з "
"позитивними значеннями. Вхідні дані можуть бути від’ємними або нульовими, "
"але створюються лише виходи з позитивними значеннями. Немає обмежень щодо "
"типів, але тип значення має підтримувати додавання, віднімання та порівняння."
msgid ""
"The :meth:`~Counter.elements` method requires integer counts. It ignores "
"zero and negative counts."
msgstr ""
"Метод :meth:`~Counter.elements` вимагає підрахунку цілих чисел. Він ігнорує "
"нульові та негативні значення."
msgid ""
"`Bag class <https://www.gnu.org/software/smalltalk/manual-base/html_node/Bag."
"html>`_ in Smalltalk."
msgstr ""
"`Клас сумки <https://www.gnu.org/software/smalltalk/manual-base/html_node/"
"Bag.html>`_ у Smalltalk."
msgid ""
"Wikipedia entry for `Multisets <https://en.wikipedia.org/wiki/Multiset>`_."
msgstr ""
"Запис у Вікіпедії для `Мультимножини <https://en.wikipedia.org/wiki/"
"Multiset>`_."
msgid ""
"`C++ multisets <http://www.java2s.com/Tutorial/Cpp/0380__set-multiset/"
"Catalog0380__set-multiset.htm>`_ tutorial with examples."
msgstr ""
"`C++ multisets <http://www.java2s.com/Tutorial/Cpp/0380__set-multiset/"
"Catalog0380__set-multiset.htm>`_ посібник із прикладами."
msgid ""
"For mathematical operations on multisets and their use cases, see *Knuth, "
"Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise "
"19*."
msgstr ""
"Про математичні операції над мультимножинами та випадки їх використання див. "
"*Knuth, Donald. Мистецтво комп’ютерного програмування, том II, розділ 4.6.3, "
"вправа 19*."
msgid ""
"To enumerate all distinct multisets of a given size over a given set of "
"elements, see :func:`itertools.combinations_with_replacement`::"
msgstr ""
"Щоб перерахувати всі різні мультимножини заданого розміру над заданим "
"набором елементів, перегляньте :func:`itertools."
"combinations_with_replacement`::"
msgid ""
"map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC CC"
msgstr ""
msgid ":class:`deque` objects"
msgstr ":class:`deque` об'єкти"
msgid ""
"Returns a new deque object initialized left-to-right (using :meth:`append`) "
"with data from *iterable*. If *iterable* is not specified, the new deque is "
"empty."
msgstr ""
"Повертає новий об’єкт deque, ініціалізований зліва направо (за допомогою :"
"meth:`append`) з даними з *iterable*. Якщо *iterable* не вказано, нова "
"двочерга порожня."
msgid ""
"Deques are a generalization of stacks and queues (the name is pronounced "
"\"deck\" and is short for \"double-ended queue\"). Deques support thread-"
"safe, memory efficient appends and pops from either side of the deque with "
"approximately the same *O*\\ (1) performance in either direction."
msgstr ""
msgid ""
"Though :class:`list` objects support similar operations, they are optimized "
"for fast fixed-length operations and incur *O*\\ (*n*) memory movement costs "
"for ``pop(0)`` and ``insert(0, v)`` operations which change both the size "
"and position of the underlying data representation."
msgstr ""
msgid ""
"If *maxlen* is not specified or is ``None``, deques may grow to an arbitrary "
"length. Otherwise, the deque is bounded to the specified maximum length. "
"Once a bounded length deque is full, when new items are added, a "
"corresponding number of items are discarded from the opposite end. Bounded "
"length deques provide functionality similar to the ``tail`` filter in Unix. "
"They are also useful for tracking transactions and other pools of data where "
"only the most recent activity is of interest."
msgstr ""
"Якщо *maxlen* не вказано або має значення ``None``, дві версії можуть "
"зростати до довільної довжини. В іншому випадку двочерга обмежена до "
"вказаної максимальної довжини. Коли двочерга обмеженої довжини заповнюється, "
"коли додаються нові елементи, відповідна кількість елементів відкидається з "
"протилежного кінця. Обмежена довжина двох рядків забезпечує "
"функціональність, подібну до фільтра ``tail`` в Unix. Вони також корисні для "
"відстеження транзакцій та інших наборів даних, де цікаві лише останні дії."
msgid "Deque objects support the following methods:"
msgstr "Об’єкти Deque підтримують такі методи:"
msgid "Add *x* to the right side of the deque."
msgstr "Додайте *x* до правої сторони дека."
msgid "Add *x* to the left side of the deque."
msgstr "Додайте *x* до лівої сторони дека."
msgid "Remove all elements from the deque leaving it with length 0."
msgstr "Видаліть усі елементи з двоканального ряду, залишивши його довжиною 0."
msgid "Create a shallow copy of the deque."
msgstr "Створіть поверхневу копію deque."
msgid "Count the number of deque elements equal to *x*."
msgstr "Підрахуйте кількість елементів deque, що дорівнює *x*."
msgid ""
"Extend the right side of the deque by appending elements from the iterable "
"argument."
msgstr ""
"Розширте праву частину двоканального ряду, додавши елементи з ітерованого "
"аргументу."
msgid ""
"Extend the left side of the deque by appending elements from *iterable*. "
"Note, the series of left appends results in reversing the order of elements "
"in the iterable argument."
msgstr ""
"Розширте ліву сторону двостороннього коду, додавши елементи з *iterable*. "
"Зауважте, що серія лівих додань призводить до зміни порядку елементів у "
"повторюваному аргументі."
msgid ""
"Return the position of *x* in the deque (at or after index *start* and "
"before index *stop*). Returns the first match or raises :exc:`ValueError` "
"if not found."
msgstr ""
"Повертає позицію *x* у черзі (за індексом *start* і перед індексом *stop*). "
"Повертає перший збіг або викликає :exc:`ValueError`, якщо не знайдено."
msgid "Insert *x* into the deque at position *i*."
msgstr "Вставте *x* у рядок у позицію *i*."
msgid ""
"If the insertion would cause a bounded deque to grow beyond *maxlen*, an :"
"exc:`IndexError` is raised."
msgstr ""
"Якщо вставка призведе до того, що обмежена двочерга виросте за межі "
"*maxlen*, виникає :exc:`IndexError`."
msgid ""
"Remove and return an element from the right side of the deque. If no "
"elements are present, raises an :exc:`IndexError`."
msgstr ""
"Видаліть і поверніть елемент з правого боку двоканальної таблиці. Якщо немає "
"елементів, викликає :exc:`IndexError`."
msgid ""
"Remove and return an element from the left side of the deque. If no elements "
"are present, raises an :exc:`IndexError`."
msgstr ""
"Видаліть і поверніть елемент з лівої сторони двосторонньої версії. Якщо "
"немає елементів, викликає :exc:`IndexError`."
msgid ""
"Remove the first occurrence of *value*. If not found, raises a :exc:"
"`ValueError`."
msgstr ""
"Видаліть перше входження *значення*. Якщо не знайдено, викликає :exc:"
"`ValueError`."
msgid "Reverse the elements of the deque in-place and then return ``None``."
msgstr "Перевернути елементи дек-версії на місці, а потім повернути ``None``."
msgid ""
"Rotate the deque *n* steps to the right. If *n* is negative, rotate to the "
"left."
msgstr ""
"Поверніть двічі *n* кроків праворуч. Якщо *n* від’ємне, поверніть ліворуч."
msgid ""
"When the deque is not empty, rotating one step to the right is equivalent to "
"``d.appendleft(d.pop())``, and rotating one step to the left is equivalent "
"to ``d.append(d.popleft())``."
msgstr ""
"Якщо двочерга не порожня, поворот на один крок праворуч еквівалентний ``d."
"appendleft(d.pop())`` , а поворот на один крок ліворуч еквівалентний ``d."
"append(d.popleft ())``."
msgid "Deque objects also provide one read-only attribute:"
msgstr "Об’єкти Deque також надають один атрибут лише для читання:"
msgid "Maximum size of a deque or ``None`` if unbounded."
msgstr "Максимальний розмір двочергового рядка або ``None``, якщо необмежений."
msgid ""
"In addition to the above, deques support iteration, pickling, ``len(d)``, "
"``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing "
"with the :keyword:`in` operator, and subscript references such as ``d[0]`` "
"to access the first element. Indexed access is *O*\\ (1) at both ends but "
"slows to *O*\\ (*n*) in the middle. For fast random access, use lists "
"instead."
msgstr ""
msgid ""
"Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and "
"``__imul__()``."
msgstr ""
"Починаючи з версії 3.5, deques підтримують ``__add__()``, ``__mul__()`` і "
"``__imul__()``."
msgid "Example:"
msgstr "приклад:"
msgid ""
">>> from collections import deque\n"
">>> d = deque('ghi') # make a new deque with three items\n"
">>> for elem in d: # iterate over the deque's elements\n"
"... print(elem.upper())\n"
"G\n"
"H\n"
"I\n"
"\n"
">>> d.append('j') # add a new entry to the right side\n"
">>> d.appendleft('f') # add a new entry to the left side\n"
">>> d # show the representation of the deque\n"
"deque(['f', 'g', 'h', 'i', 'j'])\n"
"\n"
">>> d.pop() # return and remove the rightmost item\n"
"'j'\n"
">>> d.popleft() # return and remove the leftmost item\n"
"'f'\n"
">>> list(d) # list the contents of the deque\n"
"['g', 'h', 'i']\n"
">>> d[0] # peek at leftmost item\n"
"'g'\n"
">>> d[-1] # peek at rightmost item\n"
"'i'\n"
"\n"
">>> list(reversed(d)) # list the contents of a deque in "
"reverse\n"
"['i', 'h', 'g']\n"
">>> 'h' in d # search the deque\n"
"True\n"
">>> d.extend('jkl') # add multiple elements at once\n"
">>> d\n"
"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n"
">>> d.rotate(1) # right rotation\n"
">>> d\n"
"deque(['l', 'g', 'h', 'i', 'j', 'k'])\n"
">>> d.rotate(-1) # left rotation\n"
">>> d\n"
"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n"
"\n"
">>> deque(reversed(d)) # make a new deque in reverse order\n"
"deque(['l', 'k', 'j', 'i', 'h', 'g'])\n"
">>> d.clear() # empty the deque\n"
">>> d.pop() # cannot pop from an empty deque\n"
"Traceback (most recent call last):\n"
" File \"<pyshell#6>\", line 1, in -toplevel-\n"
" d.pop()\n"
"IndexError: pop from an empty deque\n"
"\n"
">>> d.extendleft('abc') # extendleft() reverses the input "
"order\n"
">>> d\n"
"deque(['c', 'b', 'a'])"
msgstr ""
msgid ":class:`deque` Recipes"
msgstr ":class:`deque` Рецепти"
msgid "This section shows various approaches to working with deques."
msgstr "У цьому розділі показано різні підходи до роботи з deque."
msgid ""
"Bounded length deques provide functionality similar to the ``tail`` filter "
"in Unix::"
msgstr ""
"Обмежена довжина двостороннього ряду забезпечує функціональність, подібну до "
"фільтра ``tail`` в Unix::"
msgid ""
"def tail(filename, n=10):\n"
" 'Return the last n lines of a file'\n"
" with open(filename) as f:\n"
" return deque(f, n)"
msgstr ""
msgid ""
"Another approach to using deques is to maintain a sequence of recently added "
"elements by appending to the right and popping to the left::"
msgstr ""
"Інший підхід до використання двох блоків полягає в підтримці послідовності "
"нещодавно доданих елементів шляхом додавання праворуч і висування ліворуч:"
msgid ""
"def moving_average(iterable, n=3):\n"
" # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0\n"
" # https://en.wikipedia.org/wiki/Moving_average\n"
" it = iter(iterable)\n"
" d = deque(itertools.islice(it, n-1))\n"
" d.appendleft(0)\n"
" s = sum(d)\n"
" for elem in it:\n"
" s += elem - d.popleft()\n"
" d.append(elem)\n"
" yield s / n"
msgstr ""
msgid ""
"A `round-robin scheduler <https://en.wikipedia.org/wiki/Round-"
"robin_scheduling>`_ can be implemented with input iterators stored in a :"
"class:`deque`. Values are yielded from the active iterator in position "
"zero. If that iterator is exhausted, it can be removed with :meth:`~deque."
"popleft`; otherwise, it can be cycled back to the end with the :meth:`~deque."
"rotate` method::"
msgstr ""
"`Циклічний планувальник <https://en.wikipedia.org/wiki/Round-"
"robin_scheduling>`_ може бути реалізований за допомогою ітераторів введення, "
"що зберігаються в :class:`deque`. Значення виводяться з активного ітератора "
"в нульовій позиції. Якщо цей ітератор вичерпано, його можна видалити за "
"допомогою :meth:`~deque.popleft`; інакше його можна повернути до кінця за "
"допомогою методу :meth:`~deque.rotate`::"
msgid ""
"def roundrobin(*iterables):\n"
" \"roundrobin('ABC', 'D', 'EF') --> A D E B F C\"\n"
" iterators = deque(map(iter, iterables))\n"
" while iterators:\n"
" try:\n"
" while True:\n"
" yield next(iterators[0])\n"
" iterators.rotate(-1)\n"
" except StopIteration:\n"
" # Remove an exhausted iterator.\n"
" iterators.popleft()"
msgstr ""
msgid ""
"The :meth:`~deque.rotate` method provides a way to implement :class:`deque` "
"slicing and deletion. For example, a pure Python implementation of ``del "
"d[n]`` relies on the ``rotate()`` method to position elements to be popped::"
msgstr ""
"Метод :meth:`~deque.rotate` забезпечує спосіб реалізації :class:`deque` "
"нарізки та видалення. Наприклад, чиста реалізація ``del d[n]`` на Python "
"покладається на метод ``rotate()`` для позиціонування елементів, які "
"потрібно відкрити:"