<commit_before>import json
import requests
import logging


def post(url, otherHeaders, data):
    session = _getSession()
    headers = dict(_getConfig()['headers'])
    for key in otherHeaders:
        headers[key] = otherHeaders[key]
    response = session.post(url, headers=headers, data=data)
    _checkResponse(response)
    return response


def get(url, otherHeaders=None):
    session = _getSession()
    headers = dict(_getConfig()['headers'])
    if otherHeaders is not None:
        for key in otherHeaders:
            headers[key] = otherHeaders[key]
    response = session.get(url, headers=headers)
    _checkResponse(response)
    return response
<commit_msg>fix request headers encoding.<commit_after>import json
import requests
import logging


def post(url, otherHeaders, data):
    session = _getSession()
    headers = dict(_getConfig()['headers'])
    for key in otherHeaders:
        headers[key] = otherHeaders[key].encode("utf-8").decode("latin1")
    response = session.post(url, headers=headers, data=data)
    _checkResponse(response)
    return response


def get(url, otherHeaders=None):
    session = _getSession()
    headers = dict(_getConfig()['headers'])
    if otherHeaders is not None:
        for key in otherHeaders:
            headers[key] = otherHeaders[key].encode("utf-8").decode("latin1")
    response = session.get(url, headers=headers)
    _checkResponse(response)
    return response

{'fraction_non_alphanumeric': 0.11103351955307263, 'fraction_numerical': 0.002793296089385475, 'mean_word_length': 3.8907849829351537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3537386', 'n_tokens_mistral': 404, 'n_tokens_neox': 399, 'n_words': 105}