Lookups the object that was used for creating the reference.
517646
def lookup(self, opaque_ref):
        
        opaque_ref_value = self._get_reference_value(opaque_ref)
        # check local refs
        if opaque_ref_value in self.local_refs:
            return self.local_refs[opaque_ref_value]
        # check global refs
        if opaque_ref_value in self.global_refs:
            return self.global_refs[opaque_ref_value]
        raise KeyError("Unknown JNI reference %d. Local references: %s Global references: %s"
                       % (opaque_ref_value, self.local_refs, self.global_refs))
261404
function resolveReferences() {

    var elementsById = context.elementsById;
    var references = context.references;

    var i, r;

    for (i = 0; (r = references[i]); i++) {
      var element = r.element;
      var reference = elementsById[r.id];
      var property = getModdleDescriptor(element).propertiesByName[r.property];

      if (!reference) {
        context.addWarning({
          message: 'unresolved reference <' + r.id + '>',
          element: r.element,
          property: r.property,
          value: r.id
        });
      }

      if (property.isMany) {
        var collection = element.get(property.name),
            idx = collection.indexOf(r);

        // we replace an existing place holder (idx != -1) or
        // append to the collection instead
        if (idx === -1) {
          idx = collection.length;
        }

        if (!reference) {
          // remove unresolvable reference
          collection.splice(idx, 1);
        } else {
          // add or update reference in collection
          collection[idx] = reference;
        }
      } else {
        element.set(property.name, reference);
      }
    }
  }
423772
def lookup_object(model, object_id, slug, slug_field):
    
    lookup_kwargs = {}
    if object_id:
        lookup_kwargs['%s__exact' % model._meta.pk.name] = object_id
    elif slug and slug_field:
        lookup_kwargs['%s__exact' % slug_field] = slug
    else:
        raise GenericViewError(
            "Generic view must be called with either an object_id or a"
            " slug/slug_field.")
    try:
        return model.objects.get(**lookup_kwargs)
    except ObjectDoesNotExist:
        raise Http404("No %s found for %s"
                      % (model._meta.verbose_name, lookup_kwargs))
1107164
function findReference(scope, node) {
    const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] &&
            reference.identifier.range[1] === node.range[1]);

    if (references.length === 1) {
        return references[0];
    }
    return null;
}
536536
def reference(self):
        
        ref = ModelReference()
        ref._proto = self._proto.model_reference
        return ref
406411
Reference<T> lookupReference(String name, boolean isLongName) {
    if (isLongName) {
      for (Reference<T> r : referenceMap.values()) {
        if (r.longName.equals(name)) {
          return r;
        }
      }
      return null;
    }
    return referenceMap.get(name);
  }
1196808
def addReference(self, reference):
        
        id_ = reference.getId()
        self._referenceIdMap[id_] = reference
        self._referenceNameMap[reference.getLocalId()] = reference
        self._referenceIds.append(id_)
919663
def get_referenced_object(self):
        

        if self._BillingInvoice is not None:
            return self._BillingInvoice

        if self._DraftPayment is not None:
            return self._DraftPayment

        if self._MasterCardAction is not None:
            return self._MasterCardAction

        if self._Payment is not None:
            return self._Payment

        if self._PaymentBatch is not None:
            return self._PaymentBatch

        if self._RequestResponse is not None:
            return self._RequestResponse

        if self._ScheduleInstance is not None:
            return self._ScheduleInstance

        if self._TabResultResponse is not None:
            return self._TabResultResponse

        if self._WhitelistResult is not None:
            return self._WhitelistResult

        raise exception.BunqException(self._ERROR_NULL_FIELDS)
942311
def fetch_object(self, model_id):
        """"""
        pk_field_instance = getattr(self.object_class, self.pk_field)
        qs = self.object_class.query.filter(pk_field_instance == model_id)
        model = qs.one_or_none()
        if not model:
            raise ReferenceNotFoundError
        return model
