code: def inter_event_time_distribution(self, u=None, v=None):
          
          dist = {}
          if u is None:
              # global inter event
              first = True
              delta = None
              for ext in self.stream_interactions():
                  if first:
                      delta = ext
                      first = False
                      continue
                  disp = ext[-1] - delta[-1]
                  delta = ext
                  if disp in dist:
                      dist[disp] += 1
                  else:
                      dist[disp] = 1
  
          elif u is not None and v is None:
              # node inter event
              delta = (0, 0, 0, 0)
              flag = False
              for ext in self.stream_interactions():
                  if ext[0] == u or ext[1] == u:
                      if flag:
                          disp = ext[-1] - delta[-1]
                          delta = ext
                          if disp in dist:
                              dist[disp] += 1
                          else:
                              dist[disp] = 1
                      else:
                          delta = ext
                          flag = True
          else:
              # interaction inter event
              evt = self._adj[u][v]['t']
              delta = []
  
              for i in evt:
                  if i[0] != i[1]:
                      for j in [0, 1]:
                          delta.append(i[j])
                  else:
                      delta.append(i[0])
  
              if len(delta) == 2 and delta[0] == delta[1]:
                  return {}
  
              for i in range(0, len(delta) - 1):
                  e = delta[i + 1] - delta[i]
                  if e not in dist:
                      dist[e] = 1
                  else:
                      dist[e] += 1
  
          return dist
docs: Return the distribution of inter event time.
          If u and v are None the dynamic graph intere event distribution is returned.
          If u is specified the inter event time distribution of interactions involving u is returned.
          If u and v are specified the inter event time distribution of (u, v) interactions is returned
  
          Parameters
          ----------
  
          u : node id
          v : node id
  
          Returns
          -------
  
          nd : dictionary
              A dictionary from inter event time to number of occurrences