<commit_before>#!/usr/bin/env python2
# coding: utf-8

import calendar
import datetime
import time
import types

formats = {
    'default': '%a, %d %b %Y %H:%M:%S UTC',

    'iso': '%Y-%m-%dT%H:%M:%S.000Z',

    'utc': '%a, %d %b %Y %H:%M:%S UTC',
    'archive': '%Y%m%d-%H',
    'compact': '%Y%m%d-%H%M%S',
    'daily': '%Y-%m-%d',

    'mysql': '%Y-%m-%d %H:%M:%S',

    'nginxaccesslog': "%d/%b/%Y:%H:%M:%S",
    'nginxerrorlog': "%Y/%m/%d %H:%M:%S",
}


def parse(time_str, fmt_key):
    return datetime.datetime.strptime(time_str, _get_format(fmt_key))


def format(dt, fmt_key):
    return dt.strftime(_get_format(fmt_key))


def format_ts(ts, fmt_key):<commit_msg>sort timeutil.formats<commit_after>#!/usr/bin/env python2
# coding: utf-8

import calendar
import datetime
import time
import types

formats = {

    'default':        '%a, %d %b %Y %H:%M:%S UTC',
    'utc':            '%a, %d %b %Y %H:%M:%S UTC',
    'iso':            '%Y-%m-%dT%H:%M:%S.000Z',
    'archive':        '%Y%m%d-%H',
    'compact':        '%Y%m%d-%H%M%S',
    'daily':          '%Y-%m-%d',
    'mysql':          '%Y-%m-%d %H:%M:%S',
    'nginxaccesslog': "%d/%b/%Y:%H:%M:%S",
    'nginxerrorlog':  "%Y/%m/%d %H:%M:%S",
}


def parse(time_str, fmt_key):
    return datetime.datetime.strptime(time_str, _get_format(fmt_key))


def format(dt, fmt_key):
    return dt.strftime(_get_format(fmt_key))


def format_ts(ts, fmt_key):
{'fraction_non_alphanumeric': 0.24343506032647266, 'fraction_numerical': 0.007097232079488999, 'mean_word_length': 3.2215568862275448, 'pattern_counts': {'":': 0, '<': 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': '3178426', 'n_tokens_mistral': 623, 'n_tokens_neox': 611, 'n_words': 114}