<commit_before>import gargparse


FLAGS = gargparse.ARGS
_FLAG_NAMES = set()


def add_flag(name, *args, **kwargs):
    """Add a flag.

    Args:
        name: Flag name. Real flag name will be `"--{}".format(name)`.
        *args, **kwargs: The rest arguments are the same as
            `argparse.add_argument()`.
    """
    global _FLAG_NAMES

    if name not in _FLAG_NAMES:
        _FLAG_NAMES.add(name)
        gargparse.add_argument("--" + name, *args, **kwargs)


def add_required_flag(name, *args, **kwargs):
    """Add a required flag.

    Its interface is the same as `add_flag()` but `required=True` is set by
    default.
    """
    add_flag(name, *args, required=True, **kwargs)


class FlagAdder:
    """Manage addition of flags."""

    def __init__(self):<commit_msg>Add documentation about how to access added flags<commit_after>import gargparse


FLAGS = gargparse.ARGS
_FLAG_NAMES = set()


def add_flag(name, *args, **kwargs):
    """Add a flag.

    Added flags can be accessed by `FLAGS` global variable.
    (e.g. `FLAGS.my_flag_name`)

    Args:
        name: Flag name. Real flag name will be `"--{}".format(name)`.
        *args, **kwargs: The rest arguments are the same as
            `argparse.add_argument()`.
    """
    global _FLAG_NAMES

    if name not in _FLAG_NAMES:
        _FLAG_NAMES.add(name)
        gargparse.add_argument("--" + name, *args, **kwargs)


def add_required_flag(name, *args, **kwargs):
    """Add a required flag.

    Its interface is the same as `add_flag()` but `required=True` is set by
    default.
    """
    add_flag(name, *args, required=True, **kwargs)


class FlagAdder:
    """Manage addition of flags."""

    def __init__(self):
{'fraction_non_alphanumeric': 0.13388138578978273, 'fraction_numerical': 0.0, 'mean_word_length': 2.908256880733945, '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': '1616776', 'n_tokens_mistral': 570, 'n_tokens_neox': 545, 'n_words': 173}