<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cloned_workspace(clone_config, chdir=True):
 """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. """

    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()