code: def work_dir(dirname):
      orig_dir = os.getcwd()
      os.chdir(dirname)
      yield
      os.chdir(orig_dir)
  
file_path: pfrl/tests/experiments_tests/test_prepare_output_dir.py
imports: import contextlib
  import itertools
  import json
  import os
  import subprocess
  import sys
  import tempfile
  import pytest
  import pfrl
label_desc: Use image node_id 1 for calling a global function with example usage: work_dir(dirname) without return types