code: def group_by_key_impl(sequence):
      
      result = {}
      for element in sequence:
          if result.get(element[0]):
              result.get(element[0]).append(element[1])
          else:
              result[element[0]] = [element[1]]
      return six.viewitems(result)
docs: Implementation for group_by_key_t
      :param sequence: sequence to group
      :return: grouped sequence