o
    Ëý°j¤  ã                   @   s    d dl mZ d dlmZmZ d dl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d
ddee dee dee dee defdd„ZdS )é    )ÚMapping)ÚAnyÚOptionalN)ÚJustifyMethodé   )Úbox)ÚReprHighlighter)ÚPretty)ÚTableÚmappingzMapping[Any, Any]ÚtitleÚcaptionÚtitle_justifyÚcaption_justifyÚreturnc           	      C   s€   t  dt¡ td||tjdd�}||_||_|dur||_|dur$||_	t
ƒ }|  ¡ D ]\}}| t||d�t||d�¡ q+|S )a  Generate a simple table from a mapping.

    Args:
        mapping (Mapping): A mapping object (e.g. a dict);
        title (str, optional): Optional title to be displayed over the table.
        caption (str, optional): Optional caption to be displayed below the table.
        title_justify (str, optional): Justify method for title. Defaults to None.
        caption_justify (str, optional): Justify method for caption. Defaults to None.

    Returns:
        Table: A table instance which may be rendered by the Console.
    z/tabulate_mapping will be deprecated in Rich v11FÚblue)Úshow_headerr   r   r   Úborder_styleN)Úhighlighter)ÚwarningsÚwarnÚDeprecationWarningr
   r   ÚROUNDEDr   r   r   r   r   ÚitemsÚadd_rowr	   )	r   r   r   r   r   Útabler   ÚkeyÚvalue© r   úŒ/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/pip/_vendor/rich/tabulate.pyÚtabulate_mapping   s(   ûÿr    )NNNN)Úcollections.abcr   Útypingr   r   r   Úpip._vendor.rich.consoler   Ú r   r   r   Úprettyr	   r   r
   Ústrr    r   r   r   r   Ú<module>   s2    ûÿþýüûú