code: def post_processing(data, context):
      if data:
          if isinstance(data, list):
              data = data[0]
          data = data.get("data") or data.get("body")
          data = torch.load(io.BytesIO(data))
  
          properties = context.system_properties
          model_dir = properties.get("model_dir")
          mapping_file_path = os.path.join(
              model_dir, "index_to_name.json"
          )
          mapping = load_label_mapping(mapping_file_path)
  
          ps = F.softmax(data, dim=1)
          probs, classes = torch.topk(ps, topk, dim=1)
          probs = probs.tolist()
          classes = classes.tolist()
          return map_class_to_label(probs, mapping, classes)
  
file_path: serve/frontend/server/src/test/resources/densenet_workflow_handler.py
imports: import io
  import logging
  import os
  from PIL import Image
  import torch.nn.functional
  import torch
  import itertools
  import json
  from torchvision import transforms
label_desc: Use image node_id 2 for calling a global function with example usage: post_processing(data, context) and returns: map_class_to_label