docs: def _setup_schema(Base, session):
      """Create a function which adds `__marshmallow__` attribute to all signal models."""
  
      def create_schema_class(m):
          if hasattr(m, 'send_signalbus_message'):
              # Signal models should not use the SQLAlchemy session.
              class Meta(object):
                  model = m
          else:
              class Meta(object):
                  model = m
                  sqla_session = session
  
          schema_class_name = '%sSchema' % m.__name__
          return type(schema_class_name, (ModelSchema,), {'Meta': Meta})
  
      def setup_schema_fn():
          for model in Base._decl_class_registry.values():
              if hasattr(model, '__tablename__'):
                  if model.__name__.endswith("Schema"):
                      raise ModelConversionError(
                          'Unexpected model name: "{}". '
                          'For safety, _setup_schema() can not be used when a '
                          'model class ends with "Schema".'.format(model.__name__)
                      )
                  schema_class = getattr(model, '__marshmallow__', None)
                  if schema_class is None:
                      schema_class = model.__marshmallow__ = create_schema_class(model)
                  if hasattr(model, 'send_signalbus_message'):
                      setattr(model, '__marshmallow_schema__', schema_class())
  
      return setup_schema_fn