path
stringlengths
14
112
content
stringlengths
0
6.32M
size
int64
0
6.32M
max_lines
int64
1
100k
repo_name
stringclasses
2 values
autogenerated
bool
1 class
cosmopolitan/third_party/python/Lib/xdrlib.py
"""Implements (a subset of) Sun XDR -- eXternal Data Representation. See: RFC 1014 """ import struct from io import BytesIO from functools import wraps __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] # exceptions class Error(Exception): """Exception class for this module. Use: except xdrlib.E...
5,913
242
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/dummy_threading.py
"""Faux ``threading`` version using ``dummy_thread`` instead of ``thread``. The module ``_dummy_threading`` is added to ``sys.modules`` in order to not have ``threading`` considered imported. Had ``threading`` been directly imported it would have made all subsequent imports succeed regardless of whether ``_thread`` w...
3,285
105
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/this.py
s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyrk. Pbzcyrk vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcnefr vf orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Nygubhtu cenpg...
1,003
29
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/pipes.py
"""Conversion pipeline templates. The problem: ------------ Suppose you have some data that you want to convert to another format, such as from GIF image format to PPM image format. Maybe the conversion involves several steps (e.g. piping it through compress or uuencode). Some of the conversion steps may require th...
8,916
248
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/mime.types
# This is a comment. I love comments. -*- indent-tabs-mode: t -*- # This file controls what Internet media types are sent to the client for # given file extension(s). Sending the correct media type to the client # is important so they know how to handle the content of the file. # Extra types can either be added ...
48,509
1,446
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/tempfile.py
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. All of the interfaces provided by this module can be used without fear of race conditions except for 'mktemp'. 'mktemp' is subject to race conditions and should not be used; it is provided f...
26,926
815
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/locale.py
"""Locale support module. The module provides low-level access to the C lib's locale APIs and adds high level number formatting APIs as well as a locale aliasing engine to complement these. The aliasing engine includes support for many commonly used locale names and maps them to values suitable for passing to the C l...
77,300
1,732
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/inspect.py
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...
117,016
3,135
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/csv.py
""" csv.py - read/write/investigate CSV files """ import re from _csv import Error, __version__, writer, reader, register_dialect, \ unregister_dialect, get_dialect, list_dialects, \ field_size_limit, \ QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \ ...
16,180
450
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_pydecimal.py
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module should be kept in sync with ...
230,228
6,450
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_compat_pickle.py
# This module is used to map the old Python 2 names to the new names used in # Python 3 for the pickle module. This needed to make pickle streams # generated with Python 2 loadable by Python 3. # This is a copy of lib2to3.fixes.fix_imports.MAPPING. We cannot import # lib2to3 and use the mapping defined there, becaus...
8,749
252
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/bdb.py
"""Debugger basics""" import fnmatch import sys import os from inspect import CO_GENERATOR, CO_COROUTINE, CO_ASYNC_GENERATOR __all__ = ["BdbQuit", "Bdb", "Breakpoint"] GENERATOR_AND_COROUTINE_FLAGS = CO_GENERATOR | CO_COROUTINE | CO_ASYNC_GENERATOR class BdbQuit(Exception): """Exception to give up completely."...
23,556
677
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/shelve.py
"""Manage shelves of pickled objects. A "shelf" is a persistent, dictionary-like object. The difference with dbm databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects -- anything that the "pickle" module can handle. This includes most class instances, recursive data type...
8,517
244
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/pdb.py
#! /usr/bin/env python3 """ The Python Debugger Pdb ======================= To use the debugger in its simplest form: >>> import pdb >>> pdb.run('<a statement>') The debugger's prompt is '(Pdb) '. This will stop in the first function call in <a statement>. Alternatively, if a statement terminated ...
61,312
1,695
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/getopt.py
"""Parser for command line options. This module helps scripts to parse the command line arguments in sys.argv. It supports the same conventions as the Unix getopt() function (including the special meanings of arguments of the form `-' and `--'). Long options similar to those supported by GNU software may be used as ...
7,489
216
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/pathlib.py
import cosmo import fnmatch import functools import io import os import ntpath import posixpath import re import sys from collections.abc import Sequence from contextlib import contextmanager from errno import EINVAL, ENOENT, ENOTDIR from operator import attrgetter from _stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK,...
48,835
1,454
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/keyword.py
#! /usr/bin/env python3 """Keywords (from "graminit.c") This file is automatically generated; please don't muck it up! To update the symbols in this file, 'cd' to the top directory of the python source tree after building the interpreter and run: ./python Lib/keyword.py """ __all__ = ["iskeyword", "kwlist"] k...
2,211
95
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/codeop.py
r"""Utilities to compile possibly incomplete Python source code. This module provides two interfaces, broadly similar to the builtin function compile(), which take program text, a filename and a 'mode' and: - Return code object if the command is complete and valid - Return None if the command is incomplete - Raise Sy...
5,994
169
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/pyclbr.py
"""Parse a Python module and describe its classes and methods. Parse enough of a Python file to recognize imports and class and method definitions, and to find out the superclasses of a class. The interface consists of a single function: readmodule_ex(module [, path]) where module is the name of a Python modu...
13,558
353
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/pkgutil.py
"""Utilities to support packages.""" from collections import namedtuple from functools import singledispatch as simplegeneric import importlib import importlib.util import importlib.machinery import os import os.path import sys from types import ModuleType import warnings __all__ = [ 'get_importer', 'iter_importe...
21,315
635
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/reprlib.py
"""Redo the builtin repr() (representation) but with limits on most sizes.""" __all__ = ["Repr", "repr", "recursive_repr"] import builtins from itertools import islice try: from _thread import get_ident except ImportError: from _dummy_thread import get_ident def recursive_repr(fillvalue='...'): 'Decorato...
5,336
165
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/ipaddress.py
# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """A fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. """ __version__ = '1.0' import functools IPV4LENGTH = 32 IPV6LENGTH = 128 class Add...
74,565
2,267
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/os.py
r"""OS routines for NT or Posix depending on what system we're on. This exports: - all functions from posix or nt, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix' or 'nt' - os.curdir is a string representing the current directory (always '.') - os.pardir is a strin...
41,038
1,271
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/fnmatch.py
"""Filename matching with shell patterns. fnmatch(FILENAME, PATTERN) matches according to the local convention. fnmatchcase(FILENAME, PATTERN) always takes case in account. The functions operate by translating the pattern into a regular expression. They cache the compiled regular expressions for speed. The function...
3,166
110
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/timeit.py
#! /usr/bin/env python3 """Tool for measuring execution time of small code snippets. This module avoids a number of common traps for measuring execution times. See also Tim Peters' introduction to the Algorithms chapter in the Python Cookbook, published by O'Reilly. Library usage: see the Timer class. Command line...
13,334
363
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/smtplib.py
#! /usr/bin/env python3 '''SMTP/ESMTP client class. This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP Authentication) and RFC 2487 (Secure SMTP over TLS). Notes: Please remember, when doing ESMTP, that the names of the SMTP service extensions are NOT the same thing as the option keywords for the R...
44,211
1,117
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/mimetypes.py
"""Guess the MIME type of a file. This module defines two useful functions: guess_type(url, strict=True) -- guess the MIME type and encoding of a URL. guess_extension(type, strict=True) -- guess the extension for a given MIME type. It also contains the following, for tuning the behavior: Data: knownfiles -- list ...
21,073
601
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/configparser.py
"""Configuration file parser. A configuration file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ConfigParse...
53,592
1,343
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/tabnanny.py
#! /usr/bin/env python3 """The Tab Nanny despises ambiguous indentation. She knows no mercy. tabnanny -- Detection of ambiguous indentation For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function check() described below. Warning: The...
11,403
333
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/ssl.py
# Wrapper module for _ssl, providing some additional facilities # implemented in Python. Written by Bill Janssen. """This module provides some more Pythonic support for SSL. Object types: SSLSocket -- subtype of socket.socket which does SSL over the socket Exceptions: SSLError -- exception raised for I/O erro...
44,793
1,238
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/tracemalloc.py
from collections.abc import Sequence, Iterable from functools import total_ordering import fnmatch import linecache import os.path import pickle # Import types and functions implemented in C from _tracemalloc import * from _tracemalloc import _get_object_traceback, _get_traces def _format_size(size, sign): for u...
16,662
525
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/cProfile.py
#! /usr/bin/env python3 """Python interface for the 'lsprof' profiler. Compatible with the 'profile' module. """ __all__ = ["run", "runctx", "Profile"] import _lsprof import profile as _pyprofile # ____________________________________________________________ # Simple interface def run(statement, filename=None, ...
5,372
162
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/token.py
"""Token constants (from "token.h").""" __all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF'] # This file is automatically generated; please don't muck it up! # # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # # ./pyth...
3,075
144
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/opcode.py
""" opcode module - potentially shared between dis and other modules which operate on bytecodes (e.g. peephole optimizers). """ __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", "haslocal", "hascompare", "hasfree", "opname", "opmap", "HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs", '...
5,823
215
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/pprint.py
# Author: Fred L. Drake, Jr. # fdrake@acm.org # # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly non-desc...
20,860
598
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/netrc.py
"""An object-oriented interface to .netrc files.""" # Module and documentation by Eric S. Raymond, 21 Dec 1998 import os, shlex, stat __all__ = ["netrc", "NetrcParseError"] class NetrcParseError(Exception): """Exception raised on syntax errors in the .netrc file.""" def __init__(self, msg, filename=None, l...
5,684
143
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/signal.py
import _signal from _signal import * from functools import wraps as _wraps from enum import IntEnum as _IntEnum _globals = globals() _IntEnum._convert( 'Signals', __name__, lambda name: name.isupper() and (name.startswith('SIG') and not name.startswith('SIG_')) or n...
2,887
127
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/quopri.py
#! /usr/bin/env python3 """Conversions to/from quoted-printable transport encoding as per RFC 1521.""" # (Dec 1991 version). __all__ = ["encode", "decode", "encodestring", "decodestring"] ESCAPE = b'=' MAXLINESIZE = 76 HEX = b'0123456789ABCDEF' EMPTYSTRING = b'' from encodings import quopri_codec, aliases try: ...
7,299
245
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/sndhdr.py
"""Routines to help recognizing sound files. Function whathdr() recognizes various types of sound file headers. It understands almost all headers that SOX can decode. The return tuple contains the following items, in this order: - file type (as SOX understands it) - sampling rate (0 if unknown or hard to decode) - nu...
7,088
258
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/textwrap.py
"""Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gward@python.net> import re __all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten'] # Hardcode the recognized whitespace characters to the US-A...
19,558
489
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/__phello__.foo.py
# This file exists as a helper for the test.test_frozen module.
64
2
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/optparse.py
"""A powerful, extensible, and easy-to-use option parser. By Greg Ward <gward@python.net> Originally distributed as Optik. For support, use the optik-users@lists.sourceforge.net mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). Simple usage example: from optparse import OptionParser pa...
60,371
1,682
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/cmd.py
"""A generic class to build line-oriented command interpreters. Interpreters constructed with this class obey the following conventions: 1. End of file on input is processed as the command 'EOF'. 2. A command is parsed out of each line by collecting the prefix composed of characters in the identchars member. 3. A ...
14,941
405
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/copyreg.py
"""Helper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] dispatch_table = {} def pickle(ob_typ...
7,007
207
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/weakref.py
"""Weak reference support for Python. This module is an implementation of PEP 205: http://www.python.org/dev/peps/pep-0205/ """ # Naming convention: Variables named "wr" are weak reference objects; # they are called this instead of "ref" to avoid name collisions with # the module-global ref() function imported from ...
20,466
633
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/stringprep.py
# This file is generated by mkstringprep.py. DO NOT EDIT. """Library that exposes various tables found in the StringPrep RFC 3454. There are two kinds of tables: sets, for which a member test is provided, and mappings, for which a mapping function is provided. """ from unicodedata import ucd_3_2_0 as unicodedata ass...
12,917
273
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/profile.py
#! /usr/bin/env python3 # # Class for profiling python code. rev 1.0 6/2/94 # # Written by James Roskind # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum """Class for profiling Python code.""" # Copyright Disney Enterprises, Inc. All Rights Reserved. # Licens...
22,021
590
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/sunau.py
"""Stuff to parse Sun and NeXT audio files. An audio file consists of a header followed by the data. The structure of the header is as follows. +---------------+ | magic word | +---------------+ | header size | +---------------+ | data size | +--------...
18,095
526
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_osx_support.py
"""Shared OS X support functions.""" import os import re import sys __all__ = [ 'compiler_fixup', 'customize_config_vars', 'customize_compiler', 'get_platform_osx', ] # configuration variables that may contain universal build flags, # like "-arch" or "-isdkroot", that may need customization for # the...
19,132
503
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/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 "...
8,870
267
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/imaplib.py
"""IMAP4 client. Based on RFC 2060. Public class: IMAP4 Public variable: Debug Public functions: Internaldate2tuple Int2AP ParseFlags Time2Internaldate """ # Author: Piers Lauder <piers@cs.su.oz.au> December 1997. # # Auth...
53,295
1,615
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/gzip.py
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time, os import zlib import builtins import io import _compression __al...
20,334
575
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/sre_parse.py
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
36,536
974
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/threading.py
"""Thread module emulating a subset of Java's threading model.""" import sys as _sys from time import monotonic as _time from traceback import format_exc as _format_exc from _weakrefset import WeakSet from itertools import islice as _islice, count as _count try: import _thread except ImportError: import _dumm...
49,518
1,417
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/abc.py
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) according to PEP 3119.""" from _weakrefset import WeakSet def abstractmethod(funcobj): """A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or de...
8,727
251
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_strptime.py
"""Strptime-related classes and functions. CLASSES: LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing time information FUNCTIONS: _getlang -- Figure out what language is being used for the locale ...
25,366
590
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/trace.py
#!/usr/bin/env python3 # portions copyright 2001, Autonomous Zones Industries, Inc., all rights... # err... reserved and offered to the public under the terms of the # Python 2.2 license. # Author: Zooko O'Whielacronx # http://zooko.com/ # mailto:zooko@zooko.com # # Copyright 2000, Mojam Media, Inc., all rights reser...
28,724
736
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/sched.py
"""A generally useful event scheduler class. Each instance of this class manages its own queue. No multi-threading is implied; you are supposed to hack that yourself, or use a single instance per application. Each instance is parametrized with two functions, one that is supposed to return the current time, one that i...
6,511
171
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/copy.py
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
8,815
314
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/pickle.py
"""Create portable serialized representations of Python objects. See module copyreg for a mechanism for registering custom picklers. See module pickletools source for extensive comments. Classes: Pickler Unpickler Functions: dump(object, file) dumps(object) -> string load(file) -> object lo...
55,861
1,615
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/uu.py
#! /usr/bin/env python3 # Copyright 1994 by Lance Ellinghouse # Cathedral City, California Republic, United States of America. # All Rights Reserved # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provid...
6,898
207
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/poplib.py
"""A POP3 client class. Based on the J. Myers POP3 draft, Jan. 96 """ # Author: David Ascher <david_ascher@brown.edu> # [heavily stealing from nntplib.py] # Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97] # String method conversion and test jig improvements by ESR, February 2001. # Added the POP3_SSL clas...
14,964
479
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/asynchat.py
# -*- Mode: Python; tab-width: 4 -*- # Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp # Author: Sam Rushing <rushing@nightmare.com> # ====================================================================== # Copyright 1996 by Sam Rushing # # All Rights Reserved # # Permission...
11,328
308
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/cgi.py
#! /usr/local/bin/python # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin/env w...
37,068
1,100
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/uuid.py
r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122. If all you want is a unique ID, you should probably call uuid1() ...
23,973
637
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/fractions.py
# Originally contributed by Sjoerd Mullender. # Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>. """Fraction, infinite-precision, real numbers.""" from decimal import Decimal import math import numbers import operator import re import sys __all__ = ['Fraction', 'gcd'] def gcd(a, b): """Calcu...
23,639
644
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/nturl2path.py
"""Convert a NT pathname to a file URL and vice versa.""" def url2pathname(url): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.""" # e.g. # ///C|/foo/bar/spam.foo # and # ///C:/foo/bar/spam.foo # become # ...
2,444
69
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/tty.py
"""Terminal utilities.""" # Author: Steen Lumholt. from termios import * __all__ = ["setraw", "setcbreak"] # Indexes for termios list. IFLAG = 0 OFLAG = 1 CFLAG = 2 LFLAG = 3 ISPEED = 4 OSPEED = 5 CC = 6 def setraw(fd, when=TCSAFLUSH): """Put terminal into a raw mode.""" mode = tcgetattr(fd) mode[IFLAG...
879
37
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/statistics.py
""" Basic statistics module. This module provides functions for calculating statistics of data, including averages, variance, and standard deviation. Calculating averages -------------------- ================== ============================================= Function Description ================== =======...
20,673
671
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/argparse.py
# Author: Steven J. Bethard <steven.bethard@gmail.com>. """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The...
90,372
2,394
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/pickletools.py
'''"Executable documentation" for the pickle module. Extensive comments about the pickle protocols and pickle-machine opcodes can be found here. Some functions meant for external use: genops(pickle) Generate all the opcodes in a pickle, as (opcode, arg, position) triples. dis(pickle, out=None, memo=None, indentl...
91,847
2,841
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/launchpy.py
import sys from importlib import _bootstrap_external def run_module_as_main(mod_name): path = "/zip/.python/%s.pyc" % (mod_name.replace(".", "/")) loader = _bootstrap_external.SourcelessFileLoader(mod_name, path) code = loader.get_code(mod_name) globs = sys.modules["__main__"].__dict__ globs["__nam...
506
16
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_markupbase.py
"""Shared support for scanning document type declarations in HTML and XHTML. This module is used as a foundation for the html.parser module. It has no documented public API and should not be used directly. """ import re _declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match _declstringlit_match = re.com...
14,598
396
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/bz2.py
"""Interface to the libbzip2 compression library. This module provides a file interface, classes for incremental (de)compression, and functions for one-shot (de)compression. """ __all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor", "open", "compress", "decompress"] __author__ = "Nadeem Vawda <nadeem.v...
12,478
362
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/posixpath.py
"""Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Mac, Windows), os.path provides the same operations in a manner specific to that platform, and is a...
16,036
539
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/functools.py
"""functools.py - Tools for working with functions and callable objects """ # Python module wrapper for _functools C module # to allow utilities written in Python to be added # to the functools module. # Written by Nick Coghlan <ncoghlan at gmail.com>, # Raymond Hettinger <python at rcn.com>, # and Łukasz Langa <lukas...
31,398
821
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/socket.py
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
31,697
964
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/__future__.py
"""Record of phased-in incompatible language changes. Each line is of the form: FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease "," CompilerFlag ")" where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples of the same form as sys.version_info: (...
4,841
141
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/datetime.py
"""Concrete date/time and related types. See http://www.iana.org/time-zones/repository/tz-link.html for time zone and DST data sources. """ import time as _time import math as _math import sys def _cmp(x, y): return 0 if x == y else 1 if x > y else -1 MINYEAR = 1 MAXYEAR = 9999 _MAXORDINAL = 3652059 # date.max...
82,084
2,326
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/filecmp.py
"""Utilities for comparing files and directories. Classes: dircmp Functions: cmp(f1, f2, shallow=True) -> int cmpfiles(a, b, common) -> ([], [], []) clear_cache() """ import os import stat from itertools import filterfalse __all__ = ['clear_cache', 'cmp', 'dircmp', 'cmpfiles', 'DEFAULT_IGNORES'] _...
9,830
306
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_bootlocale.py
def getpreferredencoding(do_setlocale=True): return 'UTF-8'
64
3
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/compileall.py
"""Module/script to byte-compile all .py files to .pyc files. When called as a script with arguments, this compiles the directories given as arguments recursively; the -l option prevents it from recursing into directories. Without arguments, if compiles all modules on sys.path, without recursing into subdirectories. ...
12,125
300
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_sysconfigdata_m_cosmo_x86_64_cosmo.py
# system configuration generated and used by the sysconfig module build_time_vars = {'ABIFLAGS': 'm', 'AC_APPLE_UNIVERSAL_BUILD': 0, 'AIX_GENUINE_CPLUSPLUS': 0, 'ANDROID_API_LEVEL': 0, 'AR': 'ar', 'ARFLAGS': 'rcs', 'BASECFLAGS': '-Wno-unused-result -Wsign-compare', 'BASECPPFLAGS': '', 'BASEMODLIBS': '', 'BINDI...
26,578
810
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_threading_local.py
"""Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local objects support the management of thread-local d...
7,417
257
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/heapq.py
"""Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always its smallest element. Usag...
22,909
603
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/hashlib.py
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # __doc__ = """hashlib module - A common interface to many hash functions. new(name, data=b'', **kwargs) - returns a new hash object implementing the given hash function; i...
7,316
194
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/pydoc.py
#!/usr/bin/env python3 """Generate Python documentation in HTML or text for interactive use. At the Python interactive prompt, calling help(thing) on a Python object documents the object, and calling help() starts up an interactive help session. Or, at the shell command line outside of Python: Run "pydoc <name>" to ...
104,549
2,686
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/cgitb.py
"""More comprehensive traceback formatting for Python scripts. To enable this module, do: import cgitb; cgitb.enable() at the top of your script. The optional arguments to enable() are: display - if true, tracebacks are displayed in the web browser logdir - if set, tracebacks are written to fi...
12,018
320
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/bisect.py
"""Bisection algorithms.""" def insort_right(a, x, lo=0, hi=None): """Insert item x in list a, and keep it sorted assuming a is sorted. If x is already in a, insert it to the right of the rightmost x. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. """ ...
2,643
96
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_pyio.py
""" Python implementation of the io module. """ import os import abc import codecs import errno import stat import sys # Import _thread instead of threading to reduce startup cost try: from _thread import allocate_lock as Lock except ImportError: from _dummy_thread import allocate_lock as Lock if sys.platform ...
88,097
2,533
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/codecs.py
""" codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import builtins, sys ### Registry and builtin stateless codec functions from _codecs import _forget_codec, ascii_decode, ascii_encode, charmap_build, ...
36,849
1,111
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/warnings.py
"""Python part of the warnings subsystem.""" import sys __all__ = ["warn", "warn_explicit", "showwarning", "formatwarning", "filterwarnings", "simplefilter", "resetwarnings", "catch_warnings"] def showwarning(message, category, filename, lineno, file=None, line=None): """Hook to write a wa...
18,535
527
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/difflib.py
""" Module difflib -- helpers for computing deltas between objects. Function get_close_matches(word, possibilities, n=3, cutoff=0.6): Use SequenceMatcher to return list of the best "good enough" matches. Function context_diff(a, b): For two lists of strings, return a delta in context diff format. Function nd...
84,450
2,103
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/symtable.py
"""Interface to the compiler's internal symbol tables""" import _symtable from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE, LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL) import weakref __all__ = ["symtable", "SymbolTable", "Class",...
7,277
239
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/hmac.py
"""HMAC (Keyed-Hashing for Message Authentication) Python module. Implements the HMAC algorithm as described by RFC 2104. """ import warnings as _warnings from _operator import _compare_digest as compare_digest import hashlib as _hashlib trans_5C = bytes((x ^ 0x5C) for x in range(256)) trans_36 = bytes((x ^ 0x36) fo...
5,057
145
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/_collections_abc.py
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. Unit tests are in test_collections. """ from abc import ABCMeta, abstractmethod import sys __all__ = ["Awaitable", "Coroutine", "Asyn...
26,392
1,012
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/macpath.py
"""Pathname and path-related operations for the Macintosh.""" # strings representing various path-related bits and pieces # These are primarily for export; internally, they are hardcoded. # Should be set before imports for resolving cyclic dependency. curdir = ':' pardir = '::' extsep = '.' sep = ':' pathsep = '\n' de...
5,971
213
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/turtle.py
# # turtle.py: a Tkinter based turtle graphics module for Python # Version 1.1b - 4. 5. 2009 # # Copyright (C) 2006 - 2010 Gregor Lingl # email: glingl@aon.at # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from th...
143,620
4,140
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/imp.py
"""This module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. """ # (Probably) need to stay in _imp from _imp import (lock_held, acquire_lock, release_lo...
10,669
347
jart/cosmopolitan
false
cosmopolitan/third_party/python/Lib/telnetlib.py
r"""TELNET client class. Based on RFC 854: TELNET Protocol Specification, by J. Postel and J. Reynolds Example: >>> from telnetlib import Telnet >>> tn = Telnet('www.python.org', 79) # connect to finger port >>> tn.write(b'guido\r\n') >>> print(tn.read_all()) Login Name TTY Idle When...
23,136
676
jart/cosmopolitan
false