def j_to_paths(path_list):
    """ A helper function to retrieve a candidate paths dictionary from JSON.

        Parameters
        ----------
        path_list : list
            a list of dictionaries, each representing a JSON path candidate
            object with from, to, and paths keywords.

        Returns
        -------
        path_dict : dictionary
            a dictionary indexed by a node pair whose value is a list of paths, where each path
            is a list of nodes.
    """
    tmp = {}
    for p in path_list:
        tmp[p["source"],p["target"]] = p["paths"]
    return tmp