<commit_before>from __future__ import unicode_literals

try:
    import io
    StringIO = io.StringIO
except ImportError:
    import StringIO
    StringIO = StringIO.StringIO
import os
import shutil
import sys
import tempfile
import unittest

import mock

import cudnnenv


if 'linux' in sys.platform:
    _available_versions = '''  v2
  v3
  v4
  v5
  v5-cuda8
  v51
  v51-cuda8
  v6
  v6-cuda8
  v7-cuda8
  v7-cuda9
'''
elif sys.platform == 'darwin':
    _available_versions = '''  v2
  v3
  v4
  v5
  v5-cuda8
  v51
  v51-cuda8
  v6
  v6-cuda8
  v7-cuda9
'''


class TestCommand(unittest.TestCase):

    empty_tgz_path = os.path.join(
        os.path.dirname(__file__), 'files', 'cudnn.empty.tar.gz')

    def setUp(self):
        self.path = tempfile.mkdtemp()
        self.original_cudnn_home = cudnnenv.cudnn_home
        cudnnenv.cudnn_home = self.path
        self.stdout = StringIO()
        sys.stdout = self.stdout

    def tearDown(self):<commit_msg>Fix test<commit_after>from __future__ import unicode_literals

try:
    import io
    StringIO = io.StringIO
except ImportError:
    import StringIO
    StringIO = StringIO.StringIO
import os
import shutil
import sys
import tempfile
import unittest

import mock

import cudnnenv


if 'linux' in sys.platform:
    _available_versions = '''  v2
  v3
  v4
  v5
  v5-cuda8
  v51
  v51-cuda8
  v6
  v6-cuda8
  v7-cuda8
  v7-cuda9
  v7.0.1-cuda8
  v7.0.1-cuda9
  v7.0.2-cuda8
  v7.0.2-cuda9
  v7.0.3-cuda8
  v7.0.3-cuda9
'''
elif sys.platform == 'darwin':
    _available_versions = '''  v2
  v3
  v4
  v5
  v5-cuda8
  v51
  v51-cuda8
  v6
  v6-cuda8
  v7-cuda9
  v7.0.1-cuda9
  v7.0.2-cuda9
  v7.0.3-cuda9
'''


class TestCommand(unittest.TestCase):

    empty_tgz_path = os.path.join(
        os.path.dirname(__file__), 'files', 'cudnn.empty.tar.gz')

    def setUp(self):
        self.path = tempfile.mkdtemp()
        self.original_cudnn_home = cudnnenv.cudnn_home
        cudnnenv.cudnn_home = self.path
        self.stdout = StringIO()
        sys.stdout = self.stdout

    def tearDown(self):
{'fraction_non_alphanumeric': 0.0988315481986368, 'fraction_numerical': 0.05063291139240506, 'mean_word_length': 2.5926573426573425, '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': '1836161', 'n_tokens_mistral': 886, 'n_tokens_neox': 863, 'n_words': 169}