<commit_before>from __future__ import division, absolute_import, print_function

import os
import re
import sys
import imp
import copy
import glob
import atexit
import tempfile
import subprocess
import shutil

import distutils
from distutils.errors import DistutilsError
try:
    from threading import local as tlocal
except ImportError:
    from dummy_threading import local as tlocal

# stores temporary directory of each thread to only create one per thread
_tdata = tlocal()

# store all created temporary directories so they can be deleted on exit
_tmpdirs = []
def clean_up_temporary_directory():
    for d in _tmpdirs:
        try:
            shutil.rmtree(d)
        except OSError:
            pass

atexit.register(clean_up_temporary_directory)

try:
    set
except NameError:
    from sets import Set as set<commit_msg>numpy/distutils/misc_util.py fix for #7809: check that _tmpdirs is not None<commit_after>from __future__ import division, absolute_import, print_function

import os
import re
import sys
import imp
import copy
import glob
import atexit
import tempfile
import subprocess
import shutil

import distutils
from distutils.errors import DistutilsError
try:
    from threading import local as tlocal
except ImportError:
    from dummy_threading import local as tlocal

# stores temporary directory of each thread to only create one per thread
_tdata = tlocal()

# store all created temporary directories so they can be deleted on exit
_tmpdirs = []
def clean_up_temporary_directory():
    if _tmpdirs is not None:
        for d in _tmpdirs:
            try:
                shutil.rmtree(d)
            except OSError:
                pass

atexit.register(clean_up_temporary_directory)

try:
    set
except NameError:
    from sets import Set as set
{'fraction_non_alphanumeric': 0.03722504230118443, 'fraction_numerical': 0.0022560631697687537, 'mean_word_length': 3.668421052631579, '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': '6585309', 'n_tokens_mistral': 504, 'n_tokens_neox': 492, 'n_words': 205}