<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def number_of_interactions(self, u=None, v=None, t=None):
 """Return the number of interaction between two nodes at time t. Parameters u, v : nodes, optional (default=all interaction) If u and v are specified, return the number of interaction between u and v. Otherwise return the total number of all interaction. t : snapshot id (default=None) If None will be returned the number of edges on the flattened graph. Returns ------- nedges : int The number of interaction in the graph. If nodes u and v are specified return the number of interaction between those nodes. If a single node is specified return None. See Also -------- size Examples -------- 3 1 4 """

        if t is None:
            if u is None:
                return int(self.size())
            elif u is not None and v is not None:
                if v in self._succ[u]:
                    return 1
                else:
                    return 0
        else:
            if u is None:
                return int(self.size(t))
            elif u is not None and v is not None:
                if v in self._succ[u]:
                    if self.__presence_test(u, v, t):
                        return 1
                    else:
                        return 0