Get an object directly from plasma without going through object table.

    Precondition: plasma_prefetch(object_id) has been called before.
342426
def plasma_get(object_id):
    
    client = ray.worker.global_worker.plasma_client
    plasma_id = ray.pyarrow.plasma.ObjectID(object_id)
    while not client.contains(plasma_id):
        pass
    return client.get(plasma_id)
833310
def fetch_object(self, doc_id):
        """"""
        try:
            return self.object_class.objects.get(pk=doc_id)
        except self.object_class.DoesNotExist:
            raise ReferenceNotFoundError
248330
def _get(app, endpoint, id=None, auth_required=False, **kwargs):
    '''
    
    '''
    nb = _nb_obj(auth_required=auth_required)
    if id:
        item = getattr(getattr(nb, app), endpoint).get(id)
    else:
        kwargs = __utils__['args.clean_kwargs'](**kwargs)
        item = getattr(getattr(nb, app), endpoint).get(**kwargs)
    return item
587345
def get_object(conn, binding_name, object_cls):
        
        try:
            obj = conn.rootContext.resolve(binding_name)
            narrowed = obj._narrow(object_cls)
        except CORBA.TRANSIENT:
            raise IOError('Attempt to retrieve object failed')

        if narrowed is None:
            raise IOError('Attempt to retrieve object got a different class of object')

        return narrowed
337260
def get_referenced_object(self):
        

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

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

        raise exception.BunqException(self._ERROR_NULL_FIELDS)
241302
def get_prefetch_queryset(self, instances, queryset=None):
        
        if queryset is None:
            queryset = self.get_queryset()
        queryset._add_hints(instance=instances[0])

        # CleanerVersion change 1: force the querytime to be the same as the
        # prefetched-for instance.
        # This is necessary to have reliable results and avoid extra queries
        # for cache misses when accessing the child objects from their
        # parents (e.g. choice.poll).
        instance_querytime = instances[0]._querytime
        if instance_querytime.active:
            if queryset.querytime.active and \
                            queryset.querytime.time != instance_querytime.time:
                raise ValueError(
                    "A Prefetch queryset that specifies an as_of time must "
                    "match the as_of of the base queryset.")
            else:
                queryset.querytime = instance_querytime

        # CleanerVersion change 2: make rel_obj_attr return a tuple with
        # the object's identity.
        # rel_obj_attr = self.field.get_foreign_related_value
        def versioned_fk_rel_obj_attr(versioned_rel_obj):
            return versioned_rel_obj.identity,

        rel_obj_attr = versioned_fk_rel_obj_attr
        instance_attr = self.field.get_local_related_value
        instances_dict = {instance_attr(inst): inst for inst in instances}
        # CleanerVersion change 3: fake the related field so that it provides
        # a name of 'identity'.
        # related_field = self.field.foreign_related_fields[0]
        related_field = namedtuple('VersionedRelatedFieldTuple', 'name')(
            'identity')

        # FIXME: This will need to be revisited when we introduce support for
        # composite fields. In the meantime we take this practical approach to
        # solve a regression on 1.6 when the reverse manager in hidden
        # (related_name ends with a '+'). Refs #21410.
        # The check for len(...) == 1 is a special case that allows the query
        # to be join-less and smaller. Refs #21760.
        if self.field.remote_field.is_hidden() or len(
                self.field.foreign_related_fields) == 1:
            query = {'%s__in' % related_field.name: set(
                instance_attr(inst)[0] for inst in instances)}
        else:
            query = {'%s__in' % self.field.related_query_name(): instances}
        queryset = queryset.filter(**query)

        # Since we're going to assign directly in the cache,
        # we must manage the reverse relation cache manually.
        if not self.field.remote_field.multiple:
            rel_obj_cache_name = self.field.remote_field.get_cache_name()
            for rel_obj in queryset:
                instance = instances_dict[rel_obj_attr(rel_obj)]
                setattr(rel_obj, rel_obj_cache_name, instance)

        if VERSION[:1] < (2,):
            return (queryset, rel_obj_attr, instance_attr, True,
                    self.field.get_cache_name())
        else:
            return (queryset, rel_obj_attr, instance_attr, True,
                    self.field.get_cache_name(), False)
