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,001 | _get_bases | def _get_bases(typ):
if '__orig_bases__' in getattr(typ, '__dict__', {}):
# For generic types (see PEP 560)
# Note that simply checking `hasattr(typ, '__orig_bases__')` is not
# correct. Subclasses of a fully-parameterized generic class does not
# have `__orig_bases__` defined, but ... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle.py | 916 | 927 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,002 | _make_dict_keys | def _make_dict_keys(obj, is_ordered=False):
if is_ordered:
return OrderedDict.fromkeys(obj).keys()
else:
return dict.fromkeys(obj).keys() | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle.py | 930 | 934 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,003 | _make_dict_values | def _make_dict_values(obj, is_ordered=False):
if is_ordered:
return OrderedDict((i, _) for i, _ in enumerate(obj)).values()
else:
return {i: _ for i, _ in enumerate(obj)}.values() | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle.py | 937 | 941 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,004 | _make_dict_items | def _make_dict_items(obj, is_ordered=False):
if is_ordered:
return OrderedDict(obj).items()
else:
return obj.items() | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle.py | 944 | 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,005 | dump | def dump(obj, file, protocol=None, buffer_callback=None):
"""Serialize obj as bytes streamed into file
protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to
pickle.HIGHEST_PROTOCOL. This setting favors maximum communication
speed between processes running the same Pytho... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 45 | 57 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,006 | dumps | def dumps(obj, protocol=None, buffer_callback=None):
"""Serialize obj as a string of bytes allocated in memory
protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to
pickle.HIGHEST_PROTOCOL. This setting favors maximum communication
speed between processes running the sa... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 59 | 74 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,007 | dump | def dump(obj, file, protocol=None):
"""Serialize obj as bytes streamed into file
protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to
pickle.HIGHEST_PROTOCOL. This setting favors maximum communication
speed between processes running the same Python version.
Se... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 78 | 88 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,008 | dumps | def dumps(obj, protocol=None):
"""Serialize obj as a string of bytes allocated in memory
protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to
pickle.HIGHEST_PROTOCOL. This setting favors maximum communication
speed between processes running the same Python version.
... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 90 | 103 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,009 | _class_getnewargs | def _class_getnewargs(obj):
type_kwargs = {}
if "__slots__" in obj.__dict__:
type_kwargs["__slots__"] = obj.__slots__
__dict__ = obj.__dict__.get('__dict__', None)
if isinstance(__dict__, property):
type_kwargs['__dict__'] = __dict__
return (type(obj), obj.__name__, _get_bases(obj)... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 112 | 122 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,010 | _enum_getnewargs | def _enum_getnewargs(obj):
members = {e.name: e.value for e in obj}
return (obj.__bases__, obj.__name__, obj.__qualname__, members,
obj.__module__, _get_or_create_tracker_id(obj), None) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 125 | 128 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,011 | _file_reconstructor | def _file_reconstructor(retval):
return retval | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 133 | 134 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,012 | _function_getstate | def _function_getstate(func):
# - Put func's dynamic attributes (stored in func.__dict__) in state. These
# attributes will be restored at unpickling time using
# f.__dict__.update(state)
# - Put func's members into slotstate. Such attributes will be restored at
# unpickling time by iterating ... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 139 | 175 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,013 | _class_getstate | def _class_getstate(obj):
clsdict = _extract_class_dict(obj)
clsdict.pop('__weakref__', None)
if issubclass(type(obj), abc.ABCMeta):
# If obj is an instance of an ABCMeta subclass, don't pickle the
# cache/negative caches populated during isinstance/issubclass
# checks, but pickle t... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 178 | 215 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,014 | _enum_getstate | def _enum_getstate(obj):
clsdict, slotstate = _class_getstate(obj)
members = {e.name: e.value for e in obj}
# Cleanup the clsdict that will be passed to _rehydrate_skeleton_class:
# Those attributes are already handled by the metaclass.
for attrname in ["_generate_next_value_", "_member_names_",
... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 218 | 231 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,015 | _code_reduce | def _code_reduce(obj):
"""codeobject reducer"""
# If you are not sure about the order of arguments, take a look at help
# of the specific type from types, for example:
# >>> from types import CodeType
# >>> help(CodeType)
if hasattr(obj, "co_exceptiontable"): # pragma: no branch
# Pytho... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 245 | 304 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,016 | _cell_reduce | def _cell_reduce(obj):
"""Cell (containing values of a function's free variables) reducer"""
try:
obj.cell_contents
except ValueError: # cell is empty
return _make_empty_cell, ()
else:
return _make_cell, (obj.cell_contents, ) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 307 | 314 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,017 | _classmethod_reduce | def _classmethod_reduce(obj):
orig_func = obj.__func__
return type(obj), (orig_func,) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 317 | 319 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,018 | _file_reduce | def _file_reduce(obj):
"""Save a file"""
import io
if not hasattr(obj, "name") or not hasattr(obj, "mode"):
raise pickle.PicklingError(
"Cannot pickle files that do not map to an actual file"
)
if obj is sys.stdout:
return getattr, (sys, "stdout")
if obj is sys.s... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 322 | 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,019 | _getset_descriptor_reduce | def _getset_descriptor_reduce(obj):
return getattr, (obj.__objclass__, obj.__name__) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 369 | 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,020 | _mappingproxy_reduce | def _mappingproxy_reduce(obj):
return types.MappingProxyType, (dict(obj),) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 373 | 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,021 | _memoryview_reduce | def _memoryview_reduce(obj):
return bytes, (obj.tobytes(),) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 377 | 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,022 | _module_reduce | def _module_reduce(obj):
if _should_pickle_by_reference(obj):
return subimport, (obj.__name__,)
else:
# Some external libraries can populate the "__builtins__" entry of a
# module's `__dict__` with unpicklable objects (see #316). For that
# reason, we do not attempt to pickle the... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 381 | 391 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,023 | _method_reduce | def _method_reduce(obj):
return (types.MethodType, (obj.__func__, obj.__self__)) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 394 | 395 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,024 | _logger_reduce | def _logger_reduce(obj):
return logging.getLogger, (obj.name,) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 398 | 399 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,025 | _root_logger_reduce | def _root_logger_reduce(obj):
return logging.getLogger, () | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 402 | 403 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,026 | _property_reduce | def _property_reduce(obj):
return property, (obj.fget, obj.fset, obj.fdel, obj.__doc__) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 406 | 407 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,027 | _weakset_reduce | def _weakset_reduce(obj):
return weakref.WeakSet, (list(obj),) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 410 | 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,028 | _dynamic_class_reduce | def _dynamic_class_reduce(obj):
"""
Save a class that can't be stored as module global.
This method is used to serialize classes that are defined inside
functions, or that otherwise can't be serialized as attribute lookups
from global modules.
"""
if Enum is not None and issubclass(obj, Enu... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 414 | 431 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,029 | _class_reduce | def _class_reduce(obj):
"""Select the reducer depending on the dynamic nature of the class obj"""
if obj is type(None): # noqa
return type, (None,)
elif obj is type(Ellipsis):
return type, (Ellipsis,)
elif obj is type(NotImplemented):
return type, (NotImplemented,)
elif obj ... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 434 | 446 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,030 | _dict_keys_reduce | def _dict_keys_reduce(obj):
# Safer not to ship the full dict as sending the rest might
# be unintended and could potentially cause leaking of
# sensitive information
return _make_dict_keys, (list(obj), ) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 449 | 453 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,031 | _dict_values_reduce | def _dict_values_reduce(obj):
# Safer not to ship the full dict as sending the rest might
# be unintended and could potentially cause leaking of
# sensitive information
return _make_dict_values, (list(obj), ) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 456 | 460 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,032 | _dict_items_reduce | def _dict_items_reduce(obj):
return _make_dict_items, (dict(obj), ) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 463 | 464 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,033 | _odict_keys_reduce | def _odict_keys_reduce(obj):
# Safer not to ship the full dict as sending the rest might
# be unintended and could potentially cause leaking of
# sensitive information
return _make_dict_keys, (list(obj), True) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 467 | 471 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,034 | _odict_values_reduce | def _odict_values_reduce(obj):
# Safer not to ship the full dict as sending the rest might
# be unintended and could potentially cause leaking of
# sensitive information
return _make_dict_values, (list(obj), True) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 474 | 478 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,035 | _odict_items_reduce | def _odict_items_reduce(obj):
return _make_dict_items, (dict(obj), True) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 481 | 482 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,036 | _function_setstate | def _function_setstate(obj, state):
"""Update the state of a dynamic function.
As __closure__ and __globals__ are readonly attributes of a function, we
cannot rely on the native setstate routine of pickle.load_build, that calls
setattr on items of the slotstate. Instead, we have to modify them inplace.... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 491 | 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,037 | _class_setstate | def _class_setstate(obj, state):
state, slotstate = state
registry = None
for attrname, attr in state.items():
if attrname == "_abc_impl":
registry = attr
else:
setattr(obj, attrname, attr)
if registry is not None:
for subclass in registry:
obj... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 525 | 537 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,038 | _dynamic_function_reduce | def _dynamic_function_reduce(self, func):
"""Reduce a function that is not pickleable via attribute lookup."""
newargs = self._function_getnewargs(func)
state = _function_getstate(func)
return (_make_function, newargs, state, None, None,
_function_setstate) | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 573 | 578 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,039 | _function_reduce | def _function_reduce(self, obj):
"""Reducer for function objects.
If obj is a top-level attribute of a file-backed module, this
reducer returns NotImplemented, making the CloudPickler fallback to
traditional _pickle.Pickler routines to save obj. Otherwise, it reduces
obj using a... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 580 | 595 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,040 | _function_getnewargs | def _function_getnewargs(self, func):
code = func.__code__
# base_globals represents the future global namespace of func at
# unpickling time. Looking it up and storing it in
# CloudpiPickler.globals_ref allow functions sharing the same globals
# at pickling time to also share t... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 597 | 628 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,041 | dump | def dump(self, obj):
try:
return Pickler.dump(self, obj)
except RuntimeError as e:
if "recursion" in e.args[0]:
msg = (
"Could not pickle object as excessively deep recursion "
"required."
)
r... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 630 | 641 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,042 | __init__ | def __init__(self, file, protocol=None, buffer_callback=None):
if protocol is None:
protocol = DEFAULT_PROTOCOL
Pickler.__init__(
self, file, protocol=protocol, buffer_callback=buffer_callback
)
# map functions __globals__ attribute ids, to... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 644 | 654 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,043 | __init__ | def __init__(self, file, protocol=None):
if protocol is None:
protocol = DEFAULT_PROTOCOL
Pickler.__init__(self, file, protocol=protocol)
# map functions __globals__ attribute ids, to ensure that functions
# sharing the same global namespace at pickling ti... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 656 | 664 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,044 | reducer_override | def reducer_override(self, obj):
"""Type-agnostic reducing callback for function and classes.
For performance reasons, subclasses of the C _pickle.Pickler class
cannot register custom reducers for functions and classes in the
dispatch_table. Reducer for such types must i... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 691 | 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,045 | _save_reduce_pickle5 | def _save_reduce_pickle5(self, func, args, state=None, listitems=None,
dictitems=None, state_setter=None, obj=None):
save = self.save
write = self.write
self.save_reduce(
func, args, state=None, listitems=listitems,
dic... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 750 | 769 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,046 | save_global | def save_global(self, obj, name=None, pack=struct.pack):
"""
Save a "global".
The name of this method is somewhat misleading: all types get
dispatched here.
"""
if obj is type(None): # noqa
return self.save_reduce(type, (None,), o... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 771 | 804 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,047 | save_function | def save_function(self, obj, name=None):
""" Registered with the dispatch to handle all function types.
Determines what kind of function obj is (e.g. lambda, defined at
interactive prompt, etc) and handles the pickling appropriately.
"""
if _should_pickle_by_... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 807 | 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,048 | save_pypy_builtin_func | def save_pypy_builtin_func(self, obj):
"""Save pypy equivalent of builtin functions.
PyPy does not have the concept of builtin-functions. Instead,
builtin-functions are simple function instances, but with a
builtin-code attribute.
Most of the time, builtin fun... | python | python-3.10.8.amd64/Lib/site-packages/srsly/cloudpickle/cloudpickle_fast.py | 822 | 842 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,049 | make_local_function | def make_local_function():
def g(x):
# this function checks that the globals are correctly handled and that
# the builtins are available
assert TEST_GLOBALS == "a test value"
return sum(range(10))
return g | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 19 | 26 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,050 | g | def g(x):
# this function checks that the globals are correctly handled and that
# the builtins are available
assert TEST_GLOBALS == "a test value"
return sum(range(10)) | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 20 | 24 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,051 | _make_cwd_env | def _make_cwd_env():
"""Helper to prepare environment for the child processes"""
cloudpickle_repo_folder = op.normpath(
op.join(op.dirname(__file__), '..'))
env = os.environ.copy()
pythonpath = "{src}{sep}tests{pathsep}{src}".format(
src=cloudpickle_repo_folder, sep=os.sep, pathsep=os.pa... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 29 | 37 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,052 | subprocess_pickle_string | def subprocess_pickle_string(input_data, protocol=None, timeout=TIMEOUT,
add_env=None):
"""Retrieve pickle string of an object generated by a child Python process
Pickle the input data into a buffer, send it to a subprocess via
stdin, expect the subprocess to unpickle, re-pickl... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 40 | 77 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,053 | subprocess_pickle_echo | def subprocess_pickle_echo(input_data, protocol=None, timeout=TIMEOUT,
add_env=None):
"""Echo function with a child Python process
Pickle the input data into a buffer, send it to a subprocess via
stdin, expect the subprocess to unpickle, re-pickle that data back
and send it ba... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 80 | 93 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,054 | _read_all_bytes | def _read_all_bytes(stream_in, chunk_size=4096):
all_data = b""
while True:
data = stream_in.read(chunk_size)
all_data += data
if len(data) < chunk_size:
break
return all_data | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 96 | 103 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,055 | pickle_echo | def pickle_echo(stream_in=None, stream_out=None, protocol=None):
"""Read a pickle from stdin and pickle it back to stdout"""
if stream_in is None:
stream_in = sys.stdin
if stream_out is None:
stream_out = sys.stdout
# Force the use of bytes streams under Python 3
if hasattr(stream_i... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 106 | 124 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,056 | call_func | def call_func(payload, protocol):
"""Remote function call that uses cloudpickle to transport everthing"""
func, args, kwargs = loads(payload)
try:
result = func(*args, **kwargs)
except BaseException as e:
result = e
return dumps(result, protocol=protocol) | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 127 | 134 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,057 | __init__ | def __init__(self, protocol=None):
self.protocol = protocol
self.pool = ProcessPoolExecutor(max_workers=1)
self.pool.submit(id, 42).result() # start the worker process | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 138 | 141 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,058 | run | def run(self, func, *args, **kwargs):
"""Synchronous remote function call"""
input_payload = dumps((func, args, kwargs), protocol=self.protocol)
result_payload = self.pool.submit(
call_func, input_payload, self.protocol).result()
result = loads(result_payload)
if is... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 143 | 153 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,059 | memsize | def memsize(self):
workers_pids = [p.pid if hasattr(p, "pid") else p
for p in list(self.pool._processes)]
num_workers = len(workers_pids)
if num_workers == 0:
return 0
elif num_workers > 1:
raise RuntimeError("Unexpected number of workers: ... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 155 | 164 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,060 | close | def close(self):
self.pool.shutdown(wait=True) | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 166 | 167 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,061 | subprocess_worker | def subprocess_worker(protocol=None):
worker = _Worker(protocol=protocol)
yield worker
worker.close() | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 171 | 174 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,062 | assert_run_python_script | def assert_run_python_script(source_code, timeout=TIMEOUT):
"""Utility to help check pickleability of objects defined in __main__
The script provided in the source code should return 0 and not print
anything on stderr or stdout.
"""
fd, source_file = tempfile.mkstemp(suffix='_src_test_cloudpickle.p... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/cloudpickle/testutils.py | 177 | 212 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,063 | dedent | def dedent(data):
try:
position_of_first_newline = data.index("\n")
for idx in range(position_of_first_newline):
if not data[idx].isspace():
raise ValueError
except ValueError:
pass
else:
data = data[position_of_first_newline + 1 :]
return text... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 11 | 21 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,064 | round_trip_load | def round_trip_load(inp, preserve_quotes=None, version=None):
import srsly.ruamel_yaml # NOQA
dinp = dedent(inp)
return srsly.ruamel_yaml.load(
dinp,
Loader=srsly.ruamel_yaml.RoundTripLoader,
preserve_quotes=preserve_quotes,
version=version,
) | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 24 | 33 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,065 | round_trip_load_all | def round_trip_load_all(inp, preserve_quotes=None, version=None):
import srsly.ruamel_yaml # NOQA
dinp = dedent(inp)
return srsly.ruamel_yaml.load_all(
dinp,
Loader=srsly.ruamel_yaml.RoundTripLoader,
preserve_quotes=preserve_quotes,
version=version,
) | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 36 | 45 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,066 | round_trip_dump | def round_trip_dump(
data,
stream=None,
indent=None,
block_seq_indent=None,
top_level_colon_align=None,
prefix_colon=None,
explicit_start=None,
explicit_end=None,
version=None,
):
import srsly.ruamel_yaml # NOQA
return srsly.ruamel_yaml.round_trip_dump(
data,
... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 48 | 71 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,067 | diff | def diff(inp, outp, file_name="stdin"):
import difflib
inl = inp.splitlines(True) # True for keepends
outl = outp.splitlines(True)
diff = difflib.unified_diff(inl, outl, file_name, "round trip YAML")
# 2.6 difflib has trailing space on filename lines %-)
strip_trailing_space = sys.version_info... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 74 | 85 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,068 | round_trip | def round_trip(
inp,
outp=None,
extra=None,
intermediate=None,
indent=None,
block_seq_indent=None,
top_level_colon_align=None,
prefix_colon=None,
preserve_quotes=None,
explicit_start=None,
explicit_end=None,
version=None,
dump_data=None,
):
"""
inp: input s... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 88 | 147 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,069 | na_round_trip | def na_round_trip(
inp,
outp=None,
extra=None,
intermediate=None,
indent=None,
top_level_colon_align=None,
prefix_colon=None,
preserve_quotes=None,
explicit_start=None,
explicit_end=None,
version=None,
dump_data=None,
):
"""
inp: input string to parse
outp:... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 150 | 194 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,070 | YAML | def YAML(**kw):
import srsly.ruamel_yaml # NOQA
class MyYAML(srsly.ruamel_yaml.YAML):
"""auto dedent string parameters on load"""
def load(self, stream):
if isinstance(stream, str):
if stream and stream[0] == "\n":
stream = stream[1:]
... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 197 | 272 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,071 | load | def load(self, stream):
if isinstance(stream, str):
if stream and stream[0] == "\n":
stream = stream[1:]
stream = textwrap.dedent(stream)
return srsly.ruamel_yaml.YAML.load(self, stream) | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 203 | 208 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,072 | load_all | def load_all(self, stream):
if isinstance(stream, str):
if stream and stream[0] == "\n":
stream = stream[1:]
stream = textwrap.dedent(stream)
for d in srsly.ruamel_yaml.YAML.load_all(self, stream):
yield d | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 210 | 216 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,073 | dump | def dump(self, data, **kw):
from srsly.ruamel_yaml.compat import StringIO, BytesIO # NOQA
assert ("stream" in kw) ^ ("compare" in kw)
if "stream" in kw:
return srsly.ruamel_yaml.YAML.dump(data, **kw)
lkw = kw.copy()
expected = textwrap.dedent... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 218 | 236 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,074 | round_trip | def round_trip(self, stream, **kw):
from srsly.ruamel_yaml.compat import StringIO, BytesIO # NOQA
assert isinstance(stream, (srsly.ruamel_yaml.compat.text_type, str))
lkw = kw.copy()
if stream and stream[0] == "\n":
stream = stream[1:]
stream... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 238 | 253 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,075 | round_trip_all | def round_trip_all(self, stream, **kw):
from srsly.ruamel_yaml.compat import StringIO, BytesIO # NOQA
assert isinstance(stream, (srsly.ruamel_yaml.compat.text_type, str))
lkw = kw.copy()
if stream and stream[0] == "\n":
stream = stream[1:]
st... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 255 | 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,076 | save_and_run | def save_and_run(program, base_dir=None, output=None, file_name=None, optimized=False):
"""
safe and run a python program, thereby circumventing any restrictions on module level
imports
"""
from subprocess import check_output, STDOUT, CalledProcessError
if not hasattr(base_dir, "hash"):
... | python | python-3.10.8.amd64/Lib/site-packages/srsly/tests/ruamel_yaml/roundtrip.py | 275 | 308 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,077 | __new__ | def __new__(cls, *args, **kw):
# type: (Any, Any, Any) -> Any
width = kw.pop("width", None) # type: ignore
prec = kw.pop("prec", None) # type: ignore
m_sign = kw.pop("m_sign", None) # type: ignore
m_lead0 = kw.pop("m_lead0", 0) # type: ignore
exp = kw.pop("exp", None)... | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 16 | 38 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,078 | __iadd__ | def __iadd__(self, a): # type: ignore
# type: (Any) -> Any
return float(self) + a
x = type(self)(self + a)
x._width = self._width
x._underscore = (
self._underscore[:] if self._underscore is not None else None
) # NOQA
return x | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 40 | 48 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,079 | __ifloordiv__ | def __ifloordiv__(self, a): # type: ignore
# type: (Any) -> Any
return float(self) // a
x = type(self)(self // a)
x._width = self._width
x._underscore = (
self._underscore[:] if self._underscore is not None else None
) # NOQA
return x | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 50 | 58 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,080 | __imul__ | def __imul__(self, a): # type: ignore
# type: (Any) -> Any
return float(self) * a
x = type(self)(self * a)
x._width = self._width
x._underscore = (
self._underscore[:] if self._underscore is not None else None
) # NOQA
x._prec = self._prec # check f... | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 60 | 69 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,081 | __ipow__ | def __ipow__(self, a): # type: ignore
# type: (Any) -> Any
return float(self) ** a
x = type(self)(self ** a)
x._width = self._width
x._underscore = (
self._underscore[:] if self._underscore is not None else None
) # NOQA
return x | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 71 | 79 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,082 | __isub__ | def __isub__(self, a): # type: ignore
# type: (Any) -> Any
return float(self) - a
x = type(self)(self - a)
x._width = self._width
x._underscore = (
self._underscore[:] if self._underscore is not None else None
) # NOQA
return x | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 81 | 89 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,083 | 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/scalarfloat.py | 92 | 96 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,084 | yaml_anchor | def yaml_anchor(self, any=False):
# type: (bool) -> Any
if not hasattr(self, Anchor.attrib):
return None
if any or self.anchor.always_dump:
return self.anchor
return None | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 98 | 104 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,085 | 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/scalarfloat.py | 106 | 109 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,086 | dump | def dump(self, out=sys.stdout):
# type: (Any) -> Any
out.write(
"ScalarFloat({}| w:{}, p:{}, s:{}, lz:{}, _:{}|{}, w:{}, s:{})\n".format(
self,
self._width, # type: ignore
self._prec, # type: ignore
self._m_sign, # type: igno... | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 111 | 125 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,087 | __new__ | def __new__(cls, value, width=None, underscore=None):
# type: (Any, Any, Any) -> Any
return ScalarFloat.__new__(cls, value, width=width, underscore=underscore) | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 129 | 131 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,088 | __new__ | def __new__(cls, value, width=None, underscore=None):
# type: (Any, Any, Any) -> Any
return ScalarFloat.__new__(cls, value, width=width, underscore=underscore) | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scalarfloat.py | 135 | 137 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,089 | __init__ | def __init__(self, token_number, required, index, line, column, mark):
# type: (Any, Any, int, int, int, Any) -> None
self.token_number = token_number
self.required = required
self.index = index
self.line = line
self.column = column
self.mark = mark | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 56 | 63 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,090 | __init__ | def __init__(self, loader=None):
# type: (Any) -> None
"""Initialize the scanner."""
# It is assumed that Scanner and Reader will have a common descendant.
# Reader do the dirty work of checking for BOM and converting the
# input data to Unicode. It also adds NUL to the end.
... | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 67 | 84 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,091 | flow_level | def flow_level(self):
# type: () -> int
return len(self.flow_context) | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 87 | 89 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,092 | reset_scanner | def reset_scanner(self):
# type: () -> None
# Had we reached the end of the stream?
self.done = False
# flow_context is an expanding/shrinking list consisting of '{' and '['
# for each unclosed flow context. If empty list that means block context
self.flow_context = [] ... | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 91 | 143 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,093 | reader | def reader(self):
# type: () -> Any
try:
return self._scanner_reader # type: ignore
except AttributeError:
if hasattr(self.loader, "typ"):
self._scanner_reader = self.loader.reader
else:
self._scanner_reader = self.loader._read... | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 146 | 155 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,094 | scanner_processing_version | def scanner_processing_version(self): # prefix until un-composited
# type: () -> Any
if hasattr(self.loader, "typ"):
return self.loader.resolver.processing_version
return self.loader.processing_version | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 158 | 162 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,095 | check_token | def check_token(self, *choices):
# type: (Any) -> bool
# Check if the next token is one of the given types.
while self.need_more_tokens():
self.fetch_more_tokens()
if bool(self.tokens):
if not choices:
return True
for choice in choices:... | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 166 | 177 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,096 | peek_token | def peek_token(self):
# type: () -> Any
# Return the next token, but do not delete if from the queue.
while self.need_more_tokens():
self.fetch_more_tokens()
if bool(self.tokens):
return self.tokens[0] | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 179 | 185 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,097 | get_token | def get_token(self):
# type: () -> Any
# Return the next token.
while self.need_more_tokens():
self.fetch_more_tokens()
if bool(self.tokens):
self.tokens_taken += 1
return self.tokens.pop(0) | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 187 | 194 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,098 | need_more_tokens | def need_more_tokens(self):
# type: () -> bool
if self.done:
return False
if not self.tokens:
return True
# The current token may be a potential simple key, so we
# need to look further.
self.stale_possible_simple_keys()
if self.next_possib... | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 198 | 209 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,099 | fetch_comment | def fetch_comment(self, comment):
# type: (Any) -> None
raise NotImplementedError | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 211 | 213 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
6,069,100 | fetch_more_tokens | def fetch_more_tokens(self):
# type: () -> Any
# Eat whitespaces and comments until we reach the next token.
comment = self.scan_to_next_token()
if comment is not None: # never happens for base scanner
return self.fetch_comment(comment)
# Remove obsolete possible sim... | python | python-3.10.8.amd64/Lib/site-packages/srsly/ruamel_yaml/scanner.py | 215 | 323 | {
"name": "PortablePy/3.10.8.0",
"url": "https://github.com/PortablePy/3.10.8.0.git",
"license": "NOASSERTION",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.