code: def _thread_body(self) -> None:
      while True:
          req = self._request_queue.get()
          if isinstance(req, RequestUpload):
              path = req.path
              if req.copy:
                  path = os.path.join(
                      self._tempdir.name,
                      f"{runid.generate_id()}-{req.save_name}",
                  )
                  filesystem.mkdir_exists_ok(os.path.dirname(path))
                  try:
                      # certain linux distros throw an exception when copying
                      # large files: https://bugs.python.org/issue43743
                      shutil.copy2(req.path, path)
                  except OSError:
                      shutil._USE_CP_SENDFILE = False  # type: ignore[attr-defined]
                      shutil.copy2(req.path, path)
              self._stats.init_file(
                  req.save_name, os.path.getsize(path)
              )
              self._output_queue.put(
                  step_upload.RequestUpload(
                      path,
                      req.save_name,
                      None,
                      None,
                      req.copy,
                      None,
                      None,
                      None,
                  )
              )
          elif isinstance(req, RequestStoreManifestFiles):
              for entry in req.manifest.entries.values():
                  if entry.local_path:
                      self._stats.init_file(
                          entry.local_path,
                          cast(int, entry.size),
                          is_artifact_file=True,
                      )
                      self._output_queue.put(
                          step_upload.RequestUpload(
                              entry.local_path,
                              entry.path,
                              req.artifact_id,
                              entry.digest,
                              False,
                              functools.partial(req.save_fn, entry),
                              functools.partial(
                                  req.save_fn_async, entry
                              ),
                              entry.digest,
                          )
                      )
          elif isinstance(req, RequestCommitArtifact):
              self._output_queue.put(
                  step_upload.RequestCommitArtifact(
                      req.artifact_id,
                      req.finalize,
                      req.before_commit,
                      req.result_future,
                  )
              )
          elif isinstance(req, RequestFinish):
              break
          else:
              raise Exception("internal error")
  
      self._output_queue.put(step_upload.RequestFinish(req.callback))
  
imports: import concurrent.futures
  import functools
  import os
  import queue
  import shutil
  import threading
  from typing import TYPE_CHECKING, NamedTuple, Optional, Union, cast
  from wandb.filesync import step_upload
  from wandb.sdk.lib import filesystem, runid
  from wandb.sdk.lib.paths import LogicalPath
label_desc: Use image node_id 2 for calling the StepChecksum obj's underlying member method code with example usage: obj._thread_body() without return types