def is_db_connection_error(args):
 conn_err_codes = ('2002', '2003', '2006')
 for err_code in conn_err_codes:
  if (args.find(err_code) != (-1)):
   return True
 return False

def is_db_connection_error ( args ) : conn_err_codes = ( '2002' , '2003' , '2006' ) for err_code in conn_err_codes : if ( args . find ( err_code ) != ( - 1 ) ) : return True return False
return true if error in connecting to db .