Return a list of parent nodes that dominate this child.

    In a 'syntax tree' a node never has more than one parent node
    dominating it. To enforce this, set strict=True.

    Parameters
    ----------
    docgraph : DiscourseDocumentGraph
        a document graph
    strict : bool
        If True, raise a ValueError if a child node is dominated
        by more than one parent node.

    Returns
    -------
    parents : list
        a list of (parent) node IDs.

def get_parents(docgraph, child_node, strict=True):
    """Return a list of parent nodes that dominate this child.

    In a 'syntax tree' a node never has more than one parent node
    dominating it. To enforce this, set strict=True.

    Parameters
    ----------
    docgraph : DiscourseDocumentGraph
        a document graph
    strict : bool
        If True, raise a ValueError if a child node is dominated
        by more than one parent node.

    Returns
    -------
    parents : list
        a list of (parent) node IDs.
    """
    parents = []
    for src, _, edge_attrs in docgraph.in_edges(child_node, data=True):
        if edge_attrs['edge_type'] == EdgeTypes.dominance_relation:
            parents.append(src)

    if strict and len(parents) > 1:
        raise ValueError(("In a syntax tree, a node can't be "
                          "dominated by more than one parent"))
    return parents