def get_phase_dataset(dataset_source, is_test_phase):
    """ Obtain the dataset of the required phase train/test. """
    if not is_test_phase:
        dataset = dataset_source.get_train_set()
    else:
        dataset = dataset_source.get_test_set()

    return dataset