U cf @sddlmZddlmZmZmZmZddlmZddl m Z ddl m Z ddl mZddlmZmZertdd lmZd d d d d d deeeeeeeeddddZedkrddlmZeeed dddZedded S))Mapping) TYPE_CHECKINGAnyOptionalTuple)ReprHighlighter)Panel)Pretty)Table)TextTextType)ConsoleRenderableNTF)title sort_keys indent_guides max_length max_stringzMapping[str, Any]r)scoperrrrrreturnc Cst}tjddd}|jddtttftttfddd}|rTt| |d n| } | D]@\} } t | | d r|d nd fd } | | t| ||||dq`tj||dddS)aRender 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. )rrF)paddingexpandright)justify)itemrcSs|\}}|d |fS)z2Sort special variables first, then alphabetically.__) startswithlower)rkey_r D/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/rich/scope.py sort_items)sz render_scope..sort_items)rrzscope.key.specialz scope.key)z =z scope.equals) highlighterrrrz scope.border)r border_styler)rr grid add_columnrstrrboolsorteditemsr assembleradd_rowr r fit) rrrrrrr# items_tabler"r*rvaluekey_textr r r! render_scopes4    r1__main__)print)foobarrcCsFddddddddg}dd d d d d gdgdd}tttddddS)NrTFz Hello Worldz1.1ZconfirmFruitPurchaseappleZorangeZmangoesZpomelog+?Z 194521489)versionmethodparamsidz [i]locals)rr)r3r1locals)r4r5Zlist_of_thingsZdict_of_thingsr r r!testKsr?gk W4@g?$ @)collections.abcrtypingrrrrr#rpanelr prettyr tabler textr r consolerr(intr1__name__pip._vendor.richr3floatr?r r r r!s8       8