def slice(ds, idx_start, idx_stop):
    """Retrieve a slice of the dataset."""
    if type(ds) != tuple: raise TypeError("'ds' isn't a tuple")
    if len(ds) != 2: raise ValueError("'ds' isn't a 2-element tuple")
    if idx_stop < idx_start: raise RuntimeError("'idx_start' value of the range has a greater value then 'idx_stop'")

    return (
        ds[0][idx_start:idx_stop, :],
        ds[1][idx_start:idx_stop, :],
    )