code: def _conversations(group, delta=datetime.timedelta(hours=1)):
      
      last_time = None
      results = []
      for g in group:
  
          if last_time is None or g.datetime - last_time < delta:
              if g.interaction == 'text':
                  results.append(g)
  
              # A call always ends a conversation
              else:
                  if len(results) != 0:
                      yield results
                      results = []
  
          else:
              if len(results) != 0:
                  yield results
  
              if g.interaction == 'call':
                  results = []
              else:
                  results = [g]
  
          last_time = g.datetime
  
      if len(results) != 0:
          yield results
docs: Group texts into conversations. The function returns an iterator over
      records grouped by conversations.
  
      See :ref:`Using bandicoot <conversations-label>` for a definition of
      conversations.
  
      A conversation begins when one person sends a text-message to the other and
      ends when one of them makes a phone call or there is no activity between
      them for an hour.