<commit_before>module App.Clk.Util where

import System.Locale
import System.Environment
import Data.Time

getClkDir :: IO String
getClkDir = do
    home <- getEnv "HOME"
    return $ home ++ "/.clkq/"  -- q avoids collision with older data

split :: Char -> String -> [String]
split delim s
    | [] == rest = [token]
    | otherwise = token : split delim (tail rest)
    where (token,rest) = span (/=delim) s

strftime :: String -> UTCTime -> String
strftime = formatTime defaultTimeLocale

iso8601 :: String
iso8601 = "%FT%T%QZ"<commit_msg>Helpful shortcut function for parsing times<commit_after>module App.Clk.Util where

import System.Locale
import System.Environment
import Data.Time

getClkDir :: IO String
getClkDir = do
    home <- getEnv "HOME"
    return $ home ++ "/.clkq/"  -- q avoids collision with older data

split :: Char -> String -> [String]
split delim s
    | [] == rest = [token]
    | otherwise = token : split delim (tail rest)
    where (token,rest) = span (/=delim) s

strftime :: String -> UTCTime -> String
strftime = formatTime defaultTimeLocale

iso8601 :: String
iso8601 = "%FT%T%QZ"

strptime :: String -> String -> UTCTime
strptime = readTime defaultTimeLocale
{'fraction_non_alphanumeric': 0.12133891213389121, 'fraction_numerical': 0.013389121338912133, 'mean_word_length': 3.564885496183206, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1494380', 'n_tokens_mistral': 399, 'n_tokens_neox': 369, 'n_words': 125}