o
    Mf                     @   s   d dl mZ d dlmZmZmZm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mZ er:dd	lmZ d
ddd
d
ddddee dededee dee ddfddZedkr|d dlmZ e  dededd
fddZedd  e  d
S d
S )!    )Mapping)TYPE_CHECKINGAnyOptionalTuple   )ReprHighlighter)Panel)Pretty)Table)TextTextType)ConsoleRenderableNTF)title	sort_keysindent_guides
max_length
max_stringscopezMapping[str, Any]r   r   r   r   r   returnr   c                C   s   t  }tjddd}|jdd dtttf dtttf fdd	}|r+t| 	 |d
n| 	 }	|	D ] \}
}t
|
|
dr?dndfd}||t|||||d q1tj||dddS )a  Render python variables in a given scope.

    Args:
        scope (Mapping): A mapping containing variable names and values.
        title (str, optional): Optional title. Defaults to None.
        sort_keys (bool, optional): Enable sorting of items. Defaults to True.
        indent_guides (bool, optional): Enable indentaton guides. Defaults to False.
        max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation.
            Defaults to None.
        max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to None.

    Returns:
        ConsoleRenderable: A renderable object.
    )r   r   F)paddingexpandright)justifyitemr   c                 S   s   | \}}| d | fS )z2Sort special variables first, then alphabetically.__)
startswithlower)r   key_ r    X/var/www/html/analyze/labelStudio/lib/python3.10/site-packages/pip/_vendor/rich/scope.py
sort_items)   s   z render_scope.<locals>.sort_items)r   r   zscope.key.specialz	scope.key)z =zscope.equals)highlighterr   r   r   zscope.border)r   border_styler   )r   r   grid
add_columnr   strr   boolsorteditemsr   assembler   add_rowr
   r	   fit)r   r   r   r   r   r   r#   items_tabler"   r*   r   valuekey_textr    r    r!   render_scope   s4   "
r1   __main__)printfoobarc                 C   s6   g d}ddg ddgdd}t tt dd	d
 d S )N)r         N   TFzHello Worldz1.1confirmFruitPurchase)appleorangemangoespomelog+?	194521489)versionmethodparamsidz	[i]localsF)r   r   )r3   r1   locals)r4   r5   list_of_thingsdict_of_thingsr    r    r!   testK   s   
rF   gk	W4@g?$	@)collections.abcr   typingr   r   r   r   r#   r   panelr	   prettyr
   tabler   textr   r   consoler   r(   intr1   __name__pip._vendor.richr3   floatrF   r    r    r    r!   <module>   sH    
8


