def get_batch(data, current_batch_index, batch_size, fixed_batch_size=True, continuous_batches=False):
    """
        This function returns a batch of data with the correct size and taken from the correct place.

        Input:
            data: list, holds any type of data that we need to get a batch from;
            current_batch_index: int, which batch are we taking from this data;
            batch_size: int, how big a batch should be;
            fixed_batch_size: bool, does the batch have to be in a fixed size, if False, then the batch may be in a size
                that is in the range [batch_size, 2 * batch_size)
            continuous_batches: bool, do the batches have to be taken in a continuous manner. For example:
                    data = [1,2,3,4,5,6,7,8,9]
                    batch_size = 3
                    Then with continuous_batches off we get 3 batches - [1, 2, 3], [4, 5, 6], [7, 8, 9]
                    Then with continuous_batches on we get 3 batches - [1, 4, 7], [2, 5, 8], [3, 6, 9].

        Output:
            batch: list, a batch taken from the data.
    """

    # Get the number of batches
    number_of_batches = len(data) // batch_size

    if continuous_batches:  # If the batches are continuous we need to take it with a for loop
        batch = []
        if fixed_batch_size:
            for j in range(current_batch_index, number_of_batches * batch_size, number_of_batches):
                batch.append(data[j])
        else:  # This might return a batch of data that is larger than batch_size
            for j in range(current_batch_index, len(data), number_of_batches):
                batch.append(data[j])
    else:  # If batches don't have to be continuous
        # If this isn't the last batch, or if it is the last batch, but the batch size is fixed
        if fixed_batch_size or current_batch_index != number_of_batches - 1:
            batch = data[current_batch_index * batch_size: current_batch_index * batch_size + batch_size]
        else:
            # Take the remaining data
            batch = data[current_batch_index * batch_size:]

    return batch