import glob
from shutil import copyfile


def process_and_save_examples(read_directory_path, write_directory_path, label, count):
    """Copy training/validation files from one directory to another in a folder with matching label"""
    working_count = count
    for file in glob.glob(read_directory_path + '*.png'):
        copyfile(file, f'{write_directory_path}/{label}/{working_count}.png')
        working_count += 1
    return working_count