def METHOD_NAME(cls, parent, child):
    """
    :param ControlFlowContext|None parent:
    :param ControlFlowContext|None child:
    :rtype: bool
    """
    if parent == child:
        return True
    if not parent:
        return True  # parent is root
    if not child:
        return False  # child is root but parent is not
    while child:
        if child == parent:
            return True
        child = child.outer_ctx
    return False