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

# import funkcí z jiného adresáře
import os
import os.path

from nose.plugins.attrib import attr
path_to_script = os.path.dirname(os.path.abspath(__file__))
import unittest

import shutil
import numpy as np


# from imtools import qmisc
# from imtools import misc


import imtools.sample_data as sd
#

class SampleDataTest(unittest.TestCase):
    interactivetTest = False
    # interactivetTest = True
    def sample_data_test(self):
        sd.get_sample_data("head", "delete_head")
        self.assertTrue(os.path.exists("./delete_head/matlab/examples/sample_data/DICOM/digest_article/brain_001.dcm"))
        shutil.rmtree("delete_head")


        # import imtools.vesseltree_export as vt
        # yaml_input = os.path.join(path_to_script, "vt_biodur.yaml")
        # yaml_output = os.path.join(path_to_script, "delme_esofspy.txt")
        # vt.vt2esofspy(yaml_input, yaml_output)

    def sample_data_batch_test(self):
        sd.get_sample_data(["head", "exp_small"], "delete_sample_data")
        self.assertTrue(os.path.exists("./delete_sample_data/exp_small/seeds/org-liver-orig003-seeds.pklz"))
        self.assertTrue(os.path.exists("./delete_sample_data/matlab/examples/sample_data/DICOM/digest_article/brain_001.dcm"))
        shutil.rmtree("delete_sample_data")

if __name__ == "__main__":
    unittest.main()<commit_msg>delete sample data before test<commit_after>#! /usr/bin/python
# -*- coding: utf-8 -*-

# import funkcí z jiného adresáře
import os
import os.path

from nose.plugins.attrib import attr
path_to_script = os.path.dirname(os.path.abspath(__file__))
import unittest

import shutil
import numpy as np


# from imtools import qmisc
# from imtools import misc


import imtools.sample_data as sd
#

class SampleDataTest(unittest.TestCase):
    interactivetTest = False
    # interactivetTest = True
    def sample_data_test(self):
        sd.get_sample_data("head", "delete_head")
        self.assertTrue(os.path.exists("./delete_head/matlab/examples/sample_data/DICOM/digest_article/brain_001.dcm"))
        shutil.rmtree("delete_head")


        # import imtools.vesseltree_export as vt
        # yaml_input = os.path.join(path_to_script, "vt_biodur.yaml")
        # yaml_output = os.path.join(path_to_script, "delme_esofspy.txt")
        # vt.vt2esofspy(yaml_input, yaml_output)

    def sample_data_batch_test(self):
        tmp_sample_data_path = "delete_sample_data"
        if os.path.exists(tmp_sample_data_path):
            shutil.rmtree(tmp_sample_data_path)

        sd.get_sample_data(["head", "exp_small"], tmp_sample_data_path)
        self.assertTrue(os.path.exists("./delete_sample_data/exp_small/seeds/org-liver-orig003-seeds.pklz"))
        self.assertTrue(os.path.exists("./delete_sample_data/matlab/examples/sample_data/DICOM/digest_article/brain_001.dcm"))
        shutil.rmtree(tmp_sample_data_path)

if __name__ == "__main__":
    unittest.main()
{'fraction_non_alphanumeric': 0.11539763113367174, 'fraction_numerical': 0.007445008460236886, 'mean_word_length': 3.9348914858096826, 'pattern_counts': {'":': 2, '<': 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': '3594949', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1037, 'n_words': 158}