def parse_query_context(context):
 if (not context):
  return None
 pair = context.split(':', 1)
 if ((len(pair) != 2) or (pair[0] not in ('table', 'design'))):
  LOG.error(('Invalid query context data: %s' % (context,)))
  return None
 if (pair[0] == 'design'):
  pair[1] = models.SavedQuery.get(int(pair[1]))
 return pair

def parse_query_context ( context ) : if ( not context ) : return None pair = context . split ( ':' , 1 ) if ( ( len ( pair ) != 2 ) or ( pair [ 0 ] not in ( 'table' , 'design' ) ) ) : LOG . error ( ( 'Invalid query context data: %s' % ( context , ) ) ) return None if ( pair [ 0 ] == 'design' ) : pair [ 1 ] = models . SavedQuery . get ( int ( pair [ 1 ] ) ) return pair
parse_query_context -> -or- .