def _is_parent_pathway(shortest_path, targets):
    """Returns true if ShortestPath is a parent pathway, false if not.

    A ShortestPath object is the parent of a branch if its terminal residue is the
    only surface exposed residue in the path. For example, if targets=[A,B,C] and
    the pathway is [H,I,C], then this pathway is a parent pathway. In contrast, if
    the pathway is [H,B,A], then this pathway is not a parent pathway.

    Parameters
    ----------
    shortest_path: ShortestPath
        ShortestPath object
    targets: list of str
        List of surface exposed residues

    Returns
    -------
    bool
        True if path is ShortestPath object is a parent pathway
    """

    count = 0
    for res in shortest_path.path:
        if res in targets:
            count += 1
    return count == 1