<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    Re&                 @   s   d dl Z d dlZd dlZd dlmZ d dlmZ ejdkr>eZ	dddZ
dddZd	d
 Zdd Zdd ZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )    N)Decimal)InlineTableDict)   c             C   s(   |j stdt| |d}| | |S )a  Writes out dict as toml to a file

    Args:
        o: Object to dump into toml
        f: File descriptor where the toml should be stored
        encoder: The ``TomlEncoder`` to use for constructing the output string

    Returns:
        String containing the toml corresponding to dictionary

    Raises:
        TypeError: When anything other than file descriptor is passed
    z0You can only dump an object to a file descriptor)encoder)write	TypeErrordumps)ofr   d r   /builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_vendor/toml/encoder.pydump   s
    
r   c             C   s  d}|dkrt | j}|| d\}}||7 }t| g}x|r
dd |D }x|D ]}||krTtdqTW ||7 }| }x|D ]~}	|||	 |	\}}
|s|s|
s|r|dd dkr|d7 }|d	|	 d
 7 }|r||7 }x |
D ]}|
| ||	d | < qW qW |}q:W |S )a  Stringifies input dict as toml

    Args:
        o: Object to dump into toml
        encoder: The ``TomlEncoder`` to use for constructing the output string

    Returns:
        String containing the toml corresponding to dict

    Examples:
        ```python
        >>> import toml
        >>> output = {
        ... 'a': "I'm a string",
        ... 'b': ["I'm", "a", "list"],
        ... 'c': 2400
        ... }
        >>> toml.dumps(output)
        'a = "I'm a string"
b = [ "I'm", "a", "list",]
c = 2400
'
        ```
     Nc             S   s   g | ]}t |qS r   )id).0sectionr   r   r   
<listcomp>@   s    zdumps.<locals>.<listcomp>zCircular reference detectedz


[z]
.)TomlEncoder	__class__dump_sectionsr   
ValueErrorget_empty_table)r	   r   retvaladdtoretvalsections
outer_objssection_ids	outer_objnewsectionsr   addtosectionssr   r   r   r   "   s4    




r   c             C   s`  t jdk r(t| dr(t| tr(| d} d|  } | d dkrH| dd  } | d}|s`| d	rl| dd
 } |r| dd} | d	d} | d} xt	| dkrJd
}| d s| dd  } | d dd| d< | d | dk}x6| d d | r| d | dkr| }|d8 }qW |r"d}nd}| d | | d  g| dd   } qW t
d	| d  d	 S )N)r   decodezutf-8z%rr   u   '"z\'z\"z\xz\\\xu00   )sysversion_infohasattr
isinstancestrr&   
startswithreplacesplitlenunicode)vsinglequoteijoinxjoinerr   r   r   	_dump_strV   s4    


&&r?   c             C   s   d | ddddS )Nz{}ze+0ze+ze-0ze-)formatr6   )r:   r   r   r   _dump_floatu   s    rA   c             C   s(   |   }|d kr|  S |  d d S )Ni)	utcoffset	isoformat)r:   rB   r   r   r   
_dump_timey   s    rD   c               @   sB   e Zd ZedfddZdd Zdd Zdd	 Zd
d Zdd Z	dS )r   Fc             C   sV   || _ || _ttttt| jtdd tdd t	t
tt
tjdd tjttjdd i
| _d S )Nc             S   s   t |  S )N)r9   lower)r:   r   r   r   <lambda>       z&TomlEncoder.__init__.<locals>.<lambda>c             S   s   | S )Nr   )r:   r   r   r   rF      rG   c             S   s   |   ddS )Nz+00:00Z)rC   r6   )r:   r   r   r   rF      rG   c             S   s   |   S )N)rC   )r:   r   r   r   rF      rG   )_dictpreserver4   r?   r9   list	dump_listboolintfloatrA   r   datetimetimerD   date
dump_funcs)selfrI   rJ   r   r   r   __init__   s    
zTomlEncoder.__init__c             C   s   |   S )N)rI   )rT   r   r   r   r      s    zTomlEncoder.get_empty_tablec             C   s8   d}x&|D ]}|dt | | d 7 }q
W |d7 }|S )Nr    ,])r9   
dump_value)rT   r:   r   r'   r   r   r   rL      s
    
zTomlEncoder.dump_listc             C   sp   d}t |tr^g }x0| D ]$\}}| |}||d |  qW |dd| d 7 }|S t| |S dS )zPreserve inline table in its compact syntax instead of expanding
        into subsection.

        https://github.com/toml-lang/toml#user-content-inline-table
        r   z = z{ z, z }
N)r3   dictitemsdump_inline_tableappendjoinr9   rY   )rT   r   r   val_listkr:   valr   r   r   r\      s    

