
    (i
              	           d dl mZmZmZmZmZ d dlmZmZ dee   deeeef   eef   de	fdZ
dee   deeeef   eef   de	fdZdee   deeeef   eef   de	fdZ	 dd	ee   d
ee   dede	fdZy)    )AnyIterableMappingSetUnion)TxDataTxParamsvaluesdreturnc                 B    t              t        fd| D              S )ag  
    Returns a bool based on whether ALL of the provided values exist
    among the keys of the provided dict-like object.

    :param values: An iterable with values to look for within the dict-like object
    :param d:      A dict-like object
    :return:       True if ALL values exist in keys;
                   False if NOT ALL values exist in keys
    c              3   &   K   | ]  }|v  
 y wN .0_r   s     L/var/www/br/venv/lib/python3.12/site-packages/web3/_utils/utility_methods.py	<genexpr>zall_in_dict.<locals>.<genexpr>        &!qAv&   )dictallr
   r   s    `r   all_in_dictr           	QA&v&&&    c                 B    t              t        fd| D              S )ak  
    Returns a bool based on whether ANY of the provided values exist
    among the keys of the provided dict-like object.

    :param values: An iterable with values to look for within the dict-like object
    :param d:      A dict-like object
    :return:       True if ANY value exists in keys;
                   False if NONE of the values exist in keys
    c              3   &   K   | ]  }|v  
 y wr   r   r   s     r   r   zany_in_dict.<locals>.<genexpr>,   r   r   )r   anyr   s    `r   any_in_dictr!      r   r   c                     t        | |       S )al  
    Returns a bool based on whether NONE of the provided values exist
    among the keys of the provided dict-like object.

    :param values: An iterable with values to look for within the dict-like object
    :param d:      A dict-like object
    :return:       True if NONE of the values exist in keys;
                   False if ANY value exists in keys
    )r!   r   s     r   none_in_dictr#   /   s     61%%%r   set1set2
percentagec                     |dz  }t        | j                  |            t        |       |z  k\  xs) t        |j                  |             t        |      |z  k\  S )aF  
    Returns a bool based on whether two sets might have some differences but are mostly
    the same. This can be useful when comparing formatters to an actual response for
    formatting.

    :param set1:        A set of values.
    :param set2:        A second set of values.
    :param percentage:  The percentage of either set that must be present in the
                        other set; defaults to 100.
    :return:            True if one set's intersection with the other set is greater
                        than or equal to the given percentage of the other set.
    d   )lenintersection)r$   r%   r&   	thresholds       r   either_set_is_a_subsetr,   >   s]    " S I 	Dd#$D	I(== 	At  &'3t9y+@@r   N)r(   )typingr   r   r   r   r   
web3.typesr   r	   boolr   r!   r#   intr,   r   r   r   <module>r1      s    'SM'#GCH$5vx$GH'	' 'SM'#GCH$5vx$GH'	' &SM&#GCH$5vx$GH&	&$ 
c(
c(  
	r   