class_docstr: Prevent __pycache__ files from being added to the checkpoint.
code: def find_spec(self, name, path=None, target=None):
      spec = super().find_spec(name, path, target)
      if spec is not None and spec.loader is not None:
          old_loader = spec.loader
  
          class NoCacheLoader(type(old_loader)):  # type: ignore
              def __init__(wrapper) -> None:
                  pass
  
              def set_data(wrapper, *args, **kwarg):
                  # We don't want to generate __pycache__
                  # directories in the checkpoint dir.
                  raise NotImplementedError()
  
              def __getattr__(wrapper, *args, **kwargs):
                  return getattr(old_loader, *args, **kwargs)
  
              def __setattr__(wrapper, *args, **kwargs):
                  return setattr(old_loader, *args, **kwargs)
  
              def __delattr__(wrapper, *args, **kwargs):
                  return delattr(old_loader, *args, **kwargs)
  
          spec.loader = NoCacheLoader()
  
      return spec
  
file_path: determined/harness/determined/_import.py
imports: import contextlib
  import os
  import sys
  from importlib import machinery
  from typing import Iterator, Set, no_type_check
label_desc: Use image node_id 1 for calling the NoCachePathFinder obj's underlying member method code with example usage: obj.find_spec(name, path, target) and returns: spec, getattr, setattr, delattr