code: def from_json(cls, data):
          
          # Check required and optional keys
          optional_keys = {'wind_direction': 0, 'rain': False, 'snow_on_ground': False}
          assert 'wind_speed' in data, 'Required key "wind_speed" is missing!'
          for key, val in optional_keys.items():
              if key not in data:
                  data[key] = val
  
          return cls(data['wind_speed'], data['wind_direction'], data['rain'],
                     data['snow_on_ground'])
docs: Create a Wind Condition from a dictionary.
  
          Args:
              data = {
              "wind_speed": float,
              "wind_direction": float,
              "rain": bool,
              "snow_on_ground": bool}