<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_values(cls, location, direct_normal_irradiance, diffuse_horizontal_irradiance, timestep=1, is_leap_year=False):
 """Create wea from a list of irradiance values. This method converts input lists to data collection. """

        err_message = 'For timestep %d, %d number of data for %s is expected. ' \
            '%d is provided.'
        if len(direct_normal_irradiance) % cls.hour_count(is_leap_year) == 0:
            # add extra information to err_message
            err_message = err_message + ' Did you forget to set the timestep to %d?' \
                % (len(direct_normal_irradiance) / cls.hour_count(is_leap_year))

        assert len(direct_normal_irradiance) / \
            timestep == cls.hour_count(is_leap_year), \
            err_message % (timestep, timestep * cls.hour_count(is_leap_year),
                           'direct normal irradiance', len(
                               direct_normal_irradiance))

        assert len(diffuse_horizontal_irradiance) / timestep == \
            cls.hour_count(is_leap_year), \
            err_message % (timestep, timestep * cls.hour_count(is_leap_year),
                           'diffuse_horizontal_irradiance', len(
                               direct_normal_irradiance))

        metadata = {'source': location.source, 'country': location.country,
                    'city': location.city}
        dnr, dhr = cls._get_data_collections(
            direct_normal_irradiance, diffuse_horizontal_irradiance,
            metadata, timestep, is_leap_year)
        return cls(location, dnr, dhr, timestep, is_leap_year)