zTomlEncoder.dump_inline_tablec             C   sJ   | j t|}|d kr,t|dr,| j t }|d k	r<||S | j t |S )N__iter__)rS   gettyper2   rK   r4   )rT   r:   dump_fnr   r   r   rY      s    
zTomlEncoder.dump_valuec             C   s*  d}|dkr |d dkr |d7 }|   }d}x|D ]}t|}|}td|sZt|}t|| tsd}t|| trx|| D ]}	t|	trd}qW |rx|| D ]}	d}
|d| | d	 7 }| |	|| \}}|r|d
 dkr|
|7 }
n||7 }x|r|   }x||D ]t}| || || d | \}}|rb|
d| | d | d 7 }
|
|7 }
x"|D ]}|| ||d | < qhW qW |}q W ||
7 }qW n0|| d k	r||d t| 	||  d 7 }q4| j
r
t|| tr
||d | ||  7 }q4|| ||< q4W ||7 }||fS )Nr   r+   r   z^[A-Za-z0-9_-]+$FTr   z[[z]]
r   r   z]
z = )rI   r9   rematchr?   r3   rZ   rK   r   rY   rJ   r   r\   )rT   r	   supretstrretdictarraystrr   qsectionarrayoftablesaarraytabstrr%   r   newddsecs1d1r   r   r   r      s`    





 
"zTomlEncoder.dump_sectionsN)
__name__
__module____qualname__rZ   rU   r   rL   r\   rY   r   r   r   r   r   r      s   r   c                   s    e Zd Zef fdd	Z  ZS )TomlPreserveInlineDictEncoderc                s   t t| |d d S )NT)superrw   rU   )rT   rI   )r   r   r   rU      s    z&TomlPreserveInlineDictEncoder.__init__)rt   ru   rv   rZ   rU   __classcell__r   r   )r   r   rw      s   rw   c                   s,   e Zd Zeddf fdd	Zdd Z  ZS )TomlArraySeparatorEncoderFrW   c                sD   t t| || | dkr(d| }n|dr:td|| _d S )Nr   rW   z 	
,zInvalid separator for arrays)rx   rz   rU   stripr   	separator)rT   rI   rJ   r|   )r   r   r   rU      s    

z"TomlArraySeparatorEncoder.__init__c             C   s   g }d}x|D ]}| | | qW x\|g krg }xF|D ]>}t|trbx.|D ]}| | qNW q:|dt| | j 7 }q:W |}q(W |d7 }|S )Nr   rV   rX   )r]   rY   r3   rK   r9   r|   )rT   r:   tr   r'   r%   rr   r   r   rL      s    




z#TomlArraySeparatorEncoder.dump_list)rt   ru   rv   rZ   rU   rL   ry   r   r   )r   r   rz      s   rz   c                   s*   e Zd Zedf fdd	Zdd Z  ZS )TomlNumpyEncoderFc                sl   dd l }tt| || t| j|j< t| j|j< t| j|j< | j	| j|j
< | j	| j|j< | j	| j|j< d S )Nr   )numpyrx   r   rU   rA   rS   float16float32float64	_dump_intint16int32int64)rT   rI   rJ   np)r   r   r   rU     s    zTomlNumpyEncoder.__init__c             C   s   d t|S )Nz{})r@   rN   )rT   r:   r   r   r   r     s    zTomlNumpyEncoder._dump_int)rt   ru   rv   rZ   rU   r   ry   r   r   )r   r   r     s   
r   c                   s"   e Zd Zedf fdd	Z  ZS )TomlPreserveCommentEncoderFc                s4   ddl m} tt ||  fdd j|< d S )Nr   )CommentValuec                s   |   jS )N)r   rY   )r:   )rT   r   r   rF   #  rG   z5TomlPreserveCommentEncoder.__init__.<locals>.<lambda>)pip._vendor.toml.decoderr   rx   r   rU   rS   )rT   rI   rJ   r   )r   )rT   r   rU      s    z#TomlPreserveCommentEncoder.__init__)rt   ru   rv   rZ   rU   ry   r   r   )r   r   r     s   r   c                   s$   e Zd Zdd Z fddZ  ZS )TomlPathlibEncoderc             C   s   t t|S )N)r?   r4   )rT   r:   r   r   r   _dump_pathlib_path(  s    z%TomlPathlibEncoder._dump_pathlib_pathc                s6   dt jkr&dd l}t||jr&t|}tt| |S )N)r      r   )	r0   r1   pathlibr3   PurePathr4   rx   r   rY   )rT   r:   r   )r   r   r   rY   +  s
    
zTomlPathlibEncoder.dump_value)rt   ru   rv   r   rY   ry   r   r   )r   r   r   &  s   r   )N)N)rP   rf   r0   decimalr   r   r   r1   r4   r9   r   r   r?   rA   rD   objectr   rw   rz   r   r   r   r   r   r   r   <module>   s"   


4k