1048797
def fetch_object_from_db_by_pk(self,
                                   obj: Any,
                                   table: str,
                                   fieldlist: Sequence[str],
                                   pkvalue: Any) -> bool:
        """"""
        if pkvalue is None:
            blank_object(obj, fieldlist)
            return False
        row = self.fetchone(
            get_sql_select_all_non_pk_fields_by_pk(table, fieldlist,
                                                   self.get_delims()),
            pkvalue
        )
        if row is None:
            blank_object(obj, fieldlist)
            return False
        setattr(obj, fieldlist[0], pkvalue)  # set PK value of obj
        assign_from_list(obj, fieldlist[1:], row)  # set non-PK values of obj
        return True
239631
def get_object(self, queryset=None):
        
        if self._cached_object is None:
            self._cached_object = super(EntryCacheMixin, self).get_object(
                queryset)
        return self._cached_object
945260
def get_object(table, id=None, condition=None, cache=False, fields=None, use_local=False,
               engine_name=None, session=None):
    
    from uliweb import functions, settings
    
    model = get_model(table, engine_name)
        
    #if id is an object of Model, so get the real id value
    if isinstance(id, Model):
        return id
      
    if cache:
        if use_local:
            s = get_session(session)
            key = get_object_id(s.engine_name, model.tablename, id)
            value = s.get_local_cache(key)
            if value:
                return value
        obj = model.get(id, condition=condition, fields=fields, cache=True)
        if use_local:
            value = s.get_local_cache(key, obj)
    else:
        obj = model.get(id, condition=condition, fields=fields)
    
    return obj
1320136
def get(self, transaction=None):
        """"""
        warnings.warn(
            "'Query.get' is deprecated:  please use 'Query.stream' instead.",
            DeprecationWarning,
            stacklevel=2,
        )
        return self.stream(transaction=transaction)
1323615
def get_object_by_natural_key(self, app_label, model_name, object_id):
        
        try:
            model_type = ContentType.objects.get_by_natural_key(app_label, model_name)
        except ContentType.DoesNotExist:
            return None

        # Pointless to fetch the object, if there is no URL to generate
        # Avoid another database query.
        ModelClass = model_type.model_class()
        if not hasattr(ModelClass, 'get_absolute_url'):
            return None

        try:
            return model_type.get_object_for_this_type(pk=object_id)
        except ObjectDoesNotExist:
            return None
929279
def fetch_all_objects_from_db_by_pklist(self,
                                            cls: Type,
                                            table: str,
                                            fieldlist: Sequence[str],
                                            pklist: Sequence[Any],
                                            construct_with_pk: bool,
                                            *args) -> List[T]:
        """"""
        objarray = []
        for pk in pklist:
            if construct_with_pk:
                obj = cls(pk, *args)  # should do its own fetching
            else:
                obj = cls(*args)
                self.fetch_object_from_db_by_pk(obj, table, fieldlist, pk)
            objarray.append(obj)
        return objarray
1350074
def getobject_use_prevfield(idf, idfobject, fieldname):
    """"""
    if not fieldname.endswith("Name"):
        return None
    # test if prevfieldname ends with "Object_Type"
    fdnames = idfobject.fieldnames
    ifieldname = fdnames.index(fieldname)
    prevfdname = fdnames[ifieldname - 1]
    if not prevfdname.endswith("Object_Type"):
        return None
    objkey = idfobject[prevfdname].upper()
    objname = idfobject[fieldname]
    try:
        foundobj = idf.getobject(objkey, objname)
    except KeyError as e:
        return None
    return foundobj
163172
def get(cls, id_):
        """"""
        with db.session.no_autoflush:
            query = cls.dbmodel.query.filter_by(id=id_)
            try:
                model = query.one()
            except NoResultFound:
                raise WorkflowsMissingObject("No object for for id {0}".format(
                    id_
                ))
            return cls(model)
455102
def get_object_by_record(record):
    

    # nothing to do here
    if not record:
        return None

    if record.get("uid"):
        return get_object_by_uid(record["uid"])
    if record.get("path"):
        return get_object_by_path(record["path"])
    if record.get("parent_path") and record.get("id"):
        path = "/".join([record["parent_path"], record["id"]])
        return get_object_by_path(path)

    logger.warn("get_object_by_record::No object found! record='%r'" % record)
    return None
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()
801890
def _get_current_object(self):
        
        if not hasattr(self.__local, '__release_local__'):
            return self.__local()
        try:
            return getattr(self.__local, self.__name__)
        except AttributeError:
            raise RuntimeError('no object bound to %s' % self.__name__)