code: def test_resnet18(batch_size=1):
      # Define your handler
      handler = ImageClassifier()
  
      # Context definition
      ctx = MockContext(
          model_pt_file=MODEL_PT_FILE,
          model_dir=EXAMPLE_ROOT_DIR.as_posix(),
          model_file=None,
      )
  
      torch.manual_seed(42 * 42)
      handler.initialize(ctx)
      handler.context = ctx
  
      data = prepare_data(batch_size)
  
      # Here we are using the BaseHandler's handle method. You can define your own
      result = handler.handle(data, ctx)
      logger.info(f"Result is {result}")
  
      # Can be used with pytest
      value = max(result[0], key=result[0].get)
      assert value == "tabby"
  
file_path: serve/examples/image_classifier/resnet_18/debugging_backend/test_handler.py
imports: import argparse
  import io
  import logging
  from pathlib import Path
  import torch
  from ts.torch_handler.image_classifier import ImageClassifier
  from ts.torch_handler.unit_tests.test_utils.mock_context import MockContext
label_desc: Use image node_id 2 for calling a global function with example usage: test_resnet18(batch_size) without return types