def find_parent(
        child: str,
        parent_of: dict,
        recursive=False):

    """
    Find the parent or great-great-...-great-parent of a child

    Required Parameters
    -------------------
    child: str
        If this is already the greatest-parent, will return itself
        otherwise, raise KeyError

    parent_of: dict
        dictionary with key = child and value = parent, eg:
            parent_of = {}
            parent_of["child"] = "parent"

    Other Parameters
    ----------------
    recursive: bool (default: False)
        if True, look for greatest-parent of a child.

    Returns
    -------
    itself, the Parent or the greatest-parent
    """
    try:
        parent = parent_of[child]
    except KeyError:
        if child in parent_of.values():
            return child
        raise
    if recursive:
        return find_parent(parent, parent_of)
    else:
        return parent