
    g                        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Zedk(  r(d dlmZ  e        dededd
fdZ edd        e        y
y
)    )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                   t               }t        j                  dd      }|j                  d       dt        t
        t        f   dt        t        t
        f   fd}|rt        | j                         |	      n| j                         }	|	D ]P  \  }
}t        j                  |
|
j                  d
      rdndfd      }|j                  |t        |||||             R t        j                   ||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 indentation 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                 P    | \  }}|j                  d       |j                         fS )z2Sort special variables first, then alphabetically.__)
startswithlower)r   key_s      I/var/www/html/venv/lib/python3.12/site-packages/pip/_vendor/rich/scope.py
sort_itemsz render_scope.<locals>.sort_items)   s(    QNN4((#))+66    )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_texts                r#   render_scoper4      s    . "#K**VE:K7+7sCx 7U49-= 7
 6?F5;;=j1EKKME 

U==)=%;O"
 	'+%%		

 99#	 r%   __main__)printfoobarc                 `    g d}ddg ddgdd}t        t        t               dd	
             y )N)r         N   TFzHello Worldz1.1confirmFruitPurchase)appleorangemangoespomelog+?	194521489)versionmethodparamsidz	[i]localsF)r   r   )r6   r4   locals)r7   r8   list_of_thingsdict_of_thingss       r#   testrJ   K   s4    G,?G	
 	l68;%HIr%   gk	W4@g?$	@)collections.abcr   typingr   r   r   r   r&   r	   panelr
   prettyr   tabler   textr   r   consoler   r+   intr4   __name__pip._vendor.richr6   floatrJ    r%   r#   <module>rW      s    # 6 6 (     * !% $ $55 H5 	5
 5 5 5 5p z&	GJ% Je J J 	&	G! r%   