<!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
    pSe-                 @   s  d dl Z d dlZd dlZd dlZd dlmZ d dlmZ G dd deZ	e	 Z
e	 Ze	 Ze	 Zee
eeedZdTdd	Zed
dedddd ZedZeddddddd Zeedredejejefddd ZedZeddddddd Zyd dlZW n ek
r$   Y nX edejdd d! Zyd dlZW nf ek
r   yd d"l m!Z! W n ek
r   Y n*X ed#dd$d% Z"ed&d&ed'd(d) Z#Y nTX ed*edd+d, Z$ed-edd.d/ Z%ed#edd0d% Z"ed&d&ed'd1d) Z#yd d2l&m'Z' W nB ek
rT   yd d2l(m'Z' W n ek
rN   dZ'Y nX Y nX e'red3dd4d5 Z)ed6d7d8d9 Z*ed:ejdd;d< Z+ed=d=ed>d?d@ Z,ed6edAdBdC Z-yd dl.Z.W n ek
r   Y n*X dDdE Z/edFee0fdAdGdH Z1dIdJ Z2yd dl3Z3W n ek
r.   Y n0X edKdKe3j4d'dLdM Z5edNe3j4ddOdP Z6yd dl7Z8W n ek
r   Y n(X edQdQe8j9j:d'e8; < fdRdSZ=dS )U    N)	str_types)FormatErrorc               @   sH   e Zd ZdZi ZdddZdd Zddd	ZeeZ	d
d Z
dd ZdS )FormatCheckera  
    A ``format`` property checker.

    JSON Schema does not mandate that the ``format`` property actually do any
    validation. If validation is desired however, instances of this class can
    be hooked into validators to enable format validation.

    `FormatChecker` objects always return ``True`` when asked about
    formats that they do not know how to validate.

    To check a custom format using a function that takes an instance and
    returns a ``bool``, use the `FormatChecker.checks` or
    `FormatChecker.cls_checks` decorators.

    Arguments:

        formats (~collections.Iterable):

            The known formats to validate. This argument can be used to
            limit which formats will be used during validation.
    Nc                s2   |d kr j   _ nt fdd|D  _ d S )Nc             3   s   | ]}| j | fV  qd S )N)checkers).0k)self C/opt/alt/python37/lib/python3.7/site-packages/jsonschema/_format.py	<genexpr>'   s    z)FormatChecker.__init__.<locals>.<genexpr>)r   copydict)r   formatsr	   )r   r
   __init__#   s    zFormatChecker.__init__c             C   s   d t| jS )Nz<FormatChecker checkers={}>)formatsortedr   )r   r	   r	   r
   __repr__)   s    zFormatChecker.__repr__r	   c                s    fdd}|S )a  
        Register a decorated function as validating a new format.

        Arguments:

            format (str):

                The format that the decorated function will check.

            raises (Exception):

                The exception(s) raised by the decorated function when an
                invalid instance is found.

                The exception object will be accessible as the
                `jsonschema.exceptions.ValidationError.cause` attribute of the
                resulting validation error.
        c                s   | fj  < | S )N)r   )func)r   raisesr   r	   r
   _checks@   s    z%FormatChecker.checks.<locals>._checksr	   )r   r   r   r   r	   )r   r   r   r
   checks,   s    zFormatChecker.checksc          
   C   st   || j krdS | j | \}}d\}}y||}W n& |k
rV } z|}W dd}~X Y nX |sptd||f |ddS )a}  
        Check whether the instance conforms to the given format.

        Arguments:

            instance (*any primitive type*, i.e. str, number, bool):

                The instance to check

            format (str):

                The format that instance should conform to


        Raises:

            FormatError: if the instance does not conform to ``format``
        N)NNz%r is not a %r)cause)r   r   )r   instancer   r   r   resultr   er	   r	   r
   checkG   s    
zFormatChecker.checkc             C   s.   y|  || W n tk
r$   dS X dS dS )a\  
        Check whether the instance conforms to the given format.

        Arguments:

            instance (*any primitive type*, i.e. str, number, bool):

                The instance to check

            format (str):

                The format that instance should conform to

        Returns:

            bool: whether it conformed
        FTN)r   r   )r   r   r   r	   r	   r
   conformsi   s
    zFormatChecker.conforms)N)r	   )__name__
__module____qualname____doc__r   r   r   r   classmethod
cls_checksr   r   r	   r	   r	   r
   r   
   s   

"r   )draft3draft4draft6draft7r	   c                s8    p|  p| p| p|  fdd}|S )Nc                s    rt d  | } r0t d | } rHt d | } r`t d | } tprprpr |  | S )Nr#   r$   r%   r&   )_draft_checkersr   r   r"   )r   )r#   r$   r%   r&   r   r	   r
   wrap   s    z_checks_drafts.<locals>.wrapr	   )namer#   r$   r%   r&   r   r(   r	   )r#   r$   r%   r&   r   r
   _checks_drafts   s    r*   z	idn-email)r)   emailc             C   s   t | tsdS d| kS )NT@)
isinstancer   )r   r	   r	   r
   is_email   s    
