class_docstr: WIT widget for colab.
class_docstr_tok: ["WIT","widget","for","colab","."]
code: def compute_custom_distance(self, index, callback_fn, params):
      try:
          distances = base.WitWidgetBase.compute_custom_distance_impl(
              self, index, params["distanceParams"]
          )
          callback_dict = {
              "distances": distances,
              "exInd": index,
              "funId": callback_fn,
              "params": params["callbackParams"],
          }
          output.eval_js(
              """distanceCallback({callback_dict})""".format(
                  callback_dict=json.dumps(callback_dict)
              )
          )
      except Exception as e:
          output.eval_js(
              """backendError({error})""".format(
                  error=json.dumps({"msg": repr(e)})
              )
          )
  
imports: import json
  import math
  import tensorflow
  from IPython import display
  from google.colab import output
  from witwidget.notebook import base
label_desc: Use image node_id 10 for calling the WitWidget obj's underlying member method code with example usage: obj.compute_custom_distance(index, callback_fn, params) without return types