Get the binder from an AbstractModule.
341840
public static Binder binder(Object module) {
        if (module instanceof AbstractModule) {
            try {
                Method method = AbstractModule.class.getDeclaredMethod("binder");
                if (!method.isAccessible()) {
                    method.setAccessible(true);
                }
                return (Binder) method.invoke(module);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        } else {
            throw new IllegalArgumentException("Module must be an instance of AbstractModule");
        }
    }
1122431
public com.google.javascript.jscomp.FunctionInformationMap.Module getModule(int index) {
    return module_.get(index);
  }
826074
def get_tuple(self):
        """"""
        objType, objInstance = self.value

        if isinstance(objType, int):
            pass
        elif isinstance(objType, str):
            # turn it back into an integer
            objType = self.objectTypeClass()[objType]
        else:
            raise TypeError("invalid datatype for objType")

        # pack the components together
        return (objType, objInstance)
14863
function (moduleName) {
            var moduleNames = Utils.unalias(S, Utils.normalizeModNamesWithAlias(S, [moduleName]));
            if (Utils.attachModsRecursively(moduleNames, S)) {
                return Utils.getModules(S, moduleNames)[1];
            }
            return undefined;
        }
991686
def install(self, binder, module):
        """"""
        ModuleAdapter(module, self._injector).configure(binder)
361652
def get_from_import(self, resource, name):
        """"""
        module_name = libutils.modname(resource)
        names = []
        if isinstance(name, list):
            names = [(imported, None) for imported in name]
        else:
            names = [(name, None), ]
        return FromImport(module_name, 0, tuple(names))
117569
def get(self, name):
        """"""
        if name not in self.modules:
            self.load_dependency(name, False, False, False)

        if name in self.modules:
            return self.modules[name]
        else:
            return None
204285
def _get_app_module(self):
        # type: () -> Callable
        

        def configure(binder):
            # type: (Binder) -> Callable
            binder.bind(ServiceApplication, to=self, scope=singleton)
            binder.bind(Config, to=self.config, scope=singleton)

        return configure
1157672
static Binding from(Export boundExport, Node sourceNode) {
    return new AutoValue_Binding(
        boundExport.moduleMetadata(),
        sourceNode,
        boundExport,
        /* isModuleNamespace= */ false,
        /* closureNamespace= */ null,
        CreatedBy.EXPORT);
  }
242200
private Management getProxyChain(Management m)
            throws ModuleInitializationException {
        try {
            invocationHandlers = getInvocationHandlers();
            return (Management) ProxyFactory.getProxy(m, invocationHandlers);
        } catch (Exception e) {
            throw new ModuleInitializationException(e.getMessage(), getRole());
        }
    }
488775
function getModule(name, loader) {
    var exports;
    var entry = loader.defined[name];

    if (!entry) {
      exports = loader.get(name);
      if (!exports)
        throw new Error('Unable to load dependency ' + name + '.');
    }

    else {
      if (entry.declarative)
        ensureEvaluated(name, entry, [], loader);
    
      else if (!entry.evaluated)
        linkDynamicModule(entry, loader);

      exports = entry.module.exports;
    }

    if ((!entry || entry.declarative) && exports && exports.__useDefault)
      return exports['default'];
    
    return exports;
  }
390085
def get_instance(self, cls):
        """"""
        binding = self._bindings.get(cls)
        if binding:
            return binding()

        # Try to create a runtime binding.
        with _BINDING_LOCK:
            binding = self._bindings.get(cls)
            if binding:
                return binding()

            if not self._bind_in_runtime:
                raise InjectorException('No binding was found for key=%s' % cls)

            if not callable(cls):
                raise InjectorException(
                    'Cannot create a runtime binding, the key is not callable, key=%s' % cls)

            instance = cls()
            self._bindings[cls] = lambda: instance

            logger.debug('Created a runtime binding for key=%s, instance=%s', cls, instance)
            return instance
11141
@Bind(optional = true, aggregate = true)
    public synchronized void bindModule(Module module) {
        register(module);
    }
183419
private String getModuleFromClass(Class<?> klass, Map<String, ModuleProperties> moduleMap) {
        String file = getClassFileLocation(klass);
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "File name : " + file);
        }
        String moduleName = null;
        for (Map.Entry<String, ModuleProperties> entry : moduleMap.entrySet()) {
            URL location = entry.getValue().getLocation();
            String filePath = location.getFile();
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "location : " + filePath);
            }

            if (location.getProtocol().equals("file") && file.startsWith(filePath)) {
                moduleName = entry.getKey();
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "module name from the list  : " + moduleName);
                }
                break;
            }
        }
        if (moduleName == null) {
            moduleName = file;
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "no match. use filename as module name : " + moduleName);
            }
        }
        return moduleName;
    }
964881
def getClassInModuleFromName(className, module):
    
    n = getAvClassNamesInModule(module)
    i = n.index(className)
    c = getAvailableClassesInModule(module)
    return c[i]
1136446
def get_provider(moduleOrReq):
    """"""
    if isinstance(moduleOrReq, Requirement):
        return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
    try:
        module = sys.modules[moduleOrReq]
    except KeyError:
        __import__(moduleOrReq)
        module = sys.modules[moduleOrReq]
    loader = getattr(module, '__loader__', None)
    return _find_adapter(_provider_factories, loader)(module)
670919
@Override
	public IModuleBuilder getModuleBuilder(String mid, IResource res) {
		IModuleBuilder builder = null;

		String path = res.getPath();
		int idx = path.lastIndexOf("."); //$NON-NLS-1$
		String ext = (idx == -1) ? "" : path.substring(idx+1); //$NON-NLS-1$
		if (ext.contains("/")) { //$NON-NLS-1$
			ext = ""; //$NON-NLS-1$
		}

		for (IAggregatorExtension extension : getExtensions(IModuleBuilderExtensionPoint.ID)) {
			String extAttrib = extension.getAttribute(IModuleBuilderExtensionPoint.EXTENSION_ATTRIBUTE);
			if (ext.equals(extAttrib) || "*".equals(extAttrib)) { //$NON-NLS-1$
				IModuleBuilder test = (IModuleBuilder)extension.getInstance();
				if (test.handles(mid, res)) {
					builder = test;
					break;
				}
			}
		}
		if (builder == null) {
			throw new UnsupportedOperationException(
					"No module builder for " + mid //$NON-NLS-1$
					);
		}
		return builder;

	}