def parse_edges_and_weights(
    data: str, start_string: str = "Distance", end_string: str = "# Source",
) -> list:
    """Return a list of edges with weights.
    
    This function will parse through the read-in input data between strings ''start_string'' and ''end_string''
    to return the filtered text in-between.
    This text is then converted to a list of sub-lists, where each sub-list is of the form:
    [from_vertex, to_vertex, weight].

    :param data: read-in input file
    :type data: str
    :param start_string: starting string to search from, defaults to 'Distance'
    :type start_string: str
    :param end_string: ending string to search until, defaults to '# Source'
    :type end_string: str
    :return: a list of lists of edges and weights
    :rtype: list
    """
    # split the data on the two strings
    list_of_edges = data.split(start_string)[-1].split(end_string)[0]
    # split the data on newline character
    list_of_edges = list_of_edges.split("\n")
    # remove empty strings that arose due to whitespace by using filter
    list_of_edges = list(filter(lambda x: x != "", list_of_edges))

    # create a list of lists of type [from, to, weight] by splitting on the comma character
    list_of_lists_edges = []
    for i in list_of_edges:
        splitted_string = i.split(",")
        # convert the splitted string elements to integer
        sublist_of_edges = [int(i) for i in splitted_string]
        # append the sublist to the major list
        list_of_lists_edges.append(sublist_of_edges)

    return list_of_lists_edges