| /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 …]
|
| D | pydoc.py | 11 the name of a function, module, package, or a dotted reference to a 12 class or function within a module or module in a package. If the 16 Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines 19 Run "pydoc -n <hostname>" to start an HTTP server with the given 22 Run "pydoc -p <port>" to start an HTTP server on the given port on the 25 Run "pydoc -b" to start an HTTP server on an arbitrary unused port and 27 the -n and -p options to control the hostname and port used. 29 Run "pydoc -w <name>" to write out the HTML documentation for a module 32 Module docs for core modules are assumed to be in 41 __author__ = "Ka-Ping Yee <ping@lfw.org>" [all …]
|
| /third_party/typescript/src/services/ |
| D | importTracker.ts | 36 type Importer = AnyImportOrReExport | ValidImportTypeNode | Identifier; alias 37 type ImporterOrCallExpression = Importer | CallExpression; 39 …statements that directly reference the exporting module, and a list of files that may access the m… 47 ): { directImports: Importer[], indirectUsers: readonly SourceFile[] } { 50 const directImports: Importer[] = []; 64 // Module augmentations may use this module's exports without importing it. 73 …// This may return duplicates (if there are multiple module declarations in a single source file, … 125 … // This is `export * from "foo"`, so imports of this module may import the export too. 133 …rt { foo } from "foo"` and creates an alias symbol, so recursive search will get handle re-exports. 167 // 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/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/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/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/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/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 …]
|
| /third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/IPO/ |
| D | FunctionImport.cpp | 1 //===- FunctionImport.cpp - ThinLTO Summary-based Function Import ---------===// 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 //===----------------------------------------------------------------------===// 11 //===----------------------------------------------------------------------===// 31 #include "llvm/IR/Module.h" 61 #define DEBUG_TYPE "function-import" 80 "import-instr-limit", cl::init(100), cl::Hidden, cl::value_desc("N"), 84 "import-cutoff", cl::init(-1), cl::Hidden, cl::value_desc("N"), 85 cl::desc("Only import first N functions if N>=0 (default -1)")); 88 ImportInstrFactor("import-instr-evolution-factor", cl::init(0.7), [all …]
|
| /third_party/typescript/lib/fr/ |
| D | diagnosticMessages.generated.json | 33 …le_module_1319": "Une exportation par défaut ne peut être utilisée que dans un module ECMAScript.", 34 …rtation par défaut doit se trouver au niveau supérieur d’une déclaration de fichier ou de module.", 37 …ez une déclaration pour le constructeur 'Promise', ou incluez 'ES2015' dans votre option '--lib'.", 38 …fiez que vous avez une déclaration pour 'Promise', ou incluez 'ES2015' dans votre option '--lib'.", 39 …nnot_have_a_reference_to_itself_1006": "Un fichier ne peut pas contenir une référence à lui-même.", 54 …"A_module_cannot_have_multiple_default_exports_2528": "Un module ne peut pas avoir plusieurs expor… 57 …ation d’espace de noms n’est autorisée qu’au niveau supérieur d’un espace de noms ou d’un module.", 58 "A_non_dry_build_would_build_project_0_6357": "Une build non-dry va générer le projet '{0}'", 59 …"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "Une build non-dry va supprimer l… 60 …"A_non_dry_build_would_update_output_of_project_0_6375": "Une build non-dry va mettre à jour la so… [all …]
|
| /third_party/python/Lib/importlib/ |
| D | _bootstrap.py | 3 This module is NOT meant to be directly imported! It has been designed such 6 work. One should use importlib as the public-facing version of this module. 10 # IMPORTANT: Whenever making changes to this module, be sure to run a top-level 11 # `make regen-importlib` followed by `make` in order to get the frozen version 12 # of the module updated. Not doing so will result in the Makefile to fail for 13 # all others who don't have a ./python around to freeze the module 29 # Bootstrap-related code ###################################################### 52 # Module-level locking ######################################################## 54 # A dict mapping module names to weakrefs of _ModuleLock instances 102 Acquire the module lock. If a potential deadlock is detected, [all …]
|