<commit_before>import hashlib
import os
import re
import subprocess
import sys
import tempfile

import filelock
import six

from cupy.cuda import device
from cupy.cuda import function


def _get_arch():
    cc = device.Device().compute_capability
    return 'sm_%s' % cc


class TemporaryDirectory(object):

    def __enter__(self):
        self.path = tempfile.mkdtemp()
        return self.path

    def __exit__(self, exc_type, exc_value, traceback):
        if exc_value is not None:
            return

        for name in os.listdir(self.path):
            os.unlink(os.path.join(self.path, name))
        os.rmdir(self.path)


def _run_nvcc(cmd, cwd):
    try:
        return subprocess.check_output(cmd, cwd=cwd)
    except OSError as e:
        trace = sys.exc_info()[2]
        msg = 'Failed to run `nvcc` command: ' + str(e)
        six.reraise(OSError, msg, trace)


def nvcc(source, options=(), arch=None):
    if not arch:<commit_msg>Fix reraise<commit_after>import hashlib
import os
import re
import subprocess
import sys
import tempfile

import filelock
import six

from cupy.cuda import device
from cupy.cuda import function


def _get_arch():
    cc = device.Device().compute_capability
    return 'sm_%s' % cc


class TemporaryDirectory(object):

    def __enter__(self):
        self.path = tempfile.mkdtemp()
        return self.path

    def __exit__(self, exc_type, exc_value, traceback):
        if exc_value is not None:
            return

        for name in os.listdir(self.path):
            os.unlink(os.path.join(self.path, name))
        os.rmdir(self.path)


def _run_nvcc(cmd, cwd):
    try:
        return subprocess.check_output(cmd, cwd=cwd)
    except OSError as e:
        trace = sys.exc_info()[2]
        msg = 'Failed to run `nvcc` command: ' + str(e)
        six.reraise(OSError, OSError(msg), trace)


def nvcc(source, options=(), arch=None):
    if not arch:
{'fraction_non_alphanumeric': 0.10089332632685234, 'fraction_numerical': 0.0010509721492380452, 'mean_word_length': 2.823293172690763, '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': '3787896', 'n_tokens_mistral': 649, 'n_tokens_neox': 626, 'n_words': 174}