code: def coerce_to_strict(const):
      """
      This is used to ultimately *encode* into strict JSON, see `encode`
  
      """
      # before python 2.7, 'true', 'false', 'null', were include here.
      if const in ("Infinity", "-Infinity", "NaN"):
          return None
      else:
          return const
  
imports: import json
  import decimal
  import datetime
  import warnings
  from pathlib import Path
  from plotly.io._utils import validate_coerce_fig_to_dict, validate_coerce_output_type
  from _plotly_utils.optional_imports import get_module
  from _plotly_utils.basevalidators import ImageUriValidator
label_desc: Use image node_id 1 for calling a global function with example usage: coerce_to_strict(const) and returns: None, const