import random


def random_simple_split(data, split_proportion=0.8):
    """Splits incoming data into two sets, randomly and with no overlapping. Returns the two resulting data objects along
    with two arrays containing the original indices of each element.

    Args:
      data: the data to be split
      split_proportion: proportion of the data to be assigned to the fist split subset. As this function returns
    two subsets, this parameter must be strictly between 0.0 and 1.0 (Default value = 0.8)

    Returns:
      the two resulting datasets and the original index lists

    """
    assert 0.0 < split_proportion < 1.0
    indices = list(range(len(data)))  # all indices in data
    random.shuffle(indices)
    split_index = int(len(data) * split_proportion)
    return data[indices[:split_index]], data[indices[split_index:]], indices[:split_index], indices[split_index:]