| /third_party/python/Lib/test/test_importlib/ |
| D | test_lazy.py | 17 def exec_module(self, module): argument 27 lazy_loader = factory('module name', 'module path', kw='kw') 29 self.assertEqual(('module name', 'module path'), loader.args) 50 def exec_module(self, module): argument 51 exec(self.source_code, module.__dict__) 52 self.loaded = module 68 module = spec.loader.create_module(spec) 69 if module is None: 70 module = types.ModuleType(TestingImporter.module_name) 71 module.__spec__ = spec [all …]
|
| D | util.py | 49 """Import a module from importlib both w/ and w/o _frozen_importlib.""" 58 # XXX Support passing in submodule names--load (and cache) them? 87 # Windows is the only OS that is *always* case-insensitive 88 # (OS X *can* be case-sensitive). 102 """Class decorator that nullifies tests requiring a case-insensitive 105 "requires a case-insensitive filesystem")(test) 110 with open(path, 'w', encoding='utf-8') as subfile: 127 """Uncache a module from sys.modules. 166 # Make sure the module file gets created. 170 with open(modpath, 'w', encoding='utf-8') as modfile: [all …]
|
| /third_party/python/Lib/test/test_importlib/import_/ |
| D | test_path.py | 24 module = '<test module>' 26 self.assertIsNone(self.find(module)) 31 module = '<test module>' 33 importer = util.mock_spec(module) 34 with util.import_state(path_importer_cache={path: importer}, 36 found = self.find(module) 37 self.check_found(found, importer) 42 module = '<test module>' 44 importer = util.mock_spec(module) 45 with util.import_state(path_importer_cache={path: importer}): [all …]
|
| D | test_meta_path.py | 12 specified in the sequence, starting with the first importer 46 self.assertTrue(issubclass(w[-1].category, ImportWarning)) 56 """If there is no __path__ entry on the parent module, then 'path' is None 60 def log_finder(self, importer): argument 61 fxn = getattr(importer, self.finder_name) 72 with self.mock_modules(mod_name) as importer: 73 log, wrapped_call = self.log_finder(importer) 74 setattr(importer, self.finder_name, MethodType(wrapped_call, importer)) 75 with util.import_state(meta_path=[importer]): 86 mod_name = pkg_name + '.module' [all …]
|
| D | test_caching.py | 14 the module desired. If so, then it is returned [use cache]. If it is not 16 sys.modules is still used to return the imported module (e.g., not what a 27 module_to_use = "some module found!" 30 module = self.__import__('some_module') 31 self.assertEqual(id(module_to_use), id(module)) 50 # Pertinent only to PEP 302; exec_module() doesn't return a module. 63 # __import__ inconsistent between loaders and built-in import when it comes 64 # to when to use the module in sys.modules and when not to. 69 with self.create_mock('module') as mock: 71 module = self.__import__('module') [all …]
|
| D | test___package__.py | 1 """PEP 366 ("Main module explicit relative imports") specifies the 3 used, when available, to detect which package a module belongs to (instead 15 what package a module belongs to. The basic algorithm is [__package__]:: 18 level -= 1 38 with self.mock_modules('pkg.__init__', 'pkg.fake') as importer: 39 with util.import_state(meta_path=[importer]): 41 module = self.__import__('', 44 return module 48 module = self.import_module({'__package__': 'pkg.fake'}) 49 self.assertEqual(module.__name__, 'pkg') [all …]
|
| D | test_relative_imports.py | 12 A simple example is to import another module within the same package 13 [module from module]:: 15 # From pkg.mod1 with pkg.mod2 being a module. 18 This also works for getting an attribute from a module that is specified 19 in a relative fashion [attr from module]:: 25 from [package to module],:: 27 # From pkg, importing pkg.module which is a module. 28 from . import module 30 [module to package],:: 32 # Pull attr from pkg, called from pkg.module which is a module. [all …]
|
| /third_party/python/Lib/ |
| D | pkgutil.py | 23 ModuleInfo.__doc__ = 'A namedtuple with minimal info about a module.' 27 """Return the finder-specific module spec.""" 60 'prefix' is a string to output on the front of every module name 112 or, if path is None, all top-level modules on sys.path. 117 'prefix' is a string to output on the front of every module name 137 def iter_importer_modules(importer, prefix=''): argument 138 if not hasattr(importer, 'iter_modules'): 140 return importer.iter_modules(prefix) 144 def _iter_file_finder_modules(importer, prefix=''): argument 145 if importer.path is None or not os.path.isdir(importer.path): [all …]
|
| D | runpy.py | 1 """runpy.py - locating and running Python code using the module namespace 4 module namespace instead of the native filesystem. 6 This allows Python code to play nicely with non-filesystem based PEP 302 14 import importlib.machinery # importlib first so we can test #15386 via -m 27 """Temporarily replace a module in sys.modules with an empty namespace""" 30 self.module = ModuleType(mod_name) 39 sys.modules[mod_name] = self.module 97 mod_globals = temp_module.module.__dict__ 100 # Copy the globals of the temporary module, as they 101 # may be cleared when the temporary module goes away [all …]
|
| D | zipimport.py | 3 This module exports three objects: 4 - zipimporter: a class; its constructor takes a path to a Zip archive. 5 - ZipImportError: exception raised by zipimporter objects. It's a 7 - _zip_directory_cache: a dict, mapping archive paths to zip directory 10 It is usually not needed to use the zipimport module explicitly; it is 44 MAX_COMMENT_LEN = (1 << 16) - 1 47 """zipimporter(archivepath) -> zipimporter object 99 self.prefix = _bootstrap_external._path_join(*prefix[::-1]) 104 # Check whether we can satisfy the import of the module named by 110 """find_loader(fullname, path=None) -> self, str or None. [all …]
|
| /third_party/grpc/bazel/ |
| D | _single_module_tester.py | 7 # http://www.apache.org/licenses/LICENSE-2.0 28 for importer, module_name, is_package in pkgutil.walk_packages([unittest_path]): 30 module = importer.find_module(module_name).load_module(module_name) 31 tests.append(loader.loadTestsFromModule(module)) 33 raise AssertionError("Expected only 1 test module. Found {}".format(tests)) 36 …def loadTestsFromNames(self, names: Sequence[str], module: Optional[str] = None) -> unittest.TestS…
|
| D | _gevent_test_main.py | 7 # http://www.apache.org/licenses/LICENSE-2.0 75 …for importer, module_name, is_package in pkgutil.walk_packages([os.path.dirname(os.path.relpath(__… 77 spec = importer.find_spec(module_name) 78 module = importlib.util.module_from_spec(spec) 79 spec.loader.exec_module(module) 80 tests.append(loader.loadTestsFromModule(module)) 82 raise AssertionError("Expected only 1 test module. Found {}".format(tests)) 86 def loadTestsFromNames(self, names: Sequence[str], module: str = None) -> unittest.TestSuite:
|
| /third_party/typescript/src/services/ |
| D | importTracker.ts | 64 type Importer = AnyImportOrReExport | ValidImportTypeNode | Identifier; alias 65 type ImporterOrCallExpression = Importer | CallExpression; 67 …statements that directly reference the exporting module, and a list of files that may access the m… 75 ): { directImports: Importer[], indirectUsers: readonly SourceFile[] } { 78 const directImports: Importer[] = []; 92 // Module augmentations may use this module's exports without importing it. 101 …// This may return duplicates (if there are multiple module declarations in a single source file, … 153 … // This is `export * from "foo"`, so imports of this module may import the export too. 161 …rt { foo } from "foo"` and creates an alias symbol, so recursive search will get handle re-exports. 195 // This is a direct import, not import-as-namespace. [all …]
|
| /third_party/python/Modules/ |
| D | main.c | 32 /* --- pymain_init() ---------------------------------------------- */ 57 if (args->use_bytes_argv) { in pymain_init() 58 status = PyConfig_SetBytesArgv(&config, args->argc, args->bytes_argv); in pymain_init() 61 status = PyConfig_SetArgv(&config, args->argc, args->wchar_argv); in pymain_init() 79 /* --- pymain_run_python() ---------------------------------------- */ 81 /* Non-zero if filename, command (-c) or module (-m) is set 85 return (config->run_command != NULL in config_run_code() 86 || config->run_filename != NULL in config_run_code() 87 || config->run_module != NULL); in config_run_code() 91 /* Return non-zero if stdin is a TTY or if -i command line option is used */ [all …]
|
| /third_party/grpc/src/python/grpcio_tests/tests/ |
| D | _loader.py | 7 # http://www.apache.org/licenses/LICENSE-2.0 33 # path on sys.path. Useful for determining what a directory's module 59 module discovered. 61 against module names and determine whether or not the discovered module 70 def loadTestsFromNames(self, names, module=None): argument 106 for importer, module_name, is_package in pkgutil.walk_packages( 109 module = None 111 module = sys.modules[module_name] 112 self.visit_module(module) 115 spec = importer.find_spec(module_name) [all …]
|
| /third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Transforms/IPO/ |
| D | FunctionImport.h | 1 //===- llvm/Transforms/IPO/FunctionImport.h - ThinLTO importing -*- C++ -*-===// 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 //===----------------------------------------------------------------------===// 29 class Module; variable 31 /// The function importer is automatically importing function from other modules 35 /// Set of functions to import from a source module. Each entry is a set 36 /// containing all the GUIDs of all functions to import for a source module. 56 // in the referenced module for direct calls. 68 /// Information optionally tracked for candidates the importer decided 86 /// Map of callee GUID considered for import into a given module to a pair [all …]
|
| /third_party/python/Doc/library/ |
| D | zipimport.rst | 1 :mod:`zipimport` --- Import modules from Zip archives 4 .. module:: zipimport 11 -------------- 13 This module adds the ability to import Python modules (:file:`\*.py`, 14 :file:`\*.pyc`) and packages from ZIP-format archives. It is usually not 15 needed to use the :mod:`zipimport` module explicitly; it is automatically used 16 by the built-in :keyword:`import` mechanism for :data:`sys.path` items that are paths 19 Typically, :data:`sys.path` is a list of directory names as strings. This module 42 :pep:`273` - Import Modules from Zip Archives 47 :mod:`importlib` - The implementation of the import machinery [all …]
|
| D | importlib.rst | 1 :mod:`!importlib` --- The implementation of :keyword:`!import` 4 .. module:: importlib 14 -------------- 18 ------------ 20 The purpose of the :mod:`importlib` package is three-fold. 31 generically as an :term:`importer`) to participate in the import process. 36 * :mod:`importlib.metadata` presents access to metadata from third-party 38 * :mod:`importlib.resources` provides routines for accessing non-code 54 :ref:`sys-path-init` 58 Import on Case-Insensitive Platforms [all …]
|
| /third_party/python/Lib/test/support/ |
| D | import_helper.py | 16 """Context manager to suppress package and module deprecation 23 warnings.filterwarnings("ignore", ".+ (module|package)", 38 """'Forget' a module was ever imported. 40 This removes the module from sys.modules and deletes any PEP 3147/488 or 68 """Import and return the module to be tested, raising SkipTest if 71 If deprecated is True, any module or package deprecation messages 72 will be suppressed. If a module is required on a platform but optional for 101 _imp._override_frozen_modules_for_tests(1 if enabled else -1) 112 """Import and return a module, deliberately bypassing sys.modules. 114 This function imports and returns a fresh copy of the named Python module [all …]
|
| /third_party/python/Python/ |
| D | import.c | 1 /* Module definition and import implementation */ 40 module _imp 61 int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; in _PyImportZip_Init() 68 _PyErr_Clear(tstate); /* No zip import module -- okay */ in _PyImportZip_Init() 77 _PyErr_Clear(tstate); /* No zipimporter object -- okay */ in _PyImportZip_Init() 102 /* Locking primitives to prevent parallel imports of the same module 103 in different threads to return with a partially loaded module. 144 return -1; in _PyImport_ReleaseLock() 145 import_lock_level--; in _PyImport_ReleaseLock() 173 import_lock_level--; in _PyImport_ReInitLock() [all …]
|
| /third_party/python/Doc/extending/ |
| D | building.rst | 13 and must be named after the module name, with an appropriate extension. 20 It returns either a fully initialized module, or a :c:type:`PyModuleDef` 21 instance. See :ref:`initializing-modules` for details. 25 For modules with ASCII-only names, the function must be named 27 module. When using :ref:`multi-phase-initialization`, non-ASCII module names 36 suffix = b'U_' + name.encode('punycode').replace(b'-', b'_') 41 using symbolic links or a custom importer, because by default only the 60 .. code-block:: python3 77 will compile :file:`demo.c`, and produce an extension module named ``demo`` in 78 the :file:`build` directory. Depending on the system, the module file will end [all …]
|
| /third_party/python/Tools/importbench/ |
| D | importbench.py | 1 """Benchmark some basic import use-cases. 4 thus has no external changes made to import-related attributes in sys. 37 count -= 1 43 module = imp.new_module(name) 44 module.__file__ = '<test>' 45 module.__package__ = '' 47 sys.modules[name] = module 52 """Built-in module""" 56 # Relying on built-in importer being implicit. 79 def _wo_bytecode(module): argument [all …]
|
| /third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/LTO/ |
| D | LTOBackend.cpp | 1 //===-LTOBackend.cpp - LLVM Link Time Optimizer Backend -------------------===// 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 //===----------------------------------------------------------------------===// 10 // optimization and code generation on a loaded module. It is generally used 14 //===----------------------------------------------------------------------===// 70 Hook = [=](unsigned Task, const Module &M) { in addSaveTemps() 77 // If this is the combined module (not a ThinLTO backend compile) or the in addSaveTemps() 78 // user hasn't requested using the input module's path, emit to a file in addSaveTemps() 80 if (M.getModuleIdentifier() == "ld-temp.o" || !UseInputModulePath) { in addSaveTemps() 82 if (Task != (unsigned)-1) in addSaveTemps() [all …]
|
| /third_party/rust/rust/library/std/src/sys/windows/ |
| D | compat.rs | 6 //! This module implements a form of delayed DLL import binding, using 14 //! The stored function pointer starts out as an importer function which will 40 // See https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-initialization?view=msvc-170 59 // https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices in init() 86 pub(crate) const fn const_cstr_from_bytes(bytes: &'static [u8]) -> &'static CStr { in const_cstr_from_bytes() 92 while i < bytes.len() - 1 { in const_cstr_from_bytes() 102 /// Represents a loaded module. 105 /// Therefore a `Module` is always valid for the lifetime of std. 107 pub(in crate::sys) struct Module(NonNull<c_void>); struct 108 impl Module { implementation [all …]
|
| /third_party/python/Doc/whatsnew/ |
| D | 2.3.rst | 9 .. $Id: whatsnew23.tex 54631 2007-03-31 11:58:36Z georg.brandl $ 18 improved the performance of new-style classes. A few new built-in functions 24 data types, the ability to import modules from ZIP-format archives, metadata 25 support for the long-awaited Python catalog, an updated version of IDLE, and 27 command-line options, using BerkeleyDB databases... the list of new and 43 The new :mod:`sets` module contains an implementation of a set datatype. The 68 ``&`` and ``|``. Mutable sets also have in-place versions of these methods, 90 in-place version with the ungainly name :meth:`symmetric_difference_update`. :: 116 :pep:`218` - Adding a Built-In Set Object Type 123 .. _section-generators: [all …]
|