code: def raw_connection_from(engine_or_conn):
      
      if hasattr(engine_or_conn, 'cursor'):
          return engine_or_conn, False
      if hasattr(engine_or_conn, 'connection'):
          return engine_or_conn.connection, False
      return engine_or_conn.raw_connection(), True
docs: Extract a raw_connection and determine if it should be automatically closed.
  
      Only connections opened by this package will be closed automatically.