<commit_before>#!/usr/bin/env bash

koopa::contains() { # {{{1
    # """
    # Does an array contain a specific element?
    # @note Updated 2021-05-07.
    #
    # @examples
    # string='foo'
    # array=('foo' 'bar')
    # koopa::contains "$string" "${array[@]}"
    #
    # @seealso
    # https://stackoverflow.com/questions/3685970/
    # """
    local string x
    koopa::assert_has_args_ge "$#" 2
    # FIXME Seeing an error for configure system at the end of dotfiles
    # inside Debian 10 docker image? Why is this?
    string="${1:?}"
    shift 1
    for x
    do
        [[ "$x" == "$string" ]] && return 0
    done
    return 1
}

koopa::file_match() { # {{{1
    # """
    # Is a string defined in a file?
    # @note Updated 2020-04-30.
    #
    # @examples
    # koopa::file_match FILE PATTERN
    # echo FILE | koopa::file_match PATTERN
    # """<commit_msg>Resolve FIXME<commit_after>#!/usr/bin/env bash

koopa::contains() { # {{{1
    # """
    # Does an array contain a specific element?
    # @note Updated 2021-05-07.
    #
    # @examples
    # string='foo'
    # array=('foo' 'bar')
    # koopa::contains "$string" "${array[@]}"
    #
    # @seealso
    # https://stackoverflow.com/questions/3685970/
    # """
    local string x
    koopa::assert_has_args_ge "$#" 2
    string="${1:?}"
    shift 1
    for x
    do
        [[ "$x" == "$string" ]] && return 0
    done
    return 1
}

koopa::file_match() { # {{{1
    # """
    # Is a string defined in a file?
    # @note Updated 2020-04-30.
    #
    # @examples
    # koopa::file_match FILE PATTERN
    # echo FILE | koopa::file_match PATTERN
    # """
{'fraction_non_alphanumeric': 0.16809815950920245, 'fraction_numerical': 0.03803680981595092, 'mean_word_length': 2.288306451612903, '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': '5515769', 'n_tokens_mistral': 638, 'n_tokens_neox': 569, 'n_words': 143}