code: def context(tmp_path_factory):
      model_dir = tmp_path_factory.mktemp("model_dir")
  
      shutil.copytree(
          REPO_DIR.joinpath("examples/image_classifier/mnist/"),
          model_dir,
          dirs_exist_ok=True,
      )
  
      context = MockContext(
          model_name="mnist",
          model_dir=model_dir.as_posix(),
          model_file="mnist.py",
          model_pt_file="mnist_cnn.pt",
      )
  
      sys.path.append(model_dir.as_posix())
      yield context
      sys.path.pop()
  
file_path: serve/ts/torch_handler/unit_tests/test_mnist_kf.py
imports: import io
  import shutil
  import sys
  from pathlib import Path
  import pytest
  import torchvision.transforms
  from PIL import Image
  from examples.image_classifier.mnist.mnist_handler import MNISTDigitClassifier
  from ts.torch_handler.request_envelope import kserve, kservev2
  from .test_utils.mock_context import MockContext
label_desc: Use image node_id 2 for calling a global function with example usage: context(tmp_path_factory) without return types