<commit_before>import requests

class API:
    """docstring for API"""
    def __init__(self, consumer_key, consumer_secret, access_token='', access_token_secret='',
            endpoint='https://api.croudia.com'):
        self.consumer_key = consumer_key
        self.consumer_secret = consumer_secret
        self.endpoint = endpoint
        if access_token != '' and access_token_secret != '':
            self.set_access_token(access_token, access_token_secret)

    def set_access_token(self, access_token, access_token_secret):
        self.access_token = access_token
        self.access_token_secret = access_token_secret

    def get_access_token(self):
        return self.access_token, self.access_token_secret

    def request_access_token(self, grant_type='authorization_code',
            client_id=self.consumer_key, client_secret=self.consumer_secret, code='', refresh_token=''):
        if grant_type == 'authorization_code':
            return self.do('post', '/oauth/token',
            {'grant_type': grant_type, 'client_id': client_id, 'client_secret': client_secret, 'code': code})
        else:
            return self.do('post', '/oauth/token',
            {'grant_type': grant_type, 'client_id': client_id, 'client_secret': client_secret, 'refresh_token': refresh_token})

    def do(self, method, url, args={}):
        pass<commit_msg>delete API.do()<commit_after>import requests

class API:
    """docstring for API"""
    def __init__(self, consumer_key, consumer_secret, access_token='', access_token_secret='',
            endpoint='https://api.croudia.com'):
        self.consumer_key = consumer_key
        self.consumer_secret = consumer_secret
        self.endpoint = endpoint
        if access_token != '' and access_token_secret != '':
            self.set_access_token(access_token, access_token_secret)

    def set_access_token(self, access_token, access_token_secret):
        self.access_token = access_token
        self.access_token_secret = access_token_secret

    def get_access_token(self):
        return self.access_token, self.access_token_secret

    def request_access_token(self, grant_type='authorization_code',
            client_id=self.consumer_key, client_secret=self.consumer_secret, code='', refresh_token=''):
        if grant_type == 'authorization_code':
            return self.do('post', '/oauth/token',
            {'grant_type': grant_type, 'client_id': client_id, 'client_secret': client_secret, 'code': code})
        else:
            return self.do('post', '/oauth/token',
            {'grant_type': grant_type, 'client_id': client_id, 'client_secret': client_secret, 'refresh_token': refresh_token})

{'fraction_non_alphanumeric': 0.11597456041900486, 'fraction_numerical': 0.0, 'mean_word_length': 3.570940170940171, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6908652', 'n_tokens_mistral': 791, 'n_tokens_neox': 771, 'n_words': 150}