golden hour
/opt/alt/python-internal/lib64/python3.11
⬆️ Go Up
Upload
File/Folder
Size
Actions
LICENSE.txt
13.61 KB
Del
OK
__future__.py
5.1 KB
Del
OK
__hello__.py
227 B
Del
OK
__pycache__
-
Del
OK
_aix_support.py
3.31 KB
Del
OK
_bootsubprocess.py
2.61 KB
Del
OK
_collections_abc.py
29.49 KB
Del
OK
_compat_pickle.py
8.56 KB
Del
OK
_compression.py
5.55 KB
Del
OK
_markupbase.py
14.31 KB
Del
OK
_osx_support.py
21.51 KB
Del
OK
_py_abc.py
6.04 KB
Del
OK
_pydecimal.py
223.83 KB
Del
OK
_pyio.py
91.99 KB
Del
OK
_sitebuiltins.py
3.05 KB
Del
OK
_strptime.py
24.58 KB
Del
OK
_sysconfigdata__linux_x86_64-linux-gnu.py
58.3 KB
Del
OK
_sysconfigdata_d_linux_x86_64-linux-gnu.py
57.55 KB
Del
OK
_threading_local.py
7.05 KB
Del
OK
_weakrefset.py
5.75 KB
Del
OK
abc.py
6.38 KB
Del
OK
aifc.py
33.41 KB
Del
OK
antigravity.py
500 B
Del
OK
argparse.py
97.93 KB
Del
OK
ast.py
60 KB
Del
OK
asynchat.py
11.3 KB
Del
OK
asyncio
-
Del
OK
asyncore.py
19.83 KB
Del
OK
base64.py
20.55 KB
Del
OK
bdb.py
31.7 KB
Del
OK
bisect.py
3.06 KB
Del
OK
bz2.py
11.57 KB
Del
OK
cProfile.py
6.22 KB
Del
OK
calendar.py
24.15 KB
Del
OK
cgi.py
33.63 KB
Del
OK
cgitb.py
12.13 KB
Del
OK
chunk.py
5.37 KB
Del
OK
cmd.py
14.52 KB
Del
OK
code.py
10.37 KB
Del
OK
codecs.py
36.28 KB
Del
OK
codeop.py
5.77 KB
Del
OK
collections
-
Del
OK
colorsys.py
3.97 KB
Del
OK
compileall.py
19.78 KB
Del
OK
concurrent
-
Del
OK
config-3.11-x86_64-linux-gnu
-
Del
OK
configparser.py
54.36 KB
Del
OK
contextlib.py
26.77 KB
Del
OK
contextvars.py
129 B
Del
OK
copy.py
8.48 KB
Del
OK
copyreg.py
7.5 KB
Del
OK
crypt.py
3.82 KB
Del
OK
csv.py
15.65 KB
Del
OK
ctypes
-
Del
OK
curses
-
Del
OK
dataclasses.py
57.1 KB
Del
OK
datetime.py
89.68 KB
Del
OK
dbm
-
Del
OK
decimal.py
320 B
Del
OK
difflib.py
81.36 KB
Del
OK
dis.py
28.23 KB
Del
OK
distutils
-
Del
OK
doctest.py
103.81 KB
Del
OK
email
-
Del
OK
encodings
-
Del
OK
ensurepip
-
Del
OK
enum.py
77.72 KB
Del
OK
filecmp.py
9.94 KB
Del
OK
fileinput.py
15.35 KB
Del
OK
fnmatch.py
5.86 KB
Del
OK
fractions.py
28 KB
Del
OK
ftplib.py
34.98 KB
Del
OK
functools.py
37.51 KB
Del
OK
genericpath.py
5.12 KB
Del
OK
getopt.py
7.31 KB
Del
OK
getpass.py
5.85 KB
Del
OK
gettext.py
20.82 KB
Del
OK
glob.py
8.53 KB
Del
OK
graphlib.py
9.43 KB
Del
OK
gzip.py
23.51 KB
Del
OK
hashlib.py
11.49 KB
Del
OK
heapq.py
22.48 KB
Del
OK
hmac.py
7.54 KB
Del
OK
html
-
Del
OK
http
-
Del
OK
imaplib.py
53.92 KB
Del
OK
imghdr.py
3.86 KB
Del
OK
imp.py
10.36 KB
Del
OK
importlib
-
Del
OK
inspect.py
120.53 KB
Del
OK
io.py
4.22 KB
Del
OK
ipaddress.py
79.51 KB
Del
OK
json
-
Del
OK
keyword.py
1.04 KB
Del
OK
lib-dynload
-
Del
OK
lib2to3
-
Del
OK
linecache.py
5.52 KB
Del
OK
locale.py
77.24 KB
Del
OK
logging
-
Del
OK
lzma.py
12.97 KB
Del
OK
mailbox.py
76.98 KB
Del
OK
mailcap.py
9.15 KB
Del
OK
mimetypes.py
22.42 KB
Del
OK
modulefinder.py
23.14 KB
Del
OK
multiprocessing
-
Del
OK
netrc.py
6.77 KB
Del
OK
nntplib.py
40.12 KB
Del
OK
ntpath.py
29.97 KB
Del
OK
nturl2path.py
2.82 KB
Del
OK
numbers.py
10.11 KB
Del
OK
opcode.py
10.2 KB
Del
OK
operator.py
10.71 KB
Del
OK
optparse.py
58.95 KB
Del
OK
os.py
38.6 KB
Del
OK
pathlib.py
47.43 KB
Del
OK
pdb.py
62.69 KB
Del
OK
pickle.py
63.61 KB
Del
OK
pickletools.py
91.66 KB
Del
OK
pipes.py
8.77 KB
Del
OK
pkgutil.py
24.06 KB
Del
OK
platform.py
41.3 KB
Del
OK
plistlib.py
27.69 KB
Del
OK
poplib.py
14.84 KB
Del
OK
posixpath.py
16.8 KB
Del
OK
pprint.py
24.01 KB
Del
OK
profile.py
22.37 KB
Del
OK
pstats.py
28.67 KB
Del
OK
pty.py
6.17 KB
Del
OK
py_compile.py
7.65 KB
Del
OK
pyclbr.py
11.13 KB
Del
OK
pydoc.py
110.03 KB
Del
OK
pydoc_data
-
Del
OK
queue.py
11.23 KB
Del
OK
quopri.py
7.12 KB
Del
OK
random.py
31.41 KB
Del
OK
re
-
Del
OK
reprlib.py
5.31 KB
Del
OK
rlcompleter.py
7.64 KB
Del
OK
runpy.py
12.85 KB
Del
OK
sched.py
6.2 KB
Del
OK
secrets.py
1.98 KB
Del
OK
selectors.py
19.21 KB
Del
OK
shelve.py
8.36 KB
Del
OK
shlex.py
13.18 KB
Del
OK
shutil.py
55.19 KB
Del
OK
signal.py
2.44 KB
Del
OK
site-packages
-
Del
OK
site.py
22.45 KB
Del
OK
smtpd.py
30.45 KB
Del
OK
smtplib.py
44.37 KB
Del
OK
sndhdr.py
7.27 KB
Del
OK
socket.py
36.68 KB
Del
OK
socketserver.py
26.94 KB
Del
OK
sqlite3
-
Del
OK
sre_compile.py
231 B
Del
OK
sre_constants.py
232 B
Del
OK
sre_parse.py
229 B
Del
OK
ssl.py
53.03 KB
Del
OK
stat.py
5.36 KB
Del
OK
statistics.py
46.59 KB
Del
OK
string.py
11.51 KB
Del
OK
stringprep.py
12.61 KB
Del
OK
struct.py
257 B
Del
OK
subprocess.py
86.65 KB
Del
OK
sunau.py
18.05 KB
Del
OK
symtable.py
10.13 KB
Del
OK
sysconfig.py
29.6 KB
Del
OK
tabnanny.py
11.05 KB
Del
OK
tarfile.py
109.22 KB
Del
OK
telnetlib.py
22.75 KB
Del
OK
tempfile.py
31.13 KB
Del
OK
textwrap.py
19.26 KB
Del
OK
this.py
1003 B
Del
OK
threading.py
56.87 KB
Del
OK
timeit.py
13.22 KB
Del
OK
token.py
2.33 KB
Del
OK
tokenize.py
25.72 KB
Del
OK
tomllib
-
Del
OK
trace.py
28.52 KB
Del
OK
traceback.py
39.6 KB
Del
OK
tracemalloc.py
17.62 KB
Del
OK
tty.py
879 B
Del
OK
types.py
9.83 KB
Del
OK
typing.py
118.12 KB
Del
OK
unittest
-
Del
OK
urllib
-
Del
OK
uu.py
7.17 KB
Del
OK
uuid.py
26.95 KB
Del
OK
venv
-
Del
OK
warnings.py
20.62 KB
Del
OK
wave.py
21.31 KB
Del
OK
weakref.py
21.01 KB
Del
OK
webbrowser.py
24.57 KB
Del
OK
wsgiref
-
Del
OK
xdrlib.py
5.84 KB
Del
OK
xml
-
Del
OK
xmlrpc
-
Del
OK
zipapp.py
7.36 KB
Del
OK
zipfile.py
91.59 KB
Del
OK
zipimport.py
30.17 KB
Del
OK
zoneinfo
-
Del
OK
Edit: rlcompleter.py
"""Word completion for GNU readline. The completer completes keywords, built-ins and globals in a selectable namespace (which defaults to __main__); when completing NAME.NAME..., it evaluates (!) the expression up to the last dot and completes its attributes. It's very cool to do "import sys" type "sys.", hit the completion key (twice), and see the list of names defined by the sys module! Tip: to use the tab key as the completion key, call readline.parse_and_bind("tab: complete") Notes: - Exceptions raised by the completer function are *ignored* (and generally cause the completion to fail). This is a feature -- since readline sets the tty device in raw (or cbreak) mode, printing a traceback wouldn't work well without some complicated hoopla to save, reset and restore the tty state. - The evaluation of the NAME.NAME... form may cause arbitrary application defined code to be executed if an object with a __getattr__ hook is found. Since it is the responsibility of the application (or the user) to enable this feature, I consider this an acceptable risk. More complicated expressions (e.g. function calls or indexing operations) are *not* evaluated. - When the original stdin is not a tty device, GNU readline is never used, and this module (and the readline module) are silently inactive. """ import atexit import builtins import inspect import keyword import re import __main__ __all__ = ["Completer"] class Completer: def __init__(self, namespace = None): """Create a new completer for the command line. Completer([namespace]) -> completer instance. If unspecified, the default namespace where completions are performed is __main__ (technically, __main__.__dict__). Namespaces should be given as dictionaries. Completer instances should be used as the completion mechanism of readline via the set_completer() call: readline.set_completer(Completer(my_namespace).complete) """ if namespace and not isinstance(namespace, dict): raise TypeError('namespace must be a dictionary') # Don't bind to namespace quite yet, but flag whether the user wants a # specific namespace or to use __main__.__dict__. This will allow us # to bind to __main__.__dict__ at completion time, not now. if namespace is None: self.use_main_ns = 1 else: self.use_main_ns = 0 self.namespace = namespace def complete(self, text, state): """Return the next possible completion for 'text'. This is called successively with state == 0, 1, 2, ... until it returns None. The completion should begin with 'text'. """ if self.use_main_ns: self.namespace = __main__.__dict__ if not text.strip(): if state == 0: if _readline_available: readline.insert_text('\t') readline.redisplay() return '' else: return '\t' else: return None if state == 0: if "." in text: self.matches = self.attr_matches(text) else: self.matches = self.global_matches(text) try: return self.matches[state] except IndexError: return None def _callable_postfix(self, val, word): if callable(val): word += "(" try: if not inspect.signature(val).parameters: word += ")" except ValueError: pass return word def global_matches(self, text): """Compute matches when text is a simple name. Return a list of all keywords, built-in functions and names currently defined in self.namespace that match. """ matches = [] seen = {"__builtins__"} n = len(text) for word in keyword.kwlist + keyword.softkwlist: if word[:n] == text: seen.add(word) if word in {'finally', 'try'}: word = word + ':' elif word not in {'False', 'None', 'True', 'break', 'continue', 'pass', 'else', '_'}: word = word + ' ' matches.append(word) for nspace in [self.namespace, builtins.__dict__]: for word, val in nspace.items(): if word[:n] == text and word not in seen: seen.add(word) matches.append(self._callable_postfix(val, word)) return matches def attr_matches(self, text): """Compute matches when text contains a dot. Assuming the text is of the form NAME.NAME....[NAME], and is evaluable in self.namespace, it will be evaluated and its attributes (as revealed by dir()) are used as possible completions. (For class instances, class members are also considered.) WARNING: this can still invoke arbitrary C code, if an object with a __getattr__ hook is evaluated. """ m = re.match(r"(\w+(\.\w+)*)\.(\w*)", text) if not m: return [] expr, attr = m.group(1, 3) try: thisobject = eval(expr, self.namespace) except Exception: return [] # get the content of the object, except __builtins__ words = set(dir(thisobject)) words.discard("__builtins__") if hasattr(thisobject, '__class__'): words.add('__class__') words.update(get_class_members(thisobject.__class__)) matches = [] n = len(attr) if attr == '': noprefix = '_' elif attr == '_': noprefix = '__' else: noprefix = None while True: for word in words: if (word[:n] == attr and not (noprefix and word[:n+1] == noprefix)): match = "%s.%s" % (expr, word) if isinstance(getattr(type(thisobject), word, None), property): # bpo-44752: thisobject.word is a method decorated by # `@property`. What follows applies a postfix if # thisobject.word is callable, but know we know that # this is not callable (because it is a property). # Also, getattr(thisobject, word) will evaluate the # property method, which is not desirable. matches.append(match) continue if (value := getattr(thisobject, word, None)) is not None: matches.append(self._callable_postfix(value, match)) else: matches.append(match) if matches or not noprefix: break if noprefix == '_': noprefix = '__' else: noprefix = None matches.sort() return matches def get_class_members(klass): ret = dir(klass) if hasattr(klass,'__bases__'): for base in klass.__bases__: ret = ret + get_class_members(base) return ret try: import readline except ImportError: _readline_available = False else: readline.set_completer(Completer().complete) # Release references early at shutdown (the readline module's # contents are quasi-immortal, and the completer function holds a # reference to globals). atexit.register(lambda: readline.set_completer(None)) _readline_available = True
Save