def get_gravityspy_triggers(tablename, engine=None, **kwargs):
from sqlalchemy.engine import create_engine<EOL>from sqlalchemy.exc import ProgrammingError<EOL>if engine is None:<EOL><INDENT>conn_kw = {}<EOL>for key in ('<STR_LIT>', '<STR_LIT:host>', '<STR_LIT:user>', '<STR_LIT>'):<EOL><INDENT>try:<EOL><INDENT>conn_kw[key] = kwargs.pop(key)<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>engine = create_engine(get_connection_str(**conn_kw))<EOL><DEDENT>try:<EOL><INDENT>return GravitySpyTable(fetch(engine, tablename, **kwargs))<EOL><DEDENT>except ProgrammingError as exc:<EOL><INDENT>if '<STR_LIT>' % tablename in str(exc):<EOL><INDENT>msg = exc.args[<NUM_LIT:0>]<EOL>msg = msg.replace(<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' % '<STR_LIT>'.join(engine.table_names()))<EOL>exc.args = (msg,)<EOL><DEDENT>raise<EOL><DEDENT>
Fetch data into an `GravitySpyTable`

    Parameters
    ----------
    table : `str`,
        The name of table you are attempting to receive triggers
        from.

    selection
        other filters you would like to supply
        underlying reader method for the given format

    .. note::

       For now it will attempt to automatically connect you
       to a specific DB. In the future, this may be an input
       argument.

    Returns
    -------
    table : `GravitySpyTable`