def get(self, ident):
    "Return an instance based on the given primary key identifier,\n        or ``None`` if not found.\n\n        E.g.::\n\n            my_user = session.query(User).get(5)\n\n            some_object = session.query(VersionedFoo).get((5, 10))\n\n        :meth:`~.Query.get` is special in that it provides direct\n        access to the identity map of the owning :class:`.Session`.\n        If the given primary key identifier is present\n        in the local identity map, the object is returned\n        directly from this collection and no SQL is emitted,\n        unless the object has been marked fully expired.\n        If not present,\n        a SELECT is performed in order to locate the object.\n\n        :meth:`~.Query.get` also will perform a check if\n        the object is present in the identity map and\n        marked as expired - a SELECT\n        is emitted to refresh the object as well as to\n        ensure that the row is still present.\n        If not, :class:`~sqlalchemy.orm.exc.ObjectDeletedError` is raised.\n\n        :meth:`~.Query.get` is only used to return a single\n        mapped instance, not multiple instances or\n        individual column constructs, and strictly\n        on a single primary key value.  The originating\n        :class:`.Query` must be constructed in this way,\n        i.e. against a single mapped entity,\n        with no additional filtering criterion.  Loading\n        options via :meth:`~.Query.options` may be applied\n        however, and will be used if the object is not\n        yet locally present.\n\n        A lazy-loading, many-to-one attribute configured\n        by :func:`.relationship`, using a simple\n        foreign-key-to-primary-key criterion, will also use an\n        operation equivalent to :meth:`~.Query.get` in order to retrieve\n        the target value from the local identity map\n        before querying the database.  See :doc:`/orm/loading`\n        for further details on relationship loading.\n\n        :param ident: A scalar or tuple value representing\n         the primary key.   For a composite primary key,\n         the order of identifiers corresponds in most cases\n         to that of the mapped :class:`.Table` object's\n         primary key columns.  For a :func:`.mapper` that\n         was given the ``primary key`` argument during\n         construction, the order of identifiers corresponds\n         to the elements present in this collection.\n\n        :return: The object instance, or ``None``.\n\n        "
    if hasattr(ident, '__composite_values__'):
        ident = ident.__composite_values__()
    ident = util.to_list(ident)
    mapper = self._only_full_mapper_zero('get')
    if (len(ident) != len(mapper.primary_key)):
        raise sa_exc.InvalidRequestError(('Incorrect number of values in identifier to formulate primary key for query.get(); primary key columns are %s' % ','.join((("'%s'" % c) for c in mapper.primary_key))))
    key = mapper.identity_key_from_primary_key(ident)
    if ((not self._populate_existing) and (not mapper.always_refresh) and (self._for_update_arg is None)):
        instance = loading.get_from_identity(self.session, key, attributes.PASSIVE_OFF)
        if (instance is not None):
            self._get_existing_condition()
            if (not issubclass(instance.__class__, mapper.class_)):
                return None
            return instance
    return loading.load_on_ident(self, key)
Return an instance based on the given primary key identifier,
or ``None`` if not found.

E.g.::

    my_user = session.query(User).get(5)

    some_object = session.query(VersionedFoo).get((5, 10))

:meth:`~.Query.get` is special in that it provides direct
access to the identity map of the owning :class:`.Session`.
If the given primary key identifier is present
in the local identity map, the object is returned
directly from this collection and no SQL is emitted,
unless the object has been marked fully expired.
If not present,
a SELECT is performed in order to locate the object.

:meth:`~.Query.get` also will perform a check if
the object is present in the identity map and
marked as expired - a SELECT
is emitted to refresh the object as well as to
ensure that the row is still present.
If not, :class:`~sqlalchemy.orm.exc.ObjectDeletedError` is raised.

