<commit_before>import gc

from medea.auth import twitterBearerId

twitterBaseUrl = "https://api.twitter.com/1.1/"

twitterHeaders = (
    b'Authorization: Bearer ',
    twitterBearerId,
    b'\r\n'
)


def createTwitterHeaders():
    from medea.twitter import twitterHeaders
    return twitterHeaders


def createTwitterUrl(apiPath, getParams):
    url = twitterBaseUrl + apiPath + "?"
    url += "&".join(["{}={}".format(key, value) for key,value in getParams.items()])
    gc.collect()
    return url


def createTwitterTimelineUrl(screen_name, count=1, **k):
    params = dict(
        screen_name=screen_name,
        count=count,
        include_rts = "false",
    )
    params.update(k)
    return createTwitterUrl("statuses/user_timeline.json", params)


def createTwitterSearchUrl(text, count=1, **k):
    params = dict(
        q=text,
        count=count,
        include_entities = "false",
    )
    params.update(k)<commit_msg>Commented<commit_after>import gc

from medea.auth import twitterBearerId

twitterBaseUrl = "https://api.twitter.com/1.1/"

twitterHeaders = (
    b'Authorization: Bearer ',
    twitterBearerId,
    b'\r\n'
)
"""Headers authenticating request to the Twitter API"""


def createTwitterUrl(apiPath, getParams):
    url = twitterBaseUrl + apiPath + "?"
    url += "&".join(["{}={}".format(key, value) for key,value in getParams.items()])
    gc.collect()
    return url


def createTwitterTimelineUrl(screen_name, count=1, **k):
    params = dict(
        screen_name=screen_name,
        count=count,
        include_rts = "false",
    )
    params.update(k)
    return createTwitterUrl("statuses/user_timeline.json", params)


def createTwitterSearchUrl(text, count=1, **k):
    params = dict(
        q=text,
        count=count,
        include_entities = "false",
    )
    params.update(k)
{'fraction_non_alphanumeric': 0.13216821409066085, 'fraction_numerical': 0.004369197160021846, 'mean_word_length': 3.2903981264637, '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': '2707965', 'n_tokens_mistral': 621, 'n_tokens_neox': 593, 'n_words': 122}