def shard_chooser(mapper, instance, clause=None):
 if isinstance(instance, WeatherLocation):
  return shard_lookup[instance.continent]
 else:
  return shard_chooser(mapper, instance.location)

def shard_chooser ( mapper , instance , clause = None ) : if isinstance ( instance , WeatherLocation ) : return shard_lookup [ instance . continent ] else : return shard_chooser ( mapper , instance . location )
shard chooser .