code: def input_fn(input_data, content_type):
      if content_type == content_types.JSON:
          obj = json.loads(input_data)
          features = obj["instances"][0]["features"]
          array = np.array(features).reshape((1, -1))
          return xgb.DMatrix(array)
      else:
          return xgb_encoders.decode(input_data, content_type)
  
file_path: sagemaker-python-sdk/tests/data/sip/xgboost_source_dir/inference.py
imports: import os
  import pickle
  import json
  import numpy
  import xgboost
  from sagemaker_containers.beta.framework import content_types, encoders, env, modules, transformer, worker
  from sagemaker_xgboost_container import encoder
label_desc: Use image node_id 1 for calling a global function with example usage: input_fn(input_data, content_type) and returns: xgb, xgb_encoders