
    Mh                       % S SK Jr  S SKJrJrJrJr  S SKJrJ	r	J
r
JrJrJr  S SKJr  S SKJrJr  \(       a  S SKJr  \\   r\" S\
\/\4   S9r0 rS	\S
'   SS jrSSS jjrSS jrS S jrS!S jr\S"S j5       r \S#S j5       r \S$S j5       r \S%S j5       r     S&S jr \S'S j5       r!\S(S j5       r!S)S jr!      S*S jr"      S+S jr#S,S jr$g)-    )annotations)HashableIterableMutableMappingSequence)TYPE_CHECKINGAnyCallableLiteralTypeVaroverloadimport_optional_dependency)
is_integeris_list_like)ExcelWriterusecols_func)boundz"MutableMapping[str, ExcelWriter_t]_writersc                d    [        U 5      (       d  [        S5      eU R                  nU [        U'   g)z
Add engine to the excel writer registry.io.excel.

You must use this method to integrate with ``to_excel``.

Parameters
----------
klass : ExcelWriter
z&Can only register callables as enginesN)callable
ValueError_enginer   )klassengine_names     G/var/www/html/env/lib/python3.13/site-packages/pandas/io/excel/_util.pyregister_writerr   "   s,     E??ABB--K!H[    c                x    SSSSSS.nSSSSS.nUS;   d   eUS:X  a  [        S	S
S9nU(       a  S	US'   X0   $ X    $ )a[  
Return the default reader/writer for the given extension.

Parameters
----------
ext : str
    The excel file extension for which to get the default engine.
mode : str {'reader', 'writer'}
    Whether to get the default engine for reading or writing.
    Either 'reader' or 'writer'

Returns
-------
str
    The default engine for the extension.
openpyxlpyxlsbxlrdodf)xlsxxlsmxlsbxlsods)r$   r%   r&   r(   )readerwriterr*   
xlsxwriterwarn)errorsr$   r   )extmode_default_readers_default_writersr+   s        r   get_default_enginer2   2   sv    $  	 ''''x/VL
'3V$$$$$r   c                Z     [         U    $ ! [         a  n[        SU  S35      UeS nAff = f)NzNo Excel writer '')r   KeyErrorr   )r   errs     r   
get_writerr7   [   s<    F$$ F,[M;<#EFs    
*%*c                    SnU R                  5       R                  5        HQ  n[        U5      nU[        S5      :  d  U[        S5      :  a  [        SU  35      eUS-  U-   [        S5      -
  S-   nMS     US-
  $ )a1  
Convert Excel column name like 'AB' to 0-based column index.

Parameters
----------
x : str
    The Excel column name to convert to a 0-based column index.

Returns
-------
num : int
    The column index corresponding to the name.

Raises
------
ValueError
    Part of the Excel column name was invalid.
r   AZzInvalid column name:       )upperstripordr   )xindexccps       r   
_excel2numrD   b   sx    & EWWY__VC=BSM4QC899
R#c(*Q.  19r   c           
        / nU R                  S5       Hl  nSU;   aI  UR                  S5      nUR                  [        [        US   5      [        US   5      S-   5      5        MR  UR	                  [        U5      5        Mn     U$ )aT  
Convert comma separated list of column names and ranges to indices.

Parameters
----------
areas : str
    A string containing a sequence of column ranges (or areas).

Returns
-------
cols : list
    A list of 0-based column indices.

Examples
--------
>>> _range2cols('A:E')
[0, 1, 2, 3, 4]
>>> _range2cols('A,C,Z:AB')
[0, 2, 25, 26, 27]
,:r   r<   )splitextendrangerD   append)areascolsrngrngss       r   _range2colsrP      sq    * D{{3#:99S>DKKja1:d1g3F3JKLKK
3(   Kr   c                    g N usecolss    r   maybe_convert_usecolsrV          r   c                    g rR   rS   rT   s    r   rV   rV      rW   r   c                    g rR   rS   rT   s    r   rV   rV      rW   r   c                    g rR   rS   rT   s    r   rV   rV      rW   r   c                    U c  U $ [        U 5      (       a  [        S5      e[        U [        5      (       a  [	        U 5      $ U $ )z
Convert `usecols` into a compatible format for parsing in `parsers.py`.

Parameters
----------
usecols : object
    The use-columns object to potentially convert.

Returns
-------
converted : object
    The compatible format of `usecols`.
z}Passing an integer for `usecols` is no longer supported.  Please pass in a list of int from 0 to `usecols` inclusive instead.)r   r   
isinstancestrrP   rT   s    r   rV   rV      sK      'R
 	

 '37##Nr   c                    g rR   rS   freeze_paness    r   validate_freeze_panesra      rW   r   c                    g rR   rS   r_   s    r   ra   ra      rW   r   c                n    U b2  [        U 5      S:X  a  [        S U  5       5      (       a  g[        S5      eg)N   c              3  B   #    U  H  n[        U[        5      v   M     g 7frR   )r\   int).0items     r   	<genexpr>(validate_freeze_panes.<locals>.<genexpr>   s      *
.:dJtS!!ls   TzLfreeze_panes must be of form (row, column) where row and column are integersF)lenallr   r_   s    r   ra   ra      sJ    |!c *
.:*
 '
 '
 0
 	
 r   c                    U S   n[        S[        U 5      5       H+  nX   (       d  X   nX   S:X  d  X   c  X U'   M#  SX'   X   nM-     X4$ )a  
Forward fill blank entries in row but only inside the same parent index.

Used for creating headers in Multiindex.

Parameters
----------
row : list
    List of items in a single row.
control_row : list of bool
    Helps to determine if particular column is in same parent index as the
    previous value. Used to stop propagation of empty cells between
    different indexes.

Returns
-------
Returns changed row and control_row
r   r<    F)rJ   rk   )rowcontrol_rowlastis       r   fill_mi_headerrs      s]    * q6D1c#h~6D6R<36>F"KN6D   r   c                    [        U5      (       a#  [        U[        5      (       d   e[        U5      nO[        U[        5      (       a   eUnX   nUS:X  a  SOUnX0SU S/-   XS-   S -   4$ )a]  
Pop the header name for MultiIndex parsing.

Parameters
----------
row : list
    The data row to parse for the header name.
index_col : int, list
    The index columns for our data. Assumed to be non-null.

Returns
-------
header_name : str
    The extracted header name.
trimmed_row : list
    The original data row with the header name removed.
rn   Nr<   )r   r\   r   max)ro   	index_colrr   header_names       r   pop_header_namerx     sz    * I)X....	Ni2222&K%+$KBQ2$UW555r   c                T    U c  0 nOU R                  5       nUR                  U5        U$ )a  
Used to combine two sources of kwargs for the backend engine.

Use of kwargs is deprecated, this function is solely for use in 1.3 and should
be removed in 1.4/2.0. Also _base.ExcelWriter.__new__ ensures either engine_kwargs
or kwargs must be None or empty respectively.

Parameters
----------
engine_kwargs: dict
    kwargs to be passed through to the engine.
kwargs: dict
    kwargs to be psased through to the engine (deprecated)

Returns
-------
engine_kwargs combined with kwargs
)copyupdate)engine_kwargskwargsresults      r   combine_kwargsr   6  s.    & ##%
MM&Mr   N)r   ExcelWriter_treturnNone)r)   )r.   r]   r/   zLiteral['reader', 'writer']r   r]   )r   r]   r   r   )r@   r]   r   rf   )rL   r]   r   	list[int])rU   zstr | list[int]r   r   )rU   	list[str]r   r   )rU   r   r   r   )rU   r   r   r   )rU   z1str | list[int] | list[str] | usecols_func | Noner   z+None | list[int] | list[str] | usecols_func)r`   ztuple[int, int]r   zLiteral[True])r`   r   r   zLiteral[False])r`   ztuple[int, int] | Noner   bool)ro   list[Hashable]rp   z
list[bool]r   z!tuple[list[Hashable], list[bool]])ro   r   rv   zint | Sequence[int]r   z&tuple[Hashable | None, list[Hashable]])r|   zdict[str, Any] | Noner}   dictr   r   )%
__future__r   collections.abcr   r   r   r   typingr   r	   r
   r   r   r   pandas.compat._optionalr   pandas.core.dtypes.commonr   r   pandas.io.excel._baser   typer   objectr   r   __annotations__r   r2   r7   rD   rP   rV   ra   rs   rx   r   rS   r   r   <module>r      sK   "   ?
 1%M>8*f:L1MNL/1
, 1" &%RF@B 
 
 
 
 
 
 
 
>0> 
 
 
 
" 	 &0 & F6	6$76+6Dr   