<commit_before>import io
import json
from os import path

import arrow
import requests

from provider import get_logger, Provider, Status, ProviderException

logger = get_logger('meteoswiss')


class MeteoSwiss(Provider):
    provider_code = 'meteoswiss'
    provider_name = 'meteoswiss.ch'
    provider_url = 'http://www.meteoswiss.ch'

    def process_data(self):
        try:
            logger.info("Processing MeteoSwiss data...")

            with open(path.join(path.dirname(__file__), 'meteoswiss/vqha69.json')) as in_file:
                descriptions = json.load(in_file)

            data_file = io.StringIO(requests.get("http://data.geo.admin.ch/ch.meteoschweiz.swissmetnet/VQHA69.csv",
                                                 timeout=(self.connect_timeout, self.read_timeout)).text)
            lines = data_file.readlines()
            keys = lines[2].strip().split('|')

            for line in lines[3:]:
                station_id = None<commit_msg>Fixed 503 error when no user-agent<commit_after>import io
import json
from os import path

import arrow
import requests

from provider import get_logger, Provider, Status, ProviderException

logger = get_logger('meteoswiss')


class MeteoSwiss(Provider):
    provider_code = 'meteoswiss'
    provider_name = 'meteoswiss.ch'
    provider_url = 'http://www.meteoswiss.ch'

    def process_data(self):
        try:
            logger.info("Processing MeteoSwiss data...")

            with open(path.join(path.dirname(__file__), 'meteoswiss/vqha69.json')) as in_file:
                descriptions = json.load(in_file)

            data_file = io.StringIO(requests.get("http://data.geo.admin.ch/ch.meteoschweiz.swissmetnet/VQHA69.csv",
                                                 headers={'Accept': '*/*', 'User-Agent': 'winds.mobi'},
                                                 timeout=(self.connect_timeout, self.read_timeout)).text)
            lines = data_file.readlines()
            keys = lines[2].strip().split('|')

            for line in lines[3:]:
                station_id = None
{'fraction_non_alphanumeric': 0.11421686746987952, 'fraction_numerical': 0.007228915662650603, 'mean_word_length': 2.311004784688995, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1645705', 'n_tokens_mistral': 638, 'n_tokens_neox': 614, 'n_words': 119}