def add_evidence(node, value):
    '''
    Set a variable node to an observed value.
    Note that for now this is achieved
    by modifying the factor functions
    which this node is connected to.
    After updating the factor nodes
    we need to re-run the sum-product
    algorithm. We also need to normalize
    all marginal outcomes.
    '''
    node.value = value
    neighbours = node.neighbours
    for factor_node in neighbours:
        if get_args(factor_node.func) in node.name:
            factor_node.add_evidence(node, value)
dataset/ETHPy150Open eBay/bayesian-belief-networks/bayesian/factor_graph.py/add_evidence/swapped operands of `in`