Look up PackageDoc by qualified name.
425923
public PackageDocImpl lookupPackage(String name) {
        //### Jing alleges that class check is needed
        //### to avoid a compiler bug.  Most likely
        //### instead a dummy created for error recovery.
        //### Should investigate this.
        Name nameImpl = names.fromString(name);
        ModuleSymbol mod = syms.inferModule(nameImpl);
        PackageSymbol p = mod != null ? syms.getPackage(mod, nameImpl) : null;
        ClassSymbol c = getClassSymbol(name);
        if (p != null && c == null) {
            return getPackageDoc(p);
        } else {
            return null;
        }
    }
958079
function findFilesWithPlaceholders(packageDir) {
  const findCommand = buildPlaceholderFindCommand(packageDir);
  return spawnSync(findCommand.binary, findCommand.args).stdout
    .toString()
    .split(/[\n\r]/)
    .filter(String);
}
305928
def _find_package(parts):
    """"""
    for i in range(len(parts), 0, -1):
        prefix = '.'.join(parts[0:i])
        if prefix in sys.modules:
            return i, sys.modules[prefix]
    return 0, None
378028
def FindByName(cls, name):
        """"""

        reg = ComponentRegistry()
        for _, entry in reg.load_extensions('iotile.auth_provider', name_filter=name):
            return entry
243787
private String determineQualifiedName(String name, CompilationUnit from) {
        if (from != null) {
            // Determine qualified name as being relative to "from"

            String fromName = from.getName();
            int index = fromName.lastIndexOf('.');
            if (index >= 0) {
                String qual = fromName.substring(0, index + 1) + name;
                if (sourceExists(qual)) {
                    return qual;
                }
            }
        }

        if (sourceExists(name)) {
            return name;
        }

        return null;
    }
826218
def search_typedef(stmt, name):
    """"""
    mod = stmt.i_orig_module
    while stmt is not None:
        if name in stmt.i_typedefs:
            t = stmt.i_typedefs[name]
            if (mod is not None and
                mod != t.i_orig_module and
                t.i_orig_module.keyword == 'submodule'):
                # make sure this submodule is included
                if mod.search_one('include', t.i_orig_module.arg) is None:
                    return None
            return t
        stmt = stmt.parent
    return None
99658
def _resolve_name(name, package, level):
    """"""
    if not hasattr(package, 'rindex'):
        raise ValueError("'package' not set to a string")
    dot = len(package)
    for x in xrange(level, 1, -1):
        try:
            dot = package.rindex('.', 0, dot)
        except ValueError:
            raise ValueError("attempted relative import beyond top-level "
                              "package")
    return "%s.%s" % (package[:dot], name)
887095
def qualified_name(self):
        ''''''
        return '{0}.{1}#{2}'.format(self.module.name, self.struct.name, self.name)
116415
def look_up(name):
    """"""
    path = name.split('.')
    module = import_module('.'.join(path[:-1]))
    return getattr(module, path[-1])
987285
def interface_lookup(interfaces, hwaddr, address_type):
    """"""
    for interface in interfaces.values():
        if interface.get('hwaddr') == hwaddr:
            for address in interface.get('addrs'):
                if address.get('type') == address_type:
                    return address.get('addr')
133197
private void detectPackageName(final Warning warning) {
        if (!warning.hasPackageName()) {
            warning.setPackageName(PackageDetectors.detectPackageName(warning.getFileName()));
        }
    }
91821
public Content getPackageName(PackageDoc packageDoc) {
        return packageDoc == null || packageDoc.name().length() == 0 ?
            defaultPackageLabel :
            getPackageLabel(packageDoc.name());
    }
461495
public static void checkPackageAccess(String name) {
        SecurityManager s = System.getSecurityManager();
        if (s != null) {
            String cname = name.replace('/', '.');
            if (cname.startsWith("[")) {
                int b = cname.lastIndexOf('[') + 2;
                if (b > 1 && b < cname.length()) {
                    cname = cname.substring(b);
                }
            }
            int i = cname.lastIndexOf('.');
            if (i != -1) {
                s.checkPackageAccess(cname.substring(0, i));
            }
        }
    }
1364176
function guessAppName (compilerWorkingDirectory) {
  var packageJson = path.resolve(compilerWorkingDirectory, 'package.json');
  if (!fs.existsSync(packageJson)) {
    packageJson = path.resolve(compilerWorkingDirectory, '../package.json');
    if (!fs.existsSync(packageJson)) {
      return 'Webpack App';
    }
  }
  return JSON.parse(fs.readFileSync(packageJson)).name;
}
1083566
def find(name):
    """"""

    if op.exists(name):
        return name

    path = op.dirname(__file__) or '.'

    paths = [path] + config['include_path']

    for path in paths:
        filename = op.abspath(op.join(path, name))
        if op.exists(filename):
            return filename

        for d in os.listdir(path):
            fullpath = op.abspath(op.join(path, d))
            if op.isdir(fullpath):
                filename = op.abspath(op.join(fullpath, name))
                if op.exists(filename):
                    return filename

    return None
1145155
def get(self, name):
    """"""
    resolvable, packages, parent, constraint_only = self._collapse().get(
        self.normalize(name), _ResolvedPackages.empty())
    return packages
778617
def get_enclosed_object(self):
        """"""
        if self._enclosed_object is None:
            enclosed_object_id = self.get_enclosed_object_id()
            package_name = enclosed_object_id.get_identifier_namespace().split('.')[0]
            obj_name = enclosed_object_id.get_identifier_namespace().split('.')[1]
            mgr = self.my_osid_object._get_provider_manager(package_name.upper())
            try:
                lookup_session = getattr(mgr, 'get_' + obj_name.lower() + '_lookup_session')(self.my_osid_object._proxy)
            except TypeError:
                lookup_session = getattr(mgr, 'get_' + obj_name.lower() + '_lookup_session')()
            getattr(lookup_session, 'use_federated_' + CATALOG_LOOKUP[package_name] + '_view')()
            self._enclosed_object = getattr(
                lookup_session, 'get_' + obj_name.lower())(enclosed_object_id)
        return self._enclosed_object