class_docstr: This class overrides ``json.dumps`` default formatter.
  
  This version keeps everything as normal except formats numbers bigger than 1e3 using scientific notation.
  
  Just pass ``cls=ScientificNotationEncoder`` to ``json.dumps`` to activate it
class_docstr_tok: ["This","class","overrides","``","json.dumps","``","default","formatter",".","This","version","keeps","everything","as","normal","except","formats","numbers","bigger","than","1e3","using","scientific","notation",".","Just","pass","``","cls=ScientificNotationEncoder","``","to","``","json.dumps","``","to","activate","it"]
code: def iterencode(self, o, _one_shot=False, level=0):
      indent = self.indent if self.indent is not None else 4
      prefix_close = " " * level * indent
      level += 1
      prefix = " " * level * indent
      if isinstance(o, bool):
          return "true" if o else "false"
      elif isinstance(o, float) or isinstance(o, int):
          if o > 1e3:
              return f"{o:e}"
          else:
              return f"{o}"
      elif isinstance(o, collections.abc.Mapping):
          x = [
              f'\n{prefix}"{k}": {self.iterencode(v, level=level)}'
              for k, v in o.items()
          ]
          return "{" + ", ".join(x) + f"\n{prefix_close}" + "}"
      elif isinstance(o, collections.abc.Sequence) and not isinstance(
          o, str
      ):
          return f"[{ f', '.join(map(self.iterencode, o)) }]"
      return "\n, ".join(super().iterencode(o, _one_shot))
  
imports: import json
  import collections
  import collections.abc
  from functools import reduce
  from deepspeed.pydantic_v1 import BaseModel
  from deepspeed.utils import logger
label_desc: Use image node_id 1 for calling the ScientificNotationEncoder obj's underlying member method code with example usage: obj.iterencode(o, _one_shot, level) and returns: str, unknown, o, o, unknown, str, str, str