code: def model_dir(tmp_path_factory, model_name):
      model_dir = tmp_path_factory.mktemp("image_classifier_model_dir")
  
      src_dir = REPO_DIR.joinpath(
          "examples/image_classifier/resnet_18/"
      )
  
      model_url = ResNet18_Weights.DEFAULT.url
  
      download_model(model_url, model_dir)
  
      files = {
          "model.py": model_name + ".py",
          "index_to_name.json": "index_to_name.json",
      }
  
      copy_files(src_dir, model_dir, files)
  
      sys.path.append(model_dir.as_posix())
      yield model_dir
      sys.path.pop()
  
imports: import json
  import math
  import random
  import sys
  from pathlib import Path
  import pytest
  from torchvision.models.resnet import ResNet18_Weights
  from ts.handler_utils.micro_batching import MicroBatching
  from ts.torch_handler.image_classifier import ImageClassifier
  from ts.torch_handler.unit_tests.test_utils.mock_context import MockContext
  from ts.torch_handler.unit_tests.test_utils.model_dir import copy_files, download_model
label_desc: Use image node_id 5 for calling a global function with example usage: model_dir(tmp_path_factory, model_name) without return types