code: def jsonify_lists(vals):
      if len(vals) != 0:
          if isinstance(vals[0], float):
              for idx, val in enumerate(vals):
                  # JSON doesn't have NaN, or infinities, but javaScript
                  # uses dynamic typing so we can use strings instead.
                  if isnan(val):
                      vals[
                          idx
                      ] = "nan"  # standardize as lower case for all characters
                  elif val == np.inf:
                      vals[
                          idx
                      ] = "+inf"  # use a '+' to allow searching for just +inf
                  elif val == -np.inf:
                      vals[idx] = "-inf"
          else:
              for nested in vals:
                  jsonify_lists(nested)
      return vals
  
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 1 for calling a global function with example usage: jsonify_lists(vals) and returns: vals