<commit_before>from __future__ import division, print_function

def myopen(fname, mode='r'):
    if fname[-2:] == 'gz':
        from gzip import open as gopen
        return gopen(fname, mode)
    else:
        return open(fname, mode)

def make_dir(dname):
    import os
    if not os.path.isdir(dname):
        try:
            os.makedirs(dname)
        except OSError as e:
            print("Cannot create run_dir",e)

def remove_dir(dname, max_attempts=5):
    import os, shutil
    if os.path.isdir(dname):
        # Try to remove the given directory repeatedly to compensate for NFS
        # latency that can result in OSError exceptions when a directory appears
        # not to be empty when shutil attempts to remove it.
        for i in xrange(max_attempts):<commit_msg>adding missing import for remove_dir method.<commit_after>from __future__ import division, print_function

def myopen(fname, mode='r'):
    if fname[-2:] == 'gz':
        from gzip import open as gopen
        return gopen(fname, mode)
    else:
        return open(fname, mode)

def make_dir(dname):
    import os
    if not os.path.isdir(dname):
        try:
            os.makedirs(dname)
        except OSError as e:
            print("Cannot create run_dir",e)

def remove_dir(dname, max_attempts=5):
    import os, shutil, time
    if os.path.isdir(dname):
        # Try to remove the given directory repeatedly to compensate for NFS
        # latency that can result in OSError exceptions when a directory appears
        # not to be empty when shutil attempts to remove it.
        for i in xrange(max_attempts):
{'fraction_non_alphanumeric': 0.07985028072364317, 'fraction_numerical': 0.002495321272613849, 'mean_word_length': 2.6289592760180995, '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': '2044289', 'n_tokens_mistral': 500, 'n_tokens_neox': 485, 'n_words': 173}