code: def preserve_cwd(path):
      cwd = os.getcwd()
      os.chdir(path)
      try:
          yield
      finally:
          os.chdir(cwd)
  
imports: import io
  import os
  import random
  import string
  import tempfile
  from contextlib import contextmanager
  from datetime import datetime
  from math import sqrt
  from time import perf_counter
  import numpy
  from attr import dataclass
  from PIL import Image
  from PIL.PngImagePlugin import PngImageFile
  import neptune
  from neptune.internal.container_type import ContainerType
  from tests.e2e.exceptions import MissingEnvironmentVariable
label_desc: Use image node_id 3 for calling a global function with example usage: preserve_cwd(path) without return types