class_docstr: Meant to be passed as the `cls` kwarg to json.dumps(obj, cls=..)
  
  See PlotlyJSONEncoder.default for more implementation information.
  
  Additionally, this encoder overrides nan functionality so that 'Inf',
  'NaN' and '-Inf' encode to 'null'. Which is stricter JSON than the Python
  version.
class_docstr_tok: ["Meant","to","be","passed","as","the","`","cls","`","kwarg","to","json.dumps","(","obj",",","cls=","..",")","See","PlotlyJSONEncoder.default","for","more","implementation","information",".","Additionally",",","this","encoder","overrides","nan","functionality","so","that","'Inf","'",",","'NaN","'","and","'-Inf","'","encode","to","'null","'",".","Which","is","stricter","JSON","than","the","Python","version","."]
docstr: This is used to ultimately *encode* into strict JSON, see `encode`
docstr_tok: ["This","is","used","to","ultimately","*","encode","*","into","strict","JSON",",","see","`","encode","`"]
code: def coerce_to_strict(self, 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 decimal
  import json
  import sys
  import re
  from functools import reduce
  from _plotly_utils.optional_imports import get_module
  from _plotly_utils.basevalidators import ImageUriValidator
label_desc: Use image node_id 1 for calling the PlotlyJSONEncoder obj's underlying member method code with example usage: obj.coerce_to_strict(const) and returns: None, const