def get_consecutive_sublists_of_length(parent_list, length):
    """
    Returns all consecutive sublists of a lists of a given length.

    For example, let parent_list = [1,2,3,4,5] and length=2.
    Then the method will return

    [1,2], [2,3], [3,4], [4,5]

    :param parent_list:
    :param length:
    :return:
    """
    sublists = []
    for i in range(len(parent_list) - length + 1):
        sublists.append(parent_list[i:i + length])
    return sublists
