class_docstr: Provides scoped management of :class:`.AsyncSession` objects.
  
  See the section :ref:`asyncio_scoped_session` for usage details.
  
  .. versionadded:: 1.4.19
class_docstr_tok: ["Provides","scoped","management","of",":","class",":","`",".AsyncSession","`","objects",".","See","the","section",":","ref",":","`","asyncio_scoped_session","`","for","usage","details",".","..","versionadded",":",":","1.4.19"]
docstr: Return ``True`` if the given instance has locally
  modified attributes.
  
  .. container:: class_bases
  
      Proxied for the :class:`_asyncio.AsyncSession` class on
      behalf of the :class:`_asyncio.scoping.async_scoped_session` class.
  
  .. container:: class_bases
  
      Proxied for the :class:`_orm.Session` class on
      behalf of the :class:`_asyncio.AsyncSession` class.
  
  This method retrieves the history for each instrumented
  attribute on the instance and performs a comparison of the current
  value to its previously committed value, if any.
  
  It is in effect a more expensive and accurate
  version of checking for the given instance in the
  :attr:`.Session.dirty` collection; a full test for
  each attribute's net "dirty" status is performed.
  
  E.g.::
  
      return session.is_modified(someobject)
  
  A few caveats to this method apply:
  
  * Instances present in the :attr:`.Session.dirty` collection may
    report ``False`` when tested with this method.  This is because
    the object may have received change events via attribute mutation,
    thus placing it in :attr:`.Session.dirty`, but ultimately the state
    is the same as that loaded from the database, resulting in no net
    change here.
  * Scalar attributes may not have recorded the previously set
    value when a new value was applied, if the attribute was not loaded,
    or was expired, at the time the new value was received - in these
    cases, the attribute is assumed to have a change, even if there is
    ultimately no net change against its database value. SQLAlchemy in
    most cases does not need the "old" value when a set event occurs, so
    it skips the expense of a SQL call if the old value isn't present,
    based on the assumption that an UPDATE of the scalar value is
    usually needed, and in those few cases where it isn't, is less
    expensive on average than issuing a defensive SELECT.
  
    The "old" value is fetched unconditionally upon set only if the
    attribute container has the ``active_history`` flag set to ``True``.
    This flag is set typically for primary key attributes and scalar
    object references that are not a simple many-to-one.  To set this
    flag for any arbitrary mapped column, use the ``active_history``
    argument with :func:`.column_property`.
  
  :param instance: mapped instance to be tested for pending changes.
  :param include_collections: Indicates if multivalued collections
   should be included in the operation.  Setting this to ``False`` is a
   way to detect only local-column based properties (i.e. scalar columns
   or many-to-one foreign keys) that would result in an UPDATE for this
   instance upon flush.
code: def is_modified(
      self, instance: object, include_collections: bool = True
  ) -> bool:
      r"""Return ``True`` if the given instance has locally
      modified attributes.
  
      .. container:: class_bases
  
          Proxied for the :class:`_asyncio.AsyncSession` class on
          behalf of the :class:`_asyncio.scoping.async_scoped_session` class.
  
      .. container:: class_bases
  
          Proxied for the :class:`_orm.Session` class on
          behalf of the :class:`_asyncio.AsyncSession` class.
  
      This method retrieves the history for each instrumented
      attribute on the instance and performs a comparison of the current
      value to its previously committed value, if any.
  
      It is in effect a more expensive and accurate
      version of checking for the given instance in the
      :attr:`.Session.dirty` collection; a full test for
      each attribute's net "dirty" status is performed.
  
      E.g.::
  
          return session.is_modified(someobject)
  
      A few caveats to this method apply:
  
      * Instances present in the :attr:`.Session.dirty` collection may
        report ``False`` when tested with this method.  This is because
        the object may have received change events via attribute mutation,
        thus placing it in :attr:`.Session.dirty`, but ultimately the state
        is the same as that loaded from the database, resulting in no net
        change here.
      * Scalar attributes may not have recorded the previously set
        value when a new value was applied, if the attribute was not loaded,
        or was expired, at the time the new value was received - in these
        cases, the attribute is assumed to have a change, even if there is
        ultimately no net change against its database value. SQLAlchemy in
        most cases does not need the "old" value when a set event occurs, so
        it skips the expense of a SQL call if the old value isn't present,
        based on the assumption that an UPDATE of the scalar value is
        usually needed, and in those few cases where it isn't, is less
        expensive on average than issuing a defensive SELECT.
  
        The "old" value is fetched unconditionally upon set only if the
        attribute container has the ``active_history`` flag set to ``True``.
        This flag is set typically for primary key attributes and scalar
        object references that are not a simple many-to-one.  To set this
        flag for any arbitrary mapped column, use the ``active_history``
        argument with :func:`.column_property`.
  
      :param instance: mapped instance to be tested for pending changes.
      :param include_collections: Indicates if multivalued collections
       should be included in the operation.  Setting this to ``False`` is a
       way to detect only local-column based properties (i.e. scalar columns
       or many-to-one foreign keys) that would result in an UPDATE for this
       instance upon flush.
  
  
  
      """  # noqa: E501
  
      return self._proxied.is_modified(
          instance, include_collections=include_collections
      )
  
imports: from __future__ import annotations
  from typing import Any
  from typing import Callable
  from typing import Generic
  from typing import Iterable
  from typing import Iterator
  from typing import Optional
  from typing import overload
  from typing import Sequence
  from typing import Tuple
  from typing import Type
  from typing import TYPE_CHECKING
  from typing import TypeVar
  from typing import Union
  from .session import _AS
  from .session import async_sessionmaker
  from .session import AsyncSession
  from ...None import exc
  from ...None import util
  from ...orm.session import Session
  from ...util import create_proxy_methods
  from ...util import ScopedRegistry
  from ...util import warn
  from ...util import warn_deprecated
label_desc: Use image node_id 16 for calling the async_scoped_session obj's underlying member method code with example usage: obj.is_modified(instance, include_collections) and returns: self