993402
Reference getReference() {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "getReference");
        }

        // Create a reference object describing this class
        final Reference reference = new Reference(getConnectionType(),
                        getClass().getName(), null);

        // Make sure no-one can pull the rug from beneath us.
        synchronized (_properties) {

            // Convert the map of properties into an encoded form, where the
            // keys have the necessary prefix on the front, and the values are
            // all Strings.
            final Map encodedMap = JmsJcaReferenceUtils.getInstance()
                            .getStringEncodedMap(_properties, defaultJNDIProperties);

            // Now turn the encoded map into the reference items.
            for (final Iterator iterator = encodedMap.entrySet().iterator(); iterator
                            .hasNext();) {

                final Map.Entry entry = (Map.Entry) iterator.next();
                final String prefixedKey = (String) entry.getKey();
                final String stringForm = (String) entry.getValue();

                // Store the prefixed key and value in string form.
                reference.add(new StringRefAddr(prefixedKey, stringForm));

            }

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(TRACE, "getReference", reference);
        }
        return reference;

    }
417454
def referencesGenerator(self, request):
        
        referenceSet = self.getDataRepository().getReferenceSet(
            request.reference_set_id)
        results = []
        for obj in referenceSet.getReferences():
            include = True
            if request.md5checksum:
                if request.md5checksum != obj.getMd5Checksum():
                    include = False
            if request.accession:
                if request.accession not in obj.getSourceAccessions():
                    include = False
            if include:
                results.append(obj)
        return self._objectListGenerator(request, results)
454008
def _lookup(cls: str) -> LdapObjectClass:
    
    if isinstance(cls, str):
        module_name, _, name = cls.rpartition(".")
        module = importlib.import_module(module_name)
        try:
            cls = getattr(module, name)
        except AttributeError:
            raise AttributeError("%s reference cannot be found" % cls)
    return cls
1101552
def reference(self):
    
    if self.__reference is None:
      self.__reference = _ConstructReference(self.__class__,
                                             pairs=self.__pairs,
                                             app=self.__app,
                                             namespace=self.__namespace)
    return self.__reference
407542
def _add_reference(self, obj, ident=0):
        
        log_debug(
            "## New reference handle 0x{0:X}: {1} -> {2}".format(
                len(self.references) + self.BASE_REFERENCE_IDX,
                type(obj).__name__,
                repr(obj),
            ),
            ident,
        )
        self.references.append(obj)
973718
public void retrieveReference(Object pInstance, String pAttributeName) throws PersistenceBrokerException
    {
        if (logger.isDebugEnabled())
        {
        	logger.debug("Retrieving reference named ["+pAttributeName+"] on object of type ["+
        	            pInstance.getClass().getName()+"]");
        }
        ClassDescriptor cld = getClassDescriptor(pInstance.getClass());
        CollectionDescriptor cod = cld.getCollectionDescriptorByName(pAttributeName);
        getInternalCache().enableMaterializationCache();
        // to avoid problems with circular references, locally cache the current object instance
        Identity oid = serviceIdentity().buildIdentity(pInstance);
        boolean needLocalRemove = false;
        if(getInternalCache().doLocalLookup(oid) == null)
        {
            getInternalCache().doInternalCache(oid, pInstance, MaterializationCache.TYPE_TEMP);
            needLocalRemove = true;
        }
        try
        {
            if (cod != null)
            {
                referencesBroker.retrieveCollection(pInstance, cld, cod, true);
            }
            else
            {
                ObjectReferenceDescriptor ord = cld.getObjectReferenceDescriptorByName(pAttributeName);
                if (ord != null)
                {
                    referencesBroker.retrieveReference(pInstance, cld, ord, true);
                }
                else
                {
                    throw new PersistenceBrokerException("did not find attribute " + pAttributeName +
                            " for class " + pInstance.getClass().getName());
                }
            }
            // do locally remove the object to avoid problems with object state detection (insert/update),
            // because objects found in the cache detected as 'old' means 'update'
            if(needLocalRemove) getInternalCache().doLocalRemove(oid);
            getInternalCache().disableMaterializationCache();
        }
        catch(RuntimeException e)
        {
            getInternalCache().doLocalClear();
            throw e;
        }
    }
952996
def find(self, name, required):
        
        if name == None:
            raise Exception("Name cannot be null")
        
        locator = self._locate(name)
        if locator == None:
            if required:
                raise ReferenceException(None, name)
            return None
        
        return self._references.find(locator, required)
650269
def lookup(cls, basenote):
        """"""
        # Walk method resolution order, which includes current class.
        for c in cls.mro():
            if 'provider_registry' not in vars(c):
                # class is a mixin, super to base class, or never registered.
                continue
            if basenote in c.provider_registry:
                # note is in the registry.
                return c.provider_registry[basenote]
        raise LookupError(repr(basenote))