| /external/python/cpython2/Lib/ |
| D | imputil.py | 7 Importer Base class for replacing standard import functions 13 warnpy3k("the imputil module has been removed in Python 3.0", stacklevel=2) 16 # note: avoid importing non-builtin modules 25 __all__ = ["ImportManager","Importer","BuiltinImporter"] 66 # so let's just load the OS-related facilities. 70 # This is the Importer that we use for grabbing stuff from the 78 # The default will import dynamic-load modules first, followed by 87 """Python calls this hook to locate and import a module.""" 94 # if there is a parent, then its importer should manage this import 96 module = parent.__importer__._do_import(parent, parts, fromlist) [all …]
|
| D | pkgutil.py | 29 """Make a trivial single-dispatch generic function""" 75 'prefix' is a string to output on the front of every module name 102 for importer, name, ispkg in iter_modules(path, prefix): 103 yield importer, name, ispkg 128 or, if path is None, all top-level modules on sys.path. 133 'prefix' is a string to output on the front of every module name 151 def iter_importer_modules(importer, prefix=''): argument 152 if not hasattr(importer, 'iter_modules'): 154 return importer.iter_modules(prefix) 160 """PEP 302 Importer that wraps Python's "classic" import algorithm [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 25 """Temporarily replace a module in sys.modules with an empty namespace""" 28 self.module = imp.new_module(mod_name) 37 sys.modules[mod_name] = self.module 80 mod_globals = temp_module.module.__dict__ 83 # Copy the globals of the temporary module, as they 84 # may be cleared when the temporary module goes away 89 # loader protocol (specifically, "get_filename" is non-standard) [all …]
|
| D | ihooks.py | 3 Consistent use of this module will make it possible to change the 6 While the built-in module imp exports interfaces to the built-in 7 module searching and loading algorithm, and it is possible to replace 8 the built-in function __import__ in order to change the semantics of 13 This module defines three new concepts: 21 2) A "module loader" class provides an interface to search for a 22 module in a search path and to load it. It defines a method which 23 searches for a module in a single directory; by overriding this method 25 built-in and frozen modules are searched instead. 27 Two module loader class are defined, both implementing the search [all …]
|
| /external/python/cpython3/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 …]
|
| /external/python/cpython3/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 …]
|
| /external/python/apitools/apitools/base/protorpclite/ |
| D | messages_test.py | 9 # http://www.apache.org/licenses/LICENSE-2.0 34 # pylint:disable=function-redefined 35 # pylint:disable=global-variable-not-assigned 36 # pylint:disable=global-variable-undefined 37 # pylint:disable=redefined-outer-name 38 # pylint:disable=undefined-variable 39 # pylint:disable=unused-variable 40 # pylint:disable=too-many-lines 51 MODULE = messages variable in ModuleInterfaceTest 74 global Color # pylint:disable=global-variable-not-assigned [all …]
|
| D | descriptor.py | 9 # http://www.apache.org/licenses/LICENSE-2.0 28 other, non-Python languages. 89 describe_enum_value: Describe an individual enum-value. 92 describe_file: Describe a 'file' unit from a Python module or object. 183 Variant: Wire format hint sub-types for field. 194 Variant = messages.Variant # pylint:disable=invalid-name 261 files: Files in file-set. 292 enum_descriptor.name = enum_definition.definition_name().split('.')[-1] 352 '.')[-1] 386 def describe_file(module): argument [all …]
|
| /external/python/cpython3/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 …]
|
| /external/python/cpython2/Doc/library/ |
| D | pkgutil.rst | 1 :mod:`pkgutil` --- Package extension utility 4 .. module:: pkgutil 11 -------------- 13 This module provides utilities for the import system, in particular package 32 :mod:`site` module for more information), except that it doesn't special-case 43 that are not (Unicode or 8-bit) strings referring to existing directories are 51 :pep:`302` Importer that wraps Python's "classic" import algorithm. 53 If *dirname* is a string, a :pep:`302` importer is created that searches that 54 directory. If *dirname* is ``None``, a :pep:`302` importer is created that 56 built-in. [all …]
|
| D | imputil.rst | 2 :mod:`imputil` --- Import utilities 5 .. module:: imputil 10 The :mod:`imputil` module has been removed in Python 3. 15 This module provides a very handy and useful mechanism for custom 16 :keyword:`import` hooks. Compared to the older :mod:`ihooks` module, 17 :mod:`imputil` takes a dramatically simpler and more straight-forward 38 .. class:: Importer() 42 .. method:: Importer.import_top(name) 44 Import a top-level module. 46 .. method:: Importer.get_code(parent, modname, fqname) [all …]
|
| /external/python/cpython2/Lib/email/ |
| D | __init__.py | 1 # Copyright (C) 2001-2006 Python Software Foundation 3 # Contact: email-sig@python.org 48 # Some convenience routines. Don't import Parser and Message as side-effects 70 # Lazy loading to provide name mapping from new-style names (PEP 8 compatible 71 # email 4.0 module names), to old-style names (email 3.0 module names). 86 # email.<old name> -> email.<new name is lowercased old name> 102 # email.MIME<old name> -> email.mime.<new name is lowercased old name> 113 importer = LazyImporter(_name.lower()) variable 114 sys.modules['email.' + _name] = importer 115 setattr(sys.modules['email'], _name, importer) [all …]
|
| /external/python/setuptools/pkg_resources/ |
| D | __init__.py | 3 -------------------- 190 plat = 'macosx-%s-%s' % ('.'.join(_macos_vers()[:2]), m.group(3)) 256 An already-installed version conflicts with the requested version. 277 If required_by is non-empty, return a version of self that is a 337 DEVELOP_DIST = -1 343 `loader_type` is the type or class of a PEP 302 ``module.__loader__``, 344 and `provider_factory` is a function that, passed a *module* object, 345 returns an ``IResourceProvider`` for that module. 351 """Return an IResourceProvider for the named module or requirement""" 355 module = sys.modules[moduleOrReq] [all …]
|
| /external/tensorflow/tensorflow/compiler/mlir/lite/experimental/tac/ |
| D | tac_module.h | 7 http://www.apache.org/licenses/LICENSE-2.0 22 #include "mlir/Dialect/Func/IR/FuncOps.h" // from @llvm-project 23 #include "mlir/IR/BuiltinOps.h" // from @llvm-project 24 #include "mlir/Pass/PassManager.h" // from @llvm-project 36 // 2) Use SetImporter/SetExporter to the desired importer 40 // The module fetches all TargetHardware backends registered in the binary 64 void SetImporter(std::unique_ptr<TacImporter> importer) { in SetImporter() argument 65 importer_ = std::move(importer); in SetImporter() 83 // Returns all available hardware backends registered in this module 89 // Registers all dialects in 'registry' with the module. [all …]
|
| /external/tensorflow/tensorflow/dtensor/cc/ |
| D | constants.h | 7 http://www.apache.org/licenses/LICENSE-2.0 31 // Indicates a non-binding layout hint provided by the user. 32 // `tf` prefix attached in MLIR importer for dialect requirements. 35 // Indicates a non-binding layout hint provided by the user. 39 // `tf` prefix attached in MLIR importer for dialect requirements. 46 // `tf` prefix attached in MLIR importer for dialect requirements. 60 // Attribute carries input layout index for shape op. This forms a 1 -> 1 72 // Attribute attached to resource-type function arguments containing the local 80 // we allow automatical broadcasting small non-DTensor to DTensor device, which 82 // forcing users to do explicit copy-to-mesh). [all …]
|
| /external/tensorflow/tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/ |
| D | common_v1.py | 7 # http://www.apache.org/licenses/LICENSE-2.0 27 from tensorflow.python import pywrap_mlir # pylint: disable=g-direct-tensorflow-import 36 # v1 Importer. To use SavedModel V1 Importer, resource variables should be 43 # module itself, because the creation of the module has to be delayed until 52 1. Performs absl and tf "main"-like initialization that must run before almost 59 This is only for use by the MLIR SavedModel importer tests. 68 use_lite: If true, importer will not do any graph transformation such as 81 raise app.UsageError('Too many command-line arguments.') 112 'tf-standard-pipeline',
|
| /external/python/cpython2/Python/ |
| D | import.c | 2 /* Module definition and import implementation */ 6 #include "Python-ast.h" 39 -U interpeter flag will cause MAGIC+1 being used. They have been 64 Python 2.5a0: 62081 (ast-branch) 97 /* these tables define the module suffixes that Python recognizes */ 122 * "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs. in isdir() 160 for (scan = _PyImport_DynLoadFiletab; scan->suffix != NULL; ++scan) in _PyImport_Init() 163 for (scan = _PyImport_StandardFiletab; scan->suffix != NULL; ++scan) in _PyImport_Init() 180 for (; filetab->suffix != NULL; filetab++) { in _PyImport_Init() 182 if (strcmp(filetab->suffix, ".pyc") == 0) in _PyImport_Init() [all …]
|
| /external/python/setuptools/pkg_resources/extern/ |
| D | __init__.py | 7 A PEP 302 meta path importer for finding optionally-vendored 8 or otherwise naturally-installed packages from root_name. 25 """Figure out if the target module is vendored.""" 54 def exec_module(self, module): argument 58 """Return a module spec for vendored names.""" 66 Install this importer into sys.meta_path if not already present.
|
| /external/python/setuptools/setuptools/extern/ |
| D | __init__.py | 7 A PEP 302 meta path importer for finding optionally-vendored 8 or otherwise naturally-installed packages from root_name. 25 """Figure out if the target module is vendored.""" 54 def exec_module(self, module): argument 58 """Return a module spec for vendored names.""" 66 Install this importer into sys.meta_path if not already present.
|
| /external/python/cpython3/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 …]
|
| /external/grpc-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 …]
|