rL im4ddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl m Z mZddlmZmZdZdZeeiZed d Zd Zd Zd Zd ZdZdZdZdZdZdZdZ e jBjEdddgddgdZ#dZ$dZ%dZ&dZ'y)!)contextmanager)Path)TemporaryDirectoryN)pyplotstyle)USER_LIBRARY_PATHSSTYLE_EXTENSIONz image.cmappinkc#K|st}|dt} t5}t||j dj d|j Ddtj|tjddddtjy#1swYxYw#tjwxYww)zAContext manager to create a style sheet in a temporary directory.. c30K|]\}}|d|yw)z: N).0kvs a/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/tests/test_style.py ztemp_style..sC$!QQCr!+Csutf-8encodingN) DUMMY_SETTINGSr rr write_textjoinitemsrappendrreload_library) style_namesettings temp_filetmpdirs r temp_styler"s !,a01I   ! V  # . . C(..2BCC  / "  % %f -  "      s4C B9A/B-B9C-B62B99CCcddi}d}t||5 dddt|jdk(r||jdjvsJy#1swYCxYw)Nfoobarbasenamer)r"lenrecords getMessage)caplogSETTINGSr&s r)test_invalid_rc_warning_includes_filenamer-'slu~HH Hh '     1 $FNN1-88::< ;:   s AA cxtdt5dtjvsJ dddy#1swYyxYw)N_test_)r"rr availablerrtest_availabler21s3 Hn -+5??***+++s09cdtjt<tdt5t j d5tjttk(sJ ddddddy#1swYxYw#1swYyxYwNgraytestmplrcParamsPARAMr"rrcontextVALUErr1rtest_user=6sl CLL FN +0 ]]6 " 0<<&%/ // 000 0 000s"A=!A1 A=1A: 6A==Bcv|dz }|jddtdt5dtjdk(rdnd z|j j z}tj|5tjd d k(sJ ddddddy#1swYxYw#1swYyxYw) Nfilezaxes.facecolor: adeaderrr6zfile:win32z///zaxes.facecolorz#adeade) rr"rsysplatformresolveas_posixrr;r8r9)tmp_pathpathurls r test_use_urlrI=s f DOO,wO? FN +?<<72%<((*+]]3  ?<< 01Y> >> ? ?? ? ? ??s$AB/8B#B/#B, (B//B8cXdtjt<|dtz }|j tdt dt j|5tjtt k(sJ dddtjtdk(sJy#1swY&xYw)Nr5ztext.z : rr)r8r9r:r rr<rr;)rFrGs rtest_single_pathrKHs CLL o./ /DOOugS(7O; t ,||E"e+++, << & (( (,,s !B  B)cJdtjt<tdt5t j d5tjttk(sJ ddddddtjtdk(sJy#1swY.xYw#1swY2xYwr4r7rr1r test_contextrMQs CLL FN +0 ]]6 " 0<<&%/ // 00 << & (( ( 0 000s"B!B  B B BB"c d}d}|tjt<tjt|i5tjt|k(sJ dddtjt|k(sJy#1swY&xYw)Nr5blue)r8r9r:rr;original_value other_values rtest_context_with_dictrSZsnNK(CLL {+ ,2||E"k1112 << . 00 022s A::BcZd}d}|tjt<tdt5t j dt|ig5tjt|k(sJ ddddddtjt|k(sJy#1swY.xYw#1swY2xYwNr5rOr6)r8r9r:r"rrr;rPs r'test_context_with_dict_after_namedstylerVcsNK(CLL FN +6 ]]FUK$89 : 6<<&+5 55 66 << . 00 0 6 666s#B! B(B!B B!!B*cbd}d}|tjt<tdt5t j t|idg5tjttk(sJ ddddddtjt|k(sJy#1swY.xYw#1swY2xYwrUr7rPs r(test_context_with_dict_before_namedstylerXnsNK(CLL FN +0 ]]UK0&9 : 0<<&%/ // 00 << . 00 0 0 000s#B% !B,B%B" B%%B.cd}d}d}||i}|tjt<| tj|<tdt5t j d|g5tjttk(sJtj||k(sJ ddddddtjt|k(sJtj|| k(sJy#1swYGxYw#1swYKxYw)Nr5z text.usetexTr6r7)rQ other_paramrRds r.test_context_with_union_of_dict_and_namedstyler\ysNKK k"A(CLL%0CLL FN +< ]]FA; ' <<<&%/ //<< , ; ;; << << . 00 0 << $[ 99 9  < <<> ) )-Gs{{/F/F-G GG Gr1c,|j||j||dz }|j|dz jdd|j djddt j jdt jd d k(sJt j jd t jd d k(sJt j jd t jd d k(sJy)Nmpl_test_style_pkgztest_style.mplstylezlines.linewidth: 42rrz .mplstylezlines.linewidth: 84zmpl_test_style_pkg.test_stylezlines.linewidth*zmpl_test_style_pkg.mplstyleTz./mpl_test_style_pkg.mplstyle) syspath_prependchdirmkdirr with_suffixr8ruser9)rF monkeypatchpkg_paths rtest_style_from_modulers)h..H NN %%1121 %0011IIMM12 <<) *b 00 0IIMM/0 <<) *b 00 0IIMM12 <<) *b 00 0r1r)( contextlibrpathlibrtempfilerrBnumpyryr_ matplotlibr8rrwrmatplotlib.style.corerr r:r<rr"r-r2r=rIrKrMrSrVrXr\rcmark parametrizerrr|r~rrrr1rrs%'  +E &<+ 0?))111 : 2..0%w/1 16/H1r1