o
    a"<fe  ã                   @   s    d dl mZ dd„ Zdd„ ZdS )é    )ÚOrderedDictc                 C   s    | d d pd| d d f}|S )zûReturns appropriate key for sorting attribute names

    Attribute names are a tuple of ``(namespace, name)`` where namespace can be
    ``None`` or a string. These can't be compared in Python 3, so we conver the
    ``None`` to an empty string.

    r   Ú é   © )ÚattrÚkeyr   r   úC/var/www/html/kck/venv/lib/python3.10/site-packages/bleach/utils.pyÚ	_attr_key   s   r	   c                 C   s&   | s| S t dd„ t|  ¡ tdD ƒƒS )zBTakes a dict of attributes (or None) and returns them alphabetizedc                 S   s   g | ]\}}||f‘qS r   r   )Ú.0ÚkÚvr   r   r   Ú
<listcomp>   s    z*alphabetize_attributes.<locals>.<listcomp>)r   )r   ÚsortedÚitemsr	   )Úattrsr   r   r   Úalphabetize_attributes   s   r   N)Úcollectionsr   r	   r   r   r   r   r   Ú<module>   s    