#NEWLINE# def get_transaction_status_display( vendor , level ) : #NEWLINE# #INDENT# if ( vendor == 'postgresql' ) : #NEWLINE# #INDENT# import psycopg2.extensions #NEWLINE# choices = { #NEWLINE# #INDENT# psycopg2 . extensions . TRANSACTION_STATUS_IDLE : _ ( 'Idle' ) , #NEWLINE# psycopg2 . extensions . TRANSACTION_STATUS_ACTIVE : _ ( 'Active' ) , #NEWLINE# psycopg2 . extensions . TRANSACTION_STATUS_INTRANS : _ ( 'In transaction' ) , #NEWLINE# psycopg2 . extensions . TRANSACTION_STATUS_INERROR : _ ( 'In error' ) , #NEWLINE# psycopg2 . extensions . TRANSACTION_STATUS_UNKNOWN : _ ( 'Unknown' ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( vendor ) #NEWLINE# #UNINDENT# return choices . get ( level )