def trigger_function_installed(connection: connection):
installed = False<EOL>log('<STR_LIT>', logger_name=_LOGGER_NAME)<EOL>try:<EOL><INDENT>execute(connection, "<STR_LIT>")<EOL>installed = True<EOL><DEDENT>except ProgrammingError as e:<EOL><INDENT>if e.args:<EOL><INDENT>error_stdout = e.args[<NUM_LIT:0>].splitlines()<EOL>error = error_stdout.pop(<NUM_LIT:0>)<EOL>if error.endswith('<STR_LIT>'):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT>log('<STR_LIT>'.format('<STR_LIT>' if installed else '<STR_LIT>'), logger_name=_LOGGER_NAME)<EOL>return installed<EOL>
Test whether or not the psycopg2-pgevents trigger function is installed.

    Parameters
    ----------
    connection: psycopg2.extensions.connection
        Active connection to a PostGreSQL database.

    Returns
    -------
    bool
        True if the trigger function is installed, otherwise False.