def _set_autocommit(connection):
if hasattr(connection.connection, "<STR_LIT>"):<EOL><INDENT>if callable(connection.connection.autocommit):<EOL><INDENT>connection.connection.autocommit(True)<EOL><DEDENT>else:<EOL><INDENT>connection.connection.autocommit = True<EOL><DEDENT><DEDENT>elif hasattr(connection.connection, "<STR_LIT>"):<EOL><INDENT>connection.connection.set_isolation_level(<NUM_LIT:0>)<EOL><DEDENT>
Make sure a connection is in autocommit mode.