Returns the stream of resulting ModuleDescriptors
558832
public Stream<ModuleDescriptor> descriptors() {
        return automaticToNormalModule.entrySet().stream()
                    .map(Map.Entry::getValue)
                    .map(Module::descriptor);
    }
710533
def get_function_descriptor_list(self):
        
        descriptor_list = []
        if self.is_for_driver_task:
            # Driver task returns an empty list.
            return descriptor_list
        else:
            descriptor_list.append(self.module_name.encode("ascii"))
            descriptor_list.append(self.class_name.encode("ascii"))
            descriptor_list.append(self.function_name.encode("ascii"))
            if len(self._function_source_hash) != 0:
                descriptor_list.append(self._function_source_hash)
            return descriptor_list
873906
def describe_file_set(modules):
    
    descriptor = FileSet()
    file_descriptors = []
    for module in modules:
        file_descriptors.append(describe_file(module))

    if file_descriptors:
        descriptor.files = file_descriptors

    return descriptor
234387
def get_modules(self, type_name):
        '''
        '''
        modules = []
        for module in self:
            if module.__class__.__name__ == type_name:
                modules.append(module)
        return modules
186814
def get_nested_streams(dmap):
    
    return list({s for dmap in get_nested_dmaps(dmap) for s in dmap.streams})
980652
@Override
    protected Stream<Module> buildGuiceModules() {
        return Stream.concat(
                super.buildGuiceModules(),
                Stream.of(new OntopOptimizationModule(this)));
    }
663198
private static Module getModuleFromStreamByID(ModfileInputStream input)
	{
		Iterator<Module> iter = getModulesArray().iterator();
		while (iter.hasNext())
		{
			Module mod = iter.next();
			try 
			{
				if (mod.checkLoadingPossible(input)) return mod;
			}
			catch (IOException ex)
			{
				/* Ignoring */
			}
		}
		return null;
	}
623643
def _find_modules(src):
    """"""
    directors = 0
    mnames = []
    try:
        matches = _reModule.findall(open(src).read())
    except IOError:
        # If the file's not yet generated, guess the module name from the file stem
        matches = []
        mnames.append(os.path.splitext(os.path.basename(src))[0])

    for m in matches:
        mnames.append(m[2])
        directors = directors or m[0].find('directors') >= 0
    return mnames, directors
