import time


def create_datasplit(train_set, validation_set, test_set, name=None):
    """Create a datasplit dict from user-defined data sets

    Args:
        train_set (set): set of audio file paths
        valid_set (set): set of audio file paths
        test_set (set): set of audio file paths
        name (str): name of the datasplit (set to unix timestamp if not
            specified)

    Returns:
        a dict with train_set, validation_set and test_set, as sets of
        audio file paths
    """
    if not name:
        name = int(time.time())
    return {"id": "{}".format(name),
            "sets": {"train": train_set,
                     "validation": validation_set,
                     "test": test_set}
           }