code: def coltype_as_typeengine(coltype: Union[VisitableType,
                                           TypeEngine]) -> TypeEngine:
      
      if isinstance(coltype, TypeEngine):
          return coltype
      return coltype()
docs: Instances of SQLAlchemy column types are subclasses of ``TypeEngine``.
      It's possible to specify column types either as such instances, or as the
      class type. This function ensures that such classes are converted to
      instances.
  
      To explain: you can specify columns like
  
      .. code-block:: python
  
          a = Column("a", Integer)
          b = Column("b", Integer())
          c = Column("c", String(length=50))
  
          isinstance(Integer, TypeEngine)  # False
          isinstance(Integer(), TypeEngine)  # True
          isinstance(String(length=50), TypeEngine)  # True
  
          type(Integer)  # <class 'sqlalchemy.sql.visitors.VisitableType'>
          type(Integer())  # <class 'sqlalchemy.sql.sqltypes.Integer'>
          type(String)  # <class 'sqlalchemy.sql.visitors.VisitableType'>
          type(String(length=50))  # <class 'sqlalchemy.sql.sqltypes.String'>
  
      This function coerces things to a :class:`TypeEngine`.