code: def _heapqmergesorted(key=None, *iterables):
      
  
      if key is None:
          keyed_iterables = iterables
          for element in heapq.merge(*keyed_iterables):
              yield element
      else:
          keyed_iterables = [(_Keyed(key(obj), obj) for obj in iterable)
                             for iterable in iterables]
          for element in heapq.merge(*keyed_iterables):
              yield element.obj
docs: Return a single iterator over the given iterables, sorted by the
      given `key` function, assuming the input iterables are already sorted by
      the same function. (I.e., the merge part of a general merge sort.) Uses
      :func:`heapq.merge` for the underlying implementation.