ACIL FM
Dark
Refresh
Current DIR:
/usr/lib64/python3.9/site-packages/pyrsistent
/
usr
lib64
python3.9
site-packages
pyrsistent
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
__pycache__
-
chmod
Open
Rename
Delete
py.typed
0 B
chmod
View
DL
Edit
Rename
Delete
typing.py
1.73 MB
chmod
View
DL
Edit
Rename
Delete
typing.pyi
10.17 MB
chmod
View
DL
Edit
Rename
Delete
_checked_types.py
17.86 MB
chmod
View
DL
Edit
Rename
Delete
_field_common.py
11.26 MB
chmod
View
DL
Edit
Rename
Delete
_helpers.py
2.39 MB
chmod
View
DL
Edit
Rename
Delete
_immutable.py
3.45 MB
chmod
View
DL
Edit
Rename
Delete
_pbag.py
6.57 MB
chmod
View
DL
Edit
Rename
Delete
_pclass.py
9.47 MB
chmod
View
DL
Edit
Rename
Delete
_pdeque.py
11.92 MB
chmod
View
DL
Edit
Rename
Delete
_plist.py
8.1 MB
chmod
View
DL
Edit
Rename
Delete
_pmap.py
14.29 MB
chmod
View
DL
Edit
Rename
Delete
_precord.py
6.83 MB
chmod
View
DL
Edit
Rename
Delete
_pset.py
5.55 MB
chmod
View
DL
Edit
Rename
Delete
_pvector.py
22.16 MB
chmod
View
DL
Edit
Rename
Delete
_toolz.py
3.35 MB
chmod
View
DL
Edit
Rename
Delete
_transformations.py
3.71 MB
chmod
View
DL
Edit
Rename
Delete
__init__.py
1.44 MB
chmod
View
DL
Edit
Rename
Delete
__init__.pyi
7.02 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /usr/lib64/python3.9/site-packages/pyrsistent/_helpers.py
from functools import wraps from pyrsistent._pmap import PMap, pmap from pyrsistent._pset import PSet, pset from pyrsistent._pvector import PVector, pvector def freeze(o): """ Recursively convert simple Python containers into pyrsistent versions of those containers. - list is converted to pvector, recursively - dict is converted to pmap, recursively on values (but not keys) - set is converted to pset, but not recursively - tuple is converted to tuple, recursively. Sets and dict keys are not recursively frozen because they do not contain mutable data by convention. The main exception to this rule is that dict keys and set elements are often instances of mutable objects that support hash-by-id, which this function can't convert anyway. >>> freeze(set([1, 2])) pset([1, 2]) >>> freeze([1, {'a': 3}]) pvector([1, pmap({'a': 3})]) >>> freeze((1, [])) (1, pvector([])) """ typ = type(o) if typ is dict: return pmap(dict((k, freeze(v)) for k, v in o.items())) if typ is list: return pvector(map(freeze, o)) if typ is tuple: return tuple(map(freeze, o)) if typ is set: return pset(o) return o def thaw(o): """ Recursively convert pyrsistent containers into simple Python containers. - pvector is converted to list, recursively - pmap is converted to dict, recursively on values (but not keys) - pset is converted to set, but not recursively - tuple is converted to tuple, recursively. >>> from pyrsistent import s, m, v >>> thaw(s(1, 2)) {1, 2} >>> thaw(v(1, m(a=3))) [1, {'a': 3}] >>> thaw((1, v())) (1, []) """ if isinstance(o, PVector): return list(map(thaw, o)) if isinstance(o, PMap): return dict((k, thaw(v)) for k, v in o.iteritems()) if isinstance(o, PSet): return set(o) if type(o) is tuple: return tuple(map(thaw, o)) return o def mutant(fn): """ Convenience decorator to isolate mutation to within the decorated function (with respect to the input arguments). All arguments to the decorated function will be frozen so that they are guaranteed not to change. The return value is also frozen. """ @wraps(fn) def inner_f(*args, **kwargs): return freeze(fn(*[freeze(e) for e in args], **dict(freeze(item) for item in kwargs.items()))) return inner_f
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply