Do a complete resolution lookup of an External Identifier
963839
def resolve(self, pubID, sysID):
        
        ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID)
        return ret
996347
def lookup_sig(cls, sigs, method_name, expr_args, stmt_or_expr, context):
        

        def synonymise(s):
            return s.replace('int128', 'num').replace('uint256', 'num')

        # for sig in sigs['self']
        full_sig = cls.get_full_sig(
            stmt_or_expr.func.attr,
            expr_args,
            None,
            context.custom_units,
            context.structs,
            context.constants,
        )
        method_names_dict = dict(Counter([x.split('(')[0] for x in context.sigs['self']]))
        if method_name not in method_names_dict:
            raise FunctionDeclarationException(
                "Function not declared yet (reminder: functions cannot "
                "call functions later in code than themselves): %s" % method_name
            )

        if method_names_dict[method_name] == 1:
            return next(
                sig
                for name, sig
                in context.sigs['self'].items()
                if name.split('(')[0] == method_name
            )
        if full_sig in context.sigs['self']:
            return context.sigs['self'][full_sig]
        else:
            synonym_sig = synonymise(full_sig)
            syn_sigs_test = [synonymise(k) for k in context.sigs.keys()]
            if len(syn_sigs_test) != len(set(syn_sigs_test)):
                raise Exception(
                    'Incompatible default parameter signature,'
                    'can not tell the number type of literal', stmt_or_expr
                )
            synonym_sigs = [(synonymise(k), v) for k, v in context.sigs['self'].items()]
            ssig = [s[1] for s in synonym_sigs if s[0] == synonym_sig]
            if len(ssig) == 0:
                raise FunctionDeclarationException(
                    "Function not declared yet (reminder: functions cannot "
                    "call functions later in code than themselves): %s" % method_name
                )
            return ssig[0]
37756
def _confirm_resolution(self, implemented_res):
        '''  '''

        assert self.ppd in implemented_res, \
            ' Resolution %d ppd not implemented yet\n.\
            Consider using one of the implemented resolutions %s'\
            % (self.ppd, ', '.join([f + ' ppd' for f in map(str, implemented_res)]))

        if self.ppd == 256:
            assert (np.abs(self.latM) < 60) and (np.abs(self.latm) < 60),\
                'This resolution is available in\n \
                in cylindrical geometry only for -60<latitude<60 '
123423
def get_mzid_specfile_ids(mzidfn, namespace):
    """"""
    sid_fn = {}
    for specdata in mzid_specdata_generator(mzidfn, namespace):
        sid_fn[specdata.attrib['id']] = specdata.attrib['name']
    return sid_fn
462767
def cache_call_signatures(source, user_pos, stmt):
    """"""
    index = user_pos[0] - 1
    lines = source.splitlines() or ['']
    if source and source[-1] == '\n':
        lines.append('')

    before_cursor = lines[index][:user_pos[1]]
    other_lines = lines[stmt.start_pos[0]:index]
    whole = '\n'.join(other_lines + [before_cursor])
    before_bracket = re.match(r'.*\(', whole, re.DOTALL)

    module_path = stmt.get_parent_until().path
    return None if module_path is None else (module_path, before_bracket, stmt.start_pos)
944828
def getIndicesFromInstId(self, instId):
        """"""
        if instId in self._idToIdxCache:
            return self._idToIdxCache[instId]

        indices = []
        for impliedFlag, modName, symName in self._indexNames:
            mibObj, = mibBuilder.importSymbols(modName, symName)
            try:
                syntax, instId = self.oidToValue(mibObj.syntax, instId, impliedFlag, indices)
            except PyAsn1Error as exc:
                debug.logger & debug.FLAG_INS and debug.logger(
                    'error resolving table indices at %s, %s: %s' % (self.__class__.__name__, instId, exc))
                indices = [instId]
                instId = ()
                break

            indices.append(syntax)  # to avoid cyclic refs

        if instId:
            raise error.SmiError(
                'Excessive instance identifier sub-OIDs left at %s: %s' %
                (self, instId)
            )

        indices = tuple(indices)
        self._idToIdxCache[instId] = indices

        return indices
444276
function resolveId(details, filepath) {
  let id = '';

  if ('string' == typeof filepath) {
    // Only version if more than one package
    const version = details.id.includes(versionDelimiter) ? versionDelimiter + details.version : '';
    const versioned = (id, stripExtension) => {
      // Strip extension
      if (stripExtension) id = id.replace(path.extname(id), '');
      return (process.platform == 'win32' ? id.replace(/\\/g, '/') : id) + version;
    };

    // Resolve aliases
    id = alias.resolve(filepath, details.aliases);
    // Ignore disabled (false)
    id = id || filepath;
    // Return if resolved id
    if (!isFilepath(id)) return versioned(id, false);
    // Resolve alias to id (also handles main => id)
    id = alias.resolveReverse(id, details.aliases);
    // Return if resolved id
    if (!isFilepath(id)) return versioned(id, false);

    // Resolve ids from project root if nested project package
    const pkgpath = details.isNestedProjectPackage
      ? process.cwd()
      : // Resolve ids from node_modules root if npm package
        details.isNpmPackage ? details.dirname : details.pkgpath;

    [...details.paths, pkgpath].some(sourcepath => {
      if (filepath.includes(sourcepath)) {
        id = path.relative(sourcepath, filepath);
        return true;
      }
    });

    return versioned(id, true);
  }

  return id;
}
1298481
def _lookup_identity_names(self):
        
        id_batch_size = 100

        # fetch in batches of 100, store in a dict
        ac = get_auth_client()
        self._resolved_map = {}
        for i in range(0, len(self.identity_ids), id_batch_size):
            chunk = self.identity_ids[i : i + id_batch_size]
            resolved_result = ac.get_identities(ids=chunk)
            for x in resolved_result["identities"]:
                self._resolved_map[x["id"]] = x["username"]
244564
function lookForExternalDependenciesRES( _def, resources, depFile ) {
  if ( !_def ) return;
  try {
    const def = convertExternalDependencyDefinition( _def );
    for ( const dep of Object.keys( def ) ) {
      if ( def[ dep ] === "" ) {
        // `res: { "bob/foo.png": "" }` is equivalent to
        // `res: { "bob/foo.png": "bob/foo.png" }`
        def[ dep ] = dep;
      }
      const
      srcDep = Project.srcOrLibPath( `mod/${dep}` ) ||
        Project.srcOrLibPath( dep );
      if ( !srcDep ) {
        Fatal.fire(
          `Unable to find dependency file "${dep}" nor "mod/${dep}"!`,
          depFile.getAbsoluteFilePath()
        );
      }
      resources[ srcDep ] = Project.wwwPath( def[ dep ] );
    }
  } catch ( ex ) {
    Fatal.fire(
      `Unable to parse RES dependencies: ${JSON.stringify(_def)}!\n${ex}`,
      depFile
    );
  }
}
1118467
def resolve(identifier)
      return identifier if identifier.is_a?(Class)
      if constant = identifiers[identifier]
        return constant
      end

      constant = resolve_class(identifier)
      unless constant
        constant = resolve_identifier(identifier)
      end
      identifiers[identifier] = constant
    end
437390
def _make_identifier(string):
        """"""
        string = re.sub(r"[ \-+/\\*%&$£#@.,;:'" "?<>]", "_", string)
        if re.match(r"^\d", string):
            string = "a_{0}".format(string)
        return string
620607
def p_export(self, p):
        ''''''
        # unlikely case: the IDENTIFIER is an otherwise reserved name
        if len(p) > 2:
            sigs = p[3] or ((),)
        else:
            sigs = ()
        p[0] = p[1], sigs
1047235
def _external2internal_func(bounds):
    
    ls = [_external2internal_lambda(b) for b in bounds]

    def convert_e2i(xe):
        xi = empty_like(xe)
        xi[:] = [l(p) for l, p in zip(ls, xe)]
        return xi

    return convert_e2i
1303269
def extern_store_i64(self, context_handle, i64):
    """"""
    c = self._ffi.from_handle(context_handle)
    return c.to_value(i64)
1065744
function getExportSpecifierLocalTargetSymbol(node) {
            return node.parent.parent.moduleSpecifier ?
                getExternalModuleMember(node.parent.parent, node) :
                resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 8388608 /* Alias */);
        }
873984
public static int getIdentifier(String name) {
        Resources res = Resources.getSystem();
        return res.getIdentifier(name, TYPE_ID, NATIVE_PACKAGE);
    }
247091
function ReferencedIdentifier(_ref2) {
      */var node = _ref2.node;
      */var scope = _ref2.scope;

      if (node.name === "exports" && !scope.getBinding("exports")) {
        this.hasExports = true;
      }

      if (node.name === "module" && !scope.getBinding("module")) {
        this.hasModule = true;
      }
    }