code: def _ieee_to_json(value, owner):
      if isinstance(value, numbers.Real):
          # cast out-of-range floats to their reprs
          if math.isnan(value) or math.isinf(value):
              return repr(value)
      return value
  
imports: from collections import namedtuple
  from collections.abc import Sequence
  import numbers
  import math
  import re
  import warnings
  from traitlets import Unicode, Int, CInt, Instance, Enum, List, Dict, Float, CFloat, Bool, Tuple, Undefined, TraitError, Union, TraitType, CaselessStrEnum
  from ipywidgets import widget_serialization
  from ipydatawidgets import DataUnion, NDArrayWidget, shape_constraints
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: _ieee_to_json(value, owner) and returns: value, repr