golden hour
/opt/saltstack/salt/lib/python3.10
⬆️ Go Up
Upload
File/Folder
Size
Actions
__future__.py
5.03 KB
Del
OK
__phello__.foo.py
64 B
Del
OK
__pycache__
-
Del
OK
_aix_support.py
3.19 KB
Del
OK
_bootsubprocess.py
2.61 KB
Del
OK
_collections_abc.py
31.53 KB
Del
OK
_compat_pickle.py
8.54 KB
Del
OK
_compression.py
5.55 KB
Del
OK
_markupbase.py
14.31 KB
Del
OK
_osx_support.py
21.28 KB
Del
OK
_py_abc.py
6.04 KB
Del
OK
_pydecimal.py
223.32 KB
Del
OK
_pyio.py
92.25 KB
Del
OK
_sitebuiltins.py
3.05 KB
Del
OK
_strptime.py
24.68 KB
Del
OK
_sysconfigdata__linux_x86_64-linux-gnu.py
31.51 KB
Del
OK
_threading_local.py
7.05 KB
Del
OK
_weakrefset.py
5.78 KB
Del
OK
abc.py
6.37 KB
Del
OK
aifc.py
31.84 KB
Del
OK
antigravity.py
500 B
Del
OK
argparse.py
96.23 KB
Del
OK
ast.py
58.5 KB
Del
OK
asynchat.py
11.25 KB
Del
OK
asyncio
-
Del
OK
asyncore.py
19.79 KB
Del
OK
base64.py
20.36 KB
Del
OK
bdb.py
31.64 KB
Del
OK
binhex.py
14.44 KB
Del
OK
bisect.py
3.06 KB
Del
OK
bz2.py
11.57 KB
Del
OK
cProfile.py
6.2 KB
Del
OK
calendar.py
24 KB
Del
OK
cgi.py
33.37 KB
Del
OK
cgitb.py
11.81 KB
Del
OK
chunk.py
5.31 KB
Del
OK
cmd.py
14.51 KB
Del
OK
code.py
10.37 KB
Del
OK
codecs.py
35.85 KB
Del
OK
codeop.py
5.48 KB
Del
OK
collections
-
Del
OK
colorsys.py
3.92 KB
Del
OK
compileall.py
19.78 KB
Del
OK
concurrent
-
Del
OK
config-3.10-x86_64-linux-gnu
-
Del
OK
configparser.py
53.33 KB
Del
OK
contextlib.py
25.28 KB
Del
OK
contextvars.py
129 B
Del
OK
copy.py
8.48 KB
Del
OK
copyreg.py
7.25 KB
Del
OK
crypt.py
3.76 KB
Del
OK
csv.py
15.65 KB
Del
OK
ctypes
-
Del
OK
curses
-
Del
OK
dataclasses.py
55.07 KB
Del
OK
datetime.py
86.02 KB
Del
OK
dbm
-
Del
OK
decimal.py
320 B
Del
OK
difflib.py
81.36 KB
Del
OK
dis.py
19.55 KB
Del
OK
distutils
-
Del
OK
doctest.py
102.68 KB
Del
OK
email
-
Del
OK
encodings
-
Del
OK
ensurepip
-
Del
OK
enum.py
38.9 KB
Del
OK
filecmp.py
9.94 KB
Del
OK
fileinput.py
16.06 KB
Del
OK
fnmatch.py
6.56 KB
Del
OK
fractions.py
27.58 KB
Del
OK
ftplib.py
34.66 KB
Del
OK
functools.py
37.18 KB
Del
OK
genericpath.py
4.86 KB
Del
OK
getopt.py
7.31 KB
Del
OK
getpass.py
5.85 KB
Del
OK
gettext.py
26.63 KB
Del
OK
glob.py
7.7 KB
Del
OK
graphlib.py
9.35 KB
Del
OK
gzip.py
21.34 KB
Del
OK
hashlib.py
9.99 KB
Del
OK
heapq.py
22.34 KB
Del
OK
hmac.py
7.54 KB
Del
OK
html
-
Del
OK
http
-
Del
OK
imaplib.py
53.58 KB
Del
OK
imghdr.py
3.72 KB
Del
OK
imp.py
10.34 KB
Del
OK
importlib
-
Del
OK
inspect.py
121.46 KB
Del
OK
io.py
4.1 KB
Del
OK
ipaddress.py
72.97 KB
Del
OK
json
-
Del
OK
keyword.py
1.04 KB
Del
OK
lib-dynload
-
Del
OK
lib2to3
-
Del
OK
linecache.py
5.56 KB
Del
OK
locale.py
76.29 KB
Del
OK
logging
-
Del
OK
lzma.py
12.97 KB
Del
OK
mailbox.py
76.95 KB
Del
OK
mailcap.py
8.9 KB
Del
OK
mimetypes.py
22.01 KB
Del
OK
modulefinder.py
23.83 KB
Del
OK
multiprocessing
-
Del
OK
netrc.py
5.61 KB
Del
OK
nntplib.py
40.06 KB
Del
OK
ntpath.py
28.79 KB
Del
OK
nturl2path.py
2.82 KB
Del
OK
numbers.py
10.11 KB
Del
OK
opcode.py
5.76 KB
Del
OK
operator.py
10.5 KB
Del
OK
optparse.py
58.95 KB
Del
OK
os.py
38.63 KB
Del
OK
pathlib.py
48.41 KB
Del
OK
pdb.py
61.74 KB
Del
OK
pickle.py
63.43 KB
Del
OK
pickletools.py
91.29 KB
Del
OK
pipes.py
8.71 KB
Del
OK
pkgutil.py
24 KB
Del
OK
platform.py
41.04 KB
Del
OK
plistlib.py
27.69 KB
Del
OK
poplib.py
14.84 KB
Del
OK
posixpath.py
15.87 KB
Del
OK
pprint.py
23.87 KB
Del
OK
profile.py
22.35 KB
Del
OK
pstats.py
28.64 KB
Del
OK
pty.py
5.09 KB
Del
OK
py_compile.py
7.65 KB
Del
OK
pyclbr.py
11.13 KB
Del
OK
pydoc.py
107.02 KB
Del
OK
pydoc_data
-
Del
OK
queue.py
11.23 KB
Del
OK
quopri.py
7.1 KB
Del
OK
random.py
32.44 KB
Del
OK
re.py
15.49 KB
Del
OK
reprlib.py
5.14 KB
Del
OK
rlcompleter.py
7.63 KB
Del
OK
runpy.py
12.8 KB
Del
OK
sched.py
6.2 KB
Del
OK
secrets.py
1.99 KB
Del
OK
selectors.py
19.08 KB
Del
OK
shelve.py
8.36 KB
Del
OK
shlex.py
13.18 KB
Del
OK
shutil.py
53.29 KB
Del
OK
signal.py
2.38 KB
Del
OK
site-packages
-
Del
OK
site.py
22.06 KB
Del
OK
smtpd.py
34.34 KB
Del
OK
smtplib.py
44.35 KB
Del
OK
sndhdr.py
6.93 KB
Del
OK
socket.py
35.92 KB
Del
OK
socketserver.py
26.66 KB
Del
OK
sqlite3
-
Del
OK
sre_compile.py
27.32 KB
Del
OK
sre_constants.py
7.01 KB
Del
OK
sre_parse.py
39.82 KB
Del
OK
ssl.py
52.63 KB
Del
OK
stat.py
5.36 KB
Del
OK
statistics.py
42.19 KB
Del
OK
string.py
10.32 KB
Del
OK
stringprep.py
12.61 KB
Del
OK
struct.py
257 B
Del
OK
subprocess.py
82.93 KB
Del
OK
sunau.py
17.73 KB
Del
OK
symtable.py
9.98 KB
Del
OK
sysconfig.py
26.96 KB
Del
OK
tabnanny.py
11.03 KB
Del
OK
tarfile.py
103.63 KB
Del
OK
telnetlib.py
22.71 KB
Del
OK
tempfile.py
28.5 KB
Del
OK
textwrap.py
19.31 KB
Del
OK
this.py
1003 B
Del
OK
threading.py
55.86 KB
Del
OK
timeit.py
13.18 KB
Del
OK
token.py
2.33 KB
Del
OK
tokenize.py
25.31 KB
Del
OK
trace.py
28.53 KB
Del
OK
traceback.py
25.61 KB
Del
OK
tracemalloc.py
17.62 KB
Del
OK
tty.py
879 B
Del
OK
turtle.py
140.39 KB
Del
OK
types.py
9.88 KB
Del
OK
typing.py
90.39 KB
Del
OK
unittest
-
Del
OK
urllib
-
Del
OK
uu.py
7.13 KB
Del
OK
uuid.py
26.86 KB
Del
OK
venv
-
Del
OK
warnings.py
19.23 KB
Del
OK
wave.py
17.58 KB
Del
OK
weakref.py
21.05 KB
Del
OK
webbrowser.py
23.68 KB
Del
OK
wsgiref
-
Del
OK
xdrlib.py
5.77 KB
Del
OK
xml
-
Del
OK
xmlrpc
-
Del
OK
zipapp.py
7.36 KB
Del
OK
zipfile.py
87.34 KB
Del
OK
zipimport.py
30.17 KB
Del
OK
zoneinfo
-
Del
OK
Edit: types.py
""" Define names for built-in types that aren't directly accessible as a builtin. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check the type! Use hasattr to check for both # "__iter__" and "__next__" attributes instead. def _f(): pass FunctionType = type(_f) LambdaType = type(lambda: None) # Same as FunctionType CodeType = type(_f.__code__) MappingProxyType = type(type.__dict__) SimpleNamespace = type(sys.implementation) def _cell_factory(): a = 1 def f(): nonlocal a return f.__closure__[0] CellType = type(_cell_factory()) def _g(): yield 1 GeneratorType = type(_g()) async def _c(): pass _c = _c() CoroutineType = type(_c) _c.close() # Prevent ResourceWarning async def _ag(): yield _ag = _ag() AsyncGeneratorType = type(_ag) class _C: def _m(self): pass MethodType = type(_C()._m) BuiltinFunctionType = type(len) BuiltinMethodType = type([].append) # Same as BuiltinFunctionType WrapperDescriptorType = type(object.__init__) MethodWrapperType = type(object().__str__) MethodDescriptorType = type(str.join) ClassMethodDescriptorType = type(dict.__dict__['fromkeys']) ModuleType = type(sys) try: raise TypeError except TypeError: tb = sys.exc_info()[2] TracebackType = type(tb) FrameType = type(tb.tb_frame) tb = None; del tb # For Jython, the following two types are identical GetSetDescriptorType = type(FunctionType.__code__) MemberDescriptorType = type(FunctionType.__globals__) del sys, _f, _g, _C, _c, _ag # Not for export # Provide a PEP 3115 compliant mechanism for class creation def new_class(name, bases=(), kwds=None, exec_body=None): """Create a class object dynamically using the appropriate metaclass.""" resolved_bases = resolve_bases(bases) meta, ns, kwds = prepare_class(name, resolved_bases, kwds) if exec_body is not None: exec_body(ns) if resolved_bases is not bases: ns['__orig_bases__'] = bases return meta(name, resolved_bases, ns, **kwds) def resolve_bases(bases): """Resolve MRO entries dynamically as specified by PEP 560.""" new_bases = list(bases) updated = False shift = 0 for i, base in enumerate(bases): if isinstance(base, type) and not isinstance(base, GenericAlias): continue if not hasattr(base, "__mro_entries__"): continue new_base = base.__mro_entries__(bases) updated = True if not isinstance(new_base, tuple): raise TypeError("__mro_entries__ must return a tuple") else: new_bases[i+shift:i+shift+1] = new_base shift += len(new_base) - 1 if not updated: return bases return tuple(new_bases) def prepare_class(name, bases=(), kwds=None): """Call the __prepare__ method of the appropriate metaclass. Returns (metaclass, namespace, kwds) as a 3-tuple *metaclass* is the appropriate metaclass *namespace* is the prepared class namespace *kwds* is an updated copy of the passed in kwds argument with any 'metaclass' entry removed. If no kwds argument is passed in, this will be an empty dict. """ if kwds is None: kwds = {} else: kwds = dict(kwds) # Don't alter the provided mapping if 'metaclass' in kwds: meta = kwds.pop('metaclass') else: if bases: meta = type(bases[0]) else: meta = type if isinstance(meta, type): # when meta is a type, we first determine the most-derived metaclass # instead of invoking the initial candidate directly meta = _calculate_meta(meta, bases) if hasattr(meta, '__prepare__'): ns = meta.__prepare__(name, bases, **kwds) else: ns = {} return meta, ns, kwds def _calculate_meta(meta, bases): """Calculate the most derived metaclass.""" winner = meta for base in bases: base_meta = type(base) if issubclass(winner, base_meta): continue if issubclass(base_meta, winner): winner = base_meta continue # else: raise TypeError("metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases") return winner class DynamicClassAttribute: """Route attribute access on a class to __getattr__. This is a descriptor, used to define attributes that act differently when accessed through an instance and through a class. Instance access remains normal, but access to an attribute through a class will be routed to the class's __getattr__ method; this is done by raising AttributeError. This allows one to have properties active on an instance, and have virtual attributes on the class with the same name. (Enum used this between Python versions 3.4 - 3.9 .) Subclass from this to use a different method of accessing virtual atributes and still be treated properly by the inspect module. (Enum uses this since Python 3.10 .) """ def __init__(self, fget=None, fset=None, fdel=None, doc=None): self.fget = fget self.fset = fset self.fdel = fdel # next two lines make DynamicClassAttribute act the same as property self.__doc__ = doc or fget.__doc__ self.overwrite_doc = doc is None # support for abstract methods self.__isabstractmethod__ = bool(getattr(fget, '__isabstractmethod__', False)) def __get__(self, instance, ownerclass=None): if instance is None: if self.__isabstractmethod__: return self raise AttributeError() elif self.fget is None: raise AttributeError("unreadable attribute") return self.fget(instance) def __set__(self, instance, value): if self.fset is None: raise AttributeError("can't set attribute") self.fset(instance, value) def __delete__(self, instance): if self.fdel is None: raise AttributeError("can't delete attribute") self.fdel(instance) def getter(self, fget): fdoc = fget.__doc__ if self.overwrite_doc else None result = type(self)(fget, self.fset, self.fdel, fdoc or self.__doc__) result.overwrite_doc = self.overwrite_doc return result def setter(self, fset): result = type(self)(self.fget, fset, self.fdel, self.__doc__) result.overwrite_doc = self.overwrite_doc return result def deleter(self, fdel): result = type(self)(self.fget, self.fset, fdel, self.__doc__) result.overwrite_doc = self.overwrite_doc return result class _GeneratorWrapper: # TODO: Implement this in C. def __init__(self, gen): self.__wrapped = gen self.__isgen = gen.__class__ is GeneratorType self.__name__ = getattr(gen, '__name__', None) self.__qualname__ = getattr(gen, '__qualname__', None) def send(self, val): return self.__wrapped.send(val) def throw(self, tp, *rest): return self.__wrapped.throw(tp, *rest) def close(self): return self.__wrapped.close() @property def gi_code(self): return self.__wrapped.gi_code @property def gi_frame(self): return self.__wrapped.gi_frame @property def gi_running(self): return self.__wrapped.gi_running @property def gi_yieldfrom(self): return self.__wrapped.gi_yieldfrom cr_code = gi_code cr_frame = gi_frame cr_running = gi_running cr_await = gi_yieldfrom def __next__(self): return next(self.__wrapped) def __iter__(self): if self.__isgen: return self.__wrapped return self __await__ = __iter__ def coroutine(func): """Convert regular generator function to a coroutine.""" if not callable(func): raise TypeError('types.coroutine() expects a callable') if (func.__class__ is FunctionType and getattr(func, '__code__', None).__class__ is CodeType): co_flags = func.__code__.co_flags # Check if 'func' is a coroutine function. # (0x180 == CO_COROUTINE | CO_ITERABLE_COROUTINE) if co_flags & 0x180: return func # Check if 'func' is a generator function. # (0x20 == CO_GENERATOR) if co_flags & 0x20: # TODO: Implement this in C. co = func.__code__ # 0x100 == CO_ITERABLE_COROUTINE func.__code__ = co.replace(co_flags=co.co_flags | 0x100) return func # The following code is primarily to support functions that # return generator-like objects (for instance generators # compiled with Cython). # Delay functools and _collections_abc import for speeding up types import. import functools import _collections_abc @functools.wraps(func) def wrapped(*args, **kwargs): coro = func(*args, **kwargs) if (coro.__class__ is CoroutineType or coro.__class__ is GeneratorType and coro.gi_code.co_flags & 0x100): # 'coro' is a native coroutine object or an iterable coroutine return coro if (isinstance(coro, _collections_abc.Generator) and not isinstance(coro, _collections_abc.Coroutine)): # 'coro' is either a pure Python generator iterator, or it # implements collections.abc.Generator (and does not implement # collections.abc.Coroutine). return _GeneratorWrapper(coro) # 'coro' is either an instance of collections.abc.Coroutine or # some other object -- pass it through. return coro return wrapped GenericAlias = type(list[int]) UnionType = type(int | str) EllipsisType = type(Ellipsis) NoneType = type(None) NotImplementedType = type(NotImplemented) __all__ = [n for n in globals() if n[:1] != '_']
Save