Look for any references, without object type

        This always searches in "refspecific" mode
175656
def resolve_any_xref(self, env, fromdocname, builder, target,
                         node, contnode):
        
        prefix = node.get('dn:prefix')
        results = []

        match = self.find_obj(env, prefix, target, None, 1)
        if match is not None:
            (name, obj) = match
            results.append(('dn:' + self.role_for_objtype(obj[1]),
                            make_refnode(builder, fromdocname, obj[0], name, contnode,
                                         name)))
        return results
466994
def get_external_references(self):
        
        for ext_ref_node in self.node.findall('externalRef'):
            ext_refs_obj = CexternalReference(ext_ref_node)
            for ref in ext_refs_obj:
                yield ref
1354686
public static Object getThis(Object ref) {
        Object thisValue = null;

        // FIXME: We can probably remove this check for IRJSFunctions since we will not be using references
        if (ref instanceof Reference) {
            if (((Reference) ref).isPropertyReference()) {
                thisValue = ((Reference) ref).getBase();
            } else {
                thisValue = ((EnvironmentRecord) ((Reference) ref).getBase()).implicitThisValue();
            }
        }
        return thisValue;
    }
1318095
function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) {
                var sourceFile = container.getSourceFile();
                var start = findInComments ? container.getFullStart() : container.getStart();
                var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, start, container.getEnd());
                if (possiblePositions.length) {
                    // Build the set of symbols to search for, initially it has only the current symbol
                    var searchSymbols_1 = populateSearchSymbolSet(searchSymbol, searchLocation);
                    ts.forEach(possiblePositions, function (position) {
                        cancellationToken.throwIfCancellationRequested();
                        var referenceLocation = ts.getTouchingPropertyName(sourceFile, position);
                        if (!isValidReferencePosition(referenceLocation, searchText)) {
                            // This wasn't the start of a token.  Check to see if it might be a
                            // match in a comment or string if that's what the caller is asking
                            // for.
                            if ((findInStrings && ts.isInString(sourceFile, position)) ||
                                (findInComments && ts.isInNonReferenceComment(sourceFile, position))) {
                                // In the case where we're looking inside comments/strings, we don't have
                                // an actual definition.  So just use 'undefined' here.  Features like
                                // 'Rename' won't care (as they ignore the definitions), and features like
                                // 'FindReferences' will just filter out these results.
                                result.push({
                                    definition: undefined,
                                    references: [{
                                            fileName: sourceFile.fileName,
                                            textSpan: ts.createTextSpan(position, searchText.length),
                                            isWriteAccess: false,
                                            isDefinition: false
                                        }]
                                });
                            }
                            return;
                        }
                        if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) {
                            return;
                        }
                        var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation);
                        if (referenceSymbol) {
                            var referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
                            var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
                            var relatedSymbol = getRelatedSymbol(searchSymbols_1, referenceSymbol, referenceLocation);
                            if (relatedSymbol) {
                                var referencedSymbol = getReferencedSymbol(relatedSymbol);
                                referencedSymbol.references.push(getReferenceEntryFromNode(referenceLocation));
                            }
                            else if (!(referenceSymbol.flags & 67108864 /* Transient */) && searchSymbols_1.indexOf(shorthandValueSymbol) >= 0) {
                                var referencedSymbol = getReferencedSymbol(shorthandValueSymbol);
                                referencedSymbol.references.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name));
                            }
                        }
                    });
                }
                return;
                function getReferencedSymbol(symbol) {
                    var symbolId = ts.getSymbolId(symbol);
                    var index = symbolToIndex[symbolId];
                    if (index === undefined) {
                        index = result.length;
                        symbolToIndex[symbolId] = index;
                        result.push({
                            definition: getDefinition(symbol),
                            references: []
                        });
                    }
                    return result[index];
                }
            }
1304090
def _find_toc_node(toc, ref_id, objtype):
    
    for check_node in toc.traverse(nodes.reference):
        if objtype == nodes.section and (
            check_node.attributes["refuri"] == ref_id
            or check_node.attributes["anchorname"] == "#" + ref_id
        ):
            return check_node
        if (
            objtype == addnodes.desc
            and check_node.attributes["anchorname"] == "#" + ref_id
        ):
            return check_node
    return None
1357864
def get_ref(self, reftype, index):
        """"""
        try:
            got_reftype, data = self.refs[int(index)]
        except (IndexError, ValueError):
            raise CoconutInternalException("no reference at invalid index", index)
        internal_assert(got_reftype == reftype, "wanted " + reftype + " reference; got " + got_reftype + " reference")
        return data
485491
def _is_reference(bpe):
    """"""
    if isinstance(bpe, _bp('ProteinReference')) or \
        isinstance(bpe, _bpimpl('ProteinReference')) or \
        isinstance(bpe, _bp('SmallMoleculeReference')) or \
        isinstance(bpe, _bpimpl('SmallMoleculeReference')) or \
        isinstance(bpe, _bp('RnaReference')) or \
        isinstance(bpe, _bpimpl('RnaReference')) or \
        isinstance(bpe, _bp('EntityReference')) or \
        isinstance(bpe, _bpimpl('EntityReference')):
        return True
    else:
        return False
