<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""General-purpose tools shared across linting checks."""
import os
import shelve
import inspect
import functools
import re


def on_heroku():
    """Figure out if we're on Heroku."""
    if 'DYNO' in os.environ:
        return True
    else:
        return False


def memoize(f):
    """Cache results of computations on disk."""
    path_of_this_file = os.path.dirname(os.path.realpath(__file__))

    # Determine the location of the cache.
    if on_heroku():
        cache_dirname = os.path.join(os.path.dirname(path_of_this_file), "tmp")
    else:
        cache_dirname = os.path.join(path_of_this_file, "cache")

    # Create the cache if it does not already exist.<commit_msg>Don't put cache in special place on Heroku<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""General-purpose tools shared across linting checks."""
import os
import shelve
import inspect
import functools
import re


def memoize(f):
    """Cache results of computations on disk."""
    path_of_this_file = os.path.dirname(os.path.realpath(__file__))

    cache_dirname = os.path.join(path_of_this_file, "cache")

    # Create the cache if it does not already exist.
{'fraction_non_alphanumeric': 0.11702127659574468, 'fraction_numerical': 0.0016366612111292963, 'mean_word_length': 3.4963235294117645, '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': '3697360', 'n_tokens_mistral': 395, 'n_tokens_neox': 378, 'n_words': 119}