def get_surrounding_sublist_of_length(parent_list, index, length, filler=[]):
    """
    Returns the sublist surrounding an index with length <length> in each
    direction.

    Example:
    list = [2,3,4,5,6]
    index = 2
    length = 1

    yields [3,5]

    :param parent_list:
    :param index:
    :param length:
    :return:
    """
    list_length = len(parent_list)
    lowest_relevant_index = max(index - length, 0)
    highest_relevant_index = min(index + length + 1, list_length)
    list_with_index_removed = parent_list[lowest_relevant_index:index
        ] + filler + parent_list[index + 1:highest_relevant_index]
    return list_with_index_removed
