<commit_before>
import pyowm

def get_forecasts(place):
  owm = pyowm.OWM("74878f953d3a8b89ee8e75ce4b5edd2a")

  forecasts = owm.three_hours_forecast(place).get_forecast()

  reception_time = forecasts.get_reception_time()

  forecasts = [parse_weather(x,reception_time) for x in forecasts.get_weathers()]

 # forecasts = owm.three_hours_forecast(place).get_forecast()

  return forecasts

def parse_weather(weather_object,reception_time):
  w = weather_object
  parsed_weather = {
    'temp': w.get_temperature(unit='celsius')['temp'],
    'pressure': w.get_pressure()['press'],
    'reception_time': reception_time,
    'prediction_time': w.get_reference_time(),
    'clouds': w.get_clouds(),
    'humidity': w.get_humidity(),
  }

  if 'speed' in w.get_wind():
    parsed_weather['wind_speed'] = w.get_wind()['speed']

  if '3h' in w.get_rain():
    parsed_weather['rain_3h'] = w.get_rain()['3h']

  return parsed_weather<commit_msg>owm collect current weather<commit_after>
import pyowm

def get_forecasts(place):
  owm = pyowm.OWM("74878f953d3a8b89ee8e75ce4b5edd2a")
  weather_list = []

  # forecasts
  forecasts = owm.three_hours_forecast(place).get_forecast()
  reception_time = forecasts.get_reception_time()
  weather_list = [parse_weather(x,reception_time) for x in forecasts.get_weathers()]

  # current weather
  current = owm.weather_at_place(place)
  reception_time = current.get_reception_time()
  current = parse_weather(current.get_weather(),reception_time)
  weather_list.append(current)
  
  return weather_list

def parse_weather(weather_object,reception_time):
  w = weather_object
  parsed_weather = {
    'temp': w.get_temperature(unit='celsius')['temp'],
    'pressure': w.get_pressure()['press'],
    'reception_time': reception_time,
    'prediction_time': w.get_reference_time(),
    'clouds': w.get_clouds(),
    'humidity': w.get_humidity(),
  }

  if 'speed' in w.get_wind():
    parsed_weather['wind_speed'] = w.get_wind()['speed']

  if '3h' in w.get_rain():
    parsed_weather['rain_3h'] = w.get_rain()['3h']

  return parsed_weather
{'fraction_non_alphanumeric': 0.13691340106434446, 'fraction_numerical': 0.020319303338171262, 'mean_word_length': 5.442367601246106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3354311', 'n_tokens_mistral': 818, 'n_tokens_neox': 758, 'n_words': 115}