<commit_before>% Mathematics.
\usepackage{amsmath, amssymb}

% Pretty monospace font.
\usepackage{inconsolata}

% For using the lstlisting environment.
\usepackage{listings}
\lstset{basicstyle=\small\ttfamily,breaklines=true} % Set listings font to inconsolata (the default tt-font after the usepackage for inconsolata.

% Hyperlinks.
\usepackage{hyperref}

% Example environment.
% Thanks to https://tex.stackexchange.com/a/265697.
\usepackage{fontspec}
\usepackage[most]{tcolorbox}
\usepackage{xparse}
\newcounter{example}
\NewDocumentEnvironment{example}{ O{} }
{
\colorlet{colexam}{black} % Global example color
\newtcolorbox[use counter=example]{examplebox}{%
    % Example Frame Start
    empty,% Empty previously set parameters
    title={\tiny Example \\ \tiny \nobreakspace},% use \thetcbcounter to access the example counter text
    % Attaching a box requires an overlay
    attach boxed title to top left,
       % Ensures proper line breaking in longer titles
       minipage boxed title,
    % (boxed title style requires an overlay)
    boxed title style={empty,size=minimal,toprule=0pt,top=4pt,left=3mm,overlay={}},
    coltitle=colexam,fonttitle=\bfseries,
    before=\par\medskip\noindent,parbox=false,boxsep=0pt,left=3mm,right=0mm,top=2pt,breakable,pad at break=0mm,
       before upper=\csname @totalleftmargin\endcsname0pt, % Use instead of parbox=true. This ensures parskip is inherited by box.
    % Handles box when it exists on one page only
    overlay unbroken={\draw[colexam,line width=1.5pt] ([xshift=-0pt]title.north west) -- ([xshift=-0pt]frame.south west); },
    % Handles multipage box: first page
    overlay first={\draw[colexam,line width=1.5pt] ([xshift=-0pt]title.north west) -- ([xshift=-0pt]frame.south west); },
    % Handles multipage box: middle page
    overlay middle={\draw[colexam,line width=1.5pt] ([xshift=-0pt]frame.north west) -- ([xshift=-0pt]frame.south west); },
    % Handles multipage box: last page
    overlay last={\draw[colexam,line width=1.5pt] ([xshift=-0pt]frame.north west) -- ([xshift=-0pt]frame.south west); },%
    }
\begin{examplebox}}
{\end{examplebox}\endlist}

% Removes TODO notes from the Latex output, but supports LaTeX editors that
% show TODO notes in a list or window.
\newcommand{\todo}[1]{}

% Theorem definitions.
\usepackage[amsmath,thmmarks]{ntheorem}
\theoremseparator{.}
\theoremstyle{change}
\newtheorem{theorem}{Theorem}[section]
\theorembodyfont{\upshape}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma}

\theoremstyle{nonumberplain}
\theoremheaderfont{\itshape}
\theorembodyfont{\normalfont}
\theoremseparator{.\,—}
\theoremsymbol{}
\newtheorem{proof}{Proof}


