code: def _invoke_xz(self, xz_input_file):
      
      # TODO: --threads=0 is supposed to use "the number of processor cores on the machine", but I
      # see no more than 100% cpu used at any point. This seems like it could be a bug? If performance
      # is an issue, investigate further.
      cmd = [self._xz_binary_path, '--decompress', '--stdout', '--keep', '--threads=0', xz_input_file]
  
      try:
        # Pipe stderr to our own stderr, but leave stdout open so we can yield it.
        process = subprocess.Popen(
          cmd,
          stdout=subprocess.PIPE,
          stderr=sys.stderr)
      except OSError as e:
        raise self.XZArchiverError(
          "Error invoking xz with command {} for input file {}: {}"
          .format(cmd, xz_input_file, e),
          e)
  
      # This is a file object.
      yield process.stdout
  
      rc = process.wait()
      if rc != 0:
        raise self.XZArchiverError(
          "Error decompressing xz input with command {} for input file {}. Exit code was: {}. "
          .format(cmd, xz_input_file, rc))
docs: Run the xz command and yield a file object for its stdout.
  
      This allows streaming the decompressed tar archive directly into a tar decompression stream,
      which is significantly faster in practice than making a temporary file.