code: def chdir(new_dir):
      old_dir = os.getcwd()
      try:
          os.chdir(new_dir)
          sys.path.insert(0, new_dir)
          yield
      finally:
          del sys.path[0]
          os.chdir(old_dir)
  
imports: import shutil
  import os
  from setuptools import Extension, setup
  import contextlib
  import io
  import os.path
  import json
  import tempfile
  from setuptools.command.build_ext import build_ext, new_compiler
  from Cython.Build import cythonize
  import subprocess
  import sys
  import platform
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: chdir(new_dir) without return types