<commit_before>============
mxs_dict API
============

**fromkeys** ``keys`` ``default:undefined``
    Returns a dict instance build from the
    given keys and the supplied default value.

**has_key** ``key``
    Returns True if the key is part
    of the dict, False otherwise.

**get** ``key`` ``default:undefined``
    Returns the value that belongs to the given key
    or the supplied default, if the key does not exist.

**keys**
    Returns a list of keys.

**values**
    Returns a list of values.

**items**
    Returns a list of key-value tuples.

**clear**
    Resets the internal key and value
    arrays, thus emptying the dict.

**add** ``key`` ``val``
    Adds a new key-value pair if the key is new.
    Updates the value for the existing key otherwise.

**set_** ``key`` ``val``
    Can be used as an alias for add().
    set() unfortunately is a reserved MXS keyword.

**copy**
    Returns a shallow copy of this dict.
    If the keys or values are referenced datatypes,
    these references are kept intact, no copies are made.

**pop** ``key`` ``default:``
    Returns the value for the given key,
    effectively removing this item from the dict.
    If a default value is supplied, this is
    returned instead of the actual value.
    Returns undefined if the key does not exist.

**popitem**
    Updates this dict in-place with the supplied one.
    New key-value pairs are added, existing ones are updated.
    Can be used e.g. to merge two dicts into one.

**update** ``dict_``
    Updates this dict in-place with the supplied one.
    New key-value pairs are added, existing ones are updated.
    Can be used e.g. to merge two dicts into one.

**sort_by_key** ``reversed:False``
    In-place sorting of the dict's items based
    on the alphabet-/numer-ical order of the keys.

**sort_by_value** ``reversed:False``
    In-place sorting of the dict's items based
    on the alphabet-/numer-ical order of the values.
<commit_msg>Add API description for mxs_defaultdict<commit_after>============
mxs_dict API
============

**fromkeys** ``keys`` ``default:undefined``
    Returns a dict instance build from the
    given keys and the supplied default value.

**has_key** ``key``
    Returns True if the key is part
    of the dict, False otherwise.

**get** ``key`` ``default:undefined``
    Returns the value that belongs to the given key
    or the supplied default, if the key does not exist.

**keys**
    Returns a list of keys.

**values**
    Returns a list of values.

**items**
    Returns a list of key-value tuples.

**clear**
    Resets the internal key and value
    arrays, thus emptying the dict.

**add** ``key`` ``val``
    Adds a new key-value pair if the key is new.
    Updates the value for the existing key otherwise.

**set_** ``key`` ``val``
    Can be used as an alias for add().
    set() unfortunately is a reserved MXS keyword.

**copy**
    Returns a shallow copy of this dict.
    If the keys or values are referenced datatypes,
    these references are kept intact, no copies are made.

**pop** ``key`` ``default:``
    Returns the value for the given key,
    effectively removing this item from the dict.
    If a default value is supplied, this is
    returned instead of the actual value.
    Returns undefined if the key does not exist.

**popitem**
    Updates this dict in-place with the supplied one.
    New key-value pairs are added, existing ones are updated.
    Can be used e.g. to merge two dicts into one.

**update** ``dict_``
    Updates this dict in-place with the supplied one.
    New key-value pairs are added, existing ones are updated.
    Can be used e.g. to merge two dicts into one.

**sort_by_key** ``reversed:False``
    In-place sorting of the dict's items based
    on the alphabet-/numer-ical order of the keys.

**sort_by_value** ``reversed:False``
    In-place sorting of the dict's items based
    on the alphabet-/numer-ical order of the values.


===================
mxs_defaultdict API
===================

The mxs_defaultdict shares its API with the mxs_dict
with the following exceptions:

**default_factory**
    Holds a function (or class/struct name) that is
    called to create a default value for an unknown key.

**get** ``key``
    Returns the value that belongs to the given key.
    If the key is unknown, it is added to the dictionary
    using the value returned by the default_factory method
    and then returned.
{'fraction_non_alphanumeric': 0.1058584030762271, 'fraction_numerical': 0.0, 'mean_word_length': 3.239693192713327, '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': '1419254', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1239, 'n_words': 628}