code: def composite(
      _class_or_attr: Union[
          None, Type[_CC], Callable[..., _CC], _CompositeAttrType[Any]
      ] = None,
      /,
      *attrs: _CompositeAttrType[Any],
      group: Optional[str] = None,
      deferred: bool = False,
      raiseload: bool = False,
      comparator_factory: Optional[
          Type[Composite.Comparator[_T]]
      ] = None,
      active_history: bool = False,
      init: Union[_NoArg, bool] = _NoArg.NO_ARG,
      repr: Union[_NoArg, bool] = _NoArg.NO_ARG,  # noqa: A002
      default: Optional[Any] = _NoArg.NO_ARG,
      default_factory: Union[_NoArg, Callable[[], _T]] = _NoArg.NO_ARG,
      compare: Union[_NoArg, bool] = _NoArg.NO_ARG,
      kw_only: Union[_NoArg, bool] = _NoArg.NO_ARG,
      info: Optional[_InfoType] = None,
      doc: Optional[str] = None,
      **__kw: Any,
  ) -> Composite[Any]:
      r"""Return a composite column-based property for use with a Mapper.
  
      See the mapping documentation section :ref:`mapper_composite` for a
      full usage example.
  
      The :class:`.MapperProperty` returned by :func:`.composite`
      is the :class:`.Composite`.
  
      :param class\_:
        The "composite type" class, or any classmethod or callable which
        will produce a new instance of the composite object given the
        column values in order.
  
      :param \*attrs:
        List of elements to be mapped, which may include:
  
        * :class:`_schema.Column` objects
        * :func:`_orm.mapped_column` constructs
        * string names of other attributes on the mapped class, which may be
          any other SQL or object-mapped attribute.  This can for
          example allow a composite that refers to a many-to-one relationship
  
      :param active_history=False:
        When ``True``, indicates that the "previous" value for a
        scalar attribute should be loaded when replaced, if not
        already loaded.  See the same flag on :func:`.column_property`.
  
      :param group:
        A group name for this property when marked as deferred.
  
      :param deferred:
        When True, the column property is "deferred", meaning that it does
        not load immediately, and is instead loaded when the attribute is
        first accessed on an instance.  See also
        :func:`~sqlalchemy.orm.deferred`.
  
      :param comparator_factory:  a class which extends
        :class:`.Composite.Comparator` which provides custom SQL
        clause generation for comparison operations.
  
      :param doc:
        optional string that will be applied as the doc on the
        class-bound descriptor.
  
      :param info: Optional data dictionary which will be populated into the
          :attr:`.MapperProperty.info` attribute of this object.
  
      :param init: Specific to :ref:`orm_declarative_native_dataclasses`,
       specifies if the mapped attribute should be part of the ``__init__()``
       method as generated by the dataclass process.
      :param repr: Specific to :ref:`orm_declarative_native_dataclasses`,
       specifies if the mapped attribute should be part of the ``__repr__()``
       method as generated by the dataclass process.
      :param default_factory: Specific to
       :ref:`orm_declarative_native_dataclasses`,
       specifies a default-value generation function that will take place
       as part of the ``__init__()``
       method as generated by the dataclass process.
  
      :param compare: Specific to
       :ref:`orm_declarative_native_dataclasses`, indicates if this field
       should be included in comparison operations when generating the
       ``__eq__()`` and ``__ne__()`` methods for the mapped class.
  
       .. versionadded:: 2.0.0b4
  
      :param kw_only: Specific to
       :ref:`orm_declarative_native_dataclasses`, indicates if this field
       should be marked as keyword-only when generating the ``__init__()``.
  
      """
      if __kw:
          raise _no_kw()
  
      return Composite(
          _class_or_attr,
          *attrs,
          attribute_options=_AttributeOptions(
              init, repr, default, default_factory, compare, kw_only
          ),
          group=group,
          deferred=deferred,
          raiseload=raiseload,
          comparator_factory=comparator_factory,
          active_history=active_history,
          info=info,
          doc=doc,
      )
  
imports: from __future__ import annotations
  import typing
  from typing import Any
  from typing import Callable
  from typing import Collection
  from typing import Iterable
  from typing import NoReturn
  from typing import Optional
  from typing import overload
  from typing import Type
  from typing import TYPE_CHECKING
  from typing import Union
  from .None import mapperlib
  from ._typing import _O
  from .descriptor_props import Composite
  from .descriptor_props import Synonym
  from .interfaces import _AttributeOptions
  from .properties import MappedColumn
  from .properties import MappedSQLExpression
  from .query import AliasOption
  from .relationships import _RelationshipArgumentType
  from .relationships import _RelationshipSecondaryArgument
  from .relationships import Relationship
  from .relationships import RelationshipProperty
  from .session import Session
  from .util import _ORMJoin
  from .util import AliasedClass
  from .util import AliasedInsp
  from .util import LoaderCriteriaOption
  from ..None import sql
  from ..None import util
  from ..exc import InvalidRequestError
  from ..sql._typing import _no_kw
  from ..sql.base import _NoArg
  from ..sql.base import SchemaEventTarget
  from ..sql.schema import _InsertSentinelColumnDefault
  from ..sql.schema import SchemaConst
  from ..sql.selectable import FromClause
  from ..util.typing import Annotated
  from ..util.typing import Literal
label_desc: Use image node_id 8 for calling a global function with example usage: composite() and returns: Composite