<commit_before>from w3lib import html

def _time_to_npt(timestamp, webvtt_timestamp=False):
    parts = timestamp.split(':')
    try:
        hours = int(parts[-3])
    except IndexError:
        hours = 0
    minutes = int(parts[-2])
    secparts = parts[-1].split('.')
    seconds = int(secparts[0])
    try:
        fracseconds = int(secparts[1])
    except IndexError:
        fracseconds = 0
    except ValueError:
        fracseconds = 0
    if hours == 0:
        if fracseconds == 0 and not webvtt_timestamp:
            return "%02d:%02d" % (minutes, seconds)
        else:
            return "%02d:%02d.%03d" % (minutes, seconds, fracseconds)
    else:
        if fracseconds == 0 and not webvtt_timestamp:
            return "%d:%02d:%02d" % (hours, minutes, seconds)
        else:
            return "%d:%02d:%02d.%03d" % (hours, minutes, seconds, fracseconds)


def parse_linklist(text, remove_tags=False):
    data = []

    for row in text.split('\n'):
        rowparts = row.strip().split(' ')
        if len(rowparts) < 2:
            break
        time = rowparts[0]
        if rowparts[1].startswith('<') and rowparts[1].endswith('>'):
            url = rowparts[1][1:-1]<commit_msg>* fix error in WebVTT timestamp<commit_after>from w3lib import html

def _time_to_npt(timestamp, webvtt_timestamp=False):
    parts = timestamp.split(':')
    try:
        hours = int(parts[-3])
    except IndexError:
        hours = 0
    minutes = int(parts[-2])
    secparts = parts[-1].split('.')
    seconds = int(secparts[0])
    try:
        fracseconds = int(secparts[1])
    except IndexError:
        fracseconds = 0
    except ValueError:
        fracseconds = 0
    if webvtt_timestamp:
        return "%02d:%02d:%02d.%03d" % (hours, minutes, seconds, fracseconds)
    if hours == 0:
        if fracseconds == 0:
            return "%02d:%02d" % (minutes, seconds)
        else:
            return "%02d:%02d.%03d" % (minutes, seconds, fracseconds)
    else:
        if fracseconds == 0:
            return "%d:%02d:%02d" % (hours, minutes, seconds)
        else:
            return "%d:%02d:%02d.%03d" % (hours, minutes, seconds, fracseconds)


def parse_linklist(text, remove_tags=False):
    data = []

    for row in text.split('\n'):
        rowparts = row.strip().split(' ')
        if len(rowparts) < 2:
            break
        time = rowparts[0]
        if rowparts[1].startswith('<') and rowparts[1].endswith('>'):
            url = rowparts[1][1:-1]
{'fraction_non_alphanumeric': 0.14424242424242426, 'fraction_numerical': 0.03474747474747475, 'mean_word_length': 2.319034852546917, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '3473043', 'n_tokens_mistral': 860, 'n_tokens_neox': 801, 'n_words': 192}