<commit_before>"""Some helper functions for the project"""
import os


def get_ultimate_parent(obj):
    """Returns the ultimate parent of any object.

    In order to get to the ultimate parent, we need to know
    how to find it. The default has is that the object has
    a property called parent.

    """
    if obj.parent:
        return get_ultimate_parent(obj.parent)
    else:
        return obj


def get_media_file_path(instance, filename):
    """Puts any uploaded file in the right place."""
    tmp, ext = os.path.splitext(filename)
    value = os.path.join(
        instance.get_class_name(),
        unicode(instance.uuid) + ext)
    return value


def commas_format(value):
    res = '{:,}'.format(value)
    parts = res.split('.')
    if len(parts) > 1 and parts[1] == '00':
        res = parts[0]
    return res
<commit_msg>Removed agorot from all parsed amounts in commas_format()<commit_after>"""Some helper functions for the project"""
import os


def get_ultimate_parent(obj):
    """Returns the ultimate parent of any object.

    In order to get to the ultimate parent, we need to know
    how to find it. The default has is that the object has
    a property called parent.

    """
    if obj.parent:
        return get_ultimate_parent(obj.parent)
    else:
        return obj


def get_media_file_path(instance, filename):
    """Puts any uploaded file in the right place."""
    tmp, ext = os.path.splitext(filename)
    value = os.path.join(
        instance.get_class_name(),
        unicode(instance.uuid) + ext)
    return value


def commas_format(value):
    res = '{:,}'.format(value)
    parts = res.split('.')
    if len(parts) > 1:
        res = parts[0]
    return res

{'fraction_non_alphanumeric': 0.10415447630193095, 'fraction_numerical': 0.004095962551199532, 'mean_word_length': 2.8340807174887894, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4715925', 'n_tokens_mistral': 530, 'n_tokens_neox': 512, 'n_words': 182}