<commit_before>import requests
from datetime import timedelta
from django.utils.datetime_safe import datetime

BASE_URL = 'https://launchlibrary.net/'
headers = {
    "Content-Type": "application/json"
}


class LaunchLibrarySDK(object):
    # Latest stable Version stored.
    def __init__(self, version='1.2.2'):
        self.api_url = BASE_URL + version

    def get_next_launch(self, tbd=False, agency=None, launch_service_provider=None, count=1):
        """
        Builds a URL and fetches response from LL
        :param agency: Pass the ID of an Agency to get launches for that agency (Rocket, Location, or Mission agency)
        :param launch_service_provider: Pass the ID of a LSP to get launches for that provider
        :param count: The number of launch objects to fetch.
        :return: Returns a HTTP Response object
        """
        if tbd:
            url = self.api_url + '/launch/next/%d?mode=verbose' % count
        else:
            url = self.api_url + '/launch/next/%d?mode=verbose&tbdtime=0&tbddate=0' % count
        # if agency:
        #     url = url + getLSP
        return send_request(url, method='GET', headers=headers)

    def get_next_weeks_launches(self):
        """
        Sends a request using `requests` module.
        :return: Returns a HTTP Response object
        """
        today = datetime.today().strftime('%Y-%m-%d')
        next_week = (datetime.now() + timedelta(days=7)).strftime('%Y-%m-%d')
        url = self.api_url + '/launch/%s/%s?mode=verbose' % (today, next_week)
        return send_request(url, method='GET', headers=headers)

    def get_location_by_pad(self, locationId):
        url = '%s/pad/%i?fields=name' % (self.api_url, locationId)
        return send_request(url, method='GET', headers=headers)

    def get_launch_by_id(self, id):
        url = self.api_url + '/launch/%s?mode=verbose' % id
        return send_request(url, method='GET', headers=headers)


def send_request(url, method='GET', data=None, headers=None):
    """
    Sends a request using `requests` module.
    :param url: URL to send request to
    :param method: HTTP method to use e.g. GET, PUT, DELETE, POST
    :param data: Data to send in case of PUT and POST
    :param headers: HTTP headers to use
    :return: Returns a HTTP Response object
    """
    assert url and method
    assert method in ['GET', 'PUT', 'DELETE', 'POST']
    method = getattr(requests, method.lower())
    response = method(url=url, data=data, headers=headers)
    return response
<commit_msg>variable name changes<commit_after>import requests
from datetime import timedelta
from django.utils.datetime_safe import datetime

BASE_URL = 'https://launchlibrary.net/'
headers = {
    "Content-Type": "application/json"
}


class LaunchLibrarySDK(object):
    # Latest stable Version stored.
    def __init__(self, version='1.2.2'):
        self.api_url = BASE_URL + version

    def get_next_launch(self, tbd=False, agency=None, launch_service_provider=None, count=1):
        """
        Builds a URL and fetches response from LL
        :param agency: Pass the ID of an Agency to get launches for that agency (Rocket, Location, or Mission agency)
        :param launch_service_provider: Pass the ID of a LSP to get launches for that provider
        :param count: The number of launch objects to fetch.
        :return: Returns a HTTP Response object
        """
        if tbd:
            url = self.api_url + '/launch/next/%d?mode=verbose' % count
        else:
            url = self.api_url + '/launch/next/%d?mode=verbose&tbdtime=0&tbddate=0' % count
        # if agency:
        #     url = url + getLSP
        return send_request(url, method='GET', headers=headers)

    def get_next_weeks_launches(self):
        """
        Sends a request using `requests` module.
        :return: Returns a HTTP Response object
        """
        today = datetime.today().strftime('%Y-%m-%d')
        next_week = (datetime.now() + timedelta(days=7)).strftime('%Y-%m-%d')
        url = self.api_url + '/launch/%s/%s?mode=verbose' % (today, next_week)
        return send_request(url, method='GET', headers=headers)

    def get_location_by_pad(self, location_id):
        url = '%s/pad/%i?fields=name' % (self.api_url, location_id)
        return send_request(url, method='GET', headers=headers)

    def get_launch_by_id(self, launch_id):
        url = self.api_url + '/launch/%s?mode=verbose' % launch_id
        return send_request(url, method='GET', headers=headers)


def send_request(url, method='GET', data=None, headers=None):
    """
    Sends a request using `requests` module.
    :param url: URL to send request to
    :param method: HTTP method to use e.g. GET, PUT, DELETE, POST
    :param data: Data to send in case of PUT and POST
    :param headers: HTTP headers to use
    :return: Returns a HTTP Response object
    """
    assert url and method
    assert method in ['GET', 'PUT', 'DELETE', 'POST']
    method = getattr(requests, method.lower())
    response = method(url=url, data=data, headers=headers)
    return response

{'fraction_non_alphanumeric': 0.11720599842146803, 'fraction_numerical': 0.0027624309392265192, 'mean_word_length': 3.0262112787926925, 'pattern_counts': {'":': 2, '<': 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': '4102013', 'n_tokens_mistral': 1559, 'n_tokens_neox': 1508, 'n_words': 464}