
    6Dh                     x    S SK r S SKJr  S SK7  S SK7  SS jr " S S\5      r " S S\5      rSS	 jr	S
 r
S rg)    N)PrettyPrinter)*c           
         [        U [        5      (       a  Su  pVO1[        U [        5      (       a  Su  pVO[        S[	        U 5      -  5      e[        U 5      U::  a  U nO![        U SU 5      S/-   [        X* S 5      -   nUSR                  U Vs/ s H  n[        U5      PM     sn5      -   U-   n	SR                  [        R                  " U	USUS	-   -  SUS	-   -  S
95      R                  5       n
U
$ s  snf )z
Return a string representation for of a list where list is elided if
it has more than n elements

Parameters
----------
v : list
    Input list
threshold :
    Maximum number of elements to display

Returns
-------
str
)[])()zInvalid value of type: %sNz...z, 
    )widthinitial_indentsubsequent_indent)
isinstancelisttuple
ValueErrortypelenjoinstrtextwrapwrapstrip)v	threshold	edgeitemsindentr   	open_char
close_chardisp_vev_str	v_wrappeds              >/var/www/html/env/lib/python3.13/site-packages/plotly/utils.py_list_repr_elidedr&   	   s      !T (	:	Au		 (	:4tAw>??
1va
m$w.a
n1EE		6":6a3q66":;;jHE		&1*-!VaZ0		
 eg   #;s   C2
c                   4    \ rS rSrSrS r\S 5       rS rSr	g)ElidedWrapper2   z
Helper class that wraps values of certain types and produces a custom
__repr__() that may be elided and is suitable for use during pretty
printing
c                 (    Xl         X0l        X l        g N)r   r   r   )selfr   r   r   s       r%   __init__ElidedWrapper.__init__9   s    "    c                    [        S5      n[        U [        [        45      (       a(  [	        U 5      S:  a  [        U S   [
        5      (       d  gU(       a  [        XR                  5      (       a  g[        U [        5      (       a  gg)Nnumpyr   TF)
get_moduler   r   r   r   dictndarrayr   )r   r1   s     r%   is_wrappableElidedWrapper.is_wrappable>   sb    7#a$''CFQJz!A$PT?U?Uz!]]333r/   c                    [        S5      n[        U R                  [        [        45      (       a+  [        U R                  U R                  U R                  S9nU$ U(       a  [        U R                  UR                  5      (       a  UR                  5       nUR                  " S0 [        X0R                  SSS9D6  U R                  R                  5       nUR                  S5      nSSU R                  -  -   R                  U5      nUR                  " S0 UD6  U$ [        U R                  [        5      (       am  [!        U R                  5      S:  a:  S[#        U R                  S S	 5      -   S
-   [#        U R                  SS  5      -   S-   $ U R                  R                  5       $ U R                  R                  5       $ )Nr1   )r   r      P   )r   r   	linewidthr
   r   r      z ... ir	    )r2   r   r   r   r   r&   r   r   r4   get_printoptionsset_printoptionsr3   __repr__splitr   r   r   repr)r,   r1   res	orig_opts	res_liness        r%   r?   ElidedWrapper.__repr__J   se   7#dfftUm,,#$..C Jz$&&%--88 ..0I "" yNNaSUV &&//#C 		$I#++11)<C ""/Y/J$$466{RT$&&"+..84st;MMPSSSvv((66??$$r/   )r   r   r   N)
__name__
__module____qualname____firstlineno____doc__r-   staticmethodr5   r?   __static_attributes__r<   r/   r%   r(   r(   2   s%    #
 	 	#%r/   r(   c                   $    \ rS rSrSrS rS rSrg)ElidedPrettyPrinterp   z>
PrettyPrinter subclass that elides long lists/arrays/strings
c                 f    UR                  SS5      U l        [        R                  " U /UQ70 UD6  g )Nr      )popr   r   r-   )r,   argskwargss      r%   r-   ElidedPrettyPrinter.__init__u   s,    K5t5d5f5r/   c           	          [         R                  U5      (       a)  [        XR                  U5      nU R                  XrX4XV5      $ [        R                  " XX#XEU5      $ r+   )r(   r5   r   _formatr   )r,   valstreamr   	allowancecontextlevel
elided_vals           r%   rW   ElidedPrettyPrinter._formaty   sR    %%c**&sNNFCJ<<
FwVV ((69u r/   )r   N)rF   rG   rH   rI   rJ   r-   rW   rL   r<   r/   r%   rN   rN   p   s    6r/   rN   c              #      #    [        U [        5      (       d  gX4v   U R                  5        H6  u  p#[        U[        5      (       d  M  [        X1U4-   5       H  nUv   M	     M8     g7f)a  
General, node-yielding generator.

Yields (node, path) tuples when it finds values that are dict
instances.

A path is a sequence of hashable values that can be used as either keys to
a mapping (dict) or indices to a sequence (list). A path is always wrt to
some object. Given an object, a path explains how to get from the top level
of that object to a nested value in the object.

:param (dict) node: Part of a dict to be traversed.
:param (tuple[str]) path: Defines the path of the current node.
:return: (Generator)

Example:

    >>> for node, path in node_generator({'a': {'b': 5}}):
    ...     print(node, path)
    {'a': {'b': 5}} ()
    {'b': 5} ('a',)

N)r   r3   itemsnode_generator)nodepathkeyrX   items        r%   ra   ra      sX     0 dD!!
*JJLc4  &sC6M:
 ; !s   AA)
A)c                      U H  nX   n M	     U $ )a*  
Iteratively get on obj for each key in path.

:param (list|dict) obj: The top-level object.
:param (tuple[str]|tuple[int]) path: Keys to access parts of obj.

:return: (*)

Example:

    >>> figure = {'data': [{'x': [5]}]}
    >>> path = ('data', 0, 'x')
    >>> get_by_path(figure, path)
    [5]
r<   )objrc   rd   s      r%   get_by_pathrh      s      h Jr/   c                    [        U [        5      (       ae  [        U 5       HT  u  p[        U[        [        45      (       a  [	        U5      X'   M/  [        U[
        5      (       d  MF   [        U5      X'   MV     U $ [        U [        5      (       a  [        U R                  5       5      [        U R                  5       5      pC[        X45       Hn  u  pV[        U[        [        45      (       a  [	        U5      X'   O#[        U[
        5      (       a   [        U5      X'   U R                  U5      U [        U5      '   Mp     U $ ! [         a     GM-  f = f! [         a     NAf = fr+   )r   r   	enumerater3   decode_unicoder   UnicodeEncodeErrorkeysvaluesziprR   )collnoentryrm   valsrd   rX   s          r%   rk   rk      s   $"4IB%$..)%0eS))#&u: )( K 
D$		$))+&T[[](;dDHC#d|,,*3/	C%% #CDI "XXc]DSN ( K .  * s$   (E E 
EE
EE)rQ   r8   r   r9   )r<   )r   pprintr   _plotly_utils.utils_plotly_utils.data_utilsr&   objectr(   rN   ra   rh   rk   r<   r/   r%   <module>rx      s@       ! &&R;%F ;%|- (B*r/   