<commit_before>import requests, time, logging
from bs4 import BeautifulSoup

logging.basicConfig(format = u'[%(asctime)s] %(levelname)-8s %(message)s', level = logging.DEBUG)

new_data = {}
old_data = {}

def signed(i):
    if (i>0):
        return "+"+str(i)
    else:
        return i

def get_doctors():
    doctors = {}
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 OPR/40.0.2308.90'}
    data = {'COMMAND': 1}
    r = requests.post("http://p75.spb.ru/cgi-bin/tcgi1.exe", headers=headers, data=data)
    soup = BeautifulSoup(r.text.encode('latin1').decode('cp1251'), 'html.parser')

    for k in soup.find_all('button')[4:]:
        try:
            raw = k.span.string.split()
            if (raw[0] != "ТЕРАПЕВТ"):
                doctors[raw[0]] = raw[-1]
        except:
            logging.error("Ошибка! Не удалось обработать врача.")

    #Смотрим конкретных докторов терапевтов.
    data['COMMAND'] = 10
    data['DIALOGSPECCOMMAND'] = 2
    data['CODESPEC'] = 3
    r = requests.post("http://p75.spb.ru/cgi-bin/tcgi1.exe", headers=headers, data=data)
    soup = BeautifulSoup(r.text.encode('latin1').decode('cp1251'), 'html.parser')
    for k in soup.find_all('button')[4:-1]: # Три лишних кнопки, без кнопки "любой доктор"
        try:<commit_msg>Добавил таймаут<commit_after>import requests, time, logging
from bs4 import BeautifulSoup

logging.basicConfig(format = u'[%(asctime)s] %(levelname)-8s %(message)s', level = logging.DEBUG)

new_data = {}
old_data = {}

def signed(i):
    if (i>0):
        return "+"+str(i)
    else:
        return i

def get_doctors():
    doctors = {}
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 OPR/40.0.2308.90'}
    data = {'COMMAND': 1}
    r = requests.post("http://p75.spb.ru/cgi-bin/tcgi1.exe", timeout=3, headers=headers, data=data)
    soup = BeautifulSoup(r.text.encode('latin1').decode('cp1251'), 'html.parser')

    for k in soup.find_all('button')[4:]:
        try:
            raw = k.span.string.split()
            if (raw[0] != "ТЕРАПЕВТ"):
                doctors[raw[0]] = raw[-1]
        except:
            logging.error("Ошибка! Не удалось обработать врача.")

    #Смотрим конкретных докторов терапевтов.
    data['COMMAND'] = 10
    data['DIALOGSPECCOMMAND'] = 2
    data['CODESPEC'] = 3
    r = requests.post("http://p75.spb.ru/cgi-bin/tcgi1.exe", timeout=3, headers=headers, data=data)
    soup = BeautifulSoup(r.text.encode('latin1').decode('cp1251'), 'html.parser')
    for k in soup.find_all('button')[4:-1]: # Три лишних кнопки, без кнопки "любой доктор"
        try:
{'fraction_non_alphanumeric': 0.17324561403508773, 'fraction_numerical': 0.0489766081871345, 'mean_word_length': 3.0973053892215567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6901276', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1092, 'n_words': 200}