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/test/decimaltestdata/ddCompare.decTest | ------------------------------------------------------------------------
-- ddCompare.decTest -- decDouble comparison that allows quiet NaNs --
-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
------------------------------------------------------------------------
-- Please see the document "... | 29,538 | 745 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/decimaltestdata/ddAnd.decTest | ------------------------------------------------------------------------
-- ddAnd.decTest -- digitwise logical AND for decDoubles --
-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
------------------------------------------------------------------------
-- Please see the document "... | 18,272 | 348 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/decimaltestdata/dqCopy.decTest | ------------------------------------------------------------------------
-- dqCopy.decTest -- quiet decQuad copy --
-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
------------------------------------------------------------------------
-- Please see the document "... | 3,899 | 89 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/decimaltestdata/ddAdd.decTest | ------------------------------------------------------------------------
-- ddAdd.decTest -- decDouble addition --
-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
------------------------------------------------------------------------
-- Please see the document "... | 76,767 | 1,329 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/decimaltestdata/dqShift.decTest | ------------------------------------------------------------------------
-- dqShift.decTest -- shift decQuad coefficient left or right --
-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
------------------------------------------------------------------------
-- Please see the document "... | 19,138 | 299 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/decimaltestdata/ddRemainder.decTest | ------------------------------------------------------------------------
-- ddRemainder.decTest -- decDouble remainder --
-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
------------------------------------------------------------------------
-- Please see the document "... | 26,387 | 601 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/libregrtest/save_env.py | import builtins
import locale
import logging
import os
import shutil
import sys
import sysconfig
import warnings
from test import support
try:
import _thread
import threading
except ImportError:
threading = None
try:
import _multiprocessing, multiprocessing.process
except ImportError:
multiprocessin... | 11,186 | 292 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/libregrtest/setup.py | import atexit
import faulthandler
import os
import signal
import sys
import unittest
from test import support
try:
import gc
except ImportError:
gc = None
from test.libregrtest.refleak import warm_caches
def setup_tests(ns):
try:
stderr_fd = sys.__stderr__.fileno()
except (ValueError, Attribu... | 4,387 | 125 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/libregrtest/main.py | import datetime
import faulthandler
import locale
import os
import platform
import random
import re
import sys
import sysconfig
import tempfile
import time
import unittest
from test.libregrtest.cmdline import _parse_args
from test.libregrtest.runtest import (
findtests, runtest, get_abs_module,
STDTESTS, NOTTES... | 22,142 | 640 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/libregrtest/cmdline.py | import argparse
import os
import sys
from test import support
USAGE = """\
python -m test [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
"""
DESCRIPTION = """\
Run Python regression tests.
If no arguments or options are provided, finds all files m... | 17,832 | 392 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/libregrtest/refleak.py | import errno
import os
import re
import sys
import warnings
from inspect import isabstract
from test import support
def dash_R(the_module, test, indirect_test, huntrleaks):
"""Run a test multiple times, looking for reference leaks.
Returns:
False if the test didn't leak references; True if we detecte... | 7,637 | 258 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/libregrtest/runtest.py | import faulthandler
import importlib
import io
import os
import sys
import time
import traceback
import unittest
from test import support
from test.libregrtest.refleak import dash_R, clear_caches
from test.libregrtest.save_env import saved_test_environment
# Test result constants.
PASSED = 1
FAILED = 0
ENV_CHANGED = ... | 8,904 | 264 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/libregrtest/runtest_mp.py | import faulthandler
import json
import os
import queue
import sys
import time
import traceback
import types
from test import support
try:
import _thread
import threading
except ImportError:
print("Multiprocess option requires thread support")
sys.exit(2)
from test.libregrtest.runtest import (
runte... | 7,802 | 249 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/libregrtest/__init__.py | # We import importlib *ASAP* in order to test #15386
import importlib
from test.libregrtest.cmdline import _parse_args, RESOURCE_NAMES, ALL_RESOURCES
from test.libregrtest.main import main
| 190 | 6 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/libregrtest/utils.py | import os.path
import math
import textwrap
def format_duration(seconds):
ms = math.ceil(seconds * 1e3)
seconds, ms = divmod(ms, 1000)
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
parts = []
if hours:
parts.append('%s hour' % hours)
if minutes:
... | 1,400 | 57 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/tracedmodules/testmod.py | def func(x):
b = x + 1
return b + 2
def func2():
"""Test function for issue 9936 """
return (1,
2,
3)
| 143 | 10 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/tracedmodules/__init__.py | """This package contains modules that help testing the trace.py module. Note
that the exact location of functions in these modules is important, as trace.py
takes the real line numbers into account.
"""
| 203 | 5 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/test_util.py | from . import util
abc = util.import_importlib('importlib.abc')
init = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')
importlib_util = util.import_importlib('importlib.util')
import importlib.util
import os
import pathlib
import string
import sys
from test import support
im... | 31,373 | 806 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/test_abc.py | import contextlib
import inspect
import io
import marshal
import os
import sys
from test import support
import types
import unittest
from unittest import mock
import warnings
from . import util as test_util
init = test_util.import_importlib('importlib')
abc = test_util.import_importlib('importlib.abc')
machinery = te... | 32,239 | 954 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/__main__.py | from . import load_tests
import unittest
unittest.main()
| 58 | 5 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/test_locks.py | from . import util as test_util
init = test_util.import_importlib('importlib')
import sys
import unittest
import weakref
from test import support
try:
import _thread
import threading
except ImportError:
threading = None
else:
from test import lock_tests
if threading is not None:
class ModuleLoc... | 5,492 | 177 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/abc.py | import abc
import unittest
class FinderTests(metaclass=abc.ABCMeta):
"""Basic tests for a finder to pass."""
@abc.abstractmethod
def test_module(self):
# Test importing a top-level module.
pass
@abc.abstractmethod
def test_package(self):
# Test importing a package.
... | 2,288 | 95 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/test_spec.py | from . import util as test_util
init = test_util.import_importlib('importlib')
machinery = test_util.import_importlib('importlib.machinery')
util = test_util.import_importlib('importlib.util')
import os.path
import pathlib
from test.support import CleanImport
import unittest
import sys
import warnings
class TestLo... | 30,498 | 820 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/util.py | import builtins
import contextlib
import errno
import functools
import importlib
from importlib import machinery, util, invalidate_caches
import os
import os.path
from test import support
import unittest
import sys
import tempfile
import types
BUILTINS = types.SimpleNamespace()
BUILTINS.good_name = None
BUILTINS.bad_... | 12,511 | 389 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/test_api.py | from . import util as test_util
init = test_util.import_importlib('importlib')
util = test_util.import_importlib('importlib.util')
machinery = test_util.import_importlib('importlib.machinery')
import os.path
import sys
from test import support
import types
import unittest
import warnings
class ImportModuleTests:
... | 18,230 | 450 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/test_lazy.py | import importlib
from importlib import abc
from importlib import util
import sys
import types
import unittest
from . import util as test_util
class CollectInit:
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
def exec_module(self, module):
return self
cl... | 4,930 | 146 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/test_namespace_pkgs.py | import contextlib
import importlib
import os
import sys
import unittest
from test.test_importlib import util
# needed tests:
#
# need to test when nested, so that the top-level path isn't sys.path
# need to test dynamic path detection, both at top-level and nested
# with dynamic path, check when a loader is returned ... | 10,182 | 322 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/__init__.py | import os
from test.support import load_package_tests
def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)
| 142 | 6 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/test_windows.py | from . import util as test_util
machinery = test_util.import_importlib('importlib.machinery')
import os
import re
import sys
import unittest
from test import support
from distutils.util import get_platform
from contextlib import contextmanager
from .util import temp_module
support.import_module('winreg', required_on=... | 3,927 | 110 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/extension/test_loader.py | from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import os.path
import sys
import types
import unittest
import importlib.util
import importlib
from test.support.script_helper import assert_python_failure
class LoaderTests(abc.LoaderTests):
"""Test load_module() for... | 11,906 | 301 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/extension/__main__.py | from . import load_tests
import unittest
unittest.main()
| 58 | 5 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/extension/test_path_hook.py | from .. import util
machinery = util.import_importlib('importlib.machinery')
import unittest
class PathHookTests:
"""Test the path hook for extension modules."""
# XXX Should it only succeed for pre-existing directories?
# XXX Should it only work for directories containing an extension module?
def... | 864 | 32 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/extension/test_case_sensitivity.py | from importlib import _bootstrap_external
from test import support
import unittest
from .. import util
importlib = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')
@unittest.skipIf(util.EXTENSIONS.filename is None, '_testcapi not available')
@util.case_insensitive_tests
cl... | 1,573 | 47 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/extension/__init__.py | import os
from test.support import load_package_tests
def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)
| 142 | 6 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/extension/test_finder.py | from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import unittest
import warnings
class FinderTests(abc.FinderTests):
"""Test the finder for extension modules."""
def find_module(self, fullname):
importer = self.machinery.FileFinder(util.EXTENSIONS.pat... | 1,272 | 45 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/frozen/test_loader.py | from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
from test.support import captured_stdout
import types
import unittest
import warnings
class ExecModuleTests(abc.LoaderTests):
def exec_module(self, name):
with util.uncache(name), captured_stdout() as stdout... | 9,339 | 226 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/frozen/__main__.py | from . import load_tests
import unittest
unittest.main()
| 58 | 5 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/frozen/__init__.py | import os
from test.support import load_package_tests
def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)
| 142 | 6 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/frozen/test_finder.py | from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import unittest
class FindSpecTests(abc.FinderTests):
"""Test finding frozen modules."""
def find(self, name, path=None):
finder = self.machinery.FrozenImporter
return finder.find_spec(name, pat... | 2,105 | 85 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/nested_portion1.zip | PK
h£@ nested_portion1/UT ã£O%£Oux è è PK
'%¤@ nested_portion1/foo/UT *£O>£Oux è è PK
'%¤@ö( nested_portion1/foo/one.pyUT *£O'£Oux è è attr = 'portion1 foo one'
PK
h£@ ýA nested_porti... | 556 | 8 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/top_level_portion1.zip | PK
&¤@ foo/UT Ì£Oá£Oux è è PK
&¤@ö(
foo/one.pyUT Ì£OÈ£Oux è è attr = 'portion1 foo one'
PK
&¤@ ýA foo/UT Ì£Oux è è PK
&¤@ö(
´> foo/one.pyUT Ì£Oux è è PK ... | 332 | 8 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/missing_directory.zip | PK
º%¤@ bar/UT ?£Ob£Oux è è PK
º%¤@DÞu¾# #
bar/two.pyUT ?£O<£Oux è è attr = 'missing_directory foo two'
PK
¼%¤@ö(
foo/one.pyUT D£OB£Oux è è attr = 'portion1 foo one'
PK
º%¤@ ýA bar/UT ?£Oux... | 515 | 13 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/project3/parent/child/three.py | attr = 'parent child three'
| 28 | 2 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/one.py | attr = 'portion1 foo one'
| 26 | 2 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/__init__.py | 0 | 1 | jart/cosmopolitan | false | |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/portion2/foo/two.py | attr = 'portion2 foo two'
| 26 | 2 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/portion1/foo/one.py | attr = 'portion1 foo one'
| 26 | 2 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/project2/parent/child/two.py | attr = 'parent child two'
| 26 | 2 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test.py | attr = 'in module'
| 19 | 2 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test/empty | 0 | 1 | jart/cosmopolitan | false | |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/project1/parent/child/one.py | attr = 'parent child one'
| 26 | 2 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/both_portions/foo/two.py | attr = 'both_portions foo two'
| 31 | 2 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/namespace_pkgs/both_portions/foo/one.py | attr = 'both_portions foo one'
| 31 | 2 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/builtin/test_loader.py | from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import sys
import types
import unittest
@unittest.skipIf(util.BUILTINS.good_name is None, 'no reasonable builtin module')
class LoaderTests(abc.LoaderTests):
"""Test load_module() for built-in modules."""
def se... | 3,741 | 109 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/builtin/__main__.py | from . import load_tests
import unittest
unittest.main()
| 58 | 5 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/builtin/__init__.py | import os
from test.support import load_package_tests
def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)
| 142 | 6 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/builtin/test_finder.py | from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import sys
import unittest
@unittest.skipIf(util.BUILTINS.good_name is None, 'no reasonable builtin module')
class FindSpecTests(abc.FinderTests):
"""Test find_spec() for built-in modules."""
def test_module(se... | 2,891 | 91 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/test_path.py | from .. import util
importlib = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')
import os
import sys
import tempfile
from types import ModuleType
import unittest
import warnings
import zipimport
class FinderTests:
"""Tests for PathFinder."""
find = None
chec... | 9,669 | 258 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/test_meta_path.py | from .. import util
import importlib._bootstrap
import sys
from types import MethodType
import unittest
import warnings
class CallingOrder:
"""Calls to the importers on sys.meta_path happen in order that they are
specified in the sequence, starting with the first importer
[first called], and then continu... | 4,317 | 126 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/test___loader__.py | from importlib import machinery
import sys
import types
import unittest
from .. import util
class SpecLoaderMock:
def find_spec(self, fullname, path=None, target=None):
return machinery.ModuleSpec(fullname, self)
def create_module(self, spec):
return None
def exec_module(self, module):... | 1,861 | 76 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/__main__.py | from . import load_tests
import unittest
unittest.main()
| 58 | 5 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/test_packages.py | from .. import util
import sys
import unittest
from test import support
class ParentModuleTests:
"""Importing a submodule should import the parent modules."""
def test_import_parent(self):
with util.mock_spec('pkg.__init__', 'pkg.module') as mock:
with util.import_state(meta_path=[mock])... | 4,544 | 111 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/test_api.py | from .. import util
from importlib import machinery
import sys
import types
import unittest
PKG_NAME = 'fine'
SUBMOD_NAME = 'fine.bogus'
class BadSpecFinderLoader:
@classmethod
def find_spec(cls, fullname, path=None, target=None):
if fullname == SUBMOD_NAME:
spec = machinery.ModuleSpec(f... | 3,788 | 120 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/test_caching.py | """Test that sys.modules is used properly by import."""
from .. import util
import sys
from types import MethodType
import unittest
class UseCache:
"""When it comes to sys.modules, import prefers it over anything else.
Once a name has been resolved, sys.modules is checked to see if it contains
the modul... | 3,599 | 94 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/test___package__.py | """PEP 366 ("Main module explicit relative imports") specifies the
semantics for the __package__ attribute on modules. This attribute is
used, when available, to detect which package a module belongs to (instead
of using the typical __path__/__name__ test).
"""
import unittest
import warnings
from .. import util
cla... | 5,638 | 164 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/test_fromlist.py | """Test that the semantics relating to the 'fromlist' argument are correct."""
from .. import util
import warnings
import unittest
class ReturnValue:
"""The use of fromlist influences what import returns.
If direct ``import ...`` statement is used, the root module or package is
returned [import return].... | 7,526 | 176 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/__init__.py | import os
from test.support import load_package_tests
def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)
| 142 | 6 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/import_/test_relative_imports.py | """Test relative imports (PEP 328)."""
from .. import util
import unittest
import warnings
class RelativeImports:
"""PEP 328 introduced relative imports. This allows for imports to occur
from within a package without having to specify the actual package name.
A simple example is to import another module... | 9,401 | 233 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/source/__main__.py | from . import load_tests
import unittest
unittest.main()
| 58 | 5 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/source/test_path_hook.py | from .. import util
machinery = util.import_importlib('importlib.machinery')
import unittest
class PathHookTest:
"""Test the path hook for source."""
def path_hook(self):
return self.machinery.FileFinder.path_hook((self.machinery.SourceFileLoader,
self.machinery.SOURCE_SUFFIXES))
... | 1,190 | 42 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/source/test_case_sensitivity.py | """Test case-sensitivity (PEP 235)."""
from .. import util
importlib = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')
import os
from test import support as test_support
import unittest
@util.case_insensitive_tests
class CaseSensitivityTest(util.CASEOKTestBase):
"""P... | 3,221 | 86 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/source/test_file_loader.py | from .. import abc
from .. import util
importlib = util.import_importlib('importlib')
importlib_abc = util.import_importlib('importlib.abc')
machinery = util.import_importlib('importlib.machinery')
importlib_util = util.import_importlib('importlib.util')
import errno
import marshal
import os
import py_compile
import ... | 24,376 | 603 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/source/test_source_encoding.py | from .. import util
machinery = util.import_importlib('importlib.machinery')
import codecs
import importlib.util
import re
import types
# Because sys.path gets essentially blanked, need to have unicodedata already
# imported for the parser to use.
import unicodedata
import unittest
import warnings
CODING_RE = re.co... | 5,330 | 176 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/source/__init__.py | import os
from test.support import load_package_tests
def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)
| 142 | 6 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/test/test_importlib/source/test_finder.py | from .. import abc
from .. import util
machinery = util.import_importlib('importlib.machinery')
import errno
import os
import py_compile
import stat
import sys
import tempfile
from test.support import make_legacy_pyc
import unittest
import warnings
class FinderTests(abc.FinderTests):
"""For a top-level module,... | 8,775 | 237 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/compat.py | """Compatibility helpers for the different Python versions."""
import sys
PY34 = sys.version_info >= (3, 4)
PY35 = sys.version_info >= (3, 5)
PY352 = sys.version_info >= (3, 5, 2)
def flatten_list_bytes(list_of_data):
"""Concatenate a sequence of bytes-like objects."""
if not PY34:
# On Python 3.3 a... | 543 | 19 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/base_subprocess.py | import collections
import subprocess
import warnings
from . import compat
from . import protocols
from . import transports
from .coroutines import coroutine
from .log import logger
class BaseSubprocessTransport(transports.SubprocessTransport):
def __init__(self, loop, protocol, args, shell,
std... | 9,096 | 294 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/base_events.py | """Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... | 57,875 | 1,506 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/base_futures.py | __all__ = []
import concurrent.futures._base
import reprlib
from . import events
Error = concurrent.futures._base.Error
CancelledError = concurrent.futures.CancelledError
TimeoutError = concurrent.futures.TimeoutError
class InvalidStateError(Error):
"""The operation is not allowed in this state."""
# States ... | 2,074 | 72 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/windows_events.py | """Selector and proactor event loops for Windows."""
import _winapi
import errno
import math
import socket
import struct
import weakref
from . import events
from . import base_subprocess
from . import futures
from . import proactor_events
from . import selector_events
from . import tasks
from . import windows_utils
f... | 27,831 | 780 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/streams.py | """Stream-related things."""
__all__ = ['StreamReader', 'StreamWriter', 'StreamReaderProtocol',
'open_connection', 'start_server',
'IncompleteReadError',
'LimitOverrunError',
]
import socket
if hasattr(socket, 'AF_UNIX'):
__all__.extend(['open_unix_connection', 'start_... | 24,472 | 702 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/sslproto.py | import collections
import warnings
try:
import ssl
except ImportError: # pragma: no cover
ssl = None
from . import base_events
from . import compat
from . import protocols
from . import transports
from .log import logger
def _create_transport_context(server_side, server_hostname):
if server_side:
... | 26,005 | 702 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/events.py | """Event loop and event loop policy."""
__all__ = ['AbstractEventLoopPolicy',
'AbstractEventLoop', 'AbstractServer',
'Handle', 'TimerHandle',
'get_event_loop_policy', 'set_event_loop_policy',
'get_event_loop', 'set_event_loop', 'new_event_loop',
'get_child_watcher... | 23,522 | 716 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/test_utils.py | """Utilities shared by tests."""
import collections
import contextlib
import io
import logging
import os
import re
import socket
import socketserver
import sys
import tempfile
import threading
import time
import unittest
import weakref
from unittest import mock
from http.server import HTTPServer
from wsgiref.simple_... | 15,091 | 538 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/proactor_events.py | """Event loop using a proactor and related classes.
A proactor is a "notify-on-completion" multiplexer. Currently a
proactor is only implemented on Windows with IOCP.
"""
__all__ = ['BaseProactorEventLoop']
import socket
import warnings
from . import base_events
from . import compat
from . import constants
from . ... | 20,403 | 557 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/futures.py | """A Future class similar to the one in PEP 3148."""
__all__ = ['CancelledError', 'TimeoutError', 'InvalidStateError',
'Future', 'wrap_future', 'isfuture']
import concurrent.futures
import logging
import sys
import traceback
from . import base_futures
from . import compat
from . import events
CancelledE... | 15,901 | 443 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/constants.py | """Constants."""
# After the connection is lost, log warnings after this many write()s.
LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5
# Seconds to wait before retrying accept().
ACCEPT_RETRY_DELAY = 1
# Number of stack entries to capture in debug mode.
# The large the number, the slower the operation in debug mode
# (see ex... | 371 | 13 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/tasks.py | """Support for tasks, coroutines and the scheduler."""
__all__ = ['Task',
'FIRST_COMPLETED', 'FIRST_EXCEPTION', 'ALL_COMPLETED',
'wait', 'wait_for', 'as_completed', 'sleep', 'async',
'gather', 'shield', 'ensure_future', 'run_coroutine_threadsafe',
]
import concurrent.future... | 25,060 | 727 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/protocols.py | """Abstract Protocol class."""
__all__ = ['BaseProtocol', 'Protocol', 'DatagramProtocol',
'SubprocessProtocol']
class BaseProtocol:
"""Common base class for protocol interfaces.
Usually user implements protocols that derived from BaseProtocol
like Protocol or ProcessProtocol.
The only ca... | 4,512 | 135 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/base_tasks.py | import linecache
import traceback
from . import base_futures
from . import coroutines
def _task_repr_info(task):
info = base_futures._future_repr_info(task)
if task._must_cancel:
# replace status
info[0] = 'cancelling'
coro = coroutines._format_coroutine(task._coro)
info.insert(1, '... | 2,186 | 77 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/locks.py | """Synchronization primitives."""
__all__ = ['Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore']
import collections
from . import compat
from . import events
from . import futures
from .coroutines import coroutine
class _ContextManager:
"""Context manager.
This enables the following idiom for a... | 15,582 | 502 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/queues.py | """Queues"""
__all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty']
import collections
import heapq
from . import compat
from . import events
from . import locks
from .coroutines import coroutine
class QueueEmpty(Exception):
"""Exception raised when Queue.get_nowait() is called on a Queue... | 7,957 | 260 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/selector_events.py | """Event loop using a selector and related classes.
A selector is a "notify-when-ready" multiplexer. For a subclass which
also includes support for signal handling, see the unix_events sub-module.
"""
__all__ = ['BaseSelectorEventLoop']
import collections
import errno
import functools
import socket
import warnings
... | 41,633 | 1,133 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/coroutines.py | __all__ = ['coroutine',
'iscoroutinefunction', 'iscoroutine']
import functools
import inspect
import opcode
import os
import sys
import traceback
import types
from . import compat
from . import constants
from . import events
from . import base_futures
from .log import logger
# Opcode of "yield from" inst... | 11,135 | 354 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/windows_utils.py | """
Various Windows specific bits and pieces
"""
import sys
if sys.platform != 'win32': # pragma: no cover
raise ImportError('win32 only')
import _winapi
import itertools
import msvcrt
import os
import socket
import subprocess
import tempfile
import warnings
__all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', '... | 6,883 | 225 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/log.py | """Logging configuration."""
import logging
# Name the logger after the package.
logger = logging.getLogger(__package__)
| 124 | 8 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/transports.py | """Abstract Transport class."""
from asyncio import compat
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
'Transport', 'DatagramTransport', 'SubprocessTransport',
]
class BaseTransport:
"""Base class for transports."""
def __init__(self, extra=None):
if extra i... | 10,066 | 307 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/subprocess.py | __all__ = ['create_subprocess_exec', 'create_subprocess_shell']
import subprocess
from . import events
from . import protocols
from . import streams
from . import tasks
from .coroutines import coroutine
from .log import logger
PIPE = subprocess.PIPE
STDOUT = subprocess.STDOUT
DEVNULL = subprocess.DEVNULL
class Su... | 7,626 | 227 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/unix_events.py | """Selector event loop for Unix with signal handling."""
import errno
import os
import signal
import socket
import stat
import subprocess
import sys
import threading
import warnings
from . import base_events
from . import base_subprocess
from . import compat
from . import constants
from . import coroutines
from . im... | 37,261 | 1,084 | jart/cosmopolitan | false |
cosmopolitan/third_party/python/Lib/asyncio/__init__.py | """The asyncio package, tracking PEP 3156."""
import sys
# The selectors module is in the stdlib in Python 3.4 but not in 3.3.
# Do this first, so the other submodules can use "from . import selectors".
# Prefer asyncio/selectors.py over the stdlib one, as ours may be newer.
import selectors # Will also be exported.... | 1,060 | 38 | jart/cosmopolitan | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.