code: def other_set_producer(socket, which_set, image_archive, patch_archive,
                         groundtruth):
      
      patch_images = extract_patch_images(patch_archive, which_set)
      num_patched = 0
      with tar_open(image_archive) as tar:
          filenames = sorted(info.name for info in tar if info.isfile())
          images = (load_from_tar_or_patch(tar, filename, patch_images)
                    for filename in filenames)
          pathless_filenames = (os.path.split(fn)[-1] for fn in filenames)
          image_iterator = equizip(images, pathless_filenames, groundtruth)
          for (image_data, patched), filename, class_index in image_iterator:
              if patched:
                  num_patched += 1
              socket.send_pyobj((filename, class_index), zmq.SNDMORE)
              socket.send(image_data, copy=False)
      if num_patched != len(patch_images):
          raise Exception
docs: Push image files read from the valid/test set TAR to a socket.
  
      Parameters
      ----------
      socket : :class:`zmq.Socket`
          PUSH socket on which to send images.
      which_set : str
          Which set of images is being processed. One of 'train', 'valid',
          'test'.  Used for extracting the appropriate images from the patch
          archive.
      image_archive : str or file-like object
          The filename or file-handle for the TAR archive containing images.
      patch_archive : str or file-like object
          Filename or file handle for the TAR archive of patch images.
      groundtruth : iterable
          Iterable container containing scalar 0-based class index for each
          image, sorted by filename.