def query_chooser(query):
 ids = []
 for (column, operator, value) in _get_query_comparisons(query):
  if column.shares_lineage(weather_locations.c.continent):
   if (operator == operators.eq):
    ids.append(shard_lookup[value])
   elif (operator == operators.in_op):
    ids.extend((shard_lookup[v] for v in value))
 if (len(ids) == 0):
  return ['north_america', 'asia', 'europe', 'south_america']
 else:
  return ids

def query_chooser ( query ) : ids = [ ] for ( column , operator , value ) in _get_query_comparisons ( query ) : if column . shares_lineage ( weather_locations . c . continent ) : if ( operator == operators . eq ) : ids . append ( shard_lookup [ value ] ) elif ( operator == operators . in_op ) : ids . extend ( ( shard_lookup [ v ] for v in value ) ) if ( len ( ids ) == 0 ) : return [ 'north_america' , 'asia' , 'europe' , 'south_america' ] else : return ids
query chooser .