code: def number_of_interactions(self, u=None, v=None, t=None):
          
          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
docs: 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
          --------
          >>> G = dn.DynDiGraph()
          >>> G.add_path([0,1,2,3], t=0)
          >>> G.number_of_interactions()
          3
          >>> G.number_of_interactions(0,1, t=0)
          1
          >>> G.add_edge(3, 4, t=1)
          >>> G.number_of_interactions()
          4