code: def cloned_workspace(clone_config, chdir=True):
      
      workspace = ClonedWorkspace(clone_config)
      original_dir = os.getcwd()
      if chdir:
          os.chdir(workspace.clone_dir)
  
      try:
          yield workspace
      finally:
          os.chdir(original_dir)
          workspace.cleanup()
docs: Create a cloned workspace and yield it.
  
      This creates a workspace for a with-block and cleans it up on exit. By
      default, this will also change to the workspace's `clone_dir` for the
      duration of the with-block.
  
      Args:
          clone_config: The execution engine configuration to use for the workspace.
          chdir: Whether to change to the workspace's `clone_dir` before entering the with-block.
  
      Yields: The `CloneWorkspace` instance created for the context.