id
int64
1
6.07M
name
stringlengths
1
295
code
stringlengths
12
426k
language
stringclasses
1 value
source_file
stringlengths
5
202
start_line
int64
1
158k
end_line
int64
1
158k
repo
dict
6,069,701
yaml_set_start_comment
def yaml_set_start_comment(self, comment, indent=0): # type: (Any, Any) -> None """overwrites any preceding comment lines on an object expects comment to be without `#` and possible have multiple lines """ from .error import CommentMark from .tokens import CommentToken ...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
222
235
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,702
yaml_set_comment_before_after_key
def yaml_set_comment_before_after_key( self, key, before=None, indent=0, after=None, after_indent=None ): # type: (Any, Any, Any, Any, Any) -> None """ expects comment (before/after) to be without `#` and possible have multiple lines """ from srsly.ruamel_yaml.error i...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
237
270
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,703
comment_token
def comment_token(s, mark): # type: (Any, Any) -> Any # handle empty lines as having no comment return CommentToken(("# " if s else "") + s + "\n", mark, None)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
247
250
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,704
fa
def fa(self): # type: () -> Any """format attribute set_flow_style()/set_block_style()""" if not hasattr(self, Format.attrib): setattr(self, Format.attrib, Format()) return getattr(self, Format.attrib)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
273
280
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,705
yaml_add_eol_comment
def yaml_add_eol_comment(self, comment, key=NoComment, column=None): # type: (Any, Optional[Any], Optional[Any]) -> None """ there is a problem as eol comments should start with ' #' (but at the beginning of the line the space doesn't have to be before the #. The column index is ...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
282
305
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,706
lc
def lc(self): # type: () -> Any if not hasattr(self, LineCol.attrib): setattr(self, LineCol.attrib, LineCol()) return getattr(self, LineCol.attrib)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
308
312
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,707
_yaml_set_line_col
def _yaml_set_line_col(self, line, col): # type: (Any, Any) -> None self.lc.line = line self.lc.col = col
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
314
317
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,708
_yaml_set_kv_line_col
def _yaml_set_kv_line_col(self, key, data): # type: (Any, Any) -> None self.lc.add_kv_line_col(key, data)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
319
321
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,709
_yaml_set_idx_line_col
def _yaml_set_idx_line_col(self, key, data): # type: (Any, Any) -> None self.lc.add_idx_line_col(key, data)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
323
325
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,710
anchor
def anchor(self): # type: () -> Any if not hasattr(self, Anchor.attrib): setattr(self, Anchor.attrib, Anchor()) return getattr(self, Anchor.attrib)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
328
332
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,711
yaml_anchor
def yaml_anchor(self): # type: () -> Any if not hasattr(self, Anchor.attrib): return None return self.anchor
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
334
338
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,712
yaml_set_anchor
def yaml_set_anchor(self, value, always_dump=False): # type: (Any, bool) -> None self.anchor.value = value self.anchor.always_dump = always_dump
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
340
343
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,713
tag
def tag(self): # type: () -> Any if not hasattr(self, Tag.attrib): setattr(self, Tag.attrib, Tag()) return getattr(self, Tag.attrib)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
346
350
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,714
yaml_set_tag
def yaml_set_tag(self, value): # type: (Any) -> None self.tag.value = value
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
352
354
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,715
copy_attributes
def copy_attributes(self, t, memo=None): # type: (Any, Any) -> None # fmt: off for a in [Comment.attrib, Format.attrib, LineCol.attrib, Anchor.attrib, Tag.attrib, merge_attrib]: if hasattr(self, a): if memo is not None: setattr(t,...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
356
366
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,716
_yaml_add_eol_comment
def _yaml_add_eol_comment(self, comment, key): # type: (Any, Any) -> None raise NotImplementedError
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
368
370
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,717
_yaml_get_pre_comment
def _yaml_get_pre_comment(self): # type: () -> Any raise NotImplementedError
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
372
374
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,718
_yaml_get_column
def _yaml_get_column(self, key): # type: (Any) -> Any raise NotImplementedError
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
376
378
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,719
__init__
def __init__(self, *args, **kw): # type: (Any, Any) -> None list.__init__(self, *args, **kw)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
384
386
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,720
__getsingleitem__
def __getsingleitem__(self, idx): # type: (Any) -> Any return list.__getitem__(self, idx)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
388
390
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,721
__setsingleitem__
def __setsingleitem__(self, idx, value): # type: (Any, Any) -> None # try to preserve the scalarstring type if setting an existing key to a new value if idx < len(self): if ( isinstance(value, string_types) and not isinstance(value, ScalarString) ...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
392
402
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,722
__delsingleitem__
def __delsingleitem__(self, idx=None): # type: (Any) -> Any list.__delitem__(self, idx) self.ca.items.pop(idx, None) # might not be there -> default value for list_index in sorted(self.ca.items): if list_index < idx: continue self.ca.items[list_in...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
404
411
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,723
__len__
def __len__(self): # type: () -> int return list.__len__(self)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
413
415
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,724
insert
def insert(self, idx, val): # type: (Any, Any) -> None """the comments after the insertion have to move forward""" list.insert(self, idx, val) for list_index in sorted(self.ca.items, reverse=True): if list_index < idx: break self.ca.items[list_inde...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
417
424
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,725
extend
def extend(self, val): # type: (Any) -> None list.extend(self, val)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
426
428
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,726
__eq__
def __eq__(self, other): # type: (Any) -> bool return list.__eq__(self, other)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
430
432
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,727
_yaml_add_comment
def _yaml_add_comment(self, comment, key=NoComment): # type: (Any, Optional[Any]) -> None if key is not NoComment: self.yaml_key_comment_extend(key, comment) else: self.ca.comment = comment
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
434
439
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,728
_yaml_add_eol_comment
def _yaml_add_eol_comment(self, comment, key): # type: (Any, Any) -> None self._yaml_add_comment(comment, key=key)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
441
443
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,729
_yaml_get_columnX
def _yaml_get_columnX(self, key): # type: (Any) -> Any return self.ca.items[key][0].start_mark.column
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
445
447
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,730
_yaml_get_column
def _yaml_get_column(self, key): # type: (Any) -> Any column = None sel_idx = None pre, post = key - 1, key + 1 if pre in self.ca.items: sel_idx = pre elif post in self.ca.items: sel_idx = post else: # self.ca.items is not order...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
449
468
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,731
_yaml_get_pre_comment
def _yaml_get_pre_comment(self): # type: () -> Any pre_comments = [] # type: List[Any] if self.ca.comment is None: self.ca.comment = [None, pre_comments] else: self.ca.comment[1] = pre_comments return pre_comments
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
470
477
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,732
__deepcopy__
def __deepcopy__(self, memo): # type: (Any) -> Any res = self.__class__() memo[id(self)] = res for k in self: res.append(copy.deepcopy(k, memo)) self.copy_attributes(res, memo=memo) return res
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
479
486
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,733
__add__
def __add__(self, other): # type: (Any) -> Any return list.__add__(self, other)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
488
490
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,734
sort
def sort(self, key=None, reverse=False): # type: ignore # type: (Any, bool) -> None if key is None: tmp_lst = sorted(zip(self, range(len(self))), reverse=reverse) list.__init__(self, [x[0] for x in tmp_lst]) else: tmp_lst = sorted( zip(map(key...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
492
507
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,735
__repr__
def __repr__(self): # type: () -> Any return list.__repr__(self)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
509
511
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,736
_yaml_add_comment
def _yaml_add_comment(self, comment, key=NoComment): # type: (Any, Optional[Any]) -> None if key is not NoComment: self.yaml_key_comment_extend(key, comment) else: self.ca.comment = comment
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
517
522
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,737
_yaml_add_eol_comment
def _yaml_add_eol_comment(self, comment, key): # type: (Any, Any) -> None self._yaml_add_comment(comment, key=key)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
524
526
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,738
_yaml_get_columnX
def _yaml_get_columnX(self, key): # type: (Any) -> Any return self.ca.items[key][0].start_mark.column
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
528
530
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,739
_yaml_get_column
def _yaml_get_column(self, key): # type: (Any) -> Any column = None sel_idx = None pre, post = key - 1, key + 1 if pre in self.ca.items: sel_idx = pre elif post in self.ca.items: sel_idx = post else: # self.ca.items is not order...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
532
551
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,740
_yaml_get_pre_comment
def _yaml_get_pre_comment(self): # type: () -> Any pre_comments = [] # type: List[Any] if self.ca.comment is None: self.ca.comment = [None, pre_comments] else: self.ca.comment[1] = pre_comments return pre_comments
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
553
560
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,741
__init__
def __init__(self, mapping): # type: (Any) -> None self._mapping = mapping
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
566
568
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,742
__len__
def __len__(self): # type: () -> int count = len(self._mapping) return count
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
570
573
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,743
_from_iterable
def _from_iterable(self, it): # type: (Any) -> Any return set(it)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
580
582
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,744
__contains__
def __contains__(self, key): # type: (Any) -> Any return key in self._mapping
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
584
586
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,745
__iter__
def __iter__(self): # type: () -> Any # yield from self._mapping # not in py27, pypy # for x in self._mapping._keys(): for x in self._mapping: yield x
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
588
592
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,746
_from_iterable
def _from_iterable(self, it): # type: (Any) -> Any return set(it)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
599
601
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,747
__contains__
def __contains__(self, item): # type: (Any) -> Any key, value = item try: v = self._mapping[key] except KeyError: return False else: return v == value
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
603
611
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,748
__iter__
def __iter__(self): # type: () -> Any for key in self._mapping._keys(): yield (key, self._mapping[key])
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
613
616
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,749
__contains__
def __contains__(self, value): # type: (Any) -> Any for key in self._mapping: if value == self._mapping[key]: return True return False
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
622
627
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,750
__iter__
def __iter__(self): # type: () -> Any for key in self._mapping._keys(): yield self._mapping[key]
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
629
632
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,751
__init__
def __init__(self, *args, **kw): # type: (Any, Any) -> None self._ok = set() # type: MutableSet[Any] # own keys self._ref = [] # type: List[CommentedMap] ordereddict.__init__(self, *args, **kw)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
638
642
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,752
_yaml_add_comment
def _yaml_add_comment(self, comment, key=NoComment, value=NoComment): # type: (Any, Optional[Any], Optional[Any]) -> None """values is set to key to indicate a value attachment of comment""" if key is not NoComment: self.yaml_key_comment_extend(key, comment) return ...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
644
653
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,753
_yaml_add_eol_comment
def _yaml_add_eol_comment(self, comment, key): # type: (Any, Any) -> None """add on the value line, with value specified by the key""" self._yaml_add_comment(comment, value=key)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
655
658
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,754
_yaml_get_columnX
def _yaml_get_columnX(self, key): # type: (Any) -> Any return self.ca.items[key][2].start_mark.column
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
660
662
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,755
_yaml_get_column
def _yaml_get_column(self, key): # type: (Any) -> Any column = None sel_idx = None pre, post, last = None, None, None for x in self: if pre is not None and x != key: post = x break if x == key: pre = last ...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
664
690
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,756
_yaml_get_pre_comment
def _yaml_get_pre_comment(self): # type: () -> Any pre_comments = [] # type: List[Any] if self.ca.comment is None: self.ca.comment = [None, pre_comments] else: self.ca.comment[1] = pre_comments return pre_comments
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
692
699
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,757
update
def update(self, vals): # type: (Any) -> None try: ordereddict.update(self, vals) except TypeError: # probably a dict that is used for x in vals: self[x] = vals[x] try: self._ok.update(vals.keys()) # type: ignore ex...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
701
714
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,758
insert
def insert(self, pos, key, value, comment=None): # type: (Any, Any, Any, Optional[Any]) -> None """insert key value into given position attach comment if provided """ ordereddict.insert(self, pos, key, value) self._ok.add(key) if comment is not None: s...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
716
724
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,759
mlget
def mlget(self, key, default=None, list_ok=False): # type: (Any, Any, Any) -> Any """multi-level get that expects dicts within dicts""" if not isinstance(key, list): return self.get(key, default) # assume that the key is a list of recursively accessible dicts def get...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
726
750
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,760
get_one_level
def get_one_level(key_list, level, d): # type: (Any, Any, Any) -> Any if not list_ok: assert isinstance(d, dict) if level >= len(key_list): if level > len(key_list): raise IndexError return d[key_list[level - 1]] ...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
733
741
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,761
__getitem__
def __getitem__(self, key): # type: (Any) -> Any try: return ordereddict.__getitem__(self, key) except KeyError: for merged in getattr(self, merge_attrib, []): if key in merged[1]: return merged[1][key] raise
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
752
760
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,762
__setitem__
def __setitem__(self, key, value): # type: (Any, Any) -> None # try to preserve the scalarstring type if setting an existing key to a new value if key in self: if ( isinstance(value, string_types) and not isinstance(value, ScalarString) ...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
762
773
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,763
_unmerged_contains
def _unmerged_contains(self, key): # type: (Any) -> Any if key in self._ok: return True return None
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
775
779
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,764
__contains__
def __contains__(self, key): # type: (Any) -> bool return bool(ordereddict.__contains__(self, key))
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
781
783
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,765
get
def get(self, key, default=None): # type: (Any, Any) -> Any try: return self.__getitem__(key) except: # NOQA return default
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
785
790
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,766
__repr__
def __repr__(self): # type: () -> Any return ordereddict.__repr__(self).replace("CommentedMap", "ordereddict")
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
792
794
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,767
non_merged_items
def non_merged_items(self): # type: () -> Any for x in ordereddict.__iter__(self): if x in self._ok: yield x, ordereddict.__getitem__(self, x)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
796
800
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,768
__delitem__
def __delitem__(self, key): # type: (Any) -> None # for merged in getattr(self, merge_attrib, []): # if key in merged[1]: # value = merged[1][key] # break # else: # # not found in merged in stuff # ordereddict.__delitem__(self, ...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
802
820
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,769
__iter__
def __iter__(self): # type: () -> Any for x in ordereddict.__iter__(self): yield x
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
822
825
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,770
_keys
def _keys(self): # type: () -> Any for x in ordereddict.__iter__(self): yield x
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
827
830
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,771
__len__
def __len__(self): # type: () -> int return int(ordereddict.__len__(self))
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
832
834
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,772
__eq__
def __eq__(self, other): # type: (Any) -> bool return bool(dict(self) == other)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
836
838
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,773
keys
def keys(self): # type: () -> Any return list(self._keys())
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
842
844
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,774
iterkeys
def iterkeys(self): # type: () -> Any return self._keys()
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
846
848
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,775
viewkeys
def viewkeys(self): # type: () -> Any return CommentedMapKeysView(self)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
850
852
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,776
keys
def keys(self): # type: () -> Any return CommentedMapKeysView(self)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
856
858
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,777
_values
def _values(self): # type: () -> Any for x in ordereddict.__iter__(self): yield ordereddict.__getitem__(self, x)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
862
865
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,778
values
def values(self): # type: () -> Any return list(self._values())
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
867
869
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,779
itervalues
def itervalues(self): # type: () -> Any return self._values()
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
871
873
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,780
viewvalues
def viewvalues(self): # type: () -> Any return CommentedMapValuesView(self)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
875
877
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,781
values
def values(self): # type: () -> Any return CommentedMapValuesView(self)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
881
883
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,782
_items
def _items(self): # type: () -> Any for x in ordereddict.__iter__(self): yield x, ordereddict.__getitem__(self, x)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
885
888
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,783
items
def items(self): # type: () -> Any return list(self._items())
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
892
894
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,784
iteritems
def iteritems(self): # type: () -> Any return self._items()
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
896
898
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,785
viewitems
def viewitems(self): # type: () -> Any return CommentedMapItemsView(self)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
900
902
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,786
items
def items(self): # type: () -> Any return CommentedMapItemsView(self)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
906
908
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,787
merge
def merge(self): # type: () -> Any if not hasattr(self, merge_attrib): setattr(self, merge_attrib, []) return getattr(self, merge_attrib)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
911
915
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,788
copy
def copy(self): # type: () -> Any x = type(self)() # update doesn't work for k, v in self._items(): x[k] = v self.copy_attributes(x) return x
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
917
923
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,789
add_referent
def add_referent(self, cm): # type: (Any) -> None if cm not in self._ref: self._ref.append(cm)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
925
928
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,790
add_yaml_merge
def add_yaml_merge(self, value): # type: (Any) -> None for v in value: v[1].add_referent(self) for k, v in v[1].items(): if ordereddict.__contains__(self, k): continue ordereddict.__setitem__(self, k, v) self.merge.exten...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
930
938
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,791
update_key_value
def update_key_value(self, key): # type: (Any) -> None if key in self._ok: return for v in self.merge: if key in v[1]: ordereddict.__setitem__(self, key, v[1][key]) return ordereddict.__delitem__(self, key)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
940
948
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,792
__deepcopy__
def __deepcopy__(self, memo): # type: (Any) -> Any res = self.__class__() memo[id(self)] = res for k in self: res[k] = copy.deepcopy(self[k], memo) self.copy_attributes(res, memo=memo) return res
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
950
957
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,793
raise_immutable
def raise_immutable(cls, *args, **kwargs): # type: (Any, *Any, **Any) -> None raise TypeError("{} objects are immutable".format(cls.__name__))
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
962
964
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,794
__init__
def __init__(self, *args, **kw): # type: (Any, Any) -> None if hasattr(self, "_od"): raise_immutable(self) try: self._od = ordereddict(*args, **kw) except TypeError: if PY2: self._od = ordereddict(args[0].items()) else: ...
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
971
981
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,795
__getitem__
def __getitem__(self, index): # type: (Any) -> Any return self._od[index]
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
988
990
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,796
__iter__
def __iter__(self): # type: () -> Iterator[Any] for x in self._od.__iter__(): yield x
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
992
995
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,797
__len__
def __len__(self): # type: () -> int return len(self._od)
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
997
999
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,798
__hash__
def __hash__(self): # type: () -> Any return hash(tuple(self.items()))
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
1,001
1,003
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,799
__repr__
def __repr__(self): # type: () -> Any if not hasattr(self, merge_attrib): return self._od.__repr__() return "ordereddict(" + repr(list(self._od.items())) + ")"
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
1,005
1,009
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }
6,069,800
fromkeys
def fromkeys(keys, v=None): # type: (Any, Any) -> Any return CommentedKeyMap(dict.fromkeys(keys, v))
python
python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/comments.py
1,012
1,014
{ "name": "PortablePy/3.10.8.0", "url": "https://github.com/PortablePy/3.10.8.0.git", "license": "NOASSERTION", "stars": 0, "forks": 0 }