<commit_before>import requests
import json


def generate_data(base, new):
        #merge dictionary and return json
        return json.dumps(dict(base.items() + new.items()))


def send_request(method, uri, data):
    headers = {'content-type': 'application/json'}
    return requests.request(method, uri, data=data, headers=headers)


class ApiEndpoint(object):

    def __init__(self, base_data, access_token):
        self.base_data = base_data
        self.access_token = access_token
        self.header = {
            'Authorization': 'Bearer ' + self.access_token,
            'content-type': 'application/json'
        }
        self.rsp = None
        self.base_uri = 'https://api.tradegecko.com/'
        self.uri = None

    def _build_header(self, header):
        try:
            return dict(self.header.items() + header.items())
            # return self.header.update(header)
        except AttributeError:
            return self.header

    def send_request(self, method, uri, data=None, header=None):
        headers = self._build_header(header)
        self.rsp = requests.request(method, uri, data=data, headers=headers)
        return self.rsp.status_code

    def get(self):
        return self.send_request('GET', self.uri)<commit_msg>api get and get id<commit_after>import requests
import json


def generate_data(base, new):
        #merge dictionary and return json
        return json.dumps(dict(base.items() + new.items()))


def send_request(method, uri, data):
    headers = {'content-type': 'application/json'}
    return requests.request(method, uri, data=data, headers=headers)


class ApiEndpoint(object):

    def __init__(self, base_data, access_token):
        self.base_data = base_data
        self.access_token = access_token
        self.header = {
            'Authorization': 'Bearer ' + self.access_token,
            'content-type': 'application/json'
        }
        self.rsp = None
        self.json = None
        self.base_uri = 'https://api.tradegecko.com/'
        self.uri = None

    def _build_header(self, header):
        try:
            return dict(self.header.items() + header.items())
            # return self.header.update(header)
        except AttributeError:
            return self.header

    def _send_request(self, method, uri, data=None, header=None):
        headers = self._build_header(header)
        self.rsp = requests.request(method, uri, data=data, headers=headers)
        return self.rsp.status_code

    def all(self):
        if self._send_request('GET', self.uri) == 200:
            return self.rsp.json()
        else:
            return False

    def get(self, id):
        uri = self.uri + str(id)
        if self._send_request('GET', uri) == 200:
            return self.rsp.json()
        else:
            return False
{'fraction_non_alphanumeric': 0.1147424511545293, 'fraction_numerical': 0.0021314387211367673, 'mean_word_length': 2.4299634591961023, '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': '7351389', 'n_tokens_mistral': 828, 'n_tokens_neox': 811, 'n_words': 190}