code: def working_directory(path):
      """
      A context manager which changes the working directory to the given
      path, and then changes it back to its previous value on exit.
      Usage:
      > # Do something in original directory
      > with working_directory('/my/new/path'):
      >     # Do something in new directory
      > # Back to old directory
  
      Credit goes to @anjos .
      """
  
      prev_cwd = os.getcwd()
      os.chdir(path)
      try:
          yield
      finally:
          os.chdir(prev_cwd)
  
file_path: imageio/tests/conftest.py
imports: import contextlib
  import os
  import shutil
  import sys
  import warnings
  from functools import wraps
  from pathlib import Path
  import pytest
  import imageio
label_desc: Use image node_id 3 for calling a global function with example usage: working_directory(path) without return types