
    1Vhq	                     @    d Z ddlZddlZ ed      Z ed      ZddZy)a  A module providing a function for serializing JSON values with Infinity.

Python provides no way to override how json.dumps serializes
Infinity/-Infinity/NaN; if allow_nan is true, it encodes them as
Infinity/-Infinity/NaN, in violation of the JSON spec and in violation
of what JSON.parse accepts. If it's false, it throws a ValueError,
Neither subclassing JSONEncoder nor passing a function in the |default|
keyword argument overrides this.
    Ninfz-infc                 8   t        | t              r| S t        | t              r,| t        k(  ry| t        k(  ryt        j                  |       ry| S t        | t              r| j                        S t        | t        t        f      r| D cg c]  }t        |       c}S t        | t              r#t        |       D cg c]  }t        |       c}S t        | t              r,t        j                   fd| j#                         D              S | S c c}w c c}w )a  Makes Python object appropriate for JSON serialization.

    - Replaces instances of Infinity/-Infinity/NaN with strings.
    - Turns byte strings into unicode strings.
    - Turns sets into sorted lists.
    - Turns tuples into lists.

    Args:
      obj: Python data structure.
      encoding: Charset used to decode byte strings.

    Returns:
      Unicode JSON data structure.
    Infinityz	-InfinityNaNc              3   T   K   | ]  \  }}t        |      t        |      f ! y w)N)Cleanse).0kvencodings      M/home/dcms/DCMS/lib/python3.12/site-packages/tensorboard/backend/json_util.py	<genexpr>zCleanse.<locals>.<genexpr>D   s-      '
=AQWQ!71h#78'
s   %()
isinstanceintfloat	_INFINITY_NEGATIVE_INFINITYmathisnanbytesdecodelisttupler   setsorteddictcollectionsOrderedDictitems)objr   is    ` r   r   r   #   s     #s
	C	)&&ZZ_J	C	zz(##	C$	'.128$22	C	.4Sk:8$::	C	&& '
EHYY['
 
 	
 
 3:s   D>D)zutf-8)__doc__r   r   r   r   r   r        r   <module>r%      s,       %L	6] %r$   