code: def cd(newdir):
      prevdir = os.getcwd()
      os.chdir(os.path.expanduser(newdir))
      try:
          yield
      finally:
          os.chdir(prevdir)
  
file_path: dvc/tests/utils/__init__.py
imports: import csv
  import os
  from contextlib import contextmanager
  import pytest
  from funcy import first
  from dvc.scm import Git
label_desc: Use image node_id 2 for calling a global function with example usage: cd(newdir) without return types