class_docstr: WIT widget base class for common code between Jupyter and Colab.
code: def compute_custom_distance_impl(self, index, params=None):
      exs_for_distance = [
          self.json_to_proto(example) for example in self.examples
      ]
      selected_ex = exs_for_distance[index]
      return self.custom_distance_fn(
          selected_ex, exs_for_distance, params
      )
  
imports: import base64
  import json
  import googleapiclient.discovery
  import os
  import logging
  import multiprocessing
  import tensorflow
  from IPython import display
  from google.protobuf import json_format
  from numbers import Number
  from oauth2client.client import GoogleCredentials
  from six import ensure_str
  from six import integer_types
  from utils import inference_utils
label_desc: Use image node_id 4 for calling the WitWidgetBase obj's underlying member method code with example usage: obj.compute_custom_distance_impl(index, params) and returns: self