class_docstr: A helper class for construction of mappings based on
  a deferred reflection step.
  
  Normally, declarative can be used with reflection by
  setting a :class:`_schema.Table` object using autoload_with=engine
  as the ``__table__`` attribute on a declarative class.
  The caveat is that the :class:`_schema.Table` must be fully
  reflected, or at the very least have a primary key column,
  at the point at which a normal declarative mapping is
  constructed, meaning the :class:`_engine.Engine` must be available
  at class declaration time.
  
  The :class:`.DeferredReflection` mixin moves the construction
  of mappers to be at a later point, after a specific
  method is called which first reflects all :class:`_schema.Table`
  objects created so far.   Classes can define it as such::
  
      from sqlalchemy.ext.declarative import declarative_base
      from sqlalchemy.ext.declarative import DeferredReflection
      Base = declarative_base()
  
      class MyClass(DeferredReflection, Base):
          __tablename__ = 'mytable'
  
  Above, ``MyClass`` is not yet mapped.   After a series of
  classes have been defined in the above fashion, all tables
  can be reflected and mappings created using
  :meth:`.prepare`::
  
      engine = create_engine("someengine://...")
      DeferredReflection.prepare(engine)
  
  The :class:`.DeferredReflection` mixin can be applied to individual
  classes, used as the base for the declarative base itself,
  or used in a custom abstract class.   Using an abstract base
  allows that only a subset of classes to be prepared for a
  particular prepare step, which is necessary for applications
  that use more than one engine.  For example, if an application
  has two engines, you might use two bases, and prepare each
  separately, e.g.::
  
      class ReflectedOne(DeferredReflection, Base):
          __abstract__ = True
  
      class ReflectedTwo(DeferredReflection, Base):
          __abstract__ = True
  
      class MyClass(ReflectedOne):
          __tablename__ = 'mytable'
  
      class MyOtherClass(ReflectedOne):
          __tablename__ = 'myothertable'
  
      class YetAnotherClass(ReflectedTwo):
          __tablename__ = 'yetanothertable'
  
      # ... etc.
  
  Above, the class hierarchies for ``ReflectedOne`` and
  ``ReflectedTwo`` can be configured separately::
  
      ReflectedOne.prepare(engine_one)
      ReflectedTwo.prepare(engine_two)
  
  .. seealso::
  
      :ref:`orm_declarative_reflected_deferred_reflection` - in the
      :ref:`orm_declarative_table_config_toplevel` section.
code: def _sa_raise_deferred_config(cls):
      raise orm_exc.UnmappedClassError(
          cls,
          msg="Class %s is a subclass of DeferredReflection.  "
          "Mappings are not produced until the .prepare() "
          "method is called on the class hierarchy."
          % orm_exc._safe_cls_name(cls),
      )
  
imports: from __future__ import annotations
  import collections
  import contextlib
  from typing import Any
  from typing import Callable
  from typing import TYPE_CHECKING
  from typing import Union
  from ...None import exc
  from ...engine import Connection
  from ...engine import Engine
  from ...orm import exc
  from ...orm import relationships
  from ...orm.base import _mapper_or_none
  from ...orm.clsregistry import _resolver
  from ...orm.decl_base import _DeferredMapperConfig
  from ...orm.util import polymorphic_union
  from ...schema import Table
  from ...util import OrderedDict
label_desc: Use image node_id 3 for calling the DeferredReflection obj's underlying member method code with example usage: obj._sa_raise_deferred_config(cls) without return types