code: def output_fn(predictions, accept_type):
      """Placeholder docstring"""
      try:
          if hasattr(schema_builder, "custom_output_translator"):
              return schema_builder.custom_output_translator.serialize(
                  predictions, accept_type
              )
          else:
              return schema_builder.output_serializer.serialize(
                  predictions
              )
      except Exception as e:
          logger.error(
              "Encountered error: %s in serialize_response." % e
          )
          raise Exception(
              "Encountered error in serialize_response."
          ) from e
  
file_path: sagemaker-python-sdk/src/sagemaker/serve/model_server/torchserve/xgboost_inference.py
imports: from __future__ import absolute_import
  import os
  import io
  import subprocess
  import cloudpickle
  import shutil
  import platform
  from pathlib import Path
  from functools import partial
  import logging
label_desc: Use image node_id 4 for calling a global function with example usage: output_fn(predictions, accept_type) and returns: schema_builder, schema_builder