Get a citation object by its type and reference.
540665
def get_citation_by_reference(self, type: str, reference: str) -> Optional[Citation]:
        """"""
        citation_hash = hash_citation(type=type, reference=reference)
        return self.get_citation_by_hash(citation_hash)
805988
def _get_type(self, obj):
        """"""
        typever = obj['Type']
        typesplit = typever.split('.')
        return typesplit[0] + '.' + typesplit[1]
1115042
def typename(obj):
    """"""
    if hasattr(obj, '__class__'):
        return getattr(obj, '__class__').__name__
    else:
        return type(obj).__name__
602604
def get_obj(ref):
    """"""
    oid = int(ref)
    return server.id2ref.get(oid) or server.id2obj[oid]
833310
def fetch_object(self, doc_id):
        """"""
        try:
            return self.object_class.objects.get(pk=doc_id)
        except self.object_class.DoesNotExist:
            raise ReferenceNotFoundError
623015
def reference_index(self, ref_id):
        """"""
        try:
            indexes = range(self.reference_count())
            return next(i for i in indexes if self.reference_id(i) == ref_id)
        except StopIteration as e:
            raise ReferenceNotFoundError("ID: " + ref_id) from e
1033308
def citedby_url(self):
        """"""
        cite_link = self.coredata.find('link[@rel="scopus-citedby"]', ns)
        try:
            return cite_link.get('href')
        except AttributeError:  # cite_link is None
            return None
226131
def get_object_or_child_by_type(self, *types):
        

        objects = self.get_objects_or_children_by_type(*types)
        return objects[0] if any(objects) else None
1082196
def _get_object(data, position, obj_end, opts):
    """"""
    obj_size = _UNPACK_INT(data[position:position + 4])[0]
    end = position + obj_size - 1
    if data[end:position + obj_size] != b"\x00":
        raise InvalidBSON("bad eoo")
    if end >= obj_end:
        raise InvalidBSON("invalid object length")
    obj = _elements_to_dict(data, position + 4, end, opts, subdocument=True)

    position += obj_size
    if "$ref" in obj:
        return (DBRef(obj.pop("$ref"), obj.pop("$id", None),
                      obj.pop("$db", None), obj), position)
    return obj, position
297382
def get_object(request, pid):
    """"""
    sciobj = d1_gmn.app.models.ScienceObject.objects.get(pid__did=pid)
    content_type_str = d1_gmn.app.object_format_cache.get_content_type(
        sciobj.format.format
    )
    # Return local or proxied SciObj bytes
    response = django.http.StreamingHttpResponse(
        _get_sciobj_iter(sciobj), content_type_str
    )
    d1_gmn.app.views.headers.add_sciobj_properties_headers_to_response(response, sciobj)
    d1_gmn.app.event_log.log_read_event(pid, request)
    return response
836291
def _doc_object(obj, obj_type, nest=None, config=default_config):
    """"""
    doc = inspect.getdoc(obj)

    if not doc and not nest:
        return None

    result = {
        'type': obj_type,
        'name': obj.__name__,
        'doc': doc
    }

    if nest:
        result['nest'] = nest

    return result
51426
def get_type_by_descriptor(descriptor):
        
        if descriptor == None:
            raise Exception("Type descriptor cannot be null")

        return TypeReflector.get_type(descriptor.get_name(), descriptor.get_library())
1149219
def get_edge_citation(self, u: BaseEntity, v: BaseEntity, key: str) -> Optional[CitationDict]:
        """"""
        return self._get_edge_attr(u, v, key, CITATION)
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
17036
def get(cls, object_version, key):
        """"""
        return cls.query.filter_by(
            version_id=as_object_version_id(object_version),
            key=key,
        ).one_or_none()
1211459
def get_reference(self, rtype: str, label: str):
        

        # We are doing this instead of dictionary access in case we change
        # the storage later to a multidict thingy for optimization.

        reftype = self.data.get(rtype)
        if reftype:
            # The reftype might be "python" or "sphinx" or something else
            # from an Intersphinx registry, not something internal to
            # Kaybee.
            return reftype[label]
140982
def get_reference_templates(self, ref_types):
        """"""
        return OrderedDict([(x, self.get_reference_template(x)) for x in ref_types])