code: def chdir(__path: str) -> ContextManager:
      
      old = os.getcwd()
      try:
          os.chdir(__path)
          yield
      finally:
          os.chdir(old)
docs: Context handler to temporarily switch directories.
  
      Args:
          __path: Directory to change to
  
      Yields:
          Execution context in ``path``