def retrieve_train_test_subsequences(train_cases, test_cases, preprocessor):
    """
    Creates subsequences of training and test cases for hpo. Subsequences represent subsets of a case with increasing
    length / prefix sizes.

    Parameters
    ----------
    train_cases : list of dicts, where single dict represents a case
        Training cases for hpo.
    test_cases : list of dicts, where single dict represents a case
        Test cases for hpo.
    preprocessor : nap.preprocessor.Preprocessor
        Object to preprocess input data.

    Returns
    -------
    train_subseq_cases : list of dicts, where single dict represents a subsequence of a case
        Subsequences of the training cases for hpo.
    test_subseq_cases : list of dicts, where single dict represents a subsequence of a case
        Subsequences of the training cases for hpo.

    """

    train_subseq_cases = preprocessor.get_subsequences_of_cases(train_cases)
    test_subseq_cases = preprocessor.get_subsequences_of_cases(test_cases)

    return train_subseq_cases, test_subseq_cases