code: def exists_orm(session: Session,
                 ormclass: DeclarativeMeta,
                 *criteria: Any) -> bool:
      
      # http://docs.sqlalchemy.org/en/latest/orm/query.html
      q = session.query(ormclass)
      for criterion in criteria:
          q = q.filter(criterion)
      exists_clause = q.exists()
      return bool_from_exists_clause(session=session,
                                     exists_clause=exists_clause)
docs: Detects whether a database record exists for the specified ``ormclass``
      and ``criteria``.
  
      Example usage:
  
      .. code-block:: python
  
          bool_exists = exists_orm(session, MyClass, MyClass.myfield == value)