<commit_before>""" Module for helper functions used inside jinja2 templates """

# NB, each blueprint must individually load any functions defined below
# for them to appear in the namespace when invoked from respective blueprint
# See @<blueprint>.context_processor decorator for more info.

def split_string(s, delimiter=','):
    return s.split(delimiter)
<commit_msg>Allow for list/tuples in config files when looking for comma delimited strings.<commit_after>""" Module for helper functions used inside jinja2 templates """

# NB, each blueprint must individually load any functions defined below
# for them to appear in the namespace when invoked from respective blueprint
# See @<blueprint>.context_processor decorator for more info.

def split_string(s, delimiter=','):
    """Given string (or tuple) return the delimited values"""
    # If given a tuple, split already happened
    if isinstance(s, (list, tuple)):
        return s
    return s.split(delimiter)

{'fraction_non_alphanumeric': 0.07929969104016478, 'fraction_numerical': 0.0020597322348094747, 'mean_word_length': 4.855421686746988, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2943454', 'n_tokens_mistral': 250, 'n_tokens_neox': 241, 'n_words': 116}