Skip to content

Instantly share code, notes, and snippets.

@dsmith
Created November 5, 2010 00:29
Show Gist options
  • Save dsmith/663456 to your computer and use it in GitHub Desktop.
Save dsmith/663456 to your computer and use it in GitHub Desktop.
Conditional Block
metar_code = temperature_record.properties.get("weather", "")
if metar_code == "":
records_with_weather_property = filter(lambda x, x.properties.has_key('weather'), eligible_records)
if len(records_with_weather_property):
metar_code = self.pick_winning_record(lat, lon, records_with_record_property, record_ages, record_distances)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment