<!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>

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 rY e Z	 d d d  Z
 d d d  Z d	 d
   Z d d   Z d d   Z Gd d   d e  Z Gd d   d e  Z Gd d   d e  Z Gd d   d e  Z Gd d   d e  Z Gd d   d e  Z d S)    N)Decimal)InlineTableDict   c             C   s8   | j  s t d   t |  d | } | j  |  | 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-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/toml/encoder.pydump   s
    	r   c             C   sk  d } | d k r! t  |  j  } | j |  d  \ } } | | 7} t |   g } x| rfd d   | D } x& | D] } | | k ru t d   qu W| | 7} | j   } x | D] }	 | j | |	 |	  \ } }
 | s | r2|
 r2| r| d d  d k r| d 7} | d	 |	 d
 7} | r2| | 7} x$ |
 D] } |
 | | |	 d | <q9Wq W| } qU 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 Sr   )id).0sectionr   r   r   
<listcomp>@   s   	 zdumps.<locals>.<listcomp>zCircular reference detected   z


[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< |  j d  }  d |  }  |  d d k rf |  d d   }  |  j d  } | s |  j d	  r |  d d  }  | r |  j d
 d  }  |  j d	 d  }  |  j d  }  x t	 |   d k rd } |  d s|  d d   }  |  d j d d  |  d <|  d | d k } x= |  d d  |  ru|  d | d k ru| } | d 8} q9W| rd } n d } |  d | |  d g |  d d   }  q Wt
 d	 |  d d	  S)Nr   decodezutf-8z%rr   u   '"z\'z\"z\xz\\\xu00r   )r   r/   )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 j  |   j d d  j d d  S)Nz{}ze+0ze+ze-0ze-)formatr6   )r:   r   r   r   _dump_floatu   s    rA   c             C   s6   |  j    } | d  k r" |  j   S|  j   d  d  S)N   i)	utcoffset	isoformat)r:   rC   r   r   r   
_dump_timey   s    
rE   c               @   s^   e  Z d  Z e d d d  Z d d   Z d d   Z d d	   Z d
 d   Z d d   Z	 d S)r   Fc             C   s   | |  _  | |  _ 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  |   j   S)N)r9   lower)r:   r   r   r   <lambda>   s    z&TomlEncoder.__init__.<locals>.<lambda>c             S   s   |  S)Nr   )r:   r   r   r   rG      s    c             S   s   |  j    j d d  S)Nz+00:00Z)rD   r6   )r:   r   r   r   rG      s    c             S   s
   |  j    S)N)rD   )r:   r   r   r   rG      s    )_dictpreserver4   r?   r9   list	dump_listboolintfloatrA   r   datetimetimerE   date
dump_funcs)selfrI   rJ   r   r   r   __init__   s    				zTomlEncoder.__init__c             C   s
   |  j    S)N)rI   )rT   r   r   r   r      s    zTomlEncoder.get_empty_tablec             C   sF   d } x/ | D]' } | d t  |  j |   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   s   d } t  | t  r{ g  } x> | j   D]0 \ } } |  j |  } | j | d |  q( W| d d j |  d 7} | St |  j |   Sd 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   sg   |  j  j t |   } | d  k r@ t | d  r@ |  j  t } | d  k	 rV | |  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} |  j    } d } xV| D]N} t |  } | } t j d |  s{ t |  } t | | t  sGd } t | | t  r x' | | D] }	 t |	 t  r d } q W| rxj| | D]"}	 d }
 | d | | d	 7} |  j |	 | |  \ } } | rM| d
 d k rC|
 | 7}
 n
 | | 7} x | r|  j    } x | D] } |  j | | | | d |  \ } } | r|
 d | | d | d 7}
 |
 | 7}
 x$ | D] } | | | | d | <qWqiW| } qPW| |
 7} q Wq| | d  k	 r| | d t |  j	 | |   d 7} qE |  j
 rt | | t  r| | d |  j | |  7} qE | | | | <qE W| | 7} | | f S)Nr   r)   r   z^[A-Za-z0-9_-]+$FTr   z[[z]]
r   r   z]
z = r/   )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 d d  Z   S)TomlPreserveInlineDictEncoderc                s   t  t |   j | d  d  S)NT)superrw   rU   )rT   rI   )r   r   r   rU      s    z&TomlPreserveInlineDictEncoder.__init__)rt   ru   rv   rZ   rU   r   r   )r   r   rw      s   rw   c                   s7   e  Z d  Z e d d   f d d  Z d d   Z   S)TomlArraySeparatorEncoderFrW   c                s`   t  t |   j | |  | j   d k r8 d | } n | j d  rS t d   | |  _ d  S)Nr   rW   z 	
,zInvalid separator for arrays)rx   ry   rU   stripr   	separator)rT   rI   rJ   r{   )r   r   r   rU      s    z"TomlArraySeparatorEncoder.__init__c             C   s   g  } d } x$ | D] } | j  |  j |   q Wxx | g  k r g  } xY | D]Q } t | t  r x9 | D] } | j  |  qk WqO | d t |  |  j 7} qO W| } q6 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   r   r   )r   r   ry      s   ry   c                   s4   e  Z d  Z e d   f d d  Z d d   Z   S)TomlNumpyEncoderFc                s   d d  l  } t t |   j | |  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 j  t |   S)Nz{})r@   rN   )rT   r:   r   r   r   r     s    zTomlNumpyEncoder._dump_int)rt   ru   rv   rZ   rU   r   r   r   )r   r   r~     s   
r~   c                   s(   e  Z d  Z e d   f d d  Z   S)TomlPreserveCommentEncoderFc                sF   d d l  m } t t    j | |    f d d     j | <d  S)Nr   )CommentValuec                s   |  j    j  S)N)r   rY   )r:   )rT   r   r   rG   #  s    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   r   r   )r   r   r     s   r   c                   s.   e  Z d  Z d d   Z   f d d   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                sO   d t  j k r9 d d  l } t | | j  r9 t |  } t t |   j |  S)Nr      r   )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   r   r   )r   r   r   &  s   r   )r   )rP   rf   r0   decimalr   r   r   r1   r4   r9   r   r   r?   rA   rE   objectr   rw   ry   r~   r   r   r   r   r   r   <module>   s"   4k