<commit_before>import requests
from pyslaquery import exception as pyslaquery_exceptions


class RequestsHelper(object):
    """
    Logic abstraction around requests module.
    """

    def __init__(self, base):
        self.base = base

    def create_post_request(self, method, params):
        """
        Create POST request to the Slack API
        :param method: Slack API method
        :param params: params to include with the request
        :return: requests.Response object
        """
        url = "%s/%s" % (self.base, method)
        result = requests.post(url, data=params, verify=False)

        if not result.json()['ok']:
            raise pyslaquery_exceptions.SlackAPIError(result['error'])

    def create_get_request(self, method, params):
        url = "%s/%s" % (self.base, method)
        result = requests.post(url, data=params, verify=False)

        if not result.json()['ok']:
            raise pyslaquery_exceptions.SlackAPIError(result['error'])<commit_msg>utils helpers now take care of requests handling<commit_after>import requests
from pyslaquery import exception as pyslaquery_exceptions


class RequestsHelper(object):
    """
    Logic abstraction around requests module.
    """

    def __init__(self, base):
        self.base = base

    def create_post_request(self, method, params):
        """
        Create POST request to the Slack API
        :param method: Slack API method
        :param params: params to include with the request
        :return: requests.Response object
        """
        url = "%s/%s" % (self.base, method)
        result = requests.post(url, data=params, verify=False)

        if not result.json()['ok']:
            raise pyslaquery_exceptions.SlackAPIError(result.json()['error'])

        return result

    def create_get_request(self, method, params):
        url = "%s/%s" % (self.base, method)
        result = requests.post(url, data=params, verify=False)

        if not result.json()['ok']:
            raise pyslaquery_exceptions.SlackAPIError(result.json()['error'])

        return result
{'fraction_non_alphanumeric': 0.10870610870610871, 'fraction_numerical': 0.0, 'mean_word_length': 2.7818181818181817, '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': '1027389', 'n_tokens_mistral': 599, 'n_tokens_neox': 578, 'n_words': 164}