
    e%                         d dl mZmZmZmZmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ dZdZd	Z ed
e      Z G d deeeef            Zdeeee   f   deeeef      fdZy)    )AnyHashableMappingTypeVarUnion)BaseMatcher)Description)	hasmethod)wrap_matcher)MatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtK)boundc                   L    e Zd Zdee   ddfdZdeeef   defdZ	de
ddfdZy)	IsDictContainingKeykey_matcherreturnNc                     || _         y )N)r   )selfr   s     R/usr/lib/python3/dist-packages/hamcrest/library/collection/isdict_containingkey.py__init__zIsDictContainingKey.__init__   s
    &    itemc                     t        |d      r2|j                         D ]  }| j                  j                  |      s y y)NkeysTF)r
   r   r   matches)r   r   keys      r   _matcheszIsDictContainingKey._matches   s=    T6"yy{  ##++C0  r   descriptionc                 X    |j                  d      j                  | j                         y )Nza dictionary containing key )append_textappend_description_ofr   )r   r   s     r   describe_tozIsDictContainingKey.describe_to   s%     >?UU	
r   )__name__
__module____qualname__r   r   r   r   r   boolr   r	   r"    r   r   r   r      sG    'GAJ '4 'WQV_  
{ 
t 
r   r   	key_matchr   c                 *    t        t        |             S )a  Matches if dictionary contains an entry whose key satisfies a given
    matcher.

    :param key_match: The matcher to satisfy for the key, or an expected value
        for :py:func:`~hamcrest.core.core.isequal.equal_to` matching.

    This matcher iterates the evaluated dictionary, searching for any key-value
    entry whose key satisfies the given matcher. If a matching entry is found,
    ``has_key`` is satisfied.

    Any argument that is not a matcher is implicitly wrapped in an
    :py:func:`~hamcrest.core.core.isequal.equal_to` matcher to check for
    equality.

    Examples::

        has_key(equal_to('foo'))
        has_key('foo')

    )r   r   )r(   s    r   has_keyr*   !   s    * |I677r   N)typingr   r   r   r   r   hamcrest.core.base_matcherr   hamcrest.core.descriptionr	   hamcrest.core.helpers.hasmethodr
   "hamcrest.core.helpers.wrap_matcherr   hamcrest.core.matcherr   
__author____copyright____license__r   r   r*   r'   r   r   <module>r4      s{    9 9 2 1 5 ; )
-$Cx 
+gafo6 
"8uQ
]+ 830H 8r   