<commit_before>import datetime, pytz, math, re

def overlap(a,b):
    """Calculates the overlap present in two seperate time intervals"""
    return max(min(a[1], b[1]) - max(a[0],b[0]), datetime.timedelta(0))

def dgsin(degree):
    return math.sin(math.radians(degree))

def julian(date):
    """Takes a Gregorian calendar date and turns into a Julian calender date"""
    a = (14.0 - date.month)//12
    y = date.year + 4800 - a
    m = date.month + 12*a - 3

    return date.day + (153*m + 2)//5 +365*y +y//4 - y//100 + y//400 - 32045


def zephyrDisplay(stats, um = None):
    """Takes a table of stats and displays it in a zephyr-friendly pretty way."""
    usermetrics = stats.keys() if um == None else set(str(m) for m in usermetrics) & stats.viewkeys()
    return '\n'.join((i + ": ").rjust(15) + str(stats[i]) for i in usermetrics)

#------------------------------Regexes for mobile detection ------------------------------
userAgentsTestMatch = r'^(?:%s)' % '|'.join((
        "w3c ", "acs-", "alav", "alca", "amoi", "audi",
        "avan", "benq", "bird", "blac", "blaz", "brew",
        "cell", "cldc", "cmd-", "dang", "doco", "eric",
        "hipt", "inno", "ipaq", "java", "jigs", "kddi",
        "keji", "leno", "lg-c", "lg-d", "lg-g", "lge-",
        "maui", "maxo", "midp", "mits", "mmef", "mobi",
        "mot-", "moto", "mwbp", "nec-", "newt", "noki",
        "xda", "palm", "pana", "pant", "phil", "play",
        "port", "prox", "qwap", "sage", "sams", "sany",
        "sch-", "sec-", "send", "seri", "sgh-", "shar",
        "sie-", "siem", "smal", "smar", "sony", "sph-",
        "symb", "t-mo", "teli", "tim-", "tosh", "tsm-",<commit_msg>More typos<commit_after>import datetime, pytz, math, re

def overlap(a,b):
    """Calculates the overlap present in two seperate time intervals"""
    return max(min(a[1], b[1]) - max(a[0],b[0]), datetime.timedelta(0))

def dgsin(degree):
    return math.sin(math.radians(degree))

def julian(date):
    """Takes a Gregorian calendar date and turns into a Julian calender date"""
    a = (14.0 - date.month)//12
    y = date.year + 4800 - a
    m = date.month + 12*a - 3

    return date.day + (153*m + 2)//5 +365*y +y//4 - y//100 + y//400 - 32045


def zephyrDisplay(stats, um = None):
    """Takes a table of stats and displays it in a zephyr-friendly pretty way."""
    usermetrics = stats.keys() if um == None else set(str(m) for m in um) & stats.viewkeys()
    return '\n'.join((i + ": ").rjust(15) + str(stats[i]) for i in usermetrics)

#------------------------------Regexes for mobile detection ------------------------------
userAgentsTestMatch = r'^(?:%s)' % '|'.join((
        "w3c ", "acs-", "alav", "alca", "amoi", "audi",
        "avan", "benq", "bird", "blac", "blaz", "brew",
        "cell", "cldc", "cmd-", "dang", "doco", "eric",
        "hipt", "inno", "ipaq", "java", "jigs", "kddi",
        "keji", "leno", "lg-c", "lg-d", "lg-g", "lge-",
        "maui", "maxo", "midp", "mits", "mmef", "mobi",
        "mot-", "moto", "mwbp", "nec-", "newt", "noki",
        "xda", "palm", "pana", "pant", "phil", "play",
        "port", "prox", "qwap", "sage", "sams", "sany",
        "sch-", "sec-", "send", "seri", "sgh-", "shar",
        "sie-", "siem", "smal", "smar", "sony", "sph-",
        "symb", "t-mo", "teli", "tim-", "tosh", "tsm-",
{'fraction_non_alphanumeric': 0.27053140096618356, 'fraction_numerical': 0.024154589371980676, 'mean_word_length': 2.6406593406593406, 'pattern_counts': {'":': 2, '<': 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': '1946862', 'n_tokens_mistral': 1356, 'n_tokens_neox': 1299, 'n_words': 350}