:meth:`~.Query.get` is only used to return a single
mapped instance, not multiple instances or
individual column constructs, and strictly
on a single primary key value.  The originating
:class:`.Query` must be constructed in this way,
i.e. against a single mapped entity,
with no additional filtering criterion.  Loading
options via :meth:`~.Query.options` may be applied
however, and will be used if the object is not
yet locally present.

A lazy-loading, many-to-one attribute configured
by :func:`.relationship`, using a simple
foreign-key-to-primary-key criterion, will also use an
operation equivalent to :meth:`~.Query.get` in order to retrieve
the target value from the local identity map
before querying the database.  See :doc:`/orm/loading`
for further details on relationship loading.

:param ident: A scalar or tuple value representing
 the primary key.   For a composite primary key,
 the order of identifiers corresponds in most cases
 to that of the mapped :class:`.Table` object's
 primary key columns.  For a :func:`.mapper` that
 was given the ``primary key`` argument during
 construction, the order of identifiers corresponds
 to the elements present in this collection.

:return: The object instance, or ``None``.
def get(self, ident):
    "Return an instance based on the given primary key identifier,\n        or ``None`` if not found.\n\n        E.g.::\n\n            my_user = session.query(User).get(5)\n\n            some_object = session.query(VersionedFoo).get((5, 10))\n\n        :meth:`~.Query.get` is special in that it provides direct\n        access to the identity map of the owning :class:`.Session`.\n        If the given primary key identifier is present\n        in the local identity map, the object is returned\n        directly from this collection and no SQL is emitted,\n        unless the object has been marked fully expired.\n        If not present,\n        a SELECT is performed in order to locate the object.\n\n        :meth:`~.Query.get` also will perform a check if\n        the object is present in the identity map and\n        marked as expired - a SELECT\n        is emitted to refresh the object as well as to\n        ensure that the row is still present.\n        If not, :class:`~sqlalchemy.orm.exc.ObjectDeletedError` is raised.\n\n        :meth:`~.Query.get` is only used to return a single\n        mapped instance, not multiple instances or\n        individual column constructs, and strictly\n        on a single primary key value.  The originating\n        :class:`.Query` must be constructed in this way,\n        i.e. against a single mapped entity,\n        with no additional filtering criterion.  Loading\n        options via :meth:`~.Query.options` may be applied\n        however, and will be used if the object is not\n        yet locally present.\n\n        A lazy-loading, many-to-one attribute configured\n        by :func:`.relationship`, using a simple\n        foreign-key-to-primary-key criterion, will also use an\n        operation equivalent to :meth:`~.Query.get` in order to retrieve\n        the target value from the local identity map\n        before querying the database.  See :doc:`/orm/loading`\n        for further details on relationship loading.\n\n        :param ident: A scalar or tuple value representing\n         the primary key.   For a composite primary key,\n         the order of identifiers corresponds in most cases\n         to that of the mapped :class:`.Table` object's\n         primary key columns.  For a :func:`.mapper` that\n         was given the ``primary key`` argument during\n         construction, the order of identifiers corresponds\n         to the elements present in this collection.\n\n        :return: The object instance, or ``None``.\n\n        "
    if hasattr(ident, '__composite_values__'):
        ident = ident.__composite_values__()
    ident = util.to_list(ident)
    mapper = self._only_full_mapper_zero('get')
    if (len(ident) != len(mapper.primary_key)):
        raise sa_exc.InvalidRequestError(('Incorrect number of values in identifier to formulate primary key for query.get(); primary key columns are %s' % ','.join((("'%s'" % c) for c in mapper.primary_key))))
    key = mapper.identity_key_from_primary_key(ident)
    if ((not self._populate_existing) and (not mapper.always_refresh) and (self._for_update_arg is None)):
        instance = loading.get_from_identity(self.session, key, attributes.PASSIVE_OFF)
        if (instance is not None):
            self._get_existing_condition()
            if (not issubclass(instance.__class__, mapper.class_)):
                return None
            return instance
    return loading.load_on_ident(self, key)