L iddlZddlmZddlZddlmZd dZdZdejjdee fdZ d de fd Z y) N)Optional) LazyStringc fddvrdd<dvr$ tjjsdd<t fdS#t$rdd<Y wxYw)z; Returns a LazyString that formats the graph code. cdSS)N )maybe_idnamesU/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/torch/fx/_utils.py format_namez+lazy_format_graph_code..format_names  V1XJ' 'K print_outputFcoloredc tddjjjjdiS)Nz===== z ===== r)_format_graph_codeforward__code__ co_filenameprint_readable)r gmkwargssr z(lazy_format_graph_code..sA"[]O8 , JJ   + + B   ' ' r )sysstdoutisattyAttributeErrorr)r rr rr s````@r lazy_format_graph_coder sr  V#!&~F &::$$&$)y!    & %F9  &s#A AAcd|d|d|dS)z7 Returns a string that formats the graph code. zTRACED GRAPH r r)r filename graph_strs r rr'sTF!H:Qyk <}|j|j|jdk(rn|j}@dj |dddS)zD Returns a string of the last num_nodes nodes in the graph. rootrN)rangeappend format_noder(prevjoin)r* num_nodes node_contextscur_s r get_node_contextr88siM C 9 S__./ 66V  hh  99]4R4( ))r )N))rtypingrtorchtorch._loggingrrrfxGraphdictr+strr8rr r rAsF  %<=uxx~~(4. *3 *r