import random


def create_split(train_dict, split_size = .10, seed = 7):
    """
    Function to create validation data from existing train data.
    Args:
    train_dict: Dictionary containing training images.
    split_size: Validation size.
    seed: Random seed for reproducing splits.

    Example:
    create_split(train_dict = train_dict, split_size = 0.10, seed = 7)
    """
    random.seed(seed)

    val_dict = dict(random.sample(list(train_dict.items()), int(len(train_dict)*split_size)))

    train_dict = {key:value for key, value in train_dict.items() if key not in val_dict.keys()}

    return train_dict, val_dict