o
    ix                     @   s   dddZ dd Zdd ZdS )	Fc                 C   s\   t | }|t |krtd|dkr|rdS dS tdd t| |D }|r,|t| S |S )a  Compute the Hamming distance between the two sequences `seq1` and `seq2`.
	The Hamming distance is the number of differing items in two ordered
	sequences of the same length. If the sequences submitted do not have the
	same length, an error will be raised.
	
	If `normalized` evaluates to `False`, the return value will be an integer
	between 0 and the length of the sequences provided, edge values included;
	otherwise, it will be a float between 0 and 1 included, where 0 means
	equal, and 1 totally different. Normalized hamming distance is computed as:
	
		0.0                         if len(seq1) == 0
		hamming_dist / len(seq1)    otherwise
	z'expected two strings of the same length    g        c                 s   s    | ]	\}}||kV  qd S )N ).0c1c2r   r   I/home/ubuntu/.local/lib/python3.10/site-packages/distance/_simpledists.py	<genexpr>   s    zhamming.<locals>.<genexpr>)len
ValueErrorsumzipfloat)seq1seq2
normalizedLdistr   r   r   hamming   s   r   c                 C   s2   t | t |}}dt||@ tt||B   S )zCompute the Jaccard distance between the two sequences `seq1` and `seq2`.
	They should contain hashable items.
	
	The return value is a float between 0 and 1, where 0 means equal, and 1 totally different.
	   setr   r   r   r   set1set2r   r   r   jaccard   s    r   c                 C   s:   t | t |}}ddt||@  tt|t|   S )zCompute the Sorensen distance between the two sequences `seq1` and `seq2`.
	They should contain hashable items.
	
	The return value is a float between 0 and 1, where 0 means equal, and 1 totally different.
	r      r   r   r   r   r   sorensen%   s   (r   N)F)r   r   r   r   r   r   r   <module>   s   

