<jupyter_start><jupyter_text>From excel sheet create map for all the images mentioned in sheet<jupyter_code># split_directory_by_labels(src_train_directory_all, src_train_directory, label_map, label_map_names, reset=True)
# label_dir(test_from_directory, test_to_directory, sample_label_map, label_map_names, reset=True)<jupyter_output><empty_output><jupyter_text>From labels saved in excel file create diferent directory for different class for a directory with multiple classes<jupyter_code>master_dir=src_train_directory
master_dir_type = "train"
train_dir=dest_train_directory
# train_dir=None
validation_dir = dest_validation_directory
test_dir = dest_test_directory
train_percent = 60
validation_percent = 20
test_percent = 20    
copy=True

train_validation_test_split_main(master_dir, master_dir_type, train_dir, validation_dir, test_dir, train_percent, validation_percent, test_percent, copy)
# for directory in os.listdir(master_directory):
#     sub_directory = os.path.join(master_directory, directory)
#     sub_directory_files = os.listdir(sub_directory)
#     count_files = len(sub_directory_files)
#     print(directory, count_files)
#     train_count = count_files*.7
#     validate_count = train_count+count_files*.2
#     test_count = validate_count+count_files*.1
    
#     cat_train_dir = os.path.join(train_to_directory, directory)
#     cat_test_dir = os.path.join(test_to_directory, directory)
#     cat_validate_dir = os.path.join(validate_to_directory, directory)
    
#     if not os.path.isdir(cat_train_dir):
#         os.mkdir(cat_train_dir)
        
#     if not os.path.isdir(cat_validate_dir):
#         os.mkdir(cat_validate_dir)
    
#     if not os.path.isdir(cat_test_dir):
#         os.mkdir(cat_test_dir)
                 

    
#     from_dir_path = os.path.join(master_directory, directory)
#     from_dir_files= os.listdir(from_dir_path)
#     i = 0
#     for filename in from_dir_files:
#         try:
#             file_path_from = os.path.join(from_dir_path, filename)
#             if i<=train_count:
#                 shutil.copyfile(file_path_from, os.path.join(cat_train_dir, filename))
#             elif i<=validate_count:
#                 shutil.copyfile(file_path_from, os.path.join(cat_validate_dir, filename))
#             else:
#                 shutil.copyfile(file_path_from, os.path.join(cat_test_dir, filename))

#         except:
#             print("Exception for index: ", i, "Breed: ", label, ", File: ", file_path_from)
#         i+=1<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09281200631911532, 'fraction_numerical': 0.004344391785150079, 'mean_word_length': 3.947265625, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '407191', 'license': 'MIT', 'n_tokens_mistral': 841, 'n_tokens_neox': 825, 'n_words': 142, 'path': 'code/data_helper.ipynb', 'repo_name': 'kenneth004/Cancer-Detection-from-Microscopic-Tissue-Images-with-Deep-Learning-', 'size': '2532'}