46270
def get_injected_modules(classname):
    
    """
    modname_list = __CLASSNAME_CLASSKEY_REGISTER__[classname]

    injected_modules = []
    for modstr in modname_list:
        parts = modstr.split('.')
        pkgname = '.'.join(parts[:-1])
        modname = parts[-1]
        try:
            exec('from %s import %s' % (pkgname, modname, ), globals(), locals())
            module = eval(modname)
            injected_modules.append(module)
        except ImportError as ex:
            ut.printex(ex, 'Cannot load package=%r, module=%r' % (pkgname, modname, ))
    return injected_modules
819795
Map<String, JSModule> getModulesByName() {
    Map<String, JSModule> result = new HashMap<>();
    for (JSModule m : modules) {
      result.put(m.getName(), m);
    }
    return result;
  }
1086973
def find_objects(modules):
    
    return {
        subclass.__name__: subclass
        for subclass in chain(
            get_all_subclasses(Object),
            get_all_subclasses(ObjectSet),
        )
        if subclass.__module__ in modules
    }
165017
function ()
  {
    /** @type {Object.<string, ModuleDef>} */
    var modules = {};
    ((typeof this.options.externalModules === 'string' ?
      [this.options.externalModules] : this.options.externalModules
      ) || []).
      concat (this.options.builtinModules).
      forEach (function (moduleName)
    {
      // Ignore redundant names.
      if (!modules[moduleName]) {
        /** @type {ModuleDef} */
        var module = modules[moduleName] = new ModuleDef (moduleName);
        module.external = true;
      }
    });
    return modules;
  }
822777
function modGetModulesExports(modules, buildinModules) {
        var args = [];
        each(
            modules,
            function (id, index) {
                if (typeof id === 'object') {
                    id = id.absId;
                }
                args[index] = buildinModules[id] || modModules[id].exports;
            }
        );

        return args;
    }
1152239
private static List<ModuleRef> findModuleRefs(final LinkedHashSet<Object> layers, final ScanSpec scanSpec,
            final LogNode log) {
        if (layers.isEmpty()) {
            return Collections.emptyList();
        }

        // Traverse the layer DAG to find the layer resolution order
        final Deque<Object> /* Deque<ModuleLayer> */ layerOrder = new ArrayDeque<>();
        final Set<Object> /* Set<ModuleLayer */ parentLayers = new HashSet<>();
        for (final Object layer : layers) {
            findLayerOrder(layer, /* layerVisited = */ new HashSet<>(), parentLayers, layerOrder);
        }
        if (scanSpec.addedModuleLayers != null) {
            for (final Object layer : scanSpec.addedModuleLayers) {
                findLayerOrder(layer, /* layerVisited = */ new HashSet<>(), parentLayers, layerOrder);
            }
        }

        // Remove parent layers from layer order if scanSpec.ignoreParentModuleLayers is true
        List<Object> /* List<ModuleLayer> */ layerOrderFinal;
        if (scanSpec.ignoreParentModuleLayers) {
            layerOrderFinal = new ArrayList<>();
            for (final Object layer : layerOrder) {
                if (!parentLayers.contains(layer)) {
                    layerOrderFinal.add(layer);
                }
            }
        } else {
            layerOrderFinal = new ArrayList<>(layerOrder);
        }

        // Find modules in the ordered layers
        final Set<Object> /* Set<ModuleReference> */ addedModules = new HashSet<>();
        final LinkedHashSet<ModuleRef> moduleRefOrder = new LinkedHashSet<>();
        for (final Object /* ModuleLayer */ layer : layerOrderFinal) {
            final Object /* Configuration */ configuration = ReflectionUtils.invokeMethod(layer, "configuration",
                    /* throwException = */ true);
            if (configuration != null) {
                // Get ModuleReferences from layer configuration
                @SuppressWarnings("unchecked")
                final Set<Object> /* Set<ResolvedModule> */ modules = (Set<Object>) ReflectionUtils
                        .invokeMethod(configuration, "modules", /* throwException = */ true);
                if (modules != null) {
                    final List<ModuleRef> modulesInLayer = new ArrayList<>();
                    for (final Object /* ResolvedModule */ module : modules) {
                        final Object /* ModuleReference */ moduleReference = ReflectionUtils.invokeMethod(module,
                                "reference", /* throwException = */ true);
                        if (moduleReference != null && addedModules.add(moduleReference)) {
                            try {
                                modulesInLayer.add(new ModuleRef(moduleReference, layer));
                            } catch (final IllegalArgumentException e) {
                                if (log != null) {
                                    log.log("Exception while creating ModuleRef for module " + moduleReference, e);
                                }
                            }
                        }
                    }
                    // Sort modules in layer by name
                    CollectionUtils.sortIfNotEmpty(modulesInLayer);
                    moduleRefOrder.addAll(modulesInLayer);
                }
            }
        }
        return new ArrayList<>(moduleRefOrder);
    }
747297
def _module_callers(parser, modname, result):
    
    if modname in result:
        #We have already processed this module.
        return
    
    module = parser.get(modname)
    mresult = {}
    if module is not None:
        for xname, xinst in module.executables():
            _exec_callers(xinst, mresult)
        result[modname] = mresult
        
        for depkey in module.dependencies:
            depmod = depkey.split('.')[0].lower()
            _module_callers(parser, depmod, result)
1362563
private Stream<Map<Archive, Set<String>>> dependenceStream() {
        return deps.keySet().stream()
                   .filter(source -> !source.getModule().isNamed()
                            || configuration.rootModules().contains(source))
                   .map(deps::get);
    }
674595
def make_module_to_builder_dict(datasets=None):
  """"""
  # pylint: disable=g-long-lambda
  # dict to hold tfds->image->mnist->[builders]
  module_to_builder = collections.defaultdict(
      lambda: collections.defaultdict(
          lambda: collections.defaultdict(list)))
  # pylint: enable=g-long-lambda

  if datasets:
    builders = [tfds.builder(name) for name in datasets]
  else:
    builders = [
        tfds.builder(name)
        for name in tfds.list_builders()
        if name not in BUILDER_BLACKLIST
    ] + [tfds.builder("image_label_folder", dataset_name="image_label_folder")]

  for builder in builders:
    mod_name = builder.__class__.__module__
    modules = mod_name.split(".")
    if "testing" in modules:
      continue

    current_mod_ctr = module_to_builder
    for mod in modules:
      current_mod_ctr = current_mod_ctr[mod]
    current_mod_ctr.append(builder)

  module_to_builder = module_to_builder["tensorflow_datasets"]
  return module_to_builder