class_docstr: Base default handler to load torchscript or eager mode [state_dict] models
  Also, provides handle method per torch serve custom model specification
class_docstr_tok: ["Base","default","handler","to","load","torchscript","or","eager","mode","[","state_dict","]","models","Also",",","provides","handle","method","per","torch","serve","custom","model","specification"]
docstr: Entry point for default handler. It takes the data from the input request and returns
     the predicted outcome for the input.
  
  Args:
      data (list): The input data that needs to be made a prediction request on.
      context (Context): It is a JSON Object containing information pertaining to
                         the model artifacts parameters.
  
  Returns:
      list : Returns a list of dictionary with the predicted response.
docstr_tok: ["Entry","point","for","default","handler",".","It","takes","the","data","from","the","input","request","and","returns","the","predicted","outcome","for","the","input",".","Args",":","data","(","list",")",":","The","input","data","that","needs","to","be","made","a","prediction","request","on",".","context","(","Context",")",":","It","is","a","JSON","Object","containing","information","pertaining","to","the","model","artifacts","parameters",".","Returns",":","list",":","Returns","a","list","of","dictionary","with","the","predicted","response","."]
code: def handle(self, data, context):
      """Entry point for default handler. It takes the data from the input request and returns
         the predicted outcome for the input.
  
      Args:
          data (list): The input data that needs to be made a prediction request on.
          context (Context): It is a JSON Object containing information pertaining to
                             the model artifacts parameters.
  
      Returns:
          list : Returns a list of dictionary with the predicted response.
      """
  
      # It can be used for pre or post processing if needed as additional request
      # information is available in context
      start_time = time.time()
  
      self.context = context
      metrics = self.context.metrics
  
      is_profiler_enabled = os.environ.get(
          "ENABLE_TORCH_PROFILER", None
      )
      if is_profiler_enabled:
          if PROFILER_AVAILABLE:
              if self.manifest is None:
                  # profiler will use to get the model name
                  self.manifest = context.manifest
              output, _ = self._infer_with_profiler(data=data)
          else:
              raise RuntimeError(
                  "Profiler is enabled but current version of torch does not support."
                  "Install torch>=1.8.1 to use profiler."
              )
      else:
          if self._is_describe():
              output = [self.describe_handle()]
          else:
              data_preprocess = self.preprocess(data)
  
              if not self._is_explain():
                  output = self.inference(data_preprocess)
                  output = self.postprocess(output)
              else:
                  output = self.explain_handle(data_preprocess, data)
  
      stop_time = time.time()
      metrics.add_time(
          "HandlerTime",
          round((stop_time - start_time) * 1000, 2),
          None,
          "ms",
      )
      return output
  
imports: import abc
  import importlib.util
  import logging
  import os
  import time
  import torch
  from pkg_resources import packaging
  from ts.handler_utils.timer import timed
  from ..utils.util import check_valid_pt2_backend, list_classes_from_module, load_label_mapping
label_desc: Use image node_id 10 for calling the BaseHandler obj's underlying member method code with example usage: obj.handle(data, context) and returns: output