<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_edge(self, u, v, **kwargs):
 """ Add an edge between variable_node and factor_node. Parameters u, v: nodes Nodes can be any hashable Python object. Examples -------- """

        if u != v:
            super(FactorGraph, self).add_edge(u, v, **kwargs)
        else:
            raise ValueError('Self loops are not allowed')