% Commands for examples.
\newcommand{\idval}[1]{\text{\texttt{#1}}}
\newcommand{\type}[1]{\texttt{#1}}
\newcommand{\expr}[1]{\text{\texttt{#1}}}

% A typewriter/mathematics environment for grammar definitions.
\newenvironment{grammar}{\csname align*\endcsname}{\endalign}
%\lstnewenvironment{grammar}[0]{\renewcommand\lstlistingname{Grammar}\lstset{mathescape=true}}{}
\newcommand{\produce}[0]{\rightarrow}
\newcommand{\nt}[1]{\text{\underline{#1}}}
\newcommand{\tn}[1]{\texttt{#1}}
\newcommand{\alt}[0]{\hspace{0.15cm}\mid\hspace{0.1cm}}
\newcommand{\rh}[1]{\text{#1}}
\newcommand{\lpar}[0]{\texttt{(}}
\newcommand{\rpar}[0]{\texttt{)}}
\newcommand{\once}[0]{$^?$}
\newcommand{\onceplus}[0]{$^+$}
\newcommand{\many}[0]{$^*$}

% Commands and operators for notation.
\newcommand{\wildcard}[0]{\_}
\newcommand{\powerset}[1]{\mathcal{P}(#1)}
\newcommand{\typeset}[0]{\textsc{Type}} % The set of all types.
\newcommand{\funcset}[0]{\textsc{Func}} % The set of all functions.
\newcommand{\mfset}[0]{\textsc{MFunc}} % The set of all multi-functions.
\newcommand{\comparable}[0]{\lesseqgtr}
\newcommand{\incomparable}[0]{\not\lesseqgtr}
\newcommand{\fto}[0]{\rightarrow\nobreakspace}
\newcommand{\none}[0]{\text{None}}
\newcommand{\Nats}[0]{\mathbb{N}_0}
\newcommand{\mathintersect}[0]{\mathbin{\tn{\&}}}
\newcommand{\mathsum}[0]{\mathbin{\tn{|}}}
\DeclareMathOperator{\funcname}{name} % A function name.
\DeclareMathOperator{\funcin}{in} % The parameter type of a function.
\DeclareMathOperator{\funcout}{out} % The return type of a function.
\DeclareMathOperator{\funcbody}{body} % The body of a function.
\DeclareMathOperator{\funcabstract}{abstract}
\DeclareMathOperator{\mffit}{Fit} % The fit of a multi-function.
\DeclareMathOperator{\mfmin}{Min} % The most specific functions of a multi-function fit.
\DeclareMathOperator{\typedirect}{direct}
\DeclareMathOperator{\typeabstract}{abstract}
\DeclareMathOperator{\verifytotality}{verify-totality}
<commit_msg>Add colors for links.<commit_after>% Mathematics.
\usepackage{amsmath, amssymb}

% Pretty monospace font.
\usepackage{inconsolata}

% For using the lstlisting environment.
\usepackage{listings}
\lstset{basicstyle=\small\ttfamily,breaklines=true} % Set listings font to inconsolata (the default tt-font after the usepackage for inconsolata.

% Hyperlinks.
\usepackage{hyperref}
\hypersetup{colorlinks=true}

% Example environment.
% Thanks to https://tex.stackexchange.com/a/265697.
\usepackage{fontspec}
\usepackage[most]{tcolorbox}
\usepackage{xparse}
\newcounter{example}
\NewDocumentEnvironment{example}{ O{} }
{
\colorlet{colexam}{black} % Global example color
\newtcolorbox[use counter=example]{examplebox}{%
    % Example Frame Start
    empty,% Empty previously set parameters
    title={\tiny Example \\ \tiny \nobreakspace},% use \thetcbcounter to access the example counter text
    % Attaching a box requires an overlay
    attach boxed title to top left,
       % Ensures proper line breaking in longer titles
       minipage boxed title,
    % (boxed title style requires an overlay)
    boxed title style={empty,size=minimal,toprule=0pt,top=4pt,left=3mm,overlay={}},
    coltitle=colexam,fonttitle=\bfseries,
    before=\par\medskip\noindent,parbox=false,boxsep=0pt,left=3mm,right=0mm,top=2pt,breakable,pad at break=0mm,
       before upper=\csname @totalleftmargin\endcsname0pt, % Use instead of parbox=true. This ensures parskip is inherited by box.
    % Handles box when it exists on one page only
    overlay unbroken={\draw[colexam,line width=1.5pt] ([xshift=-0pt]title.north west) -- ([xshift=-0pt]frame.south west); },
    % Handles multipage box: first page
    overlay first={\draw[colexam,line width=1.5pt] ([xshift=-0pt]title.north west) -- ([xshift=-0pt]frame.south west); },
    % Handles multipage box: middle page
    overlay middle={\draw[colexam,line width=1.5pt] ([xshift=-0pt]frame.north west) -- ([xshift=-0pt]frame.south west); },
    % Handles multipage box: last page
    overlay last={\draw[colexam,line width=1.5pt] ([xshift=-0pt]frame.north west) -- ([xshift=-0pt]frame.south west); },%
    }
\begin{examplebox}}
{\end{examplebox}\endlist}

% Removes TODO notes from the Latex output, but supports LaTeX editors that
% show TODO notes in a list or window.
\newcommand{\todo}[1]{}

% Theorem definitions.
\usepackage[amsmath,thmmarks]{ntheorem}
\theoremseparator{.}
\theoremstyle{change}
\newtheorem{theorem}{Theorem}[section]
\theorembodyfont{\upshape}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma}

\theoremstyle{nonumberplain}
\theoremheaderfont{\itshape}
\theorembodyfont{\normalfont}
\theoremseparator{.\,—}
\theoremsymbol{}
\newtheorem{proof}{Proof}


% Commands for examples.
\newcommand{\idval}[1]{\text{\texttt{#1}}}
\newcommand{\type}[1]{\texttt{#1}}
\newcommand{\expr}[1]{\text{\texttt{#1}}}

% A typewriter/mathematics environment for grammar definitions.
\newenvironment{grammar}{\csname align*\endcsname}{\endalign}
%\lstnewenvironment{grammar}[0]{\renewcommand\lstlistingname{Grammar}\lstset{mathescape=true}}{}
\newcommand{\produce}[0]{\rightarrow}
\newcommand{\nt}[1]{\text{\underline{#1}}}
\newcommand{\tn}[1]{\texttt{#1}}
\newcommand{\alt}[0]{\hspace{0.15cm}\mid\hspace{0.1cm}}
\newcommand{\rh}[1]{\text{#1}}
\newcommand{\lpar}[0]{\texttt{(}}
\newcommand{\rpar}[0]{\texttt{)}}
\newcommand{\once}[0]{$^?$}
\newcommand{\onceplus}[0]{$^+$}
\newcommand{\many}[0]{$^*$}

% Commands and operators for notation.
\newcommand{\wildcard}[0]{\_}
\newcommand{\powerset}[1]{\mathcal{P}(#1)}
\newcommand{\typeset}[0]{\textsc{Type}} % The set of all types.
\newcommand{\funcset}[0]{\textsc{Func}} % The set of all functions.
\newcommand{\mfset}[0]{\textsc{MFunc}} % The set of all multi-functions.
\newcommand{\comparable}[0]{\lesseqgtr}
\newcommand{\incomparable}[0]{\not\lesseqgtr}
\newcommand{\fto}[0]{\rightarrow\nobreakspace}
\newcommand{\none}[0]{\text{None}}
\newcommand{\Nats}[0]{\mathbb{N}_0}
\newcommand{\mathintersect}[0]{\mathbin{\tn{\&}}}
\newcommand{\mathsum}[0]{\mathbin{\tn{|}}}
\DeclareMathOperator{\funcname}{name} % A function name.
\DeclareMathOperator{\funcin}{in} % The parameter type of a function.
\DeclareMathOperator{\funcout}{out} % The return type of a function.
\DeclareMathOperator{\funcbody}{body} % The body of a function.
\DeclareMathOperator{\funcabstract}{abstract}
\DeclareMathOperator{\mffit}{Fit} % The fit of a multi-function.
\DeclareMathOperator{\mfmin}{Min} % The most specific functions of a multi-function fit.
\DeclareMathOperator{\typedirect}{direct}
\DeclareMathOperator{\typeabstract}{abstract}
\DeclareMathOperator{\verifytotality}{verify-totality}

{'fraction_non_alphanumeric': 0.16800858829844337, 'fraction_numerical': 0.01524422973698336, 'mean_word_length': 5.795040116703136, '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': '5238078', 'n_tokens_mistral': 3124, 'n_tokens_neox': 2999, 'n_words': 616}