o 7]h @sddlmZddlmZmZmZmZddlmZddl m Z ddl m Z ddl mZddlmZmZer:dd lmZd d d d d d dddeedededeedeeddfddZedkr|ddlmZedededd fddZedd ed Sd S)!)Mapping) TYPE_CHECKINGAnyOptionalTuple)ReprHighlighter)Panel)Pretty)Table)TextTextType)ConsoleRenderableNTF)title sort_keys indent_guides max_length max_stringscopezMapping[str, Any]rrrrrreturnrc Cst}tjddd}|jdddtttfdtttffdd }|r+t| |d n| } | D] \} } t | | d r?d nd fd} | | t| ||||dq1tj||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 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. )rrF)paddingexpandright)justifyitemrcSs|\}}|d |fS)z2Sort special variables first, then alphabetically.__) startswithlower)rkey_r 8/usr/lib/python3/dist-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__)printfoobarcCs6gd}ddgddgdd}tttdd d dS) N)rNTFz Hello Worldz1.1confirmFruitPurchase)appleorangemangoespomelog+? 194521489)versionmethodparamsidz [i]localsF)rr)r3r1locals)r4r5list_of_thingsdict_of_thingsr r r!testKs rFgk W4@g?$ @)collections.abcrtypingrrrrr#rpanelr prettyr tabler textr r consolerr(intr1__name__pip._vendor.richr3floatrFr r r r!sH       8