r.   z$^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$z
ip-addressZipv4c             C   s4   t | tsdS t| sdS tdd | dD S )NTFc             s   s*   | ]"}d t |  kodkn  V  qdS )r      N)int)r   	componentr	   r	   r
   r      s    zis_ipv4.<locals>.<genexpr>.)r-   r   _ipv4_rematchallsplit)r   r	   r	   r
   is_ipv4   s
    

r7   	inet_ptonZipv6)r)   r   c             C   s   t | tsdS ttj| S )NT)r-   r   socketr8   AF_INET6)r   r	   r	   r
   is_ipv6   s    
r;   z#^[A-Za-z0-9][A-Za-z0-9\.\-]{1,255}$z	host-namehostnamec             C   sH   t | tsdS t| sdS | d}x|D ]}t|dkr,dS q,W dS )NTFr2   ?   )r-   r   _host_name_rer4   r6   len)r   
componentsr1   r	   r	   r
   is_host_name   s    



rA   zidn-hostname)r&   r   c             C   s   t | tsdS t|  dS )NT)r-   r   idnaencode)r   r	   r	   r
   is_idn_host_name   s    

rD   )validate_rfc3986Zuric             C   s   t | tsdS t| ddS )NTURI)rule)r-   r   rE   )r   r	   r	   r
   is_uri   s    
rH   zuri-reference)r%   r&   r   c             C   s   t | tsdS t| ddS )NTURI_reference)rG   )r-   r   rE   )r   r	   r	   r
   is_uri_reference  s    
rJ   Ziric             C   s   t | tsdS tj| ddS )NTZIRI)rG   )r-   r   rfc3987parse)r   r	   r	   r
   is_iri  s    
rM   ziri-referencec             C   s   t | tsdS tj| ddS )NTZIRI_reference)rG   )r-   r   rK   rL   )r   r	   r	   r
   is_iri_reference  s    
rN   c             C   s   t | tsdS tj| ddS )NTrF   )rG   )r-   r   rK   rL   )r   r	   r	   r
   rH     s    
c             C   s   t | tsdS tj| ddS )NTrI   )rG   )r-   r   rK   rL   )r   r	   r	   r
   rJ   #  s    
)validate_rfc3339z	date-timec             C   s   t | tsdS t| S )NT)r-   r   rO   )r   r	   r	   r
   is_datetime7  s    
rP   time)r&   c             C   s   t | tsdS td|  S )NTz1970-01-01T)r-   r   rP   )r   r	   r	   r
   is_time=  s    
rR   regexc             C   s   t | tsdS t| S )NT)r-   r   recompile)r   r	   r	   r
   is_regexD  s    
rV   date)r#   r&   r   c             C   s   t | tsdS tj| dS )NTz%Y-%m-%d)r-   r   datetimestrptime)r   r	   r	   r
   is_dateK  s    
rZ   )r#   r   c             C   s   t | tsdS tj| dS )NTz%H:%M:%S)r-   r   rX   rY   )r   r	   r	   r
   is_draft3_timeR  s    
r[   c             C   s
   t | S )N)	webcolorsZnormalize_hex)r   r	   r	   r
   is_css_color_code^  s    r]   Zcolorc             C   s$   t | tr|  tjkrdS t| S )NT)r-   r   lowerr\   Zcss21_names_to_hexr]   )r   r	   r	   r
   is_css21_colora  s    
r_   c             C   s   |   tjkrdS t| S )NT)r^   r\   Zcss3_names_to_hexr]   )r   r	   r	   r
   is_css3_colorj  s    r`   zjson-pointerc             C   s   t | tsdS t| S )NT)r-   r   jsonpointerJsonPointer)r   r	   r	   r
   is_json_pointeru  s    
rc   zrelative-json-pointerc             C   sj   t | tsdS g d }}x>t| D ]2\}}| r>|| q"|sFdS | |d  }P q"W |dkpht|S )NT F#)r-   r   	enumerateisdigitappendra   rb   )r   Znon_negative_integerresti	characterr	   r	   r
   is_relative_json_pointer  s    


rl   zuri-templatec             C   s   t | }||S )N)uritemplateZURITemplatevalidate)r   Ztemplate_validatortemplater	   r	   r
   is_uri_template  s    	
rp   )NNNNNr	   )>rX   rT   r9   structZjsonschema.compatr   Zjsonschema.exceptionsr   objectr   Zdraft3_format_checkerZdraft4_format_checkerZdraft6_format_checkerZdraft7_format_checkerr   r'   r*   r.   rU   r3   r7   hasattrerror
ValueErrorr;   r>   rA   rB   ImportErrorZ	IDNAErrorrD   rK   Zrfc3986_validatorrE   rH   rJ   rM   rN   Zstrict_rfc3339rO   Zrfc3339_validatorrP   rR   rV   rZ   r[   r\   r]   	TypeErrorr_   r`   ra   ZJsonPointerExceptionrc   rl   Zuritemplate.exceptionsrm   
exceptionsZInvalidTemplateZ	ValidatorZforce_balanced_bracesrp   r	   r	   r	   r
   <module>   s   z     




	
