K i ndZddlZddlmZddlmZej dejZdZ dZ y)z5 A few practical conventions common to all printers. N)Iterable) Derivativez^([^\W\d_]+)(\d+)$c|s|ggfSd}d}g}g}|t|kr|dz}|||dzdk(r|dz }|jd|}|dkr t|}|jd|}|dkr t|}t||}|||} |}|| }n}| jdr|j | ddnW| jdr|j | ddn1| jdr|j | ddn t d|t|krt j|} | r%| j\}} |jd| |||fS) a|Split a symbol name into a name, superscripts and subscripts The first part of the symbol name is considered to be its actual 'name', followed by super- and subscripts. Each superscript is preceded with a "^" character or by "__". Each subscript is preceded by a "_" character. The three return values are the actual name, a list with superscripts and a list with subscripts. Examples ======== >>> from sympy.printing.conventions import split_super_sub >>> split_super_sub('a_x^1') ('a', ['1'], ['x']) >>> split_super_sub('var_sub1__sup_sub2') ('var', ['sup'], ['sub1', 'sub2']) rN__^_zThis should never happen.) lenfindmin startswithappend RuntimeError_name_with_digits_pmatchgroupsinsert) textposnamesuperssubsstartpos_hatpos_uscpos_nextpartmsubs `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/printing/conventions.pysplit_super_subr" sp& R| C D F D D /a C!G  $ QJE))C' Q;$iG))C' Q;$iGw(C! <D __S ! MM$qr( # __T " MM$qr( # __S ! KKQR !:; ;- D /4 !!$'AHHJ c As  ct|trt|jSt|jt s!t t|jdkDStd|jDdkDS)aAReturn whether a partial derivative symbol is required for printing This requires checking how many free variables there are, filtering out the ones that are integers. Some expressions do not have free variables. In that case, check its variable list explicitly to get the context of the expression. rc36K|]}|j yw)N) is_integer).0ss r! z#requires_partial..Xs;A1<<;s) isinstancerrequires_partialexpr free_symbolsrr set variablessum)r,s r!r+r+Isb$ # ** d'' 23t~~&'!++ ;):):; ;a ??r#) __doc__recollections.abcrsympy.core.functionrcompileUNICODErr"r+r#r!r8s9 $* bjj!6 C9x@r#