#NEWLINE# def is_disconnect( self , e , connection , cursor ) : #NEWLINE# #INDENT# if isinstance ( e , ( self . dbapi . OperationalError , self . dbapi . ProgrammingError ) ) : #NEWLINE# #INDENT# msg = str ( e ) #NEWLINE# return ( ( 'Unable to complete network request to host' in msg ) or ( 'Invalid connection state' in msg ) or ( 'Invalid cursor state' in msg ) or ( 'connection shutdown' in msg ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return False