def index_exists(engine: Engine, tablename: str, indexname: str) -> bool:
    """
    Does the specified index exist for the specified table?
    """
    insp = Inspector.from_engine(engine)
    return any(i['name'] == indexname for i in insp.get_indexes(tablename))
def index_exists ( engine : Engine , tablename : str , indexname : str ) -> bool : insp = Inspector . from_engine ( engine ) return any ( i [ 'name' ] == indexname for i in insp . get_indexes ( tablename ) )
Does the specified index exist for the specified table?