694009
def is_job_ref(thing, reftype=dict):
    '''
    
    '''
    return isinstance(thing, reftype) and \
        ((len(thing) == 2 and \
              isinstance(thing.get('field'), basestring) and \
              isinstance(thing.get('job'), basestring)) or \
             (len(thing) == 1 and \
                  isinstance(thing.get('$dnanexus_link'), reftype) and \
                  isinstance(thing['$dnanexus_link'].get('field'), basestring) and \
                  isinstance(thing['$dnanexus_link'].get('job'), basestring)))
657654
function findReferences(schema) {
  if (schema.$ref) {
    return [schema.$ref];
  }

  let references = [];

  if (schema.allOf) {
    references = references.concat(...schema.allOf.map(findReferences));
  }

  if (schema.anyOf) {
    references = references.concat(...schema.anyOf.map(findReferences));
  }

  if (schema.oneOf) {
    references = references.concat(...schema.oneOf.map(findReferences));
  }

  if (schema.not) {
    references = references.concat(...findReferences(schema.not));
  }

  // Array

  if (schema.items) {
    if (Array.isArray(schema.items)) {
      references = references.concat(...schema.items.map(findReferences));
    } else {
      references = references.concat(findReferences(schema.items));
    }
  }

  if (schema.additionalItems && typeof schema.additionalItems === 'object') {
    references = references.concat(findReferences(schema.additionalItems));
  }

  // Object

  if (schema.properties) {
    Object.keys(schema.properties).forEach((key) => {
      references = references.concat(findReferences(schema.properties[key]));
    });
  }

  if (schema.patternProperties) {
    Object.keys(schema.patternProperties).forEach((key) => {
      references = references.concat(findReferences(schema.patternProperties[key]));
    });
  }

  if (schema.additionalProperties && typeof schema.additionalProperties === 'object') {
    references = references.concat(findReferences(schema.additionalProperties));
  }

  return references;
}
477416
def resolve_ref(cls, domain, env, fromdocname, builder, typ, target, node,
                    contnode):
        
        # indexes appear to be automatically generated at doc DOMAIN-NAME
        todocname = "bb-%s" % target

        node = nodes.reference('', '', internal=True)
        node['refuri'] = builder.get_relative_uri(fromdocname, todocname)
        node['reftitle'] = cls.localname
        node.append(nodes.emphasis(cls.localname, cls.localname))
        return node
503932
def check_reference(images, reference):
    
    if not images.shape[1:] == reference.shape:
        raise Exception('Image shape %s and reference shape %s must match'
                        % (images.shape[1:], reference.shape))
    return reference
1055290
def _bse_cli_get_refs(args):
    ''''''
    return api.get_references(
        basis_name=args.basis, elements=args.elements, version=args.version, fmt=args.reffmt, data_dir=args.data_dir)
547690
function findResolver (reference, resolvers) {
  const refParts = reference.split(':')

  for (const resolver of resolvers) {
    if (resolver.canResolve(refParts)) {
      return resolver.resolver
    }
  }

  return null
}
407718
def _iter_refs(obj, named):
    '''
    '''
    r = _getreferents(obj)  # special case
    return _refs(r, named, itor=_nameof(obj) or 'iteref')
1248017
private void findReferences(ImmutableBean root) {
        // handle root bean
        classes.put(root.getClass(), classInfoFromMetaBean(root.metaBean(), root.getClass()));
        classSerializationCount.put(root.getClass(), 1);

        // recursively check object graph
        Map<Object, Integer> objects = new LinkedHashMap<>();
        findReferencesBean(root, root.getClass(), objects, null);

        // build up the list of references, but only for those instances that are repeated
        List<Map.Entry<Object, Integer>> refEntries = objects.entrySet().stream()
                .sorted(reverseOrder(comparingInt(Map.Entry::getValue)))
                .filter(entry -> entry.getValue() > 1)
                .collect(toList());
        for (Map.Entry<Object, Integer> entry : refEntries) {
            Object value = entry.getKey();
            Class<?> realType = value.getClass();

            // simple types do not need references
            if (realType != Integer.class &&
                    realType != Double.class &&
                    realType != Float.class &&
                    realType != Boolean.class &&
                    realType != Long.class &&
                    realType != Short.class &&
                    realType != Byte.class &&
                    realType != byte[].class) {

                refs.put(value, new Ref(false, refs.size()));
            }
        }
        
        // reorder classes so the most repeated serialized names have the lowest number (hence the shortest extension)
        this.classInfoList.addAll(classSerializationCount.entrySet().stream()
                .sorted(reverseOrder(comparingInt(Map.Entry::getValue)))
                .map(entry -> classes.get(entry.getKey()))
                .collect(toList()));

        // adjust the position in the ClassInfo instance
        for (int position = 0; position < classInfoList.size(); position++) {
            ClassInfo classInfo = classInfoList.get(position);
            classInfo.position = position;
        }
    }
207208
def get_versioned_references_for(self, instance):
        
        vrefs = []

        # Retrieve the referenced objects
        refs = instance.getRefs(relationship=self.relationship)

        ref_versions = getattr(instance, REFERENCE_VERSIONS, None)
        # No versions stored, return the original references
        if ref_versions is None:
            return refs

        for ref in refs:
            uid = api.get_uid(ref)
            # get the linked version to the reference
            version = ref_versions.get(uid)
            # append the versioned reference
            vrefs.append(self.retrieve_version(ref, version))

        return vrefs
115901
def runSearchReferenceSets(self, request):
        
        return self.runSearchRequest(
            request, protocol.SearchReferenceSetsRequest,
            protocol.SearchReferenceSetsResponse,
            self.referenceSetsGenerator)