code: def _to_graph(self, contexts):
          
          prev = None
  
          for context in contexts:
              if prev is None:
                  prev = context
                  continue
  
              yield prev[0], context[1], context[0]
              prev = context
docs: This is an iterator that returns each edge of our graph
  with its two nodes