
    'hY                         S SK r S SKJr  S SKJrJrJr  S SKJr  SS jr	 " S S\
5      r " S S	\5      rSS
 jrS rS rg)    N)PrettyPrinter)NotEncodablePlotlyJSONEncoder
get_module)image_array_to_data_uric           
         [        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              _C:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\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)r   r   r   r   r   dictndarrayr   )r   r4   s     r(   is_wrappableElidedWrapper.is_wrappable>   sb    7#a$''CFQJz!A$PT?U?Uz!]]333r2   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       $ )Nr4   )r   r!      P   )r   r    	linewidthr   r   r      z ... ir    )r   r   r   r   r   r)   r   r!   r6   get_printoptionsset_printoptionsr5   __repr__splitr   r   r   repr)r/   r4   res	orig_opts	res_liness        r(   rA   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??$$r2   )r!   r   r   N)
__name__
__module____qualname____firstlineno____doc__r0   staticmethodr7   rA   __static_attributes__r>   r2   r(   r+   r+   2   s%    #
 	 	#%r2   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   r0   )r/   argskwargss      r(   r0   ElidedPrettyPrinter.__init__u   s,    K5t5d5f5r2   c           	          [         R                  U5      (       a)  [        XR                  U5      nU R                  XrX4XV5      $ [        R                  " XX#XEU5      $ r.   )r+   r7   r   _formatr   )r/   valstreamr!   	allowancecontextlevel
elided_vals           r(   rY   ElidedPrettyPrinter._formaty   sR    %%c**&sNNFCJ<<
FwVV ((69u r2   )r   N)rH   rI   rJ   rK   rL   r0   rY   rN   r>   r2   r(   rP   rP   p   s    6r2   rP   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   r5   itemsnode_generator)nodepathkeyrZ   items        r(   rc   rc      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>   )objre   rf   s      r(   get_by_pathrj      s      h Jr2   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   	enumerater5   decode_unicoder   UnicodeEncodeErrorkeysvaluesziprT   )collnoentryro   valsrf   rZ   s          r(   rm   rm      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)rS   r:   r   r;   )r>   )r   pprintr   _plotly_utils.utilsr   r   r   _plotly_utils.data_utilsr   r)   objectr+   rP   rc   rj   rm   r>   r2   r(   <module>rz      sC       K K <&R;%F ;%|- (B*r2   