code: def jsonify_item(val):
      # JSON doesn't have NaN, or infinities, but javaScript
      # uses dynamic typing so we can use strings instead.
      if isnan(val):
          val = "nan"  # standardize as lower case for all characters
      elif val == np.inf:
          val = "+inf"  # use a '+' to allow searching for just +inf
      elif val == -np.inf:
          val = "-inf"
      return val
  
file_path: interpret/python/interpret-core/interpret/glassbox/_ebm/_json.py
imports: import logging
  from warnings import warn
  from ...utils._link import identify_task
  from math import isnan
  import numpy
  from itertools import groupby
  from ._utils import generate_term_names
  from ...utils._histogram import make_all_histogram_edges
  from ...utils._clean_simple import typify_classification
label_desc: Use image node_id 2 for calling a global function with example usage: jsonify_item(val) and returns: val