class_docstr: Plugin for understanding/debugging model inference.
    
class_docstr_tok: ["Plugin","for","understanding\/debugging","model","inference","."]
docstr: Returns a sorted list of JSON objects for each feature in the example.
  
  The list is sorted by interestingness in terms of the resulting change in
  inference values across feature values, for partial dependence plots.
  
  Args:
    request: A request for sorted features.
  
  Returns:
    A sorted list with a JSON object for each feature.
    Numeric features are represented as
    {name: observedMin: observedMax: interestingness:}.
    Categorical features are represented as
    {name: samples:[] interestingness:}.
code: def _sort_eligible_features_handler(self, request):
      """Returns a sorted list of JSON objects for each feature in the example.
  
      The list is sorted by interestingness in terms of the resulting change in
      inference values across feature values, for partial dependence plots.
  
      Args:
        request: A request for sorted features.
  
      Returns:
        A sorted list with a JSON object for each feature.
        Numeric features are represented as
        {name: observedMin: observedMax: interestingness:}.
        Categorical features are represented as
        {name: samples:[] interestingness:}.
      """
      try:
          features_list = inference_utils.get_eligible_features(
              self.examples[0:NUM_EXAMPLES_TO_SCAN], NUM_MUTANTS
          )
          example_index = int(request.args.get("example_index", "0"))
          (
              inference_addresses,
              model_names,
              model_versions,
              model_signatures,
          ) = self._parse_request_arguments(request)
          chart_data = {}
          for feat in features_list:
              chart_data[feat["name"]] = self._infer_mutants_impl(
                  feat["name"],
                  example_index,
                  inference_addresses,
                  model_names,
                  request.args.get("model_type"),
                  model_versions,
                  model_signatures,
                  request.args.get("use_predict") == "true",
                  request.args.get("predict_input_tensor"),
                  request.args.get("predict_output_tensor"),
                  feat["observedMin"] if "observedMin" in feat else 0,
                  feat["observedMax"] if "observedMin" in feat else 0,
                  None,
                  custom_predict_fn=self.custom_predict_fn,
              )
          features_list = inference_utils.sort_eligible_features(
              features_list, chart_data
          )
          return http_util.Respond(
              request, features_list, "application/json"
          )
      except common_utils.InvalidUserInputError as e:
          return http_util.Respond(
              request, e.message, "application/json", code=400
          )
      except Exception as e:
          return http_util.Respond(
              request, str(e), "application/json", code=400
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import io
  import json
  import logging
  import math
  import numpy
  import os
  import werkzeug
  from werkzeug import wrappers
  from six.moves import xrange
  from google.protobuf import json_format
  from grpc.framework.interfaces.face.face import AbortionError
  from werkzeug import wrappers
  import tensorflow
  from tensorboard.backend import http_util
  from tensorboard.plugins import base_plugin
  from utils import common_utils
  from utils import inference_utils
  from utils import platform_utils
label_desc: Use image node_id 17 for calling the WhatIfToolPlugin obj's underlying member method code with example usage: obj._sort_eligible_features_handler(request) and returns: http_util, http_util, http_util