<commit_before><?php

namespace Weat;

class WeatherService
{
    private $service;

    /**
     * @param Config $config
     * @param string $service
     */
    public function __construct(Config $config, $service = '')
    {
        $this->service = $this->getService($config, $service);
    }

    /**
     * @param  Location $location
     * @return Weather
     */
    public function getWeather(Location $location)
    {
        return $this->service->getWeather($location);
    }

    private function getService(Config $config, $service)
    {
        switch ($service) {
            case 'wunderground':
                return new WeatherService\WeatherUnderground($config);
            case 'accuweather':
                return new WeatherService\AccuWeather($config);
            case 'openweathermap':
                return new WeatherService\OpenWeatherMap($config);
            case 'noaa':
                return new WeatherService\NOAA($config);
            case 'forecastio':
                return new WeatherService\ForecastIO($config);;
            default:
                throw new Exception("uknown weather service");
        }
    }


}<commit_msg>use service consts<commit_after><?php

namespace Weat;

class WeatherService
{
    const WEATHER_UNDERGROUND = 1;
    const ACCUWEATHER = 2;
    const OPEN_WEATHER_MAP = 3;
    const NOAA = 4;
    const FORECAST_IO = 5;

    private $service;

    /**
     * @param Config $config
     * @param int $service
     */
    public function __construct(Config $config, $service = self::WEATHER_UNDERGROUND)
    {
        $this->service = $this->getService($config, $service);
    }

    /**
     * @param  Location $location
     * @return Weather
     */
    public function getWeather(Location $location)
    {
        return $this->service->getWeather($location);
    }

    /**
     * @param  Config $config
     * @param  int $service
     * @return AbstractWeatherService
     */
    private function getService(Config $config, $service)
    {
        switch ($service) {
            case self::WEATHER_UNDERGROUND:
                return new WeatherService\WeatherUnderground($config);
            case self::ACCUWEATHER:
                return new WeatherService\AccuWeather($config);
            case self::OPEN_WEATHER_MAP:
                return new WeatherService\OpenWeatherMap($config);
            case self::NOAA:
                return new WeatherService\NOAA($config);
            case self::FORECAST_IO:
                return new WeatherService\ForecastIO($config);;
            default:
                throw new Exception("uknown weather service");
        }
    }


}
{'fraction_non_alphanumeric': 0.10409620443442315, 'fraction_numerical': 0.0018789928598271326, 'mean_word_length': 2.0845886442641945, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6409389', 'n_tokens_mistral': 760, 'n_tokens_neox': 714, 'n_words': 166}