
     h                     @    d dl Z  e             e            fdZd ZdS )    Nc                     | du r|S | du r|S | S )zH
    A hack to make True and 1 and False and 0 unique for ``uniq``.
    TF )elementtruefalses      L/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/coreschema/utils.pyunboolr	      s'    
 $	E		N    c                    	 t          t          d | D                                 t          |           k    S # t          $ r 	 t          d | D                       }t	          j        |dd          }t          ||          D ]\  }}||k    r Y dS nK# t          t          f$ r7 g }| D ]/}t          |          }||v r Y Y dS |	                    |           0Y nw xY wY nw xY wdS )z
    Check if all of a container's elements are unique.
    Successively tries first to rely that the elements are hashable, then
    falls back on them being sortable, and finally falls back on brute
    force.
    c              3   4   K   | ]}t          |          V  d S Nr	   .0is     r   	<genexpr>zuniq.<locals>.<genexpr>0   s(      44Qvayy444444r
   c              3   4   K   | ]}t          |          V  d S r   r   r   s     r   r   zuniq.<locals>.<genexpr>3   s(      77&))777777r
      NFT)
lenset	TypeErrorsorted	itertoolsislicezipNotImplementedErrorr	   append)	containersortslicedr   jseenes          r   uniqr$   '   s9   344)4444455YGG   	77Y77777D%dAt44FD&)) ! !166 555 ! $Y/ 	 	 	D  1II99 5555A	 	 4sF   69 
C"ABBC"+C?C"CC"CC"!C")r   objectr	   r$   r   r
   r   <module>r&      sS   0       	 	 	 	    r
   