Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
 ìÕYf|Qã @sadZddlZddlZddlZddlZddlm Z dddddd gZ dd d dd d dd„Z d d dd d dd„Z dd„Zdd„Zdd„ZGdd„dƒZdd„ZGdd „d ƒZdd„ZeeeeeeeeedƒhƒZdd„Zddd„Z dd„Z!e"d kr]e ƒdS)!a/Support to pretty-print lists, tuples, & dictionaries recursively. Very simple, but useful, especially in debugging data structures. Classes ------- PrettyPrinter() Handle pretty-printing operations onto a stream using a configured set of formatting parameters. Functions --------- pformat() Format a Python object into a pretty-printed representation. pprint() Pretty-print a Python object to a stream [default is sys.stdout]. saferepr() Generate a 'standard' repr()-like value, but protect against recursive data structures. éN)ÚStringIOÚpprintÚpformatÚ isreadableÚ isrecursiveÚsafereprÚ PrettyPrinterééPÚcompactFc Cs8td|d|d|d|d|ƒ}|j|ƒdS)zAPretty-print a Python object to a stream [default is sys.stdout].ÚstreamÚindentÚwidthÚdepthr N)rr)Úobjectr r rrr Zprinter©rú+/opt/alt/python35/lib64/python3.5/pprint.pyr/s c Cs(td|d|d|d|ƒj|ƒS)z= 0Nzdepth must be > 0zwidth must be != 0) ÚintÚ ValueErrorÚ_depthÚ_indent_per_levelÚ_widthÚ_streamÚ_sysÚstdoutÚboolÚ_compact)rr rrr r rrrrcs            zPrettyPrinter.__init__cCs3|j||jddidƒ|jjdƒdS)NrÚ )Ú_formatr+Úwrite)rrrrrrŠszPrettyPrinter.pprintcCs/tƒ}|j||ddidƒ|jƒS)Nr)Ú _StringIOr1Úgetvalue)rrZsiorrrrŽs zPrettyPrinter.pformatcCs|j|iddƒdS)Nrr)Úformat)rrrrrr“szPrettyPrinter.isrecursivecCs,|j|iddƒ\}}}|o+| S)Nr)r5)rrÚsÚreadableÚ recursiverrrr–s!zPrettyPrinter.isreadablec Cs-t|ƒ}||krA|jt|ƒƒd|_d|_dS|j|||ƒ}|j||} t|ƒ| kr|jj t |ƒj dƒ} | dk rØd||<| |||||||dƒ||=dSt |t ƒrd||<|j||||||dƒ||=dS|j|ƒdS)NTFr )rr2Ú _recursionÚ _recursiveÚ _readableÚ_reprr*ÚlenÚ _dispatchÚgetrÚ__repr__Ú isinstanceÚdictÚ _pprint_dict) rrr r Ú allowanceÚcontextÚlevelÚobjidÚrepÚ max_widthÚprrrr1šs,        zPrettyPrinter._formatc Cs|j}|dƒ|jdkr7||jddƒt|ƒ}|rt|jƒdtƒ} |j| |||d||ƒ|dƒdS)Nú{r ú Úkeyú})r2r)r=ÚsortedÚitemsr%Ú_format_dict_items) rrr r rDrErFr2ZlengthrPrrrrC´s    zPrettyPrinter._pprint_dictcCsŽt|ƒs#|jt|ƒƒdS|j}|j|jdƒ|jt|jƒƒ||t|jƒd|d||ƒ|jdƒdS)Nú(r ú))r=r2ÚreprÚ __class__rr1ÚlistrP)rrr r rDrErFÚclsrrrÚ_pprint_ordered_dictÂs   z"PrettyPrinter._pprint_ordered_dictcCs>|jdƒ|j||||d||ƒ|jdƒdS)Nú[r ú])r2Ú _format_items)rrr r rDrErFrrrÚ _pprint_listÏs  zPrettyPrinter._pprint_listcCsb|jdƒt|ƒdkr%dnd}|j||||t|ƒ||ƒ|j|ƒdS)NrRr z,)rS)r2r=r[)rrr r rDrErFÚendcharrrrÚ _pprint_tuple×s   zPrettyPrinter._pprint_tuplec CsÈt|ƒs#|jt|ƒƒdS|j}|tkrN|jdƒd}n1|j|jdƒd}|t|jƒd7}t|dtƒ}|j||||t|ƒ||ƒ|j|ƒdS)NrKrNz({z})r rM) r=r2rTrUÚsetrrOrr[) rrr r rDrErFÚtypr]rrrÚ _pprint_setàs      zPrettyPrinter._pprint_setcCsj|j}t|ƒs)|t|ƒƒdSg}|jdƒ} |dkr^|d7}|d7}|j|} } xct| ƒD]U\} } t| ƒ}| t| ƒdkr´| |8} t|ƒ| krÖ|j|ƒq|tjd| ƒ}|sôt ‚|d  st ‚|j ƒ| }d}xšt|ƒD]Œ\}}||}|t|ƒdkrt| t| ƒdkrt||8}tt|ƒƒ|kr®|r¥|jt|ƒƒ|}q(|}q(W|r||jt|ƒƒq|Wt|ƒdkrõ||ƒdS|dkr |dƒxBt|ƒD]4\} }| dkrB|dd|ƒ||ƒqW|dkrf|d ƒdS) NTr z\S*\s*ÚrRrr0rLrSéÿÿÿÿ) r2r=rTÚ splitlinesr*Ú enumerateÚappendÚreÚfindallÚAssertionErrorÚpop)rrr r rDrErFr2ZchunksÚlinesZ max_width1rIÚiÚlinerHÚpartsZ max_width2ÚcurrentÚjÚpartÚ candidaterrrÚ _pprint_strôsX          ,        zPrettyPrinter._pprint_strc CsÅ|j}t|ƒdkr/|t|ƒƒdS|dk}|r_|d7}|d7}|dƒd} xIt||j||ƒD].} || ƒ|| ƒ| sdd|} qW|rÁ|dƒdS)Nér rRrbr0rLrS)r2r=rTÚ_wrap_bytes_reprr*) rrr r rDrErFr2ZparensÚdelimrHrrrÚ _pprint_bytes's"        zPrettyPrinter._pprint_bytescCsO|j}|dƒ|jt|ƒ||d|d||dƒ|dƒdS)Nz bytearray(é r rS)r2rwÚbytes)rrr r rDrErFr2rrrÚ_pprint_bytearray<s   zPrettyPrinter._pprint_bytearraycCsH|jdƒ|j|jƒ||d|d||ƒ|jdƒdS)Nz mappingproxy(é r rS)r2r1Úcopy)rrr r rDrErFrrrÚ_pprint_mappingproxyEs   z"PrettyPrinter._pprint_mappingproxycCsÖ|j}||j7}dd|}t|ƒd} x›t|ƒD]\} \} } | | k} |j| ||ƒ}||ƒ|dƒ|j| ||t|ƒd| r±|nd||ƒ| sA||ƒqAWdS)Nz, rLr z: r)r2r)r=rer<r1)rrPr r rDrErFr2ÚdelimnlZ last_indexrlrMÚentÚlastrHrrrrQMs      z PrettyPrinter._format_dict_itemscCs«|j}||j7}|jdkr:||jddƒdd|}d} |j|d} } t|ƒ} yt| ƒ} Wntk r—dSYnXd}x|s¦| }yt| ƒ} Wn,tk rëd}| |8} | |8} YnX|jrk|j|||ƒ}t|ƒd}| |kr8| } | r8|} | |krk| |8} || ƒd} ||ƒq¡|| ƒ|} |j ||||r–|nd||ƒq¡WdS) Nr rLz, rbFTrz, ) r2r)r*ÚiterÚnextÚ StopIterationr/r<r=r1)rrPr r rDrErFr2r~rvrrIÚitZnext_entr€rrHÚwrrrr[^sN               zPrettyPrinter._format_itemscCsL|j||jƒ|j|ƒ\}}}|s9d|_|rHd|_|S)NFT)r5r|r(r;r:)rrrErFrTr7r8rrrr<‡s  zPrettyPrinter._reprcCst||||ƒS)zÈFormat object for a specific context, returning a string and flags indicating whether the representation is 'readable' and whether the object represents a recursive construct. )r)rrrEÚ maxlevelsrFrrrr5szPrettyPrinter.formatc Cs­t|ƒs#|jt|ƒƒdS|j|j||ƒ}|j}|t|jƒd7}|jd|j|d|fƒ|j||||d||ƒ|jdƒdS)Nr z %s(%s, %srLrS)r=r2rTr<Údefault_factoryrUrrC) rrr r rDrErFZrdfrWrrrÚ_pprint_default_dict—s  ! z"PrettyPrinter._pprint_default_dictc Csµt|ƒs#|jt|ƒƒdS|j}|j|jdƒ|jdkrg|j|jddƒ|jƒ}|j|||t|jƒd|d||ƒ|jdƒdS)Nz({r rLrz}))r=r2rTrUrr)Ú most_commonrQ) rrr r rDrErFrWrPrrrÚ_pprint_counter¤s     zPrettyPrinter._pprint_counterc Csøt|jƒs&|jt|ƒƒdS|j}|j|jdƒ|t|jƒd7}x—t|jƒD]†\}} |t|jƒdkr¿|j| |||d||ƒ|jdƒqj|j| ||d||ƒ|jdd|ƒqjWdS)NrRr rSz, rL)r=Úmapsr2rTrUrrer1) rrr r rDrErFrWrlÚmrrrÚ_pprint_chain_map´s  zPrettyPrinter._pprint_chain_mapc Csöt|ƒs#|jt|ƒƒdS|j}|j|jdƒ|t|jƒd7}|jdƒ|jdkr£|j||||d||ƒ|jdƒnO|j|||d||ƒ|j|j||ƒ}|jdd||fƒdS)NrRr rYrz])z], %smaxlen=%s)rL)r=r2rTrUrÚmaxlenr[r<) rrr r rDrErFrWZrmlrrrÚ _pprint_dequeÅs     zPrettyPrinter._pprint_dequecCs'|j|j|||||dƒdS)Nr )r1Údata)rrr r rDrErFrrrÚ_pprint_user_dictÙszPrettyPrinter._pprint_user_dictcCs'|j|j|||||dƒdS)Nr )r1r)rrr r rDrErFrrrÚ_pprint_user_listÞszPrettyPrinter._pprint_user_listcCs'|j|j|||||dƒdS)Nr )r1r)rrr r rDrErFrrrÚ_pprint_user_stringãsz!PrettyPrinter._pprint_user_string)2rr r!rrrrrr1r>rCrBr@rXÚ _collectionsÚ OrderedDictr\rVr^Útuplerar_Ú frozensetrsrrwryrzÚ bytearrayr}Ú_typesÚMappingProxyTyperQr[r<r5rˆÚ defaultdictrŠÚCounterrÚChainMaprÚdequer‘ÚUserDictr’ÚUserListr“Ú UserStringrrrrrbsZ &               1        )        cCsUt|ƒ}|tkr+t|ƒddfSt|ddƒ}t|tƒr®|tjkr®|sedSt|ƒ}|r–||kr–dd||kfS||krµt|ƒddfSd||)rrr)rrrrr91sr9cCs¶ddl}|dkrCddddgddd d ifgd }tƒ}|jƒ}t|iddƒ|jƒ}|j|ƒ|jƒ}td ||ƒtd ||ƒdS)NrÚstringr rértééééi †z _safe_repr:zpformat:)r r)ÚtimerrrÚprint)rrµrJZt1Zt2Zt3rrrÚ _perfcheck6s  +     r·ccs¾d}t|ƒdd}xŒtdt|ƒdƒD]r}|||d…}||}||krm||8}tt|ƒƒ|krŸ|r–t|ƒV|}q3|}q3W|rºt|ƒVdS)Nórtr)r=ÚrangerT)rrrDror€rlrqrrrrrruCs      ruÚ__main__)#r"Ú collectionsr”rgÚsysr,Útypesr™Úiorr3Ú__all__rrrrrrr%rrr—rryr˜r&ÚfloatÚcomplexr.rr¦r9r·rurrrrrÚ#s2         ÿ‰ D