��c��RDUCK3 � Z�@����������������fi�)��-eG���T�V @ 0@0$�@`@4��� �0� @� `$ �*�� �(���`�P �.@ @,�@�$� 02�`x� � "`�PL� @)@� �(-���& �0 l d� �.`Ѐ0\� �2`�� `n� �0 `�0@ h.�� �Z�=���z�h@ !�`d�p�� �2@�"�Z� �=���"@�@�G � ���J@� 0 �L� � ���x� �����-���!� ��S@P� P6@�K`�� �Z��C� L����X�h��4(� ��X �0�~@ (��-�2p �0� �E@d@`@@�!�Z��` t�����^�| �&@H@ $�&H@X��(� H��X @\ ��@H `T�&0�@� \ ��X �0�  �U�L� P�� 0g 8�4 �@X �P��` �� �^@ (m��7@.��E@� 0��������`t�9�t u�h� @�� �6`܁��@�`��>�`��-��6� �`�Bp^� ��Ap� 0/`̀C�� 8�`̀C�A"���(B�� 8�`�F�"�� E0f�#@� 4G`A!��� Ipf�!@� 4G0 �!x�@P�J�&� �����K� 2�&�+` N�:A �-�`�30@A(/`��L@ �@)0��d�SP f�)���T0&@&8����T�*p��h� 4� (.��ZA��WA(�@ @^,�@̂Yh��m��E@�-(q�܂Pp�-(���"P ��]nA�/@�[P�.xE��"� |�/�  �`0n� E��[p�� � �`p�-����Bp �1�̀ap ��"���bp z �3�b0�.�E�c�� �E��!�1��"21���dP�@@��b0�����\@ f@2xE�bP��2���@0� (��f� �@�C��"0�@x3 �h0��-�y`�[p�-�) �@��4� �i0R@0�ԠX�k@����`@� ��6�nP�� `� p� �� ��p�� ^/���n@�7���/���%��@�`1(�@�b��2P��bp1��(b0p1(3(�l�1�� �b0� ��`�d� �1P� � ��8�� �� @� �b ��0@ÀdP�A9�@�r@ �2Pb@�ҁx��a� f�(�d0 ʁ0@���"�0`W� ԁ+X/�@@ ^@`W�� � �w� �Ap� $�!���+����@���y��{ � �E��p�@/|�A ��؀!�� �@�<� � ����8@ A��8�  ��}A���<@  �y�<�\�:x��l@��@?p��W Ā+�bP\p/�:�� Eb�tp����P1y��1@q��`@ ^�E��@ \������@6�W� ��+(y��"P\0�� @� \0x� ��� B� �(�^ �a!�\�\AC��8���A"L@����! �� � x��X`@.�+�!#@�F��# W� ��y�x��H�$���A���"P�� G��#��>B  �#x�@>�H���$d�<H؀"|W�>BI+�� N(���@@�@@(a b� � �(b0�JH ��4�<��3��@%� �V�xE ��P�@0h ���P�Bp �`%����6�I80��@6 ��#P�� @ �1`$P���DE�"!��@ ��#Ą �d�p ��Lp �@� @ ��#��>B  �#x�@>�H� y@ ��@2@� �$��E�ޠ&��� 6�M� � `xA0�h�m�r�N�;a��� �J��'���(�G @!���<�H�A$d�<�|�O�!(��@��+�� �@���� >�'��DP�#�"|� (�G `(����|�O��聢`\�+pFa�� �ARP �`)�p�:S$�)� ��+C�����p O��<b�+���%` � \AT0�@*��h4�'A�L@V�XU�*�� � ��+@}+d���+� 4�+x�9P��  ,���� ր+x�,�� �Y@ h-����ZX l�,�}0؂>8 `-� � dB[@ hA��`΂8�n�(P����BP( .t�� �p)A.ă��� ���W�A�t�� /py ���`�]p�@ �p�^h� /腽��x��@�� ~�/����`��!��0��_ �'���"�@(�B�A!(��0ĠH���A1,�Pp �2��$9� ��2��p�$h����2�f� ��/t����_���Q�@� 6@4��0J�0 �a4��`D. �5���@Ch �4p�@�h 5�pr�P ����M� @jh+@�\���&������V�` �!��!@@�kx �! l_� F�[� +�0���@x�`���0� p ���P�2X����`F� ����&�VC.+` ��PpC �`��� ��d� vCJ� �/�O@N ��7(�0~�(�/�!P�(��#�02�\3@8�"� ��/(�A8x�9`6�HC@8���p6�p(3�8������9� �� �À�@ �r�ˁ0�����a� �� :̅ 0�� �:����6@t��:��0�� ��a�� �(C� P�(P��(C��q0���C�X�� ���@8̅ 0���s!����p�`d�!P2�p��;d�!� |t��a���F@;� 0ft 2a;p�`�q�`ā`p��w�`����Cq `���P�_�!�!���|�:0�0���<��!��_C���!`�������0���al�0���a���`r�y` �&0�_��< �P����!=d��p�@DxC`����� XC`�����qXC`����.�A�|�<��@zXC�/�����z|�8 �&���`Ma4����XC�/l�����zC ����y� �a��!@�@XC`���0�@{� |>��0�_8�à���qM > �&��CG� �a= ����� `>��P�}������_8��;��0�� �����p�� ��a� P��b��@����?���D |a0��p��3�?���D I�/ԃ��v��@̀���q��?(�> �B�|!( ���� ���a2���/qt�|!��P @ �<��p2� �3� �t� �A$��_X|A �;��zX 4�<�;p�B�C�/���i 3�40�@�_ �!��p`6��|a��8`�C� C�/�;pf@�� b4��� �i b,8���% `@ ���E�8���A�8@B� �@y�bBH �2�� "�@P!��X �@H�p,Ą� BL� a!�Cu -�!���@������� q�B�v`�����(�C��p!fi��a\� aHÅ�l�!<i�`��p!2@y���8�!��v`�=`�� ���;����`؁0�q |!`;p��6�b|�!��6� "D��AH�"�C��!"> E��}�����BL1Pf��bDX�@p��(F�D�;�H@�|�(��p0�@� %���`"NDpP(�/܄!p��w�7a��0�@� �!�� pR��*�/ ��"�q� C�8܄!�6�� |���!0Tq� C=�� �V�C�E��0 XD�� 2�E�q���A�/䂠���� �a��\���03�<��!�6_�!H�02�w�|!��!��� � 0"�� ��� � �a��#�CP� � (���`D� |a�0f_|a��0�_�|a�� `�@p�C�/ �P����/ ��$_|a8��` b�������!0��� C�/��0�CP� � (���`D� |!��!�2�y�/ �P����/ ��$_|a��@#��8|a��0�CP� � (���`D� |!��!�2�y�/ �P����/ ��$_|aԈ!�%� v`�����/�;�H_ 3 (��p`_ |�4���A�6�FX��� �8�h��#� � q�0�@�i�:�/؁!`�y�a��P�����/ � ��`|�4��0H� �; �0HC0�/�av�8|a؁!@�i�|a�1H� |a؁�#�CP� ������<�<��!p |_��'�ğ� P�AA( �� ����5Qʃ�X����6�&���r"� :Q'�ĝ�yBO� <�'�D��P$�@!(�(��<��C�(��X��Q8�G E����RT Kq)0E��v"Sh�M�'8E���T� Q!,_�M� 3qJ��8�b� �*6��X��U� Wq*L ��V� X�*`��@Vd�0J��83�T��SAJ��8�<� ZQ+lE�0��<��[�+r� �AW���+xE��F�W�`16���Xm� 0 x m���b�l�[0�B�cA,~@0 Y(�>@,&�6�ڀ40���˂Y��@,�B�P �B)8�g�&� �ZL�;� F�_ �"��-���Ģ��@,��8`�bA,b��� �"��i1^����,�����ӢZX�k�-�����b[\ l�-�� ��[d���-��8��Z`�l�-�E���B\� r��2 A��s�.Z���[� ��-��t��B\L d�.L�_�/[d��-����B]� v�.օ�x�"^��iQ �ż� �^� {�.��}� _` _�/n�tx �b_��~�/��oX�[d��p$^���`` ސ�_HC^�_�x~����`|�x/�$��!� �@0 ��`��!p �I�C�`��!� �H�$���L�/8�̀�1�I00�`$��1� �z�$��4@��H �$ ��0L�/X�a4 ��0�{` �a���0�����AN�Ę c+��(F�(��b\ �A1J@��cbp�]A:Fb��c���1 D�P��1F�(��d��d�,��+`W���AT��`�ML��� tT �� ��^�cW�z3F��2�al]�!8D�`3�f� ��lF�p u�I��`-��k��a���3^�̀ �5܌��3v�m���3����0F�P<�gd �a1r���@�a0��!4� �'�0��h �a��a4��?hGi���A4�F��J�`��&�0^l`�a0��q"���h#�8� �4����il��Ax�ӀQc0l��!5�Ɔ�U�iH��a5��θM�i@ �q"�Ӏ�id ��46�����k���5� �K�a� 0��T@ld�����?�_�l0 �Q6̆ΘO�� �6�T�>�lp�!t� b�]��Fp�@� �� i��"p�� ��m@@ z� ����]q�1�� m�Qx��E���8`�A. ����6A�k#�@@ r �l@@ <hIl@x1hn:�61���\PT �/ ���+�/� �`m�;7����� b� �1H� � b�+>��tb061�C�n��0�/�v`8`��v�� �a7f1����"`1������ ��nh�<� ��B� b��@�v�n� b�@� p�̀�A �@� F@oX� �6� �i� ��A ����L 0n�� b`l�7�� �7�o`�l�-F����b��7�����o` �!&����\ �1-��b¡-����Z ��a8���g�p\��8GA�������8h58Ġqd�8����H��8�1 Ā��9����]��q&X��cˡ���� 0r��AH� _�9���#�9����9� ��4�� �C�� �s��0.�s��n�!�������1:���E�\��(� B0�����``a� ��8 ���>�t��!@A� ��1�a�!\�ӁPGC�E` ����A(���V `C�Ё|� ��u�8� @p����|�yh�`����BRhq���/�@��#v�8����h $�G�� ��A;j����v|���f�y(qw `;n��E (<��1Gh  h��&��3`L��1��`܎ p;&@C���vL�p;&����vL��p;&@0�_�vL�_0;&�h��v|����@08 a|� 0&��3 L��1���c܎ �&��`܎ p;&q����s�;�������  �@/���h� � n��`6L��p;&�l��#����;l@C��!؀/`f� ���ẁ$`n� ��c�p;l@C�_�v؀p;l�����v؀�<~�H��w��;�� q���`4� ���|0l@C�6`6��` �� ���0<�/(_��`82@h� � Jp2� �6�؀ `6� �6�,��^ �q`L@0@y q� ���`l�:h�!؀ Pl@y q� ���`<��ǃ@hp<@@�Cy,� fC������8�#z@�!=�4���xVp�o(��z���p<�GJ! �5@%�� �YEp<�4(q����F`C�x��Q�+��b{p�!�=Z�8��{|�����#^`�r�p���8��a&�D�0�#��A��{0��I�3�>��`� ���PX��0t�}X��>��qh�~��>D2 �n؁����8 b~x��p��lȠ�űX!@d�@�P2@X!+�=�B��� � L�%BApڠ '@9 ���ǂ��9P�� E mp,6�\ ���c� ����B P�8@��`D�\8G���a:b@H��( �D�B �`h�c�Dv�R(1`� 0b@ JdL� @�CP�`LP�(X"Y�,&r���h"Eb�'V� p"���<(R��1 �Ā("E�C$�S��T�`EJ�"1 �Ā(R�H W$�T,R�Y"L� h�*��O�� �l�(2#$���cFH� PPC p3B��t �H��"- �Ā� (��?��,�_��Ƙ4�L�_��#`�F� bd��@F�H�0#�! �4f�A#i�#�Fkk���7�F�q�̀5�F�ș�#��]�8B�H>�t�a�;�0���#y��$ F��|D��[�L�Q�� ?"��$�D���1HdC�#��������� 󣐌��� �!�#c�$D�H�C Y$����C�H��p$c�<H� �A$�D�(�I�&(�� ����K"F�HH����|� �Aa_`0� ��A��� A2H�d6�@ |���$�d����_���I (""�(���8C?�|@�+i �d�� ]�l �v~p�N�+B=�bx�OJ&�P ��6|P�BIE%hbL�0 &��� ��RJL�8@-�:Pf(�����n�#�*q�� @�% �|PR|��D��� JjX%5���J> (Y%>D�� @�� 5����J|HH�� @6K�DW�V�+� HE@W���f@2H�8 ��A���b���Jɠ���f@���"mh�d�64qx%�Bu����t,�%iC�w�P��C@��ΐ64�M�%v�`� PK��8��4��1��4�`�ܰ/�� mh`KT�b��m����p g�"y �X�<�KCC C�/ �tt�/��B��� @&�h �L��%���c��J�>CP�Dz� 0&��-���Q� &�/���L��K&�(����_2 ~���d4@0��"pV�H "�� D1 ĀL�_� ~�/Q�d���1L��H��a�L�_�K$�y �d�� @ ~1�%� ���Dz X��PL�0&� ��c�K<0�$� � �L� 3Q��-4g�L 4Y&�DDi�����$��jbM�.��6�ؐ&~G���\�g�M�I6i&�64m��5y?�}p�m`C�� ׄ�\l��5�&��t�m�M2��&F��oB<8i���0 �I��?��q�D��8�&�������5� ����41N�� ����`�&��5� �D�#���&06plrC�l�&F�5���M���@؂���rbN� �@'J (�����i�C|�bD`�71"�D�bD`�71"���4�t�N��7����``7�&F� �u�N� � ��� 61"M ���u�M`l�&؄���M��i�D���o`7�&�n�M�HH'�d�|� 6!06pl�4V���A���h'�$�dkbމ� >�`�b�� lx �$�wRL�I1q'Ť��bRL� lH����M��7����`�bD`�71"��n�M����$�̓����5�ل,����ƉH�ę<�B@O�C�� H��I91'���gbO���a�ȓpO���'�U��bD`C>�&F䛤�� N`l�&����pC�l�'�Ĉ|���� � ����V�n�� �ěא��8����`}�O� AA|��0��q�'�����q"V�?(R���f�I�A;(Հ� eAP\4)(����rP�I1� 6� )$4)&���'�>`C�@(N$�d�D$�B��a�0��P�1! ��@�NBL�Ci'��́�Q�I��7D� ��M��k� (c�P��bQ.J1!"�d�`7�&�U��"Q� �&F��4���2& E�(�� 20JF�(06plNZ��!!�obD�IW@��T�rQ� q%�h� 6'�����n�C� (c�P��bQ.J1!"�d��Q`h&��8h�=���8�{1?t�/�(�! ��2<�@�(9��,�Hq'�4�fb`lP #���$�5���'�0P���)$����t�:���0)��8��"7`J�������l ��'áR��� U`�|�4�E@I�%.�n�'�'����8�^�R�C'�����n�71"��+���BQ*�E�(ń8� ��Q4 � ��8�i@L�I3!��8@$�@��!M����/X�p)J㥌 ��QRe�)0����r��� 7��Ћ0MXl �����L� 4q(4�����Lj�3)�d���� |�5�)?��<�BPLn�@�����P@�Y(c��Rr~�3�&(�����F�3�)��<��NpJ1��$<܃��N��N(��rH��QnJMy&Lc�40?~@xx&C�J��r.zJ1�)ad���|P *B�Ї�`O�������8�g��P� c����� De3P��|J? è���T�J�`�B ����IGXJ%]����J���`u,��qT� Si* é��1� �P �aL���� T�1�c���� ` �T h� 4�T ��/� 0U 8i���� .ą� �B�`f�3�4��`U!fB $��2|�_(fK` ��>�B� ªT��b |��B�m`��U8��1�h�x`Ba���k@B� ��� :a )b�ΰ�����K��B����*g��3�%�W��t�� &�6(� @���@?�C �`��@(y`(�<�A�� <E��R�y`Ё���)q#���FD�#��E�y�|�<� �)`%� :��@X1"� �EV��"+F��� �ŠRPa�p��X����#|��ZZK�8.� p���>��^�}x� ��h��d�p\�Z��}���[j�8��}|���2@!���d�B�b Gh�����?`K����6��"`�la����j@��� <+qZX�C�FdP �.�G�����#r������<j� �� `�0�6`�հ�� ��`d���x�}��22� xP��V1��`�r[�2��6� p[�2 �c ܖ�x���+@ h@�&@�^`Z܀iA^�?��"���n@. "[L p��2��[\�l�-�����B��d�[Nx؂�4/@�� 0-�� Ёi��o�^�L�Q�-z ��-�� ��2���+��l�-tK���%[T�{RFP���"[h�l��p��·d�?��؂�d��������� ]\��q@��@��P�Ɗ �� �HhCW��e�L���������F�hCWؒ�!� qA_�`�+�AJ�ť5�?�Eq9.��\~�X �%���\�Kr����?�˿h �t,��@X��&���\��_���^4�sQh�5���?/��b��\l��.�E�|`��t�6�$��q|A ���P�0K��%���P� l�x� ���;�V�.@�l���� �h�؀��?lrI.�#<�a^�� �%��� �?���օN�X����\�B�+�Ӆ ��VbBv� E�^����t ҆��Ö� ��]� ��@��aH�s�v�wu�����?H ���%���P� �� x�$��qV���$��9p �@`�h�KP,�[�h#p��Gw1�Ļ��&P� C9M�t�~��r����D p� ^�H�?`����� ����� @j�%�4b ^�Kxi�������T��l��5@xiܥ���!�( 7!Vļ�:�^�D�H/C������Hwq +@�� `O� w)5 �(����{��eC����^�?���X �n���/ւ��2 � ���E�܀�_�� ��[�Q�-n�����k1n}��p�lQ_�� ��C�܀p拵��"[t��r� ��0h�`x��$�c���}�/� Ё@T�R�6��$��űp�(0d±8.�܁ �_Z �4� �!�_��~� �tb�F��8�E��_�B(8�����5���� �p ��0�Yald������`����F�E��"_�B��^�k���.f�.Hf�3( ��t��7��p���8 C0� ��0F���c0 `��0A�8�`�����`�� �1\C.x ?A0���0�F�If����̀1& �c6L0� �@�X�����@��-�#���?@ ��d, ��; ���) (��1JŁ���"��Q�`�8�c��s`l �6��ܠ`��L6`��@Z�'q'6�P�?2@�(ƝԀOBZ]h �����$�T��R*Z� $��3�G���ĝ�H(B�����`�G��4�L�Pj� �K��Ԁ�~��q0��8�0�]hC��0t@ �<���`� ��b~��42?JŁy0���<�Rq`L�80�|��F>���&$��Rq`L (��ԀRq`L �W���1"L�80�t�Rq`L �0�nL��@�Ƅi `5�1a@�H c�P� ca. �a�p �{`�+ CG2 � F�l�A0 �� ��0� C>�O1 �L�Bb:�k� 6C�0 3b� � 1%�(�> 2���U�Q�aL ��'Ŝ�R �P1+�j��~� �#E �cb�ȋq1�`�L�cbL�q12f�3ch����3��0��Y�f�xԘ� 8�4!E�Ƙ@1n ��1:f*��c��1>�,���1�r9�c=���cnLY2�����Q`b� �� )FŬ@ dz Z�!=&-,�3d�i &Fȼ�i"d� Y,=f&!d� ߀!3@�,���L�1 �a��6�3���wPf@��d��"�'�I�Q~$��0f������#C'A2�#��O�̾� à!0 ��P2��B��p�I��C@�X�0f�1"Jƈ%C ��0Y2� �p8@>a2E�<-p ��b`2E�h���b`2�! �>� ��h2�0�m�1�h$�d6��`!`10�'c9��(E�#0�|�d�  !R&~����d� ��2��� V��b`2�"�T���V��8N�_�|A0 � �'x x#�!� �܃8�2��h�� |�8+����_`��2X�>�,�U��%h �� 8@� �J�2\F�t�d0�̖i"Eb�'V�I�l��e���]F)$�-�eH�^��0fŒ�3oc̼23f�I8!3c&��23f�I8!3^�̘�1�� % 3^��p��pU^Øy ���3f���_&!XJ@��x ���/�F��҈h�`�'���kP_�|����̗Y3`�˨�&��̗Q3*�ˬ0f�D l&[�����@�w��7g��E�3rf��AgF@��3w���ΐgNDZ��c2P=c�u�{���>�-��0%�#��?��?�3�@́ �IxI��$��� h������А��Qh��i?�*DC��� a�l��� ����4Gsp�x4#6 d~@�q4�&%蘑i`���%�P���GfC�*���8�IC �L��"�I��As2��[P$��P�?(M� ��T�3h��i�&,��j�*1;�/(*1v���Y��1`�Ӹ4��L�iH����lN�@��h�!�i��j�4��>X�Pc�@��@��QCj"�F(5��Ԡ�jP5�dդV�jF@I5���`�WR�H5�&��R#S^M��5�&����`:�K��1��ܚTCjp �5�C��WC� ��5���_�N���5�&ؤ�!l:�`� Æ�H�bs"$06��d�$�ȹ5�&�8 xP��Yˆ��f�r�Q�&�<4�M���ՠ�TC F@��6��pLj#mbJ��acT��rj� �1��R�j��:���Ԥ��@��$�|�k�:2�)"�&�ē"�j�ł�$�&א�s�C��?�5E��a�Nĩ�6�\�n�rM�8�4z�>���6��(a�CZ�� 9�!|�@��� �� �sK�/ ��@��/��� ��X�y`����8���LGWy�@�� �*�<�2 �J@PG2N@ �Ƞ�%�q��A�y��p�;�4��5��� �^Ay�!�@���1@! X�7t�<�VN#�J�%ā�@�i`%����~ ��`(���06�� Y!(��06�JV����@�E �"��A�y�h�x40�හh@�@��� @h`�� %� ���,�@Xq9킌�2b�4 #��؆�� ���h@F� 4 #B��<@ �x9V��Q��@�9y Ĝ�V�BX�a��(���@��r@!��� x�X��'|@�@iy%y`���Ss 0�#dW>�+p��<`s�G6+r�0T��hC �p������9y�-��F�s�<�y@u��sB�@p9�`�8�<0� 4 #��؀4R`�i<�����t�Ϲ6���*@=&@P .'�l��jIXq9 �d���F:.�~�@�V��a:��rK�`!U��V� OA�<�ZB@5j�  �NM@:a����A�Q+�� �^�V��Щ ��t��t4}��! ,��tZ�� :E�L�T�V���!���+RV��y:�D0 ��±�PG�D��!u�N���>�0uթ:A!���su@��:A��3�D� �!0��(_�I�F:� �$@� ��B��A28Z:���RJF�`0|^ �D�A�h���MX�@� ����t섪��&0E�tr� ��& �Aa ��m@P�^'(��� �A/����8� �a��0��� ��V�4�B�� 0 ���� �c܀�83�:�`� �8�;aǖ��a��{`b�50���0t���d��ؔ��@�p C���0������ΉP `�0�N�.���<�.l�B�t�����H;3����� �k�� ������0 \�".@ P��kQ-�t���ԅڡE����W)y��h`��N��E�<���yy�>���dK�9:x #�� Y�;sg*�_AVCp3������O��ԑ!0 �NXq:.�1���$H�L�ppGZ!u�������9螺;&)!A�x��DnlX_�\s�lX�B�d�k&K�ׄ1p� �c$����` L\spG,i1`:��;�`�m��#�\s�N��h`��!����$͡PpL�(w`��@8C߹����f���w���p���y@-� Jԁ�!Aat܁#�,���@� ��Y @���3u���S��w�p��Y$\@@x΁AHC� ԃ��A�A'�/(d�`�lP�J�:��:`�l� b�ԩ#;�^l@�v X�����Q)�g@@TOဍ���PxF��A<�����EP *E��6�xOWX<�����ÃxO�q<�����x����䎩 �X��dɣx}X���` �!_b5L�Q� �<���P ��2@I)���x��sy0��<7��\̃y2� �ā0f�kh,���`̓yn��<��d�@4���)%�h�����<��`��s.���<�'�܀�R(� p̀ΓR�@���t��\� x0���<�@ ��ΐ;� ���l�rF�.��Ę��{�` 1&M� />�����2 ��V����!��C�H ��G ����@�p�G�� ~�������S|���)>�g���s|*Bm>�'���|��-��ԇ0]0��@�܀P@�� ˇ����|��lt���0��Q>h�\܀iЀ� � �40]n��� @�s�����(��SbC(� ˇ�Ѕ��|� ]h>�g6��| �(P>�d�r���h@��4pT @���P@���� h����FG �A�܀wP@j�@�s����wP@j�Bc�D���L��,���T�#d����>Bft�ҁ}���2BF����s$<��� ���}����!�Bl�c<�u�b�r,��u�I��>K�:8��Cf@��>�CȐ����?�G��9`}.GP��� j�UJ��)�����C���C�Y� l�lj�!�D��qX ��9,���|`\T� *@:��?�؈�"��� X� ��'� V�@��@?`#��U�~���1.d ���%�#��`ff``�!S��/�>́�< ��nx�A ď�� ����*��0XT� ��I�@/��� �����~ ��C���$� �/LB:��� ʌ�I �������O�Y?��,��f�b �Դ��� �Oj�-��JT��6T�`��П�S�FV�� 0�s�St�EpM`؟����?@1��p@����l�|�|�G�?%�,�K��H�G � 6�(X "[��D�@7`���z�(�?����n�Y���b�� �?��������1H���Q��AZ����ذ�A2P!��D PlP+ [��@ ��g�5Cl�0�6c 3��P2@v�< ��A2(�#�$�A2(��|��`��G ΀>���I��pz ���y#������P% + .9 �p�]^ 0� ���H@X ���`~�P���?p �͸����b3�b@� �4��s�A:p@cD����{n� c�98��qlF�P@��=�%@ �?� 7�D��c3nh� T!�6��@ H) DF� *���H 4 P���6�Y Qp�ƫ@�Bj��p������� �;�� �)�܀Or>I� H  4�@7��d 2P��@47��d��I2� �$�F��"hf���1@����B~�yh����i~�a=��l@c0 ;Ԁd�� E��@&!5��BZ�".�d���d�  AP�,� f\Hp!"�� �_�Y�%�����L��`=%hܘ�bQ� 8A�M��?�DU`(����@�� ZA,�� �`� �)R�5쀪@�IX �\��6p'� M�t�<�$<� �A1��l�BLX� �Azą(�Tl���@�� `�l�`��I`CLQQb�< �f�[ à!0n�m 7H��-pЌ�Ak@m�SA8CK!-e~,�q�2 l@!���q� �HK�A`~,�q`$=����j��0.dd~���n��B##+�:p���A���!r�H�� e�h��Q�Z<��-�h�$�Z�p���$n��x.E����p���G Q�a9��Y�� {@6FF������0>4�!d乌������s��G}t��m�z.�GV�2nIPB��ְ~� J4:�0����$A �@��90�"[,!l�-���"[���~@��b ݀�~@�ق ݀z�-��(�?�8�'����$S� 5!l�-n� h ?� Q!dф�I�Ue�+�� ��)��:������a< �!� �`!/ j� a�E0��V�:Ø0�a� C\C�Qg�c��'�12H� C0�/0(L�`�P��@�`f�a0�,4a�.Dj�:0a��.�� 2a��@[Hj�[���XEb��.$5�à0P�}4 �3a@�`YhCp�U�>& ��LЅ�����@TC�'�A}܁mp�6�����%q&��P p�T�>� ��6�����;� ��u� q�mp�6��=��S��6��� _��� �' 1 1�pG: ` ��4��l����!2T�F�� j� �!2D���6�����3��l C�� ͆24 �lP f� �!2D����׀�:0��l C�� ͆24 �l�B�A-�!2D���� m�;p� ��q8B��y �!���w� =���;�x ��䁟�l�;���mpp�l�;�� �2�D�0h ��1�8�P�� ��ـ�f� dh6��@�.H������� b�6�?D�!5�����CY���/rG`줞���B���飻�6DLڐGa` } R�ir�0nhI�!�qF��Cqh �9�]ZEw�Cqh ����*RBW'š5���kH ]A����p!1h�!:�*~� !8ph uא��8YCp(��:�]��Ck�ء�B2��RN�!=��C��������ǀCqh ����� ������� �Cqh ���"�RBW'���54�>Ƒ@�' ��@� ��!�1� ;�B-܃9�0!��J��qa +0DC��>0t�Ga ��� �����"�J� V�g��(��Jܓ��#�ɂ4[2 ��XC�#����I>(C��|�k��3�Dπ�<�4�x NH D���DH��7� ` $rC�� ��"��8i���2t �)Cf(=^�&"�I5 %�4�҄�-�� �7[f�Z�lL"H�$ ђ(CfhI@"3��D0Ci���&�J�hI���&����D - 3��$Zf(� !P�`�J�� � 7�*lqC�E� �� *�%�DK-�Ht�x &�D�� a�%�2��DK� %�4���JKB%H�$�PH�hI���&*lqC�� ��J[�l�3�@T{�Ȝ�D��̀ @ԉ<�'��G��&�M�H�'� p�j0. ��) #�{��(j^'�+"$���&�hmLD6$@Cd�i"J$EJ��&��м��`’0C��<�����8�&���H�щ�7AE�h ��a�$��DK-�Ht�x &�D�� a�%�2��D��<�g� ђ0C M$�4��D0CibIP���DH���!H��P%�-n���P���;��@��>�����+�`�p�N���c܃^� zI�@>�"83� JѾ� ��<���SfN��J��qa +0DC��>0t�Ga ��� �����"� A!x���XQ�D��"�b���)b� V�gQ�H��m�dከ���� )2�1Q�d8��~���Ĉ( $^�5�)�h(�sM~ ,�'q���+��K���h(�; �� (hqg��)� ���+0�,8�?@l�*RE�H�U��T�*����M���z 1��@=ؒ�B�L-�E � �� �ڠ���p�x�`d��p���� L��B��6P=��%�";��r�-�#`A��+��Cl0&��8���^����0�1�Gl�`d��p��Rx�A)l�!�~@A!UdT�*RE&���"UD),�����l�E���� P������T�%QE�Ȓ�"Ud,�*RE�’�E`Atn�S6@�0 9D�"�� F���`T�*2&�XU��(���D�"`L�%QE��RP JaI� 0tQ#�5\�^�,�` ���Q Nĉ�� �dpq�eH��!��m��F�B�:8!n!1/#�n�@�v�4܃�eMA�E�X�T2���(F��̠ �Qڀ1�(c'�'q���1-�͑��^l Y�:d��"%�M gd��G�8 Å�۠b��8G��Ǥ#V�����C@����"%?l!���8��a8��ь��`G!?��0nȍ��k�c��v�jF;R���r�љ��(� �M ��& c 8��A�L��1�h�$d�I�L�9 �hh4#zD>�Ӂ��0�B�٢odE�-�j�eԣ����(��[d��a�nG �h �"��:�=��d�lqn� ��!l�/����!̑3�0^�� �!L�0C&�(���p�Ƀ2�Lc)2)A���`B��P!����Q&�nx�eL� ���` �e�qD�� @(�2�6G1Ed ����)3@�#�P��>�G&D)Ĕ��B � A(��p,�?R J!�^�R�1`Āp ` ���L�gP��%��e ���:|l����XP/���!��� f@? ����&@� �Bu���?R?��$:�P�$����@� p������q��ٔ&@ ���� ����t��ˆ�� bʱ (�X(�c1�� (H;Ĺ�c� �0"��X(��J�ű8�bY��Vɱ8�bY���p, ��YNg$��DVI � ��4��`��t��8H���t�~�TAH� �Π>�D��p�F�A�� ��d@B���!`��Q�8,$!�G�@�0$ҐRC"��,:`h� `�!�@<�pHC ̏�4��Ɉ�dA���a�@���R@�C�-ň؀�dDl@D�@�Y�V�CR+ "��@ǰcL��atD"�dL���� 3�cL�6 @��.�cL �l�(@3�c��T�!��D� ��&����:��76���8�����oB��� ؀%�p>��cI�!p������d�B�U�Er �Al��� ��k`����t�E6�X$E�',R!��"��!�ā88`.�R�ĉ���V�(�H�#�8���l(&7`��`�H1�u$�p��IGxH`��`2�F�H������MH �t$[�O�FY0 /�#�p�F�A�E� }����P�  �$�nT�I�L@:�@$x0&�`I`t� 0|��I`t^0&@� t� ���@� � ��6 I��$�bQ��I�@( �t��� ǂ�����FA�8I�b�c-R�lH(I @E@,R�I"�"Z@E~� ���S��EPI@%�����XRK���l�t�AKrI�����F�6Z�tx�����,�/,�%e�m`��3n�(�!@2��?����Y fր[ b�-lp"hQ(��X p2@AP 2�� � Р���b�,���� @b�L� d0�) �G|�B�}@V�kX ����i��� +�5��ϙ�L �afR\!)+��p�`�MZ+�5\�� X��I��" �*E�$���H��7�����Dj/�8�0 ��spJ�&)��#��!�� �~����'� � E��s��@��$��dC���@�xA C�'@� �Je`;+`#�O� 8�"@�Z � ��<�&4 ��@@A�!���rl�I�!����pl����BV�"+�� �'@�0p��8�e$dYq�4�`"���R�� �`�� Y��/� ���������<���@�� <E��N�8A�<�p���Q#�� q 3 ��0�CR �@�����Xf@A�⤱|� AB���A)��6 !3���ݰ!H�%`)�P1�� H�w@V�/H�/t�z����hI!)dE@.@j�'L� E�-�+1"����<��R�P�`.����2'�"��@X� h�!�0�I�'�"5�la�8i �̑\p�FjH 6��q��yO 6@�_���� tD��Q��W��+`|�B�W�Z��+`0�?����+`�@�6�*+P DPH���_�g�JF��l��]� ��� �a0��cl��ad`�����RV�JY)+)�B�B���Y��CK܅q8k �ΐA8@�c� ����/��� ��BP �Xd�p,��t��@)T�cq,��i`��Al�� �Xd�@@>� B�D��  �< ����RW�]� �1� \q�]i~�1�F�I ��p���IB �� /f̼psB�(`\�0� @.3�U�lf� �J�Hp��DN�?`�6��Y �E!B$+����V`�T�-a �X^)]�%�4��(K��,�PwX�9K6� *��Z�"����� �l ��0�N7���u�0���7@-��z1ڀ� �������B�$0pCn��H*_g-0`��� � _dad���x �[���a��QJ�� �Q��T[JV�|�ĖlHm���4!,n�[�1����� :7���#ra�xH�6l�[`C� ��Y����t �b�0-���K�"[t l�[�F\R� `�l!��E��s�܀i1 �� ��B.��4�E��g.� kØ0@]Х S�TCV�Kw�.᥻dD�R�`�، 1a�͘0� y����lF��!��1a�^�0uI54�"�n� � +���t���]�l �V�^�u�l ��`C]�.���1��k� �.� ��&L]�ti��%Ր��k �5����&L]R M�Hl�``� ��.�%#b���!�5�����E]��/��P��Ą�K`�l ��`Ä�Km�.�� S��]�0uI5��1\C�Q�"+�����K �a� �t��^�KF�.5 �1a����4���Ž���� S�TC)��ذn��KwɈ�%A0a��p �a�zQ�n���K�6�%01a����/��0a�R۠K�a�ԥlA�&L]R )�8��1\C�Qzi��%��D���66��@p��]2"vIL�1\lX{�^ԥ�1��k� u LL��&n���K�6L���6�j�0u)[Х S�T�k �5���.���)�L���0��P=`�ԥn�2�?�0u�ap��08���0 �/=� S����/0&� .`� ���_L�I0y��d�@`�" &�b@n auL `A �-b4� �E&L�C�L�K�A�< L_/L�"�Oab B���v2h��H+_/���`�*� Y<�z�a�`�<� �0&�� ��/�&@�E@!� �A0�-�`�Y�?�@��R�d?s����)`�;���V�6�^h���>��C ����@PO�n�)3�Db�2� }�� P$@��"l���D o`ЁzS8+�d�D܀-��I�ˡS�� u���"��� � �@1�tV�̀1��Fx�/hL'�|_p��Rx��^L���@�c:@4 �82��L�HD&��1`�Y�`2Q� `V�@e��2E�;� ��`$��t΂��$;a�� �$:@�dcIt̔�@f�L��h�w@T�6�L/! Ё<Йg*:B��B(�vXp�px�3�@�)*e �� �C� ��mp�C��–8�Q�tf���;�a6����Q�ڀl� � 2@@x��@�g�@�`��A��D���@@�bvLm�;���@�_� h:J9� ��FPM� (��_� V@h�L�D9BH.���&�\� �3�C4�&Z5��@.��a�&p�D˜!M�B�@��F3*M7@X�p.� 0M��4}a!n�j��I���4lC�i��%rV�h Q�Ŵ�[�X� BQ!��N@ NPJ ���� a��p�@X(��V�h Q��a�Vt)8A0@��Z�܊x���� RkG�i Q� �>` 8A��qԚ��4B�k�OB�����u@� 6�&U4���M��6�!�$n��[�6f �wq�|�/(� ���c|�_x��,�����j�_����$ݴ���n��ֈ!q�G��h *���/�@o���4���v�YH7`���b�=C� Ę%Qk���-AŘPk��PG1�t� |� ���I��J �^�p� b6T��q�S��/�֠��j�_@ �@a�Z���T�/ 7՚Z�vj �8I��$�Zc\�0N9� '~Qk^���9�ޤ ^@�Z�����"T�`y�$��TkZ��1���_�|��a�)��ʲ��@n�&����%�E0��0'а:r� %!����CT�$h �Ԛ�8� ��Tk��:�?�D���0`� ���`�i�bZ�G� 1�-��0M>�[p�\|��@�4,d#�����F��6��E��r@t:M��XL�P���'h�ּ��C(�!� (����[@o�-(���P�[�J�-���� >A(�NJ���� Bu�)J�-����Suj����q�u�N�);���I� �:�����uj�����^�5�-|�O b� pD����Tk��/(�#4G[ �5�`�܀�Bn�v����Rk^�#��ԋZ3j�'X��L���b pD�h G��@�y� �ԚO0z�4�����8>�#�N��ּ�_P�@��5/ =DU��@�h C� ���r�� �����@ ��'@�f�4Pk&H�� �&L�O���[h�{��IS��@��N���q�^�X�-|�O &���U� �A����?� Ԛ�cԑ�#��0� &@�+����N0@�+� ��N���)�N<�PL�qh�8�'�l�S? �$G�0�� �� �B �m��<�'�4&��8OI@ �� p��@/b`�` f��.=���� �@Cp�ǧ�,�0P >(?�M � nHA� =��a�N>� ��{�|�=a%)<��JRx8!( �L������ � �� ��<� AXy�@=��w�@�x��>��4莯� s܃��.��)n�=��t?~ H:Ρ����O�B6����Q@ �1  >��Q�� ��(K��1�OĀ�'="�V�R! ��ħt`z�� ��i!�Q��� `>�Up*H�F����`�8HE�nl��� V��/+`��"@�~�i"?m�PMb�lhE� �m�%V�~�E �T��s�E���b�1X@ � ��Jp 7@ �0���⠌��I�F� 0��5$�ITF��0AÄ?!�0L2�0)#����� f�0�O��?M�0�S�0� ��0 FA�L��|� AB��(!+`7���,J� �t��K�F� �#�'`�-������B�Y�?@�Ќ\� �>7�=(0`�A����?�� P�@���q8 ԉ�M����9��F�r��� � ԁBPf2����\XP *(ԦEo4�X0�����4@�J@x�/Ё� � ?�A)�F�"�xP�B��!�T�yxPC'��90����P�0�`� ��*%A�'H�R2t��� ��@�Xpd0P�A�\�2t�BP8  2���2��i4���u,4Ԇjp�C�����B�C���@�� �7D� �@W�P@�7���>�F.�9[�(|(� !@� �!j���08FBP �7�(֐�B�Q �D�#��K7 !P�� |Y ԃ�� ��������XC���6��u`D���%��pu�Z�C !�C L U�4 80, ��0BX�h�Ap�4-R���Bp��2&�$!��i� x�6XQ�bl��>XT>�+�̄E V�hQJ�.�(�n@BaEM��`TP ��%�b���!L2���>�؀2?l��!6@FM�;@=��I��� �|+� >D�(��X����F9�<�4@P �!M��02�ݙ y�L���A>���@i�! ��q{@ �+��F��Ef� �Ga���@� 6Ju���+@��!*�4�Ԣ�~����(�@ �4����X CaG��`�� ��>@�2��/�z@��IB4��0.P��Z6 4��/Q*N�>����h8z�m�( �6h� ?��) �6�Fh��L�!E��ԏR���2�6ފ� ta7�� �$4$��})� ���*R?�m )"U�� HR�4�@�?�F# ���(��B�"D��J@C��J�m��%����.d�@΄R�QL 4����@]�Q�G5)�,^I�pR^4Ѕ�T�hy"��P P���J��F`:A �$�'���0 O*J5���hh+u`��@CېR4�^���ƏRȂ3Є)*H ��GɁ�R hhO��`䣜�9F�1P�*��7�AT�J��7� ��h�� � *U�� V� �����_x%�Ja��@����)p K�:`��tI� MH����G� [�p�9p �@XKc �E�� =F(:�0F�P�"(�A���@!�) ��r�d��#6��Zw�9T�`����Xw O٩�r��(K�N9����B�2 0v�`� �`6L�`����?�"`��`�����t�!`CY�C`T�J��Jl� ��R]��!I�D���^����I2��lg���6�/`;�{T*y�I�0�*Si*,� ��#��x�����@�P0h��T-�S�+@@(�TRd &��@(U�H�5�l�,y)섓��!@�H���@T��*�E��"����PU�H��$@�P�D� U5 0�PU�H W$TՀPU�H d�Ԁ�\����d �@j�*Y%�A�&@�*�Rd ��4�A~�*�O������A�0o�U�S��H  <���?��Jc�D��S�ʏCġ ��gsVj�*U1�����2�b-!U�dT�ZB�JU �F�5��`D\���5`Ԁ Pj@ X%5� ��0j�p� :�A��� E�HP�� ��d@P�J�����0�X Ca%̀9���M`(4�@)8U7聞��҆ �Ui�C vC>P�(Um���b k`%l�� Ē�� 8B��ـ��TXU� �l0 �����0�X 3��0A�9+a($��0NU�!��Ui�C �@�h:�<���� � ��f 8+a��f�� %p�����6��p?�� rH��� J�*���!Z����!w�S�� pUC � `��B �-@��`8N� �Z ٜ*@� � ��\��@ � = F6(���9�A2(���A �$��F6($�"@ H�q���%?@.^�4��T �( ��d@�H�t !#c0@@l�` ���x"���k0�fV�*���O�'�j���U_e �*��$�C� �@L�"� � `:@��� {a �]U�@�)�D(�����P@�!`�A�0{h��a�@�UE���Q.� ��a��`�^�@��s4�/�W� |�O�)g�_�vCb0� 8�` b0�2��^���Ҁ��8`4���^�� �@X�a%�����@X�^0�����S����@�0V�jd�* �x� V3�X+bE��H��7�����6�Ղ�C`؍^%x�ĪX]c5�� y�X�cE������ �`E������$�&R$6� p"�a<^ �տP 0�㸂�Ʊj�0�c�0Ɔp!`fp p��U�B�*Y)��a32Ćp!`fp p��U�B�*Y)+�q����Ky�f4���Ž��…���1��:VǪ y!d���UVhVu)�10-�U]� "d�zA6�k��YեlѬ� hVu�^l g���k �5���Ž�x #쨏gvԇ2haG}<���>���P�C l��v�dz ;�#Z k�  haG}<���>� ��`Z݀�v�dz ;�ZY�72�`���!+4��� T��ͪ.e�� �E� �5��Ҭ�R�hVuI4��T/6��z `c����>�EV09 ��j��յBF�h��>p����A��fU��E��K� ��H`�ȉ�[���4̆a�� �'d{8LL� �A!D�18��!f�0�l���"f�0�l����8$�h� �0Au�0�ah+��@�`�`[)�� ��[( -@������P�Jp�n5 �P�J�E��A�H ��[}���I�L`� ��>j���V�,��<�U`&f[)��F���j!ďm�ނ�(oa[�+�C�¶�m�}`����) L�}l+ �L���-|�m�چ��Vh�[�E�>K��b��1:��P۪��?�q)g-��m�Fƶ�h!-�E�>K`�d��&�>��P��$���w���E��}(��/�� �� t�A�qt[�+l1���*W��1��H��:W+�=�::����j8 p`���ÐOD t�F�BW�J]��9�0����x��0��%� g0����@� �T�(��.@�G08f� ���4�&R$6� 0"�5���HA��.� �*��,Ax� q u�E�:P�`Wb�]��W�:PG�`Wb�]ԁ:��j�*]� ԁ: a� �� �� ��"X��/ �u�.��:�3`L�0b�� .@���1c �P�uv%�U�x�u� v%ؕ@�#]������ū�u���2���lNh1�6�v�:�_,�L =�N�cd���cK���'�x�J�h1$�ȫ2��¼� �J^ͫ4�B�8@����p�Bȼ� �*��yE��� �*��@B]�W!���0�B�X6ta��1t� ]X6t�Ѕ@t=����t*8�� 6�^�p*8��9��da8�8Q�,�m5� �V-'�z��A`� ����j¶j)��pX���$����*�( ��El@�H"�jل�m�R� 0�Gc0 �����aC``��p!`ft6D�Z�!��! �F_�������a_�p-��{`�������� 0�A����*�ҿ�K�!(����a#`݀|�� �)>,��� ���X7`Z��0��x�`Cp�UBJ@�b #`�:ba6� X%�,��0���#&����e�f�X*� y�TB7���:Wy���O�T@�B+a,Ѕ�� X*� y!*6 8) `pR0��0�`��������`͌w �� ka� �a�zB�����8��c�l���P�zB� !�1X�iX�a�_�� �@t�s� ��!�8 (`%����: 98��� �spv�a=,�EBl�p|� �E���������s���� �Q� /@G�02�&�8E�98�"��@M�Ρ� P��C�X��� `��C�X��(� `��C�X؃/d�P�CrE b��"0F3� �a�H���1���8X�@ 21 ΁�!�0�1�E�� � �0�8�`�����  ������xC�9�t � 8h$q�� 0J�9��M �"�XKL��� �hbM,d�&4)@�`bQ,�&V�Rb�(% 0�&�Q2J � E0�(�R�b%E����8E % @x0HF �"&1 + d����2J��(q?��x6��9�@��@�Xy�\��� ŪX$�@�E�*V�"!Є�@BBH���dh�6�H��X��,�jO$ �e�Q��m<� *�8�d�<M(V�"!�Q� �� ŪX$�����4�X��0� &��P�L�N2������u�@'h` ��I��ӉI p,�3B�� H.�tā~��@J��'$� 0��H $ pH���;I�c9Rб~H�C��@ FA*�`%���!�B P @�7@��!$D)Ā � <�8ID)� �<ֱH"M�d�/P���U�b� (3` 2�� 1��"D�@( |��@b@?H �dR�j�hUb� �\@ ����I` ���L������� �;� ��)��PwV�OY�@�ְ�[ OAd�/0���� >B���CH�(`8 0�Jl@8�$Ze��É %6 b�2�e(`������L�2 �6���7�Z0Y' e�, ��hߠ hae= ���Pf0�,! �B��ea Ep�@�e�&r@:CL�ۣe��Qpwʂ�A ����A���)w����sw�@ NF8 ^������|�d^�����p�4�xY3��X�d``���e5�"�nlx"ɀ��u-,@2xY$d�, � ^��1.T@ p@� ̚H��5��H/ �d4u�HX�u�4�p2���&R$6� � O$�`��@�������&p-���� ����d4�����e���4��$���d�K�Z����]�� a�,��d40�Y��ԫK�A8+a�b0� @������ V�09�` d@ �� P �`��a28A +���0 ށ%��,y�4�������QbV�� �a��X @�@ |A��E��Y�J0����0^/@āe��J��f�`V�8�n� @^@��`%h�� �Xڦ� ��S�@hg�5�E���g�5d�`�AVH%cC��`,�h��f̀&�p� 0"9Kg��ڂ�� /�-��0��!���u!�����'؀�@�@��<�%\d���2q�q��L˃�ϲ@�����hrq2,���C`�0^�`"|��LP��x?����!x�`"y�|_�K.A��`ЀKP0|�4� ��!p n�8 o�^�� @@�:Os�<�%` �.0ң���1h�HLC �� ~4hJ�(�u���:����)&6@q5@`\�A��,���>F��Z\��}��E ��:\�q��ABW~yC ���������6���@l� 6��{@�KT�K�L�PއJbK���� p�lX7���p@%�������B���q@%��������b]<�0-���/�C%�%��D���N6��и� ��5����>2��6�4.&��r �ᇴ���l�[�\6 �0y,�<+�#L�AnJc��4���Md>@7e�x�}A� � D��Cy$��h,���h�X�I�\�r��5P�`�M� e��5 ������QD�(=W�r��Q z��K|I�8�� �"�6�o"zl�1�Gr��by2׌�\|I�Ӄ��ih,�G���8�%��A6��嵮� �6�m��/�`țm�|����s�й���\��_p����� �@X���`.�&�?��:,!t_0���s�0��!=΂�:�K:���������+`&� �Lh0�|L� &�x��o�,h0�4�|Ç@� �z 4�|��Ā &@/�4�d�7����`L� &�x2"U�o@� &���"|ceA� &���"|Ç@� &���"�`@� �$��`"1 @� &������!� f�ae4�"�n�� �a�=�@���BD 8�1��A 0� ��l`0 ,�]�#��N"`�XYq��r�HW!��B�|��@(nǭ��OB=�@ ]O � p/� P@pE��.`��q�#��� ������ h� �66@�Rm�4� �6lV �t4��X ���x��UU��p����J�p^ x41f�TP-���p���*^�ty��"��@3`������p�K��@�&��j.�#���!�H������ �6�7��TVlN�� �AP�A}� 6 uY��DJܒ �M'�����Z�6�7�$���8��t+A��X]��d��HGcB�ѺN�SY�KX$�0�O0N6�uц��b��S�ku�.�B��E��B���h6�4 ��_�0 X�&X�|! �B���@�.�u�pW��]�+��۵�t�k�]C`p�.�;>� X_��P�`Ys�D�,t�������tW`:�$� �J2��*&5!���)�R�W>�2)%<���r��r � x%�ܕt����]� ���t�k(^��xe䕼��Y^��y5/��tW��]�˝�O�t��]��xA� ����^�Kw��O2����^� x /�E����-�=h��E��*�X� �*�J������*�E��"�� h�*@��*�Z� �*�J����YX/�@�a=��z�~ �`�.����*�E�� �"�� `�*�B��*�Z� ��*�J���r��T�UR�I�^0{�:Ol�0W ���?P � `��u��G���kL�ơ���Id���?�� h�kȀp�����#��"@�G�����U� h��Y�h0~��5҃A�n �A� �"������� p��%��A:H� ���?f4P���0&@ �# ���� ��(8��h���(�9 $F��3�4 � ��%��cȀ�?f�(�c��1�� �� �'�r4��KH�0 � �^ d/�8�� �3� fr�t���"��� ��\�� @.~0�Q�� x b ,�,@�Ip��-� �� �^ |��� �˒H.K"�����?~�f� �K}R�2� ����� @� `� |q���C��(�c���1 ȗ} Y(�_�� � �`�l�1X�)_,��l�-:K�/�"[t �_�E��,)�`�l�1XRH�H�p �� ��f��*1.FA|���|�$*�f@���%���E  �` �A%Ǵ8_|�!t��0 ��(���h�j�-K��oT���8�E����Z�1X�`�/�Z�/��J@_��J ����C}p:b%lW�+ �l���RP �' �0�CP �bd���z�X 3`%(�c1��J�+a:���H/X �%���� H�0<���B0<,��� \\�A�y<2r6��"3�}�/����P0'��9�� �}�H�0�x��a���3~��7%#~�/��0|F97@�����n����~�����������`����� �}݀>� ��+� !tr����;�7�c����08��B �h���` �a���0��R��}݀�a��ϵp>7�}�� ø7�}�҆/xC �`<1H�M� Ƃ&�ē`i�t �@x�@�"C4�� 8Ā���&�� hM� 8�� �  m$�u��w�_�Ae����HIMb@ �� @�MP�A ���_�����p!_�b}� ��C� i#)��@ ���h������[A��� �_`%�#{d�����[Y���÷@G8a+�/ �|� `wK�����_@�ୂ�D��8��m��U�>�!E��࿈�>�! ��鲷� �E��p��j�H���_���E�$����6`0�\ X���`���f���c� �6���t�[�A��4���t�[�A��4���t�[�A���t���E��`P�� E�X�"0���zBO$0=���� �� �&��Xi"%� $@ �� 0bq,�H�� � Lb���I"�X0�4�8 !0�}��� �@#00�����$a�8���dʾ�5 ,��Y�D�'#ρ�ɔO��dʹK�"���Uv��0���(�"�$b�|��` � @_��}��F�I7l��a3l&�`�OI0~�J�Ծa�O10 f8,��`�X0&U���&�H�Q0n�Ͱ�`L�i?%���*�S��ET0?��U�`��������a����� �(@7�F���q3l���`L#�) �oV l�S��ET0?��2�G�`�*�m0� �"�`��6t0/�o����V�'2��D¶B>0K A ���0G0K�"[h�$���S�s�)e�$��@��5 ���6n�) �cZ$�0 �E���"[h��6HH}�٢c��k�6�ε�٢c��k�t^�Y*ae��1 @D�Qa��װ\�&r +�5h"�`4�(�D�@ #�1 8�Q �$[p�+�S��X �� ( @�08� S���������h+�M��@j`!�c�`�UV[��dp��p���g��V��(���h�V���+��Ԃ�SN �$�� ����1�L H�^��܂l��@'I�F��ށj0!�Y��t�q � )3�]4�6 �r @���v���_`Js�]���� ��yI/Ʉ4�9�.^R�� B�%������K� B�%�� ��l�M@8����@#h�@6���!;�J8��x%p��J6` ``l� @��`�uX6�R �1��6���r� Xas`���B�� #7���9��1�k�c؀�l@P�s������´�`! (i -�~�P:�`�W1`l�-̅y���`@H�K�"�dl�H��-���C`��`���M�`���_����l�_IVL�Ű�`CP JA����*@�6 t���Kr!����U��@.�Ŋ���?����x��^� ��� �;�K�a�%�, �\~Gr/����^ {a0�w$��`���a�ㅍ�܀B�3, @��`�!f��C`� �0,PC��0�x4��|:���(�?�|�&R$6� p"��8�!��0�?���|�dJ�&C�`� 6A8+��!0&5���a6�0&&q��1P ���6�B�! L��(�"�����$AX�� ��& x`Ā$p�j@ 1`�#�j�#)3��̀p�f@�-�CG��r;&�9b (h�$�n� ��TIL�M�n���݌�q3lF�I7 ��>,4�k� v�O��!��6LL��a��$�b�NL�`�HЍF��&������S�X���n��Ibt��Q�nF��6�ݤ �4�� $��T/�� �b�&��#Ŧ�T,�U1+fŬ��ba�d���nRQ���h1uA�m� [̈�.fDf���^0��B��cp�o�fFĈ���/� E�|_@�"(�` :@xŹ�E���r�@!P�@؀����"�b���YE�@YH H.�:��JY�' H.4�5�@[ @ �,����gH_, �1�0O�BYU!�핺t8ށ�O!D��| �� *g#x8�N��y aW��+\�x `��8�&���' ( �!�X�P�����@�T�� s���0v"��8f���9��D�P��a��0��;��,�N�Ȣ�砱�0>��ɨ��^ �C��5�WF�逍��l�4�� `d^p�i����@HÅ��d�66�A2pcq������0H6xcE�$E0��@2�` � �A�?��Ux���B�@�  �E�� �/�`d��8`N xc$��8� ~ ����<� �� ��B�� z/� Cad�� @.D� ��'@� ܘ+Y$7� FV0'�H1�V��+8 a\�7��B`d@/8��4\@� / ��p!/8D� ^pVi��( @�HÅ8D�� F Hn,�E�M+����^ Aad��5��M=�cs�=���00��'��@%��B0�`��� 6�p?<VFV�`��p!zBO�=��0�z� "�^�A_)�`d@�W\�ȊM`%�@��@O�=a%�� �F�� ��@x�+����<`�Ay ��� Y����@����+}� W�WF�a�$A�1U@��-_$`� ��D���8��! @zC�).�0D\h :k����r��X f!�h� 4@.���� �2@��`�����!���0:\+Y#k�W�H p` ,���AEY'�dW��Ax��d��0��swlP^�xA59 3�=l��U�0�Ax%�`:`pā��'��@%� Xb�� 0�����bd� 3>��R8Uad���h��@&���F��Y��ā@]��lh}狌,�bL� �'�� �z��TW� �����F�w��B� ��0���v#�+4��R�BX��e�;0��CP��(8�S�!��/#k7\��5� Y�Ew�,��:L�{��ad%Cv�F\qp%� ��C���� s !�2���Bd�`X�\`�e0�,6�,��:"� q��ܑ1xC_� }�$��1� o�+�`��#�{�D �+P�A��@j�Q$� /��@j��F���:�H:��hd��A2����X �'� �N�Q$ �E���P�8(Ib�V"5�g���H��@J#��HR QQK�P�[C �������,�Q(٭� ����[T(+P �L���K�>Ĉ�)�E���BɈ�"Q�L�d2Y�d�lfp2E:���d�G�m������?N&�Q'M��f'S$b�:9�L��4�&��L�|2Ov�0(>.@�<��DY�>�GQ��3���Q�G���6<.����R6�'#���HU`�nM*�� ��0`�N٭!5�A��p�&s2�, h�M638�" ���d2���6���d�D��'�ɨ�&�d3��)1B��L&�d�l�� N�H>�';@� ��H�� e��Lࣨ��e�G���K��'�N����|PY*>�L��2|���QT�l��U��<�*>���2U|��>�LQT�ʀ�)�5� �]�� e� �� �|€�r2�+ �2W�^YaP �@��2E� A,{�L�=W6�^- �, ��00�Ĉ �L��U��^��ebD5(���T��p2Ϡ�=1� $��X������� n��X�̖I�[&�l�$�e�̖ݲ ��$�-�e(mx.\`H&� �A�`�[CjF%� �����RhQ��5ũ#4Rsk�-qCͦ8�[`��e�6�\��SpC�&��ذ$� l�:�&",�"���3e}F- &S���C�enH'� x(S$����^v �jP��<E"˞�"�e�@�(�_���0S$b$3E"F|�#�A����؇�) � �)�g F�A.{�D�=a� ��3P$��t�g��1{�d�)�_&F��0f�,T�*bF�rY��e�,�u�gP̞�"�e�� ��\�ˆY.�e�L��\&̄Y1+f@d�B��ʭ�%n(�P�5�Ȁ�1;��6��Hԁ 0`2'��€&�d3��)�0�ɜL&�?�l�� N�HĈ�q2��:i�M638�"#���d2O��6���d��y���@�q���P&���>�J��Q��*>��x2� ��.>���2��T�)���E��F�[e�̓��K�O(Se��L����Ae� ���[ʀ��%a��P�ʀO�>�' (*R|n�38f� �� ��C(ee�E�̀�y8f�L���2|�O2s2� ���[���38f�@�=ev̔�1{�L��c�̎�1Sf��3ev̎�� �a�͆g���Ba(����������38f��ݚ_�̜3c�l6(3E��f�2+͌}4��p̎�2� b���1�̞�l� �a6��g6f�l� ��͆�0f�yxf�a6̆�p��l� �a6��g6f�l� ��͆�0f�yxf�a6̆�p��l� �a6��g6f�l� ��͆�0f�yxf�a6̆�p���zf��<�g� �(S$��A�h͞�Z�f�d�)�Y��,S$�,�)Y�HdY4S$�L��2E�̠Y4�f�L�H2E�̠Y4�f�L�H2'㹤(S$���=�� Ԃ"�f���c&F$���\a��2P�� �jxb�)�Pb�3pe����Y��hYea`���Q&F�He�' �W���H-#�A �X���y� �)�^v|Y/��A5(�P��"�e�@�̲g F�/�eb�)1���"#�L �ՠT������`��3#� �=E"˞�0{��(Y� ��3Uπ�=E2��/#]F� �a�B1#f�,T�2b�˺�3(f�@�Ȳ\V�ZK.�e�,��2a&�rY.f¬�� �2@!p2� ��2E� ��3x��<E"˞�"�e�䗉� � ��3�e�@�<I&F"�3�eb$b=�[&F"�$�e��I2[&�l�-�e�,�2If�n�J� �Ҁ�8I'�t@�P�"P�����f�Li ��aK��"9���tSV�S�5�Ä`jV�<`d���Y�kv2�ٳ!eE��p2f�l@E��2F|fL6@�͆b�H�C ���A�V�` ��{`F�hI�`�����:�a +��$�{8���m��cD�B�`����m�PG#� ��\��F���a�(n� n@��f�'$��w�� hI����F� H iDްW�� p �`��@n� {%i���x�^I7`|atJv�(HB� ��@���������I����c0�iQ�� [ğ�F�8'٢@d ްW��(� �x��3�7%�|��3��=�fT�均3����<�b��\�b6�:p�lX6 ����� ����R0g��?� @ΙR@g���(��r,0@8@(Qp,0� ��L�)�! �� �$�̌0v�wP  MЮ�ahR�X�k~؀4�$~R�,@�4��@X��v%���@��A���@�ՈXg�*M8�Q�&�ՈXg3MLw^�i!ô��L p:@iC����i1  _`Z�h��3bP�1D´�K�"(� �BP�"���t� � �"(�(�PA!�Ku)��A!P�@E���l�$�@E��� C �Qe��!��<��Y08?!a<wfp@�Ug̀g��f�3� �`�zprP08��'� ��� �L�iA}��bZ�Q�-�����p̀l�♶��"[t m�f@��բZ�l�-:���~�( m1>�TB�i�9 Ϧ���,�_0��/��,9T�F��t(�`��y6��t0 �`���y6�A��| ��C� ��A�B� B@ � �@��$�̌�@���� ���� /�@8C I^4��JbK�"�z�Y#��]س_�ĊLht�4΀�† !`f|�ܤ�vC#�$�̌����d�{�J�,�"h�I��J@ x��� �:�*I#E�0�@,���P� ����@�"@p,bq,�HN�J��}�Ϛ)�b8~�t����l�~6������3 2� 1��0 #7��`L ��\�kq��� �&���36�@?�gh`ď�`���� X��n x�(՚���R�IM�A��:@��8�5���40qVk�'(?�3q��j�[1���Z��ę8�O�惍3E��S�Y��E%�Uk�Y~g�惉�Z��l ��|� kp?�|�O��@s�܀O^ӆ��π��0 ���-[ 4nXقԬ��@�:´(h�hd F� �+���l!}n@l1؂�l�-�E���d l�-�A��"�� ����� 4�`l(BS j!�Q���N���y0��ͨJ�f� �6 ~cC (�06����|��!>�Ie���2H�(M�@` r��#+4�"�n�B3�6���V&l��9ā�,��k�� �� 0 `�vu� @f@ ��`��v=��sy�� �1��&�\�5�@�WA��\`h�"���PKghh� Ԉ�|�� �J#̅������L�>�4������?�Gr hf���H.�%$܄?~�x�����(�i$���n:H �rA^� Ӂ\�� �� 0@��@.nD�A�b.���n��7�\� ��� � (-A6�D#����kA�;�`'H-1�Ec!��� �k�˒ K��ԗ �k�K�pK�T�8p�A�v��q�rĀ �@ ā�C�R(�Z�r@��P E� �K�,1@TBuX4��@L!�������(�;��\��v�l�yP�����R�)w�4�!Ҁ �/7)�t���RP J��&� �RR b %���p:�M� 4�&��@0J!��c����h��� �� �/�6��(�+`��J)&�@��RL2� � @�0��_�h���&R$6� p"�a������4���€�V�� �e@R@8�q:B��(���w.A�-2�!@ ��0� 3`� bp �l� ��̀a� �A (ã)��� Fi�2H�+$�A�iC��! ���(�R3J���lE �P�l ���H(BVM�Hl���`� x"Р@B������D� ��Xxm� �� ��`[(�c�if�� ���cq,�E � @�P�N��8�"���F�H�$�tl�����?e��Ⴧ3Җ�H�&͊���r�N�I� /a��� 0��((Cg������4��2"+bLuz(� �I2�!Ԁ�Ȋ�,fA`� �! Ѐ��Ң��|���|��Z��lAT���"[��j_F���B�m���� �/�[�l�-VZ���`d� l�-F�J�2A���f-���d��\ ��w��ܕ��')��0�X B�@Y�X���, �h�0�KsW����Np���pW,�c��W��� �!�ذ��pi�,�����"+�\ �VC�I`���~��3�����~@kX �5��M� X)�Ơ�p@ �1(�p,��Azh��(Ob"��r8:B84IH0� AB��(6`70�'�fA�i�� P@L� �"�iu1���iE`� @@ �� (1M]�R��@��bĴ�f��Q�"�с/��?(FC�� ��PE�_�+R�jp2� 9 :0 ���RPj��4(U�lݸi3�͘��.A�hB(��FV@��i+@��+Rr� � V����� Q>� �q:@CN�)@�� ���䀐�%[h�4�s�F�� �@���@��� (�1r���ih}� @.Ѐ��@@� 0clBVp6`�(�:Z�P>Q h��\��(P>� X���|��iȂ��� ��#���@7lk�i> ���� ����2jg�/�@H:y˧�4p�*� >m�����OsD3 ��4q�e|�O�i<ͧ��z�Oj`|q��@jd��L���4�ET�`�eD�ȴHD���#bD��k����?�L��hF����&@�Qs FdZ���.V@�h , �d�$h���E t|`D�m�F�L '`Ժ�l@!ӂ#� �>��2"�C!t�&@��H8�d���w���'�b5@0-�B� j���5���V� C͈�i�Q[ �!(p ����Jp A��p #B�\�Y���p�Q@�8� P��c��6 �� j�����@�VQ#j��4`DV@�Fd�#B�\�J`�#BԾ�Y�� p#���h�q#��P3"F��%50Ԍ�!jI͈h�&`D��R�1M����� ��kh�a\��A�ڎiF�5���`D8F $ʈ(��WH������ ���W �����W�˴ |l�*`D�D�+�5�(#��� p `섥�HB0"+�5L����Y�A �iaD�� p �L���E���e���nG0"a��#�Ԍ�k�����@� �PL $d�9"�ĕ8*�� ��Skj� q���Ҙ�&L� $��ԘZS�M �p��Ը� b�#���@�A:HO� �)��^�S Pm_� �����8 �0P�HA �A�4��V*�=Y�6�� NKx,� D�p��Ic�RM�4���L¸'⤱L�\�ZUS�kĈ�BT'�"��$@0|AT{⤱ܔ��X6 �jE����rSn�Ph�(4pS��-!ܖ��F�8'�Ū���2� hM��e����5h�0�0]��j�`��p \A�*~��nqw,�;�j,a���A0Ya42A3�L��2��6̀�П�B#��h5��VR@h" ⯈���>��Md��u�f@ae����>��`h6�0�Q`lC{66`؀�fZ,�I���Rl�_�!�D�)�N|�W�# ���1��V�jC�< wr|�] �Duـq����8]���0 l@� c$�Ц� �j� l����I�cl����0�0"\�D�� ����j`L����j_�D���02� HU��Q`D�@�����5\0 �H�㠊�5\0 �HW�"3�aT�� F��jUD$�5Fp6�@�`M�4�&�����l�.`{�*�� ��rq\� � 76��jh�-��#����C U��V�ā`.@���\@pE������1X��(��k��e������X��54\�T�iY+�5����^�kx ���d�x�?x + ��V���X{ +`�����Z�z ��e���V@�oÔ����C �xs ����@.T@��p��͆ق x�M����,�é�3 V��A�`��&N��P3k�[ � F�Y;kh-��@�(��b�1R�Rk� a��nI���A܀�t�Q�iF`�= �@�!agnD�v��` 飭L��0��>υ��p,�;nm� �?;�e� �vt�(; �/5#� v��HՉzp�iq�Z�0� (`��>��H-�a�dv8F\�_#�5�@ '�k�A����08 h����1�fNP�8�R-N�A(ʜ)(���{RS����-�5� |T]#rm��w@h`=�n��7F��O�haa�"�Pt@� ���.o� �u@�� ���k����$t����36�Z=+�Ԕ��E:Gx�k���@JL�_@L�#+� �"P �5�F���%0�� |��k��#�� f�s�p�1_�k3������ � �\���0"���� ������O�`���| �@a�@��P��_����P�`�X�����+��� :�:��z��e��/ �@�U��;����@o��@��d[Y�e��� ؤF`�G���ZI�- �^�XZA �9��!�XhH�`����Xt�4l�Mw��!�[�( h��� ZH @-��0d�Zlh��5�����HL��.H � ��b���w��qdI�C�� ~�`#�Ij�� ~�` l�C��v�a��-�� ��� I� @ �� �.ʬB f1Hl@d0D���| 2��o� Ŧ��( �`�)�0� F&`l���5� �&�(����d02ckl�����2`���}b� ��pl��56p؊ H��A� 2� ����� p&�( �@�6� DAcC�@<�p�!�� ���N�Q�"�d�d�̖�[Ĉ��� �ݲ�f�$[��h� �E ���� +�d(�0@� �-P6�� Ze#�  �ɖ,4 H �����d!(@��:rI� hb�/.� (!�d�  Cdp� i�C� ���')�|�g�N>I����>�R:�w��܀O�>�t�=�!�|�I�1�l��|�Iր P k�<�If�@��q�ي@A�����"��@?(@�H�o�4|aO� �q��@�#��}���6�f�l@ t�w��xJ�荒�0 ĉ8�l�$����&N2�8�l`���_V@���p9J�è@H��f=Z��R�dd���t�)�q$: �7`�o�� �s!k֬I7R�a���%�1 �x.b� �1 �l,�ڈ�7! #����6ڈ�:P�<�6� �FAi�ʹ�6@@ ��X L�� �1@`d���`# ��6� � �����NZE8!��5H��CP[jSm�m�q/+� � o�_$6B���8mr��6�R�YZbh���l� P7�M�����I�' (4���KjX�"h i pl�'$(�AZ����-@-�%�Hj�Y�jY�8Ck�1���Ͷ�� �8�b�����D� S����/���!�-�ɶ�6h�jSm�-}�&���m�m�Ͷݶ��ê�m� ���ܦ� O4da�������` A����!`�k�U�{0�1V�20�b�mT[�R!�C0��A� ��/����o� ������&z�H�m"���6�B~�_�����z�H�m"�����&|���$�!́�`Co �M$�6���D�)��6���DBo �M$�6���DBo �M$\��WfA�;������&z�H�m"�~�6���DBo �M$��&z�H�m"����Pw6�, �6�p�G�W؁�@�G��F:m���`�` ��5��`@^l�;��5�;@[��!��Q Nf@�'cM��� `�kx �a �q2��X �mC϶!����� P�;�Ɔ ����*��?�%���?�����f�33v�[ �U��T�!�2�`� ��*�J����΀*� ��BPA!��q@���8z� 7��&@Xr t*U�dGx�s@X�g@,A z�El��@��F� ��l�Z���`���/7�vܐ �.FD $�Y� J/�? ���A�X���Q����,a҅B��'K��> �pH�Y�<��0��\� �L|�`&HÅ��ad��@.D0f��� p�P0C�a 3qf� 0Ch�me&��� (' (7 0N�Xv� L�A.��X|�n��1FF�0 b�10~��v`��`�%���<3���w8f�4\��6@���Bd3a&@�3`�2�PHO������` ����pB�I�h�6���,�[�xJ,�,���l` ^�5D�\��rA a$�4��+�F�)- !��@.�=yJ�a��NZE8!�U�P@�(5���pB�I�h�0 p�*@� k@]��VN8)����s���%���܃$�.a��䘌�*RE�H�)?��܃�mJO�'M��T�*rS�"15�z�J���-G���P� �R��p���`1� e ��yB P� ]`N�n�d{D7E@L�=�0��k#,D��ǯD��PO�[�z8��L�(бF� d ��19J� ��CL���Q ����@�1!�F��spBu[G��T�{���'�d� �'@�Βp���2T�����n�-�8�@�Βp�`I���ݎP(ߦ!, 'p��*����R����`=�`���p��0!����! �������P��;�*�l7|0��B�� �"�O1iF L�3� y�X|@N(�'C�ᄂ|�h��1b���6��F�z8�-w�g���3�=� t�|���Aw�'�A�x7|�������� |@���gF�����*[9J�"x���7�v�>�x{�-���cBގ�W�*�$����݈ >PG ��%������(�c�pƛw+o��/����'�)�8���OZ�T�ļ��p��S�'�-��7��݈ K�� ���O��x�n� �9e�{�U�n�d6�'�kx[� �(Փ�0��S�(�$Z�����u{8���,xq��u�n�cIx��Fݨ�'�n���|` ����6����$�v�n�M]��!@�4Òp��Q7�0�> uoߍ���D�Βp���@�,Xo�- �{�@>!E������*�$�|���I{�]�}�.������]� R�7���^E> �ͻŷ�)؛�N��収5�r�D�n�M��7��޶��'��I�2��{soE��7��O�poRԷw�:NV����P��8GI3%|��'� �X'�R�W>�+��8��V�AC &ъ�=�VA��=�nK� P7Ͱ$��f�nK� �|�*��t���D1�ߦ[�'���� �B��o� n�7���(�(���$�I"�� %`8�O�o�r��sqr�B�B��AL0D�~`I�@�]P��p�q��� �܃"p^�3��� L�"�8�c k���@��T;�d���R�[��͂N3 <8��c���Cs��&�ߴ@b`"�90 �B�o&�`1��_�a � @b �h$b!@��� `�� @�����\Bk��f ������ q$g��˜�p8�Q DF�8��dbp N��`$�0 8Bb�a+$@ �|AS�6�*���_R��̰�7Fn� p`5$@�. �[ /�]���fAb� n��ذ��@b�v@� @�h�!��@�l "��� vl0A,���`��  � �!`���q �aȆ � h�� 8 1H�@���1@p3��1 ��lIb�C� X�� d@(�3� t  �� �|ÇH�Z@b� Ȃ��0 C X���� I ��@�Z !3�Ȁ`K �!h@�؂udC� I����0 n�°���PM� �;�a��j���%���܀0 ��6hp���U�Q0A�A��t��w �A�sp��p�i�V�k�@Kh ЫV��H!�l�` ^�2� ��!�� ���C�<�B���2xp� 1x[�p��E��h�k���!$��f� �%y�~0� e�$�2 @ hE � 7�� Ā� [B� ������Z�� �B$�!f�� �� a� �����U��n�l�N�Eb��nD��A6��:�?�D� dC�q@!0^�@H`O ��D�l��Eb��[�Phn#X8��B�pn\8@��.�X Cí4���F�p���0چ�� Zt@@ � ��rኀ"�C�­����V(n#�i��@/� E��# �F�'^`D6��p�é��@�(� ƈ^PA����õ^�@!�a�E AF��t�"�� (-��g@�"�p�� @� ���p���e�"�:/�٠ �^@��� �P� ���lP� �E M@�@�u� l�� A!t���@�pa���B��Ay @��/z��1@����F��>P7 [$ ��4�E�� N���4�(G*I�ȝ��-�Q��7�d w��J�#�� �b�-\� �b L����ø��m �|pn1P.�4�P���H A%�ӱ�E9Z.�^��_`�T� ����؁ �`0 �0� 8H+�9���X�@4�p�V�8H7`6܀�t� �@��� �jX��$@� q��f�8��6�#3�����D\85?`���&~��?����\0�� � $DG��*��H�B��T� 8B85���0~�?�#��0���3@p�\���Ҩ?�L��9��@��g6,���M"<��!nɭ�1���4�12�# �d�l�!�pfÒ� �h�-�C�V0qY�����T� #^da�0�U�Xq&.+�8;��R��cq�6�(�@B�0Y�����0�8V6#C+�q����Ky�f4������I I�Ź��� �q�jc����>8ƱbN�c�&�1\�8V��X+��7d܌�E2�iG㰅�qLC�͸]T�P\�Sq6����t�n�q9��a�G��v���q4��YWz� >�y�������q���� '�PF �d�� �|@�I�r�*���1�U>@NJ� �R�ܱ"r&.+�8;��R��cq�6�(�@��CP +�7��k�����@^8i` vu�LRH-�Ž8�0A�;V�5��q[�� 7<���J I�Ź���C C Y  �ĮM�a4A��kx��0Q�� `���c� ��Jp �L9#w�~�P>�A��"g��/5�50Q�ܱ�`b�A&���;V�L�� �D�3r�������(rF�X�0A�\� E���_&��k`���c� �D�s �L9#w�^� E��+#� ��Jp �L9#w���/0"J�50Q�ܱ2"���(�%��(rF�X�_`D��r �L9#w���/0"F�109� �D�3r�ʈ�#bD��k`���ceD~�1"N�50Q�ܱ2"������(rF�X�_`D��/p �L9#w���/0"Fd��A&���;VF�#�?\� E��+#� ��� O�50Q�ܱ2"���[��(rF�X�_`D��s �L9#w���/0"Fd�A&���;VF�#�\� E��+#� ��9VJ�50Q�ܱ2"����S��(rF�X�_`D���s �L9#w���/0"F$ � �D�3r�ʈ�#bD�@Mp �L9#w���/0"F�50Q�ܱ2"���L9� �D�3r�ʈ�#B�\� E��+#����X�� $J�3r/@H�"g䎕ސq3n�8�a h���G�1 7�vQ�Cq)N�ٸ��r�#�q�m���-���m6���8gyx\A�qPs�bͱ��!�@�[��Z� ܜ�,�L���X]����j>�OL.���w@X8C�x�� t� �$2��� �G�9�O@�#h`Dn>��ssh`�}��1r�'p@�5/� �� p�@|�c1ܜ �.@���m� F���4������L�|�` �� hā��<@C�\�c'x���9=w�,��1�|��u��Xv |�!� �Ȋps1�|�c��\8��$cq,2� p�%|��& 8���Y&��:�%��`�=�"� �sx��ٹ;�N�\��s`�� 0&+'B]L�C\���� ��>p���K�`.���2�\��Sd.I��1�2��"h�1����@P� 0���p��\ +s�鸀�2�\��K@�%�V� .�@��b�_�1�������\:8Sd.����t\@X�K� ��)2��\ 0@X��� � ���t��� �A�` l�HŤ���0R1)&76���L:�Ci0 �Dޒ �%�6� �l��p�l� n����s�A#h�6�P\�2(6E�9��� 8�$����1@j0"+�����gb�k�Aaw�/�R�(�t ħ�1��O� ]�'�36 !3� ����� �`����O� �� �6X C��� ��(�� ���� V@5�)��!�/P���X�� ��RM� � a��pf����Aй�&�� �N� �� �f�`�2���apf�`t������ t�N�:�`2��0��Ġ��. \��7���-d��P��T�"�'5��4r�(� �m���� �h ����(0$@�2,�E�C��Q�(t��Ȇqp�G>a2���0�&�k6�-�$PݒX�5�%!bJ��U�������U� E �X+ `�%Q���YI��%�E���"K� �B��Ax#UDШj!�` ���, V����`t���!:F����{t��~)�E�0� �S��)�q�hբ�_��5I�IG� �ct���!:F����F��1:D7����t��5:F����bt���)�E'7�� ��T:F��Ɠ�t��1:D��ݢ�_�N�-:����0"�e�@��dD4���t�N�-�pj^�"��!: �����5��VN�(�t��A��Q`�.�(7��0:D�!pDO�� 0ݢS��,�EW2�*Yt��!� �#��x���d� ���"X%�`�-�B�Vɢ;��m���@t��d� ��̢S����g��]!Xt� ������_�e� ���W�Sm��< ��@|H������h��i�Mg�N@8�n�q:N�&���tA��M�4&@�C8WLt�+�:�S��)�Nw�A��b���]1E�鮘"�tW�h���0��t��'p:N�8�+`�L �2Q�ʄ6u ԅ�+vŮ��bW�]1N��D�x�� p�è�b�}���C�X��b�@ @��Ct��q:DG��u�_qN����t��_!�0�BG@tW��!:R�8��+`��#p:D����W� � �Q�8��b�ё�Ɓ�D]�W��!:D�p8��W9��P���t���5D'� ����!:�����B8�aԅ:����Ct��q :QW��G�t��!Nǯ��A�.�qDw�8�#u�щ�Ư8�Ct��p:~ůru��# �+���k�N�0~�8�Ct���+~�p�è u�Q�q���t��p�+���k�N�0~�8�Ct���+��F]�����I��D�!\�9 �*@ @t�·\1R�p8��t���]1N�8H��t���]1N�8H��t���]1N�8H��t���]1N�8H�#tp:��8��!ȁ�e� ���st` :P�n�����|Sw�@_Cu`����C]�[t�N���T'M��Xt�$�I���2�\�K�n.�F'���- !��T����ݴ�a6zS3m�U�>�dž��nf4�E��r�puB`�W�^�30CB�խ����30CB�5��`�[%�n�-��ꞁ�n�4�W�����4��`�*�u�n�5��ꞁ����W'�3�tfH��U���[t�NdD���*yfH,:D�8b]��u�$� �X�� �30CB�]�U"]@t@�-:�QV�3X%�<��!pDO��%Q��i,�}���JX��iK�%���f2�X��(�E�!d�b(�nI���0l&�*y`�H�!pDO�� A]�Yt�f� ���J���[t�  �aC���tG��4(& � �E7lfݰYY����g��]!Xt�  �aC�.�`��`Db� 0"@0���2ckl�%��/��Cl��ň4:GgD��[tF��)�E'7�H�{tF��-:�eD�3"���F���it���F��]` F�� :��/�3�p�$@~�@!���F��Kg7��(�2:�y�����n� �u��͏�?h�uc� Z�H ^�#��n��iC�4�%�*��`�  �d�W�� �7����O#��p���9��/��� 4U0�E^�u`5�KTA� ?@���[�����sDa��Q`��O;X�9"�TA!7#�a G�.�#*1��Ceb�#*׍ �f283Mdlt�&� ��#�bc�L ���|Z��I'om�)1f�j�P�l����l�[� ��4E����u>-׭��A��l0�"�8N� ��6qMY�����|���u�5X��T����F8a �A: �n ��| OY ?}$�fxXCY�T�����lB�����E_��"����.�;_�~]� v$�)� ����S>��e��J�]!�N�<`�"HV�!����@T���Î�D�^7��Q��n�e� ~]�Î. ��P�]�� C�4�A�,�he��3x��쀠�Q�q�%`��f�W�1x��<�g�C���bx�OJ@8��<}� p�8��$�n�����I:�{`(t ����0F>A�#3�x|g��]ډv3�c4�1"����!7�P;؀q��F}��q,x>C��cq,x���l��n�+����!�"���+^�A`�t�ˡ:� ��)H�*RE�H�w�t�`t^�"U��T�*RE��O�"!��1������-��1x�k�71|�J����+��#�Pxk@����P2@��nѪL�E� �k`x [� ������]�)wI/��$@�sx�Iz假�F�px�}d��Γ�� /�'��"^p (E�I������ m4�;�F&Ńx���;�F^ Q�}8<��>��⥍g@�.^�K�!x=�d�L�k�$&)wa��d�b�k�x�$�W��0^��x�K��lO� 1y� ���� �U�*�@I�"�U^�*� ��5d� �\��� [�.��=�I�]�-w�.햻r�3�V��L�׀��U�r �}�����I`eB�E+���2@�p �5t�p����xT�|<*U�L�vK�K���� ���]e�����W�^y@z假���G��Ve�5�� P&D>��+<<�V�D^y���i��%�[����D�g r���[@��אB��K[@䥇 �>����Vk�5d�5�F�p ��נ�p *k ���\��r �`p���2�|�"l��D^z�"/=d f@%��+y!�$�u 8ր�+x�ᱏ��p��Ãx���A<�TO��k�$��5d<�T&~8e�5(�P\�s �k $�u��We�L���W��:���׀��>� ��5l<��>\ǣ�@z���>�^y��i���p��y�` ���D^z�"/=luPOրk�x��|<���ʄky���Q |���H��5�$ 8�D�`O���������-���m @�� C`���N�2a&o ���!�@h���1�R� (o�4`В @���q @�1���ݬ*�n��&h�����c�� ���Xl���fF#�Y�4:��8��rt �EO�`�����z��i�#�@P� `)�̀"�� �^��� x 6�Y�"� 6� E`���� v ��`�X��4��� *�  0"�xd#r�A8FĈ�p:�4�3�xh��1����)@��T/� ��H���6��@ ��}���:C0E�� �>2�(��}�d� � $l؀�� @���, �6l�?�^�d�$��n!��GȈ #6���w�T��ᇐ��A�@!���<00?�H�y ��<`EJȢx� l���y�(���wd���#����vϣ=��� �7?v�[>O�ؒ���~�B�697��c8�}� �a��<��@G�AO� =� �G�zC�=v��A�3z[a�=E�?ٳ)0G�5 �gsJ4�(����kq�M0N�����ɳ��=�P`��k0"�`� �Q@�D� zh`�1l�B�!Ld�Q��F����A D��!=��Ȟ��Az �--����{63@,=�A>�(}��=4p� @I@0��� :�z?��=4p��� ����12�+�B����0��A��B�!���� z�fY<�P`�B�yz�l-��^�#� �q����([Afh�'3��D�7`+x����x[���������@�Y$�d" 4��F��0C��E2A����o���V`�G! 5��nT��z�EPc? ��cQ`d �8A�w�&o0@y6� ��bx�DA!��f`���hdh��)*� �` f��Q0n��( zW��a����������i��G����(\��u=�������z�`�M�\B����#z k=O�:³6W��� ���{b��=�G����+{^��=�U��^�9{W�X=�w,�H�'^f7�cax�3�/��٘�u�l�M�x6��� �bx���1<�g��O2Y 6iO���g3l���C�'�52#�HP$y��4�F�� `*��HV�^#� ��Q�De<�1�4@��2�w�x�"��(z�@� ���bx E�H���|�>��`�Q0n�M#��f������1<Æج=40l��1<���|�@�Zhd����(p���cb�j�H��wk� �(DO�]=�'F�@�zD�����K���zD/aM�� �^G{S��=�G�Ȟ�#zU��=�g����*{f���7l��Cz �--����3{6< @�ڞ z���]=��o�ڣ��-=���u�$r�#����4�X�|,c �� ` �j80�`D4pA5�� �_��D�C�O�&2��� 4!@f�� `�9@; n�< _� ��`]X� �=,S0�A/�� �0"�(�sD�!p���0 +`��!V� 0&�܀~@����`���ր��?a ����푂�Q0���hC � ��'�I0&a8~�i0 �A�*�L�l � �а�PT`�=�L�_0�A �� @�l8,��]�/`�HG �a��0 @ 0E��4�U2~�iu4�&�Jf�0 � �"�P�8� F� �A�h���a{� (�� �0�( ���1� ���0�� 1c���0F�h é��p��_j쀙�`{� C� h���0��h��=0 ��0��h�=0���"^C��{'�a���4L�`�a��P�¨/y/�;@���1�ݤ F�$�F�`b��H0�'� Gx0�3����&h�v���(@7�F�Q0 �(��7�c P01�o�F�l &��4�`�Cit�������{����~����5i���~� �`@DB��B ΰ �� 7�q(���$�����=kR����{�O�D2l�H#g~@�4B.�� �7��H�@.`�2�)lE ܀�w�� #7@��"n��������n [�7�\(����Ma+B�xep��7@� >�gK� P7�L���V�� (|�O�!��� |���ْ�U���N� l�H�̙y�b8u�D.7`� 4l�=���;N���"Ng �@��q��� �K|���q2� �'�O�)q���0"�eHp`D�8 `���ah�������PQ�r�l%� �'���q�/f��PQ��9E@��I� �@����/T�8A|N��$ `���i,���@j��% ��`:� �o� � Hz�s�l��˓F��<������Άk� N��] �yF�8�O�D�<��3����D��3�K� c<����V8 A�4����y.'B5q�X��gI�o��QЃ�Ic�A���� h.B���;��F.�ܒ"4p ���:U �`�� �PE�/����\�Bp-Ա�\�.`%��R�Z@g(E�����B�@pD����k8�X%���kG���G�m�x��8B�.��^# �NM�� d�P:j�� �ZT��h�`!�Q���_ #�d<�� 4�>{�AbpVB �1�d��2�RP ���2�8HF��,����x*�Q�p�1(��0�&`D^I�x*KP�p�1(� ԁl���xad��2@!Ȁ�d@ A!�y;����@P J!�NB��&�`(-!�|`% ��|`%\����� `�l�:8�u�%`� � p���' � 4z� �`(��QK�ܹ��� �,� �`�:��@V� f��m�a�T$8'�T���@�����8��0a��xa�lp �Q��i`W�̗�H��7`W�ذr��H7�+d>0��6� g�c��9�+V�k� �`W<�\p�B�3�o� p68FY�3�b%�ؐ ~�k�|M`����2��|�L���1�œ�+�5���:_lx �`�p��2��|�L���1�œ�+�5����� +`W���r�B�3�o� p68FYx(��5��Q�F� � ��h��&���ea��׀�\lXea��3 ‹A �'8�v�B�3�o� p68FY�3��Ÿذʂ��|��܀�������|`�� �Q<��k�6���`bFݸ]!�ͷ��8�,����`� �t� ��w�B�3�o� p68FY01�5�ג�bC*21�t��f4���lp��`b�k� �!e�Q�~B*�]!�ͷ��8�,<��`�(X��t��f4���lp��`bRф� �6�����Bl�0+�,̙F��Bl�0+`l �Ƅ!�K<1 �7�@Vh c��a�h�aL@���(eh� �0H�� Y�.M���PF��$�F� ��a� ��0�a �[��-����@�K.�f:`ACjp �!]�����P>%�X��AP]A ��fK#0!؅i `�\6D��A5�^@.�D�΀\�r�rDp 3&>@�z�j���-T[b��&( n�4���;�� ������0F/ �!0@�]���B�� � L ՗R�(@}�[��@�E���[�l�[��P؂�x�kA�Xh`P��@���[}�ĉ���"N�� 0!�/���7 � �;���ݔm�DK��)��l����\�M�)�E������n�8q}�K����"ԁ�)7��/q��n��k,�_� k1��2�b��3��ݡ䠱�J@�:xa"i(��^�(�}*i�%�w�ĵ �����'ԁJbKa�Zh�@F����Q�$� 7�5����$n@l 7�ğ���� xQ���0 n@� ������f� ��-d���@E���76b_H��P�Q!��@�KT�#h}F���}������KĠ���P�f���} 5̥Fp�1 � ,�QP�j_��}�o�>�� ������k��|��@p�1�}�����\"��5��3���s �� ܀���\"��!��F�s #��Q0��K�@����f���} ���%b� \��}�4����\"��������}�a����n� ���%b�z�k8�o���@p�1��a��Q�-�I�h�"[4�3���:�}���5����\"���1 ~� ����2 ^CP�g.��0-�\"�/(\�� V�k~s)���D ��zX �a.0�3���<+�5�iAp�1~�/����n�\ `g.����Jp s)���D �_�<+�5��D �_� 7`?א��Ï���ǂ���~+�*�@p�1��!!��'�F��~M`.0�3����a���P�X��;~�� ��p(H �IL�Q�1"A>p 7`Zl�-P@~�a` l�2�s C"��:�0��CKˏ� �!�_�s~���~@(�El��@~� �(����~�`Ip���M�˳!�i�@ ɪ=я�����Կ?@���0��(8Hd� ��%�@� [���� �M~� 8H% (؀_#=�9` �4#O��9` �4#y���&Iv�a4 03�6Ĩ�~ �m נa@���Aø��04L�``�<�&]@�����@��Q�`L���ӂc0�0ӌ�D:hF֏ �t���0 �a���!@3��hc� C���p C�=0 �@�|�~؏0��!@3��hc� C���p �=0���a�3�a0�0���_�P}�+d?ԡa��p Cl?g��(7`$����Gs*�� ��0H��ePx����Y ����0�L3 �� ���Ҹ ̐�2C0� �x`fb4�f�0l��.�� f6� !3�c�0f����!C���!B� P0e�`��Av� �X �5 �f�� ;��� �� d�`��pBv�H ���6� !3�c�0��GnR�'��Ѕ�P�~`F0t!/��� `F0������_g-���0� �` �U4 �fC�Bd�`��@0XB8i`�5����I�3�!�x?d�� c\���0hF/�� f\C� ;̸�lAv�O!r`��0Vp ����>�w\[���><���@��>�ȁ!��h����� ������a�?����R�##6`��i��_(�Jd6��0��4Q �/��� �Ub !!�m�E�l #�aP�k�2� `�`�ā/2 ll� ��d5��^�8�&6`~� �����7[�� _����� $��?A� � $Ґ�BH�p��i6�o�u�������� ��?�� ��� �S���������4�?�GHC����� ��?�� �t���"A)<�g�Xl������=�q����[���𢬀,T�6h�H �� �M�#@(��p"~“�[?� �"`�(8H@��- �|�V�[A���b�ݲz+ܭ��6��2��@p���jwK0�-!]� ��.�O@p�vU�V��(�>�; �h����� ����AR>wk�Qp���(�[3o���|�n(�@��-:���@8+�gp�@f� #7���1��� ��Z��� �_O�c�̘�f6�#�!��@.���#7@쿞���� �1aW܀� �q�c���� �_O� �h� �q�c���� �_Oa��dP/n@0�C�\k1Fn� �=�A�0Fn@P���� &� ��@���q�_ �������Is ��`|ȅ�U �?� b@ �3�������fـ0~��Uz@(�8l@�`�!� Bp�0 �+���_8��!+`pp8ƴ +���p�ǘ����q`�+�5܀�8�7�(C ���1�� y` �Q�1|�+�5��!�X��c+R~ϴX ��L�iQ|V�k���5܀,6 8� �'��<�~O�>M�Hl��D`� x"+���3 ~O�������{���i"Eb�'V�YE�Q�{��������<�~O�>�eL�V�8Ys�n��0��� ��0�SDL��)j��d��X�!0����!� �aI&� ���X7@5��5��B � �Ao� /#h �X�a� �A`~�w?�.S�\l� �1T ���ra��M�Z@g�4�t� @@ � 5`ЀR�B��� �j��@��@��`�0�lY 3����t0B � . � 0h�`z�h#���jhp�x�h@���}��0 �W6`��Hj@��!�����Ă��l�p2@&6 �� �.@��X��u$J@����(8p2� p(`���.@ X���N�� ���"@Hs�R���Z����A�)`�i-����ĠD�0���Ę@�L��A�)`�i-����ĠD�0���Ę@�L��A�)`�i-����Ġ4"q`CЌV73 �Z`l CØ0��,�:�6��!����0��p c���-Ø0��`� �0��#��h����\� C�`@�0& �#!p9 ��0& p`c�-�1\C��5��"V�`�9#+Ҍ�  �p e@6�k`+�alBfÀ-�!� r�h��� � L n� �b�rA.^� � �BR�12P�\� �@R�8aW�:��(�3��@ N h�2��0ڇ�`ܔ��H p�f� �Q0n�Ͱ�`d� g���Tx8�aIX���j̒X �f�E�a�ĚY!� �Ad /p��7`Zd l�-� F�5ܢi�-@��� �l�-�������/@��(��· ��d@�!0@�/rVr�Y ��-L��0 r�_X��������B! �3�������=� ��&R$6� p"�a8�ܓ��ذ'XB�p�b��@l@�@� �L� P`K@� ��p&��X �`du�*���Ngp@�9`��` � ��P�L� D���`$�$0<�?��g`� � l[h,%GL��4@����(���L��� @Z�)�@��0N�)8�@i|��p"l��`� (�pND&X� d�S~� �� �&�)� �h� X ���]� j�!�t 0�R�-6� �Qh ���`�� �3��8l���@� �A(�N�`���,BAC�c��! �EI`��PD� � ��P`� $����ڧ��b�6����!@� �E�؀�P� i6a�0>�Y*0��@��P� �s�� "4�Z, B���/�� �`��3� ���r\���YЀ��"� ��  �@2B� 4p9�1&�(�L�0d�( �"�"|&@�(I@��lqrk������T� P/��5l��,kp �5���-X�k0��5āaX�k��·d���X� �7 �l�-t� ?���@jB�!d�Ԅ�Al@X,(0�@K�Y` t�/��Q��r9����x1i` d�6����Cl@a ?��P@8�`( =0<��3�+�(�@Ll�C(|�o0�"x9P�@����"XY�� ��P�"�Ӆ!����6���b2�4�>�1 �8 ��1=C���8�@� +?p܁>�S@� +?��P�n�,���� L�;������ 0&�@h�Xtut���w`L�;� h�X0�����8L$0&b�E�9��\P0����  p ��A��� !.�H B$t�>��&� ��(�@A8�@$\�Pڄ(��|��DBA���P�n�� 7`�);�������N�l�-^HBV�p�T*���Sy�);��آZ`��Q-F����ZT��c��2�Sy�� 8�h C#��0�X+CŔ4 ��VCh �p���a8�T� �&[�0A��PBp���aT��\P è�4��� �;C����C��N�@�: ���`��|@�H3Cp�!X�� H0 >����  &��p;��@���� �$@ �`� �$@P�D���"���xB��qr�A��H 0���`����� :DL�p~��w`|�p$��@�:� ��(�@�Q`�(� ?�x�%aB ��(��.A�+'D���v�FAf�����D�_1Y� 6A�`�� q�� �p�F�W�l���(���a � l�s�`��� ��6@��� ���t�Q@���2b�Z �@ �0&�Z9QP��� ��C�j%x�Ղ��j�.��p�=h qB�� !�E�" f�N���{0cr�8A|k��̅O~��6`���l�� C\�1l������5\���� P &@� "~0��t8�` R�)h� ��W�-XA,x� U� Tq*l����#��*8���6� ���r*��tA+ ��� @Y� ��0���� o0"e! �� � ( �,�@G� M��؀ʂ` �QPʂ`�`IP�$(J�03@t��@~��(�F ��@��rM�Q�4�!H�%@���FQ�D��a���0�p!�a���00�hF?f l�Q!�ap �� 8� HcCp���0fͨ�e7�)H�hR�)Hc� ��\��;� l� �� :���!$�|`KD:�� &/���L� /��@H�L� �;�H~ /`L�d� � b0��@T� 0�@S��� ����&[�`p`�*@ @��R�/�:A1� U�AP��`p�*R�A]! (�0XL�� (��p܌���`p"�DV�1h��@`p��RL�('3@����R� X)�Ĩ�� d`�+����b�!H�O�5г�~�a���T~�a���t��@ (������&M� ���T~�((�i$w��V C�U؀ @�x䀹0 �;X��]倹0��� c�U���0F^�\� sa.̀�0�Bx6`�,��0F^ū�cd�ͅ1�*�/��d̅1�*Z �50�\�� �a��0�  �aƨ�AXs��5 �P�~ȱp 7@���0��cG�i�A�s,�W`�|t&�A�h�<������E\� �~���?9���sB X �`�X�����xQ�|�>�,~��/�\_�'@� ��\�@�� ��[d AJ��٢���-D��`d��-��J���L�;@~������`K�@Vn��@6FF�oc܁ � ��/�6#�p�����/��Q.1�X����6���4H,&A!�@,��y����_0�y C�XȀ�;��L�c���5��'���X,bA l�IR!'�0`�p,�F ^�`,�Y�$�̲1I��3 �,A,d��0IǢ`�Au� ��`����iF�Q����C,ZK:�b��$����XkI�"w�H,���>t�����Ax�>2�X &"lqR$��bq,��t�``�A~ �d��� �p���A��X 3nl@pV�PX 3nl@pV�PX 3nl'� �,�;0Hp���� 0x��pC�*��As Obd�MB� � c(��0�  n��A�CK��vĀ8d��t @�"2&� � L�� @ yt І�d�?�!<�9H�@E��`���j>x�/(��t�AH#�/L�:�C��u�/<��Z@D )b��ߨ�~��LC � | d� ���?�]��!��9�6��8!?0<���T�m�����0`�������,:l�����N[x Q��q�T�\����[x o�-�����B�w 8�`EJ��xp܁1�?��`����5�^�p:���\4�s���[x ��䁋F ��0�vࢽb���[&�T���.AYP�,��\��?@�r����VA �H:�ڂ�h��!ȧ��H%��Bf��P^/� ���Ao��Z��!�X���� � &-Б��8��L0�`AW01h�����F[@��!d}��JW�B{�� �@,��]AМ &a��ײ9 �@\�B[�����J07BP� r@H��N��B�h-H-��*�� .�Nt���Aj�}�� ��Bn @!L�>�� �Ђ%("R -����DW�2]�+���`�F�y ��5p��p&�—� �����-�]\������\_]���a&hQ�%���5��Ù� }� 3A��� ���`����6� p.��7t���ʂ{���5��z!�J'�O�H>��A(P� x �c�'�p�DW� t�+t�"@�]Hgb\t�3���X_]�n���Q��k8�7a��#�O.x $�5���k�0~ď�@ւ!<��p�t�3A5&�!�"e����`�]� tA����@�B �]�.����r�™�0$t�pr����! ���|�@���>$���肂A]�.t��PaW� I�L���p&AW`�+ح�UZL�Q�A����Z�}X�͡�t��`& ��2]�6�/��Bh1}t��S �F�q���5t�:Z��]�(�J07Z�L( ��5t��$�To�EBI�R�P-�+@�?0U�—pA�� �SvE� E�o� E@�@�@ha ��z��߰ -t,=�t���� ]AB(=���8�+d}�xEW� -F��!Z�|r U�Ÿ��b\���]!t�"�7�D!8]aL®����p��+ЅI(�B�@ M-@�J07��@FB���%D ����$�b��P��-& d���ƙ(��v��P �@�� g�J�L�P--�gQr��h1h�Š��a U �-&��$,!Zp&!-���Ђk�-�L��Z��]!M���P/b Zx h�!����A!�����.ax��+`���`WH--0�z�|�O[=���q �bЂ39h����L(o� �%�̧���p&|Z! ]�+|�VGHCW����?@.� g�n�>M��Zp ����`�™8]�Lh� �.DWh1h��� �&l1h�v�4�b��% ��lB��U @@P0Pᴡ �+��x>�-8�P����i1h� ¶����k��b��^q&vE[@ ��5|����Z( ����(��CJ��� ��X }`6�q��AKh���N�P"�C��T N�P v���Nxb��QBI(�/�� >�l�F�������AKs@L���N<�P:'�x�E� �/ҧD���@n|�>%� B��n@p �D�w���88�`A }n�� �`*H�3(}n� �(%j 8�t6 !3�:��P�n�:�� nQ�>�"!�0�w� FA �a�� �bZ@�7��0�{����(����6<������wp���(-a H�Q�H� G $QxV�Q�� 4)H�(�0��K EH�(��$6��&�"^l88�a �BQxD�` KD��p.�k+��� ^l@�< S� ��)lM������@�;�;_�ȁ�` �80r@��v@ƙa M��h�pf��V�Ntd����S|ʁ��A%�BG^+� �5 ��BG^�(�� ?�B��k83��M���� ��h�����:H��`x�iA0|���@&��հT��1�`n�#�<���`*$� S��!Yl+�װY�283���d1֠ �� �[!�>U� '�%pg���'�$@P�8U@�H�@���܀m �Bg�Ob54�rTX!Xs�> �wTV��ʀ���qT,A�xMd���0� pEA0W� �? U[�����+T�i���Q:`  ��-P���' [֐ ��j��5�l�-P�D��Gc�u�ba�_�5���P^nY �b` l�2$ ,<+���1 >�[� � ���+���ՐzR fc5�/�zR��#��d�z�4��(��eHXx4VJ1A��S `��� c�ZL Y�"C� �g��a\N�N83�`�; �(�<�gHXx4�����L��DNPj��&��w�$ �8KMæT��Z�n�-d"�L���V }�8k`æT��Z(j�t@��!�G���Bj �q�����Ѐ#2Y�=h�p�ly L�5�aS*fa-�-� �(��a �h�� � �P }�8g⬁ �R1 k!lg�E� x"la:�8�H��_���-� ���\��� 9&��ؒ a�8�` lؔ�YX a�8�-�  p�HHLfP�`J��`'h�!`=��J����Pw���̌'�BX�&��a�0�"�p�� `10�'c9��(E�#00e��N(�� ]�p� `%�d10�m��x�2���| R>Y S��Є" vaW��d%�����g@� �,�)�d�Sc"\jp�@6.�(�� �a4 �0�bM�Hl�NZEÀ + 6ܝ��0�kh7�� �8���6Ć�32@3b���̆Op� � �c�L�`Cl�;�!���p� � �c�L�`Cl��L�1�Jp �a4 _8 �و���0�p&� ��8�V@ð� [H�N�`�a� �VQ���^�Q� m� ##��� 8� p ��+6  �a� ��@��h�p�2B�(#��@BHOP)������ :?��P������|����0�. ����������!p�@��q�p<24Ű�`�2��*��fc8���2��ch@ ��@�v`h�cx��a2T�U�/H� G�2�+�p�p���EX�W|;� ��k8b@j`,��z�w�q`N��ò��2 d�z Ҕ>�P����!�rɚ!@`�#$l��� �!4$MU�#��@x3�T�A@ �@YP��W1C��W���Q!}(Cf�1(��P��p�D�h ]Cڐ�C�(��p~�4d���앨� ��^����c���[vk�}�qځ2�+��=0C��W���ds�Ё9�>�d��ct�Ї5d�{�B��A�d�@�f�1� 6,�P������� a��������@ �r�N\6 �)ýbE��^�+�!mH�j�1��6�;�p�P�� PQ:}$�D�l� �050C�����I"�� ��t`K�[7@���݀,�� 87�WÃ2@P0<�B�����6�{�)앨�W��kHҰz���1���̐z���t`�n �e7�mxXKJ`�2C��f� �!x�?���Aabc�VAU`�{�b��4�^Q:E�dA�W��2Lcve�����pݐ*�@F�[+����Q�� X�BK��`Z���%��6XFAx�)��&���(8H� ��4  �IE�l��t��  ����0 � xRAyÄ0 �����0 ���pp�����;�)bԋ�? �%` �zQ�Jp em�`X־a�� �,��܂� ���'�2=�|���'��@�d|3>� �qh`�[�F�t��@-N9�%�@�� �A~@� ��m(O��!8<��/d|�I������G����� 0ʡ94��P.ȱsHF94�rA��C@�!q �cnC�I0 ��b,0��I@�Cshˡ\�c�0&0���!�`�� ���IR`��!q3�8̆$���) I (�ذ��>S>xk��C�@l�g��X܀��{@H"T��Cxp 8��Y�E �P���81@�� �8 �Ol���0�Q�|��(�gh@��b� �@� �l(���1@�'6���E]R>E �P�}�4���b���n��$��j��E��Bh��4e� �hY��� p��;|��ЁvH\lX��܀��ߡ�"t���p� �iʀ��E�k� � ��x��3s�� �� ��{�����IF#��Z���s�E;$�� ]���ӔAJa���lp�� Jc�1�[�=,0�繰Cz8F�1�B�\T� ��v�2H)��CrQ-��N��p��3v��@)���:`gP � (��_� ��=$_�h���~A ���|�PP΃R8� ����S΃M�`����8����(�_�(�)t�tB�/8�C���~A��:����� ~I��� (̆"� B�/�7E@w,�/� ~I��QAw��y&L]R ��CXC�#�n�Cրa��0C�l ��0�B���.��4a��kP M�Hl��1\lX{�^ԥN��0`c�%����0u L�p&��!�/��0a�R۠K�a�ԥlA�&L]R �#+�{�00L�0�L� s�0�k�0u�a�A�1a���93-��L�נ�H3�02�cБf�alØ0�A�l�1a�DŽ�K�a�c{4̆a}� ����0&L�0�a��'��>� M�Hl��D`� pĤ�͔vA��H,(� �t%���(��2��K=S�  �20[h�0��?l�r�2�l��?�!`?�#�C4P/*A�-@P���z� �C4�� ��� �����L9H�� 0 �(���� � r��?\.�.���s�� �E� ��$~0!D> �� x� 5}�AT>7@��1u�8� �܀9n@�t (�� ����+��|�2&�c�(�ؠ|f���[���c��2&�c����E��&d�(��`B@Y(Gh�-����$�Z�-���<Z�VȠ!b��B�@ i!�������>cS�Ĕ�Z3B<Y�,���� LL9�5{�4�` �B9jo�Ĕ�Z�W�A��&�՚i2 �AYx�d��e V��4A �`����0MC�@ {�E� א� `2k�̅=�ЂB�&{E!2��>b��X��@�@J!0�܀*�Rn@ 7h!��R�AJI)0@̘���� Z�)��u�RR @nA0*0 @�(p �8���R��MI)�$����� Z�)��u�RR h�1�6px@ AP0׀I4��R�� ��-ĔR�:H))�0y�0MC�� �X�@�h^�(��CynV��<�e5�"�X&��93��b�U�e�CTpc��ᵢ��RM`Ip��Mb^����� s�t �@�Љ�4�U�T  �`�@���X 7�f�,Up���:�g��� &�YgF��1@�K �4��8h�^ 4L�FT�*#��c�U_�k��#�a� \�kh^�54�E��� ApU��@�K Ap�0� @�K����9� `TA����S^p ��3���� ˆ� �a�����]�Kx�.��0����4���Ž��F� JPVhz�_�%���X�a������� l ��0� 0�A����*�ҿ�K�!(����a#` S|�K푈2n���W����m� ���� �)>�@���D`L�aI�����#Y�5�u�eM ���ܥ�dD�R� �`h��s���K���l נ^n����K� 1į�DC C Y ��F�]�KF�.僳A� ��e�V���U]R A?p ��� � 0�& �� p M@�A@`�|�=Q�͸]��j�#�q� ���|@X�!0�GH:’ �)>,����#��a$+��ڣ.���y �.�%#b�ZC���t���]fc��r _bW�!~�0&�bb�Z0 6Bp��]2"v)� �.���)�L���0���)v�.�%�t���]j ��، A`���p aG}p #�`%H���%V���L0 ��1L���aA@`� (A� l,A�ִ'`B��_j�D�q3n��t�nm�$,p�K"0���BGX�!0Ň%S|VV `#�d��P{ԅ�4)�8��s���K�����q�]�KF�. �1\�z� ��/�+��j�T�!�!���`#�.�%#b���� ���AP�A�X�`�iN�D`M@4A��� �/����R{$���q�(�ոG��vh'�`��|@X�!0�GH:’ �)>,����#��a$+��ڣ.���y �.�%#b�ZC���t���]fc��r _bW�!~�0(b�C C Y ��F�]�KF�.僳A�EV09 � �s�F�0f��ܥ�dD�R�hM�"f��!& h�5���1& haG}���v�DŽ!aG}(��v�DŽ!aG}��� �@� #쨏 CŽ��Z(���F�Q���0P��P #쨏 CŽ�;�C�� F�Q���!8��P4���>& ;�#`�k� �� haG}Lvԇ �odZ�+rT �V7�a��1a@�Q*�Z��i�t�����!L�7rT�C��o�����۔��� #쨏 CŽ�Pւa8�1a@���aL�^��KwɈإVAF�и�.�%#b���!�5���08�`��B �q��Cւa��s���K��l�&�0�� h��5�A���#�`�4� �y�L� � 0�Jp �L� � 0�q �L� � 0 �p �L� � 0�q �L� � 0�ip �L� � 0�p �L� ���#ƴ� cZV�k`��`�� 0�i���A� :�aL�/�0��-�� ��0��`Ӣ&\� tØ�_�aL˸p �L� cZ~�1-�50AG0�i�ƴ � ��0�� ��"& |y�@�Б�#e܌�E9��=��@�FT�@0��|0a�I> FH:2a6bǐq3nqD:��� ��# ��@�F� ���� /#hRqx �.�%#b�ZC���t���]�l נ^n����K� 1į�EC C Y ��F�]�KF�.僳A��h�� ��� `���� �\� t�0AG0�/�0+�50AG0�/�0?�50AG0�/�0t�50AG0�/�0{�50AG0�/�0��50AG0�/�0?�50AG0� `��`�� 0�iY �A� :�aL�/�0�#�A&��1-�Ø���\� tØ�_�aL��p �L� cZ~�1-��50AG0�i�ƴdD� ��0��`ӂ�\� tØ�& �� �0���BGj�D�q3n��t�nmQ}��N���'��LA Q�ȄوC�͸]��G�#7 L��(��a$+��ڣ.���y �.�%#b�ZC���t���]�l נ^n����K� 1į�EC C Y ��F�]�KF�.僳A�EV0��_4�"�n��KwɈ�%0A��h�!�4 ��`.h��4��s���K`�� ��0\C�i��a���F` �^��zq�]�KF�.� p68F�p a�a|D���` �^��zq�]�KF�.� p68F�p a�a|D�FoQׂo4��0 Gc)7��ܥ�dD�� g�c4 �v�Jp �aL��\D ����ܥ�dD�R� �`h��s���K�`������ `@0|�]!��Uø�b�a�!k�0���KwɈإ|p6���  ��1V�b�� p��Ќ4̆a� �'���<|B �p��Ќ�� O(�đ8 @�X�����8 @�'�ԝ:�;B��`{P�f0 ��( ���-�&�XlX�d����8Y���� �6� �)`Lq�F���+ �=0GAX%� ��\��� ��`���0.���1���� f�,U��~@C�]0 ���A,��I,�@5�p�,h~O��� �4�Ή �)�[�@((M��8 ���b� (�"�D�J��y(*�� �3-T�p��_8�3�c��k0<ӂ#������R$cnUq�oJ�EP`�@x�O�4|�7[ �%z0����'y�߬h �HX��s�a` q2 �'���d��4l�-VZ=d��p�]=EB.���c��D��ī�$v��{I3���z@L,2q&Vo�Њ�����$8���|X �aܐ�"�f�������phbM$�&�D'`��QPm�)@���@(T�s(��X���.��2�QL,�I _�N� y '.���>lY $'F��d�8X Dpl�rb�N� $'B��@rb6� ����� �DN� �����=�`P1�X�9pAҁ]7s�ԑ"0��Q��,�@&@y�L���H �DX��|��(�"���@&@��)��`4�8K�2-?�����N�' �D��X O,��4�8[P )E��_P��>Q��a"HJ!e�D�b���2pT�(�#A�N��$�D�AЀ(C ��..X:6�'z�t�҅WJ�(��H ��t�@oBF`^)����N�< ���s�ABX�6����t��0K�6��҅�h  @�"(C�(�w@- �C�(�@�҆P ��@�`��0�O��p��x2� �h�����I�����%�G�t(���� C$� ��_H� `,���0��f�V �Aa `ԅ�Q��(E��|5� c�ˬ���dA��A00EPd X��A]��6@W` �+4Ŭ�D���H&N�t��&�A���P�����` �a�q"�G� �a0dE0��h�)��$@� O�5܀��`�"�{Fj0@�����x� ���@�HnAi�_�*\� ��܀Q�\�X �\����^۸\ �/��Q���( �c���0F�`�c<��4ƈkρ����!b� e� � ��B^@�h �c��0N�`f�8�B�����5� ��0�� #N�8��0N�h$��8�Ap ���g�c E@��T$s?L \#b� !]�a\#b�EC 8����@�i q����S@� q�0A�� �S�Q�`�b8+��^P3�H����X�"U�8�@ ����B0����X�1� �@��" �(VQ�P� @/�s��*n��x/6A�TE@�q�"��ent ��+J�_���pհ!�"�"' ( �8҅鰊T����5 �c�r����B�Ii�K:�(x �d�K6�Bl�TY쒭��q�XBl�+`���hr� �O� h"Md<�SCX��Ad _�p� �O+ >�r4�2�O4!6����SCX? �: U���zy@+f�;���� 7@Sq�����kh\�hE��`�V|M]1]́���KA�Tu�5lM�]^� �5^1 !��ViB �6�)@̀ ���@#bD4������4�@��ch�1��FD� �4� @]� #bD��h"Eb�'V��� �4���� 0"E�h��4��8`l �VD?(� @0��� �@����x � FĈ �4��@ �4@0"��`��0� ���8؀cJ��2�q�&�8v� h�I4� 0�2) ���:�;�=��d�B��b�$�E�<#� �FO�[��p4 ��_@!��3��`D Ag0"��/t�� ��! k�3�8@�8,�� �΀�(�"`գ�@!P�+�AR �2X ᠘tdA��J)&����gPL2�>�3࿑(�1��Btt����X ��!���F�PGP�>ߋh�Ű�2�>�M�Hl�]lX�����ފ��/��'���UL�X ��!����m @F���D���,f )�`,B�@�vHB(&� � �RLG�Ťm4�vAj�BFC�E �VJ1� �D<�b����[�ܦd�P܅>�7�%=x�*08�� �o$ ù�F�P+ )Xf�``o�� )sC��b��0���wh�,�Ã��H^� E��IHPh@:̀38pS#0! ����T�>x�$�郷2�Mp�`� �.􁽙."=x�*08�� �o$ ù�F�Pv]a`��`��(�?�T�gp3�3(&7��nS�� 0<�] � �*�3�h��,V�g�іD8��d4��+NB�� (��b2�Z,&7#,�P@h �m��@�"�k��f�����[��$0�<�.�]k3����v��k `�@��M5��Հ�Rj��)&���� j��)&>���� j� P: �ct�P j4����}��IF��@!��b��4�5�i8��1�fT1q ��+� (& 3� ~��� 0<� ������:,�F( ���oRcP? &��PF i�d�����I�K=�J��d���h|���*p*�3�Ϡ�܌�2�M��܌`x*H� ��fd�D��� �H����H`�.TB���O�y�p`��!�H1<�F��E1 @Y8(�W� bxl�ґ�sq ��q҅� *E�.(�t�4vC�(����JW�A��(��?�E�x ����D�Ď�d[�t���A� .B�X6 ��4#�l�D�QQ:�"�ݑ��+Ad�E�D �2 v���E��Y6�|"�'��� /��A��X� 2J������ AB�"͸�-�W��^�:��Q:�F鴀^�+��"C`;��l��)C�'��^�B�H����E��YZ@�@��b�p�d���ep���(�1r� ���o8���\:����#� ��0�_���"��0��p�Lh�� 0� yQ/� �y:�p 0��t���b؋N�&ȁ��-�����#) u�gC�i��(�e�b�� ��Y��"@��Y7`�4����� �9 o応��pb�p ����=h��ԃȅ�< ��BF�@���܀�1tĆ !`f���z�/`p���~�4����I^@�4J-L���~�Z�/`,�U2�2@W`L�/0t��>���;�4�^�x%��T�L��FA&XU����L�$RM1"��7� 02o/`��"�&��U��L�L��FA&X�t�|ƛ� �!@��X�p/��; !w@�B�H�?������ h)��!p��!l�C@-��>d�� 2� x�Y����,p�C���d8�i���t���B��� �����j�!���� x�<)`8Ó(+���d�Йk�'������C�6����`@FA@B����C�6�+!z�R��_`J��!p�H8[�����.~�06���Q0� h)a<��hZ�Ix3�!F�R��Ix3�F�R�� 0�������%�J3�!؀��f�C�-��=�`l@K�J! m0��>���!L�X��>X)Ť��}00�>0�`�@L��>���,ԭ!�F ��"K� �/�¾`�2#�/���̀ `_���/���8P�6����c�V� �&M �@� �Q���1��S$0`����@2������0"Ha�����B�� a\o�@(x��L��7���l��e�!��0ހ �-#b�0�XL�€A�x��$�@ 4@��H���ЍG��5�!�6��&��bd��qD�€`�=h��Q@�����Ixʴ @#d�d:��@2��NB��)9�?#�$�ټ�H`�2a&� D��IFLy,�H�%@� ��$ۡ�:< ��*�q(�q#z�B&8��2*� ���Q�dp(�H3�(���TFcE��6w �1��Ͱ �1! ���8,c(��U-.���1��̘{�Lf 7@3*�q�3g7l�p!0� G�$���H:#� 8�G���ΨH<#4�3�FEp���!��$�I��?AA�L��h� �f4��]���� V� ��i� ��p1P��` e&1VPL�L�� p��a� ��;b �4�vGN�"� ���!�-H�`��7`%��j���� ����T��X 9�K[ E5F�"Y>�`46�`آ�hl���Y7B@�"��� %06��P[$�����¥)�l!�M���# ! �@G�"�����&������`Ip�P �8H?�ml4���x��1�66G���1u�~�A�nc�q��w\cl��Ѕ*�0��tQ+ ˆ�`:�(8`�����N^cp'�c���x��;q��$����N\��Fw��H�p'���w2R�kt'�5����Np'「�FwB��Ip��`Tqr�K�q�� �*RE��kt'``I�1ĉ` �D0�� 7l�;�ш��܉ �.`�����8H)� ��q@Ff�����e�;�16�F����Z�.`����]��;!#� ����8 #� d��s X�l4qr��w���;�d�2b��;q`���0�N�i-6���4A��� ���w��8 #d��w���;�d���,4p'� ���Xmc"#8��}s��!������n� !a0t�p����x6��O��Q�n�M��I5�����(��7��O�1r�p��~* �F ��*/@����MxP)�A ��$�̈́.3�@��ЧF�(@7�&���@�ҍF�SL ������e��O%��h& Gp!8C���C.T��p! �?�t�`=� �u� ى�j��H�^�So0��\� � X� a=��7�F��s�.dk� ��F��(�B��%K ���� �! ��Y���+���� ��Gᨎ��������p��2.)����<���0�)�K`0���'5����p���@jp!��4�dD`�8H '��GOB q썾q�ё��p ?� >�pd'���H�s=B� a� ���Pb�8.D���������z�0 ��<�^�*@���\H�����09=��KQ��8 G�((��]9�YPU�8�d�@ X&���%C"� �BRCC`�EO�����B�`r�!�� ��5�+ �al�԰\�%[4j�����B.�2���\2E�q\H�@!Q��SR�1�r�|�Ԡ��jhR�G���j�"`~�_�I 6���h,C,Q 9�� �:l�!cZ� ���k0cZ� ��sG�s M�t9�`�#�p'+| N�Ŵ8����*�c� c%��V�;��7@�d X�+FF.��'� � �A�P+�58 ����� �@������=�a��� �#2�;R��0F�@Bh�ܠ�n�\�X ��U �v�/`%��iA�Q�6��0@���06��M0?,��Di~�� ������`�� �`)����0�@���ч�G��cx����M0?*�� 6 ����l@ �Z���B��z3N���+��������� � ʣk` ��ǰ�iAFC ��������J��%!��� B�� � Z k� gE�pz�!=r� `��� `�d�G�l�g���ā��>�|z���|pz����/��tK`�M@���čӣ �ʜ�[�� ԗ9���࿈��9�G������b=��`��{l���=r�C.nǑ�c � ���|�+!>&���N�cxy˫���gEn�i,E������ˆ �u7@>���@�#I�q�#UFN�*X �ъ��9r��j�#�9������MY}������NOW����+rzTA|��|V@��$�6@ �a��0|�JY�����L��)��(�TJ(�!E1�D 80�DHE+R$�� !pN�dL'�$JC!�9� lI�` Xb��RY���B8���?*9 �T��o au�� �Zx#%h��^" 7I Rz`@�l!�,AG�ʀ@�A�� ��l�����h`r���@���2pC�g: ;�#BJ�̂��FE0�2( � ��0�G�A�H z?)�i� O<��#l�Z�(A�@m���xJ9]���`� |�l �d���}�0i#� ��8¨�����d��͆�8e0�A0p�Q&���|�0 �� �(A |(�T/�������4K��� ޠq���A��+ڦ؀w�"A��+��8�J�h��]�� �A��+�&+��ef��)lA��F@V� X�)�H��1R@#�����'� ��M�m��D�_a�YA�@(��Ԁ0B�3 ؛9P��0}� Ȇ�ꁂ`36�-�w� ���hd0��C�� �"(� d`�� T�08���U� ��ʅx�"�#R�Lk0@ĀqT�P�"t�F�6@`�rp����V&��ad\ �]$�,2�ABHE08T�loe؁nF��hv#BV:p9�SV�*���� g��6L��q$dp+[�6L����V�M�����&�y� ����eB؊���؆zapLA�m�_���QG��Yy �� r����"% �Q�Ŵ�9�5܀V� \CWp ��+��k���#��+��k�p�k��0 AW� �aZ��k�p�k']�5�� �+�5L�0! �(�]at�k1 ��7P7�%����jnA�1�0-��(���@�\õp �b@�FAW�b\ � � �g]at�k1 �E \� A0�\��#(�]�����5��!U��.���bЁ�Q �\L �\p9]�As���BN �2�(�64���l� �2�@C��<N F� �� @�ۆD������QT��䂌�� �mC&��:$DͭBZ� 9A0$�Ћ�C6� �!�GҠ�܀|P �Ks�`47"�F�ln"r d�)���| � C~�\�>����+$4�cP"�����a � �a��X��p��f"�@8�e��4774��T���#� �jHI#4�l�9�E�JI�4�l�R���B���HdA.ʊ47�E �3q��2H�����4n@�� � �R�,�t@18��ֆ8��BM gp������'�r`5��0 �@- "���|@i��t�H��,�y.�A��$@.ʊln���H�t&�A�\N$�6�h`c�:�fACh�#�\0�����0:�kHds�d f�r��""�����j�� ��E��0[\�-`�=���U�y4VCX �[�l�*�E���BV��-�E����h���� �J#��g�� Yu�4�l� ZE呑a���S�E���"[L�t�� (��HY�jd����6����fM�i7�m��"����P} @����RPj@�Q��� �RD�H��� �R8J�(��‘� +l�PV@�`�P�%+`���#� E`{���%"� (��l� �6���J�(h�Z�D�Q-�Lh�%rmP-@�8P('4���<�\�Z�*��&�jOy��ٻ!`S�� ��4x��16�2 T+����ܑk+@�$!�0 ��9�,;U� ��'�@��ڲ�;���,��#��� �!�Qp�� �;�5����>��7`�Hא>v�kH`�G��Q�#w�(2H I9$}$���E�GIy$}$���I�G*I�$}$���M�G:I�$}$���Q�GJ�)I%}d���V�GΥ+�#���̒>RK��-�#����>�K��/�#��� �>RL��1�#ɤ�,�>�L��3�#Ѥ�L�>RM��5�#٤�l�>�M��7�#ᤏ��>RN�II'뤏��>�N�H<�#�ܓz�O��>�'�����zPJA�'�ԓ��P�I@Y(�$�4�zPJD�'e�ԓ�RQ.J= (�����Q�I@�(����RO�H�'%����z�R��J�'-�����RObJ=�)���ԓ��S��Ny���ԓ�ROJA�'Ae�ԓ�rT�IR�'K���z�T��S�'Q��L�zRU�J=Y(�$�l�z�U��W�'a����zRV�IY9+�$�ԓ�RO�J=y+�$�ԓs)W�I]�'w%�ԓ�RO��P�'����RO��`�'����z�X��b�'���<�zY��d�'��ԓʒY�Ie�,���t�zRY>K=�,���T��RO*Ki�'�����z�Z��j�' ����z�ZbK=y-���d�zR[��C�-�$�ԓ��[�Il�'���ԓ�RO�K=.���ԓ�RO�K=Y.�d�ԓ�RO�K=�.�d�|�zR]��u�'٥�l�z�]��w�'ᥞ��zR^��y�'饞����^��zi/5�����_��|�' ��ԗzr_�I~�'�F���zrj�K=)'�����SOL��'&�ԓ�`�Ƀ�'��9zRQ&L=�0���d�z�a�I��'&�ԓt2b�I��''����z�lUL=I�R��$[SO����'��ѓd c�Ɍ����ԓSOr�P�';����z�c�I��'�� �zRd�ɑ�'If�4�%�d�L�Y2Sf�T�%se�L�Y2[f�dS.�d�̒ 3c�̜�4sf�̙i3g�͜�8sf�̙�3g�Μ��;u������wv9�<}������wO�Y<���<��s����<�'�d�̓y2O��<�'�d�̓y2O��<�'�d�̓y2O��<�'�d�̓y2O��<��r��zFO�)=����zVO�i=������zfO�=������zvO��=������z�O6=�&���s|BO� =�'�4���|BO� =�'�T��s}BO� =�'�t���mB�� =�'��S~B�� =�'���гQ�O�y?�'����z�O�?�'����z�O��?�'��z P�9@�'��zP�y@�']( ey2O��<�g�L� t�2��@(ed �2P�@#(�� t�2P �@+(���V� �A7hv����K�.?h�l �~�*BG( �%Tx�P�yB�' �)Tx�P�B�' �-Tx�P��B�' �1Tx�P�9C�' �5Tx�P�A�� �8Tx�P�C����� � OBiX���A8 lѲ $���  ܀pPȴH{e�������Jp ?�5 ��\îp ?�5����h}W�5��p6�D� 7 ���0� ��+?$�� �kHI�'�,��^�]t� �pxB�I�'����~�(���a약��F( b ԋ&P ~����&��� F( g�'��]��LHI�'�!��M���Jg��1 �(7`Z�A7 B��+ 6��1 耠�Ia�|��s�̍S��B (Z`n��8�e �`�0�i� \] �Aй�0��k'�"��I4�3���� �p�H�y����Q�NZE8!�n<�I4�����!���=b\��I�'���Q .�b�:�6�.p `TйuFèk��c�Q� �D `4�"B�`V�l'�"��D6�@kt&�X�1 �(xƂcD��@����ӂE�QA7 ��)b�E�Q NF��؀5\ l�-����[d���-| ��c���l�8�E� ��"[t �p-86��n<��p�h#@[aI,���WFqZM�5��]�V��xf4(4�pF}J` ρc�QLr��Xh�6֠n@7�b����G�!5n���\�j8Bl85���ȓ�ѥ�GI5h� W�j^��Y$���Z�bL�=�&�� [4X; �v���k��=W �ěU.�I=W � �T�FF���]�Sd�F &�Ƽ��T32`9�#ӰQc�jrMP�6�&������16��#����*��#�5\'ո ��rG� E��*02&B��)�@q�Q�X��x>�#ՠ�`R��H5o�ՠEr" �5�& T=`0{@��� ��7pj�@��5�h�csl�@����S�6�r�I�9$�?��@d��V@�M�17+�z0 Ebn��@h��4G��Ar���A���h�zh@��9Zn� � w���T[R�-7," ��"G��?( �d�"�@�^1AN (�wo�B�CQ�B��rcn��O�IH�R"�A5��롁0`9�Px�a@��sn����z����7jRMlI5r�ܰ�0�"�5K⍎FYc,���H5�eތ�7��-7���T�&�X E����T���������� � �!��פ�O�jЀ�1�5�9JG��I5���\�� pX��"��@CJG�!5����q3lF�����ܔ�Q�nҍC7{aT�@C�I� 5�������Q1��F���Ѝ�� �1 ��"@C�a��ŤZ�n��`v��I0��(��7��j�OpDT �8�nt��T���A�����j�Y�ãyT��?%��1;f�l���$�X~��S���GTS����ŕ�؎Yl����$�V>I�K5�h�3Q�j�1ӣ{t��$�G�(GУ�%�G?���, �0=��(G8fI�)���H��b�7�% ��`�~��Kh�]�$�G�pD ��!�Xs�A�Ap4��R3oF�-&��4�R��7h@��>�7������'P ���C�' ��;�j�� r�ܘp��c�1��T[R�-7," �f�j�������j2X  �܀j�\��h��C@r�(��%���9"KG.�E=T? �GT�@�`p���! pD����z(+^�x8����Eꡬx�ap���2�6 ̺a�pp �5��UАO�jZ !��U�)�j�ͫ�4�D�4�,�I���8"rSn��ݠF,�́�pR�?C`�pR���0 Y���~�#J57���Ɓ�#B����0l��,"�t4�@ @��� ��8J,~KH5�ƫ�ϑj:� m ����h�j��!ǂ�@��G�7A�P0 ���F�����X ~�O�) &�;I5�����������T�m~X ~�O�) 6H?A�I5m��4�@���qm���X� ~��J5��ORi�j<��q��m����!�`bD���$pHk��J�4դ�T�j�TH�?��I����"U~* ,֕j���>�f�4����S~J� �n�j�M�~�ߠ�,���O�I5�#�L�W�FyX {T�2�7����{��Q��G?@�h�'�t?�}R��d[L�5Ri�o`�H5��O�G�>�"�SI`������R8�@)����&�{(y 0(�p,�±8�B�� Z�� J�X(�c�H�E���������$��R�$x����TA �!(0�EN8I@)�cp��R8�"��a��hC`L[4*��L�ƑV�Ah�'T�@��h���D��a�NH ,V�,���s͋�� `��A$�!HR � ��$����p2`�-� 5u� �����t L�"� ���I+�L���,X�L �0�Ɓ&@P�Ё��f��%U�qL RIy�H�q��`�Q>�L�H�����(��f0@�"#E����J@8�E�!���b�Q>9�\��s&���o�� �|&�P>��cL�< �H� A���|n���� �2���:��t@u��3 ,��o)�5f��[�'6L�eIQJl�x� P� y.d��J@F��GRS(%6 �ؠ|n��8]"6 Kj���`�?�e���%qI-i�`�Ԓ��KjI-ix0"��#@�~�G��N�@H�{�%C�P���B�R�%(�L�I�6`�P'bF��٤���N�sT����1B�� �B��5s3�Dz�wfb������R�d���޲RjJ�O �7I`I��S�F�*M��I��'U: ��X�ccl�E F���x�4����1 �yc�a�҇1 2��#o�����%n�"�YA�Vj&V�X }M�(3�JWB_#b�01�J�P+#�T��R1"FΓi��4��'1�J[��fb�21���B�+���$@�J�D_a"��ұ1 �E*M/b�A�ұ� �X f���3�%��*e�b�A�/3�J�,#�4�� `&d�+]u���-V��P�y '���q��#f���~�����R`�J[�� ���Y�.>�W ��+f����0\� @@�bh��q@�hE@4�p.�h�\�� HH��Z�@-�/�"���RK�E��%L0�2&1` ��[@ �`��d��@T�@  m@��� ��1�����–��`Ko���<�g@�K��g�؀{0]� x8(�؀g�3x8 (�\J����5�Q�~�i��ܤ 0�Q�� �L��\�ԸI�$ Ā���b@�ȥ1�q܉_�b@O��� ��@?�% ���8&�`0��L�Kw)�*�4��� �C/ե�40��!b�QD.��<��0�?�'�a �F�?���CPW(&6�"D�0~�/ �tH����� 1`��0�M�E1�TL�P*�((�`��C @��q܀�� �@��\kq�n�2hc$��4�Q�I��0 ����el�� �� \�i��ؒQ��#<�R-�x>�Zl�-V�(����l�-VZ����Zd az�� i�vM�@b@��]��$hWp:�M�2Iv�H�-�dhM�2IFJ�( ��� @V`s}L��+�����'���4�O�#� aElt�b �����j@� �R$�E S;��"8� xp,���/�>��}���,J{%��P*�A (�`ISJ�(0�3���� AB��(�b7� c��!g�cL��k�ǘ`���qL�I��p p&�1�l�Ѝ��b�,�h1, �f�@`,�4�@�)�  ��LW�8����e0�F�Q��l�� r!����T� r c��Qp���A�^c � �{� � [ȗd-���9��� ЁiA��-��Y�0 ���M�� k�B�(���.�@"p���L��2j+`0S@�L�R;FD�:Sf�u�9H�����t��@8H� �"@��� ���E c��Q�-f��K��_� �AG��ih��L�g*e�@�3�����=f��!`�hM��t��{�{�i4����l��c~�4 `5�jJV�i���О�c{l���5��F�i0  (��ԎkH=]!��@VJ1Y)�$�e4wA�I ]��@;@XC8� Ť5`��k�  )��b��f@FK  x:0-@�t`Z��-x ��-٢!x:0-��x�##�Pl> E��2@X�.� @B�H��\� p��P ���\�$� �@�/�� $e�> �5��QM��`�����@XC��l�6X�k�p�!��7���L15n�~7a ��� Ҙ�&�U��D�g��@ �`Mm�\��š�������v�U@$18^�� `7��k�M�) �� `�l�MGA6զ�t��k�`��?�Ґ;хqT�6� *���2�n��4��0��0wdP�K�:@0���;:@7U^�� ��bp0ޔ�vo�MC�ԈЁo���p � ��C���^���D��a'D|��`BH. a� x�*�G�8!^�]�1� NH.�U`u��0R�L�W+���”8M+}`0��6c`�BH ���� hJO9���{�N�H�4�����Aa�ҍ!@N�B9U}���� v@s�|����$��80��0�t�9Un� ��@ �+�M����P��C8� T����a(���T�&pBr��p ^� ��C!h'$� �@���.�/(�*P�� �^� d���� �q�/(� Ah;�fܐ�TG���&sal�qC � 1��t6 �"�"�ĸ1�4�� bȍ��ET;Щ�0��L��q�Nɍ:��T�31n�ĸY�$�ܬS�aK�N�� ��� v: � ��&�B<�n1���x :b�,�q��Mk�E䦚�qCn�i���ܬ � ��(7�$�r�F��x ��9�E0n��C���0��Di��`&��Y `��2BnN�(7�e܌�w:nF��)����qOGA<���L��Q`&��7`b���0����eh4�� �R�� 3���`Xu����P2�((C�L��y:O�DR�e��)�c�~�m��t85�ē�+����q�N͐�0��Lt�{�O�x ��>�X��&@$.��`�@� C��� @�K���#����G�c� �4!�� I@5d1 C��C�_p��G�b�t�gC8��#��&pp�1�jrI3`��Z@#�eiDa���r2R���'� �W� ��� ��1�?�>��C��� �������?�G��C�����>��C����H���Ԁ!�> �����R� � ��_� ��W��_x( ��)��"�aБ� 8�2` ����[�B �c5���[.���-�p91B�p]��[؎t�Z�P��pP����*4���J�'X1�т*z P*}�� �! �u�r�\�0\���2 � �Q���h�:�/8@.1�a���p4L����(% �A���(I�x���0�P�)F�`�l�14��H`����F�PII#[$��-�FҸ�[d���4n��}�d la�n@��M�"[ȥ�-T[�٢̀�� jV *����0�Jè�� p�������eP���!� Q1�� +�T1���'+ppR0�`��p T�P��k@�� ���*��b�X�n���!P7�4�f �݀Pa�;�$$+� 2 P�=y#uD���`�B�`D�4 ��PjCu���a���PjCu��Ba���0�EV� ?p�� Q �@͈c� c{�z�O�>!�b"��"�� .��a&�D�=�A!L�5�0~��ž��Q@T8� *Uؓ7& �+����;���+��@@ �q ���b`�NE%l'HY�`L�?^`�0 � q��@`�NEe;A�� `D\�( �`�P�@�A�� �q� �('l��@`�NE'+��) 0,�Ee;U�����NE]5��n��c���0`�2���Ć��%0����@ Z lx�(��B n@Ii�ذ$n� 6`�bbD��8S3#aT�pn�ɨ7����wn@�nAP��p0�Fݨ��/�qB\@����@�]�0 (t�����u���H <�|��  @PP^'(�Q/n��0���s>�2@$ʠ)�Jp�E�z$L�r`lP��<�d�0�S��)��[���q8#���+ P0B#X ��n��A�  `� �0BH�E�^6�����m�0t:0��`lΰx���� 061�Ā�� �4@�!6 ��T~� H) �m@�1P�� ��,����:�Bz.�'���2D�HU�%+d��RDjHi����GIi$h���RJJ� �^��`�"HE�-�ԋ� D��)<�{A> K`)����w`�@),!�D��A ` �#�؁�I^@Jy.6�l��T@0 ����\� ���<��"KR� x.^g�� ��� �d��ֳDIe�%F�����IMd�<��BtHJ���DR��Q���(݀j1���ӡZ` 0P-`C � T�ul�*ţml�-�� '�|e0F�x\�V l�źX�q=����R� �m�m4��@U�S ��@��  54#���:X� ��T �f��M�5�S�@j�_�@� �z��x t$x��Ԁ,����i����26�(�O��` �����z�؀9`Ԃ >dx�ObL��E �̩��R}��E`}|d�6���C� P ���.� 4@P ��� � `KX� �.`h� �� �#�#� 90��"@�!�@ �8i,�`�q�X�������0:� ���A�@Z���`��P�Ic�7`��`-�C ��Ʋ!H�%`�0�� �` ��!f��n� �0Zj�XY�0؁0�F#�a|� )HM�&5��Q0n��(8A�I�E��4lJ<���3q�Gj��I�&>��Z�R�{�g�iԚ��Y.g���—� �H`+�0��\SS�8g�P��� � �Y�!6��;p&L��!6�܃�@ T��?`��nc>$@x���!�Cl�=�6`I؁ �$~H�3�̀�0L���q[�i�-ޔ3�o� �  q[��m/����Q�+�B�x��R:�Ax���5@%Ab�@@��O#� @0 ��m�%腽P��^����9�a �%0��a��� �@�K䐶���D�90�P��a� �3�@$ �EzVD�`b�u��*�BT��@�a0� 1�jY�BU�Q��F� .Kjy� �G�`�lCL��Z��P�g������%��@)\�K���RP �"-�0T � P ��0T��l����p,�QEx#(R��=1c�����@TJ�20c���!�Fs�$���AT̄@�"fbL��a&��f�LU�bT��yIU��@TĀ�(��¨��7�\Y B"]$ e��p�+s�dwa�@� p%(�x�BV�`d����(J�� `5x��j���� �4e�ʑA Ru�#$Պ�%B �xY�ā�0ǘ #�(0f��h ��a0 ����lp��0è��d �/F� j��0�z�A~��`c��ap�M�@`I ��?�����Q��A���q2� rQ)e��lBfF 8H�!@b@ 1�� �w@ �PE��^�T��p��(dE@L�/@F^%�i@@ ���x@EP���D @&@�-���¸� $�:n"H �w �@�Ze"HN�1�D��TiC � L����� ����Z ��� ���h�B)�c���R8�B) �p,�E k��$��BP�B)����@���(���0��RP JA)���?��� �E$�PO�@=Xm5, ��,�j F��40 ʐ)C'͈#�fCSiK�n�z�I#a��� ���1'(5�Db��q���\��$b��yW 5���Tk��S}�b Ƅ��P&�D�!e�ҁ��.ҁ 1&5՚<N��JM�7�q�1L�+��!VJ1)& @��RL�(&+����bRL`x�$�gn�*�?��pc��a^�b�����@ �0 � ��`����H�'� ��� ����@�WV,� �`�y� �����.��q�E]I Ԅ$b:� ��]�&x8���7�/���.��ׁ �"��Bl�8 �����DRH:�` �!�1B�QUiHUq":m ��H���1�T� �cȀ�@&����Uuu؀�0��2UF$�6��a�(�imC��UeJW݁\ duծ�U���j�:xU]h���W�[ 3 ��@f@�i)3����0 � (0P�̀0܂ �!� 0�@^իad,�� �PH �d� �&�?�{5��XBIH� �L �m�$��U"��!D%(�>@NC@D}�U(`��0�!(�W� 2h@�U���P>9 o���|�*P>D%l��*�0�����t���3@w���_5h�`���!$��hfh����#h ��1�Gw�0Y%�|�AA�L�@� xڀ�c1h@ h_qЀ��������E�:���$ h�c�o0@ �4�Ԁ���6�`Ё @^�6�b:h�c��] �I@(�0�"P�@$ r,��6�5� m@^�R��5�T�q��Bh�5�'�aYUTX ���V��O�F ���PV�%(�)��p�"+�O�C#`V��H��?1e��Q2�j(C>5��|jˠ+d֓p YAxN��L���B���a\��+��x(�3$��X�J���"�0L"p�e l֎ �F�>⬣@ɧQ��`�(謣JϪ�8�g���v##"��J ���~֕@D�>�=�J��PZM�>�O���V}{P�h=�����κZ�E謮A>qЊ .��@qV��Y .��A T�֊�E(� ��BT�D!( M�,�,��@ iX�$��>>@Vx 7õ&�$pXN �( ᰜ� a��\!*M�,` Dˉ��絞�m 5���0]b�L��rbP�C81��Ĝ ΀&��y�ۀC���[O Y 0L )��b�l}"�>�5`x�I91ld��� 0[�����C��jP[A�81l < 0r z� �0 l��F���� ��Hz9�Jdлr:�%�V�` �/@  m�{�C��A�)�b��1Xȁ80� >�S ��|9�[ r ��]�{fdrk�`=��;�L� w��Y`:t��ˀ��m��ӓIƀ��<�@)�����8Zx��(�ܚ�3�6@���*�� ������m�[��,�! #����`l���^�#��@Fn������ fT� ��$�qȭy`6L��1 v�2�H�5� !`rk�u�# +�c��j� �U �Y�[�@ߑ�#��� <�2�`��<�c��1�`�H@��5�Y�P�?�8&��3 ����oT�U Q�l��d�l6�re��#d� %�O> �� ו�N�F3RD`=�u\G�"!��:���\It-�5���21�k��  |q�e� )�`��A(@'^��,���\���9��G���#]�� p��G�&b� f�b#�!,�O�n�MCX$��LW�X�;iӕE|�Q�nЍ;���ݸ�CZ] �3,�Jπ�$�Ɲ.�E�I X$�,�p]c�X �\ט�H>�?h�9,ts 7�u�8#��>�+v�B�� �ZTô0%`�8���n@Y��I� _Ѕl��x 2+$�� @� �c��(��v� i�a�2�WB���0�ap������b��f�@6�k` �a��5Z�'( --��"�"�w��uW�W��]��x��,��O�bL��(��>:$ʂ�A -�5̓��kY�=�u+���`b��(H��`��}�k����ؒ B�}(�����?��w-��aW��p����L��1&� JM d���蔚~H��k��<�<�CR� HMU��4���)Xi����Iz% �J�W{�^I�I��!Xi��zG�+i� �J�׬�e��8�^� ��`��kP�ޠ�f� pb��q�TT�u^�NE5[����@�PF�5����� �ad��. ���a،i��3�6�c��9�0l�P��a uaK�ӿ9qͨ^d��3DJ1"~Ɉ(��A��zUߦ���8�:i ���W��!� {�D��v!/�6�k;�c�z��+(^����G���a��b�I#p�qAZ���F,���#V��+t��"���_P���F���cd��E�`� 0�ց����" U�if÷��#�ȸ� n�R2l�� �?'D#X�z �a�<�$��.��^� ��� (���!�/�E ��G�pH�l��5���q"���{�ȅ=������F�8����J.��د����:c��)x��!�-r�_�� hb�Z�#���Bʖ( d�_,7��` �����د�5���{Y��(�@=�#Dr-4ׅ��`�Ɓ-�� �h\� D�H���� [�ש�-�+����] ͅ-�����B�`HJ� 6�Z����SK� 3��q.����'�Z� �P�à#"[(�P&�b� ���P.� lb�6�Q-$����6��!0` ����:�0`Ɂ �!� ���CN�a9/��\ � #�B:��-TQ�E# h���X�"�$��ht�nFA��`L�i �o���Fd�H�D�H%��5�lQ�d�H>�FX,�E,�O�L�"�$��.�O��'��僱����q#,b���`�n��Y$�� Xt3 ҍ�`L#H�}�(�5"��J�D�H�3��R�EeD��IH��E|�{]�T��S��6��+,��Z,~���1�"���$(�O%ؒpG�A`�xԇ�P�J:; ȁ�x��~'(���q@lj�#OA���:�/f�.� �p̂]�`σB�)$a��` �����~�bA��� �D��.ı���X\�c�2@�B���@dC�j&�d=0��jh>`2��|0 ��)�d�F��� �'�WL�?`BAA�R���4u�2@#�Q���F��uX ��L�?@H#� �i�0g�C#� � � ; \��r>� ���C��)� �B�#�-��t����!zD�\� ���e�@hY���Y�ev�:{��`��|@���|��5���dh�Jl%� ؘ���F��G#� �4,F�, �`�=�S6B�0~����`B��GI ��z,�*ps ��m��8�K�� �`�@X�!8BW�;`�J07,�8]Œ�s�(�b�X��p L���+ ����ñh��L�+@Q ��@uHX�3�����`�6�A#� z`:�����:8!!�!��z�:�PVH�pB(,lj���"$�d�h���*�BΙp wXX��� �!��4�BU� C礍� k&ԇ�fB}� P8�� � N��F0U�T��^��<�b(3f����QG��Q e�̰Р:LBj �d��,(�����~V�aV:��� <Q0��+�� �h@)�` �G��m�=�2cf��8I�D6P��%���09�AH<쇝�`��� ��-^@G0"7`� 3an�k�dqD}�:5 �@G ``� spA��0tc�u2�N �� �EŘ\� rAVM�Hl��-�`I"vĺذF��07@�"g���Y �6�+bo� �WE�ȅ� �`� ��`_9#v&�k� d�r�خ`b @ؙ0�59#v�Մ)��/��/�L,;���"g����0z@���12��j('�� &P�� � �12^@A%�t�0N Ƅ/���p&^��9s�`L0ї@,8} Ć��ӗ@l�U���~ў�b�I��0`�/�X:�6��7�K+V�`��`OX,"R�aC����S�9A��֌4q&�Z,]腉����?F�Hi#m����6�F��#M�� ��Z,]腉����?F�H }@�����b�C��&�[��|c�� J���f0�O�g�)5 �R1 �Y6#M�U�a3��Y6#M����6�F�Hi#m����6�F�8���)ƌ4 �`l~�5#m����6�F�Hi#m��3���S��#m����&�`�:�O#�IԚ��F�Hi#m�� �!N9�'����p�R�� � ?՚�=p@� FC���`4�B�x��,x��PF��- Jg�� FA1<�����Q!2�b��X�@ck,2 ��s��n(Ya��X}1c�� *RcC0-[C#�C���p�]����5�@r8i��-�8)`�0��c]C�'`��0Ar,'`���+N��L0�c�I��p p&��L�X�>~��� �AT�Q!2"kd ��5^�� *DF_�� `4�dhañh��0|,��Y#����R��PE? &�?"��Y�#� �5�Q!2�b���b�� *��~�>X H��x�o�@�#7@�4 [:�`�SA�2����!8���>�o�Q0n�M�*�jȒ #�`l�!�!T5�g^Őm�6��>�U��7���)~ӧ�O�S�&T �>�o��b������!ۧ>X� �}jߴ�xڧ�OSTôO���O�j��Ȯ Sgdʼni<�}*�"�א �M -`pv@�A �-䁑1��-�E����ڈC 0���0H � d�0�Z *-@a�$x U`H�9�t������‚ |M�`N-�a8K���H�{P��d ��� ֵ \ �$t`�'�GP(���:0��-����|�Q�NGt� ���:�t# �t`Y�]!H�0��A� ��$@'��p��1 ��p��e�t$�h�D*��0: B����5 n�6����`�H`FAV��`��2 ���M���2$�!.�j4Y�3 � `���Q� �p����>N��8*GU�F h���Q�!�C\F����}�@��!+4�"�n.p �a�Q�doqq �a`�Q�}n�q �a�Q�d/�(`����@Fq��g�� �(�>�a@�d��ą%��'�}�� p���`�]�����v,�H Pv8�~�/ 80���AG�؆0�i (��)&� )����劊R�l� ��=+aLYqr6�('S��j.q�D�Z��UVsMY++N��T�j�ĉ�u@e��梲X6 d����X � �� 0 �lȲP�B��[Yx��,����ʂ�h���BZhj-6�$d��(0"F��1 8�( JG���;`7��].�Ih@`D�Z@ i���P�� b�#�$HÅ� R�!����P��h��@`D�Z@ i���P�� �.4�P�@`�C��0 �p!�� g`l�q�x��Fl�30n�7�K��nDe�%Q��� �N�8%)���V����*C� _�>�K� (hپv�� �k@�j٠�e��� Zv8���,��вC������2�Z� �5_0����� �9p |A��h�#|�q���8AA����e�Z_�}-hY-�,1вā\�� ��в/� ��/�eWUPв������ ���� Eh�n@7`���q�`-����U@ n �@Ђ;�"4@P)b�@� (�䓤�!�`� ��� ��O��� (0�|408 �@4Z@�*@��^���4�B���� h� �� Ђ~� ()���@.� �h� ���:�x%C��L�:@1���6X�� �8[����&1�@ @� P �.�e�җ�'B�����N(& �v_DUN����) x��M���&��"�J&��''_f;�(��x��|��O^V,}Y0{"@ �@̺�\� p@dA\(8b�d�\(8b�f��!�`��c̊Y1��l)&d��P� p����A�Xbm�bV���_�.F1��@̊Y�B1�"�dE��@HI@̊Y1KfŬ�"X�`-�E��"X�`,�E��"XD�`,�E��"X�`,�E��"X�`,�E��"�bC��@f`��?0M�@�7�8b�f��}���Y��p@�}ȊЁ�A.n@B�eY ���n�'1of�� +�rb� ��P�>�@V7@6|dUf��"@0@6|408�ULAYi-d�� X��"�H��@ ����V 4[f���٢c��j�A��h6����f3���)?!]ԑ5�f��j0�a0�~�$@��1mYU� �!�,R m6� �@ ��5%�"��� l� f��/�G��@�!�:d�@2@�P)����ق `C������t�>�ZO� �!]� v2Z���$��1A�,lh ��}������<���@ 6���NZ�g�P�9�,A>X��8L� `I A���0y�q9�8�0yF> ��8�Y@14�(�<������2y,��Y(d^Ü�U�����33^C��� d� @B�U�� � ����P�_BA�i�(L`X�(1�.�Q&@(�/@��\�LBK E\�0?d��PPf���j���̀��� 7d��1n"�-�3`�D��3 ��eP�.#A�M�g3������M�8��q3l�M�(3`�$�;qf@^ͫv����%1l"� 6I���UE0HH���� ̀zQ0P�(7�f��ԇ���% �< �;;l���% B �$pg��s�K'�*�$0lJE���'�*���f@��! ��"Yd�x8�& ��U ���& ��U�p� ���Lm��&�6� ?�w̆�\��l��%�Ά��,� JM�e6̆�;F�Hó#m��ّ6�\�Hi# Y��ZS��Pc���`&�68A��6�#1���N�)���h3n@W86�d � l/��fSk�>l� #I��t���O�6�����+�Q �髝=��B �7����M��ݳ� h"=�zł� �,<��2 �40<��.�c3����y�,��g{U� ���>K�A��r$ݡ�HPl�W�� `x��@'��j"=��H ��@�w�vX�4��~@!�RVC�`=� 5(��6 �uH `c��\p��jX`cp$���� �*5̂,6fAc&��Y��Fg����t��� �8� b@��f�.� ����� V�������y����b`؁\`f ���a��Y��:՟M�ɰ�h-�8�l�)�d�"2����7�%�ؘ4�$5̂�� ��P� ��I� �L����dQH���b�&�azʌ����̘]6&�"2�a�� �l�z!N��?X� P/�)�؆n� ���x���^��k0 I�`$r!L]�0@����� �IH #)�� �S�Sx������%�† !`f��0v�z�$�̌�P��n����qJ�� �'ĻVxCY� ���xWԘj�`�E� � �B��T ��4�VG QiAB�� �|�O!�w�@�@Z��;s���9РrJY@ �8 �1�C�"�(��08rG�p ��dL%@�!* �ز|��-�����!5\��hY�Bj���+M:+ǁ� ��`�nx�`x@���6J  X>L�q *�Ƅ���� _d�m� ` �xc������a��T2�@�E�b��B� m P@j� �Ĕ���Т�C�.�@�(�d�m�c �@�E������6@W@�">܆�G-}X@� Y�l�hm0!h�&P�0��` T�l�E�^J6$ ![(��;�@Y�ʇ���2 (*X`�;`(��@���,� �� OW�bj7�-40���v�(4@�� ���1 ��^a L���WR��]`t�#(���*��`eio8;���t�`�����0�c �I7�6h� q� �رݤ�Tti]l���a\�+v� � `��B�V�Ӆ/Ӫ4V��2��u&�p�v�nD0|AV'�"��Q0i)�(@7�ݤ�Q�nҍC7��Ҷ;1@������RZe��(�����F�-���!(��'`b�t�\|���2�"ςn6@�B7�ݤ�Q���y#Y��5�"�n@�s �aP�Xs� � g�cL�'��Τ�5��O��k�P���7���K�M�q ���f�p� �رݤ�4…��L�X�nRQ*���6h�]�0����L0q�t�k� +����iU+�b�V�:]�i�Q7"� +��VN�(���v��Q�n��(@7�F��NKi۝�b�P�XSi)�2�t@QQ�X#�UR�@Q�0�c �Y ��ntcR�gA7�O��t�nR�(�o䍼���ךH��7�ݹذ(m���L���1&�r ag��Jۧ\l�5s�OY�N�Ď%�&ݸ�`i3�F��L�X�nҍk� �B�p&v,@7�(]Z�4®pW��p&��b��5���p�t� ��*��d�L�i��.ܴݨ _p��@�����02�lj����>�n��(�&N��� �� I ���R0@�*[ӥ0��`�1PĠ���0. �1��l��������2[b���<��nlXY�`���5]nl�Ӆ4�, �@C�Y�ae9���i Aٚ.�@:���P�oy [�5l���?��0[b�l��BHPfK ؁����B���l%���iP�@0āŕ_�G� �`�j�i��`$�� �vS! �6�8��B��Ej 56�8- <���^�@0!dD�4�H�86�<�M0?l��E#�̏SQ��8٢�H�z�R����8��T��P ɠ��T#�*N�A)��0��q���=ϥ�Tq*J��}.�g��S�b8O�)��v 1��ƴ81ea��10-X��+2!��l� [@����$@0|@��v����V�6@��8 ����H�� _�|�`Q��h�C�A�<��W,ժ�lAV�j !CGi��A([�����E�K1�����0�H�h�l�-i`D̖�� � �S�X�8i�fk����%+Z�Y:�f�pV\��v�p� /S/xO�c�����2F��-[��՚-�% ��*�6�D00�o�7&�x�MU��eA�F���c l�8C0/`t�ٰ$�R� �i�� ��)3�8�:@�_���� ����̆ 0��_�vL��0^� ��op�Sb-Zp ��Ϣ�2Z@ ~-p+? Z@ ~-p+?�2Z�V ������ ʳ`?���l�z�# 0�g��E���R2ԁ�e� ��p�� B ��,ďQk������Ƞ�+\�@( �a�S��(����Z��g邟-~�.�Y�@T"A���D%��?�D��~I��!k3@1<�v7ď��g�lY�AD�p��p`�B�*|���?K�UH90�v�?K�Wpg{ �bk����*���qkq�A &� ��:b�ނ�#~�A�u�x �@&ď e�2T�~�.�Y�Pbm�o!C����+�DH�h`p-�F}��at� � ~I��!��W�k���(�`l@ �0?L�[�R�h �"�� p�&0�J�1I6BTH��02��8����!�@�m�^��:��&���X(` .�m� ��ѡ00����U��C �@�B> $ �vmU�0���rG?T~F����pV H�s�XXQ�8 ��4��Ӱ�H �l�/@N=���c����@�i�  X�gx� �"� �0 ��.�`\ R�|�6n!<��Q��f� �3$���f��� ! �k���v̀!�W6�s�d��Q0�� �C`��0< �̫x0��$�[� ��x0��4N�#``�Sk����� `�I^h �kD :B.��'y 7t�*P��0؂`ԚK��Ԍ93h` �QkH�P� 5���F�ݨ,�n ��[8 h����#d�̒x �X�� l�B720dt�wJ4X�@؂�`;����!�^ [@@l�U����b2�20��iC`�"oA����(��=+�px�!h�E1�O�^�0$fCr��"<S������ c{&����O�` ʓ�lIB�VH![>4�ғ�� �@$4\���_X��lK@�@���耳�~�E�]u�ܢ�T�x(E� � ����1Np8 �+�qU��*[ �l��p*���@Ch�^@���� ��l�Yal4[/ ���kRN64p���* �-( ljV�0+|'J�l��; �,��Q �ܳ�*Y���3 �\�e�V�=�/P8C �bh�\pf^�L(���!� �œp./�L��p�A.x �eL� �-�-�@жP4@.83�A&h�!0zt�6����r�s)�g����@�g�UЈ:<�(c�l�3c^�*83�� ��~`D^�@!�� `�WH��EC�t`Z U@T��-s�+l���� �����ЁzP-��+���B]D�j�u����g�;0�B���[@�i�H����`�b�Wm�������(�ɳ���� ��_�3�q�)G¸� h���p�`��/�gx M�8ԁ� �H8k�Z���R�@�@ �0f�:( � (���f� p"�a�=#5,�2���[0e��u n�/�� :C� �A���P�� p Q�3(�pf��Q�a�2z�������(�a>�CD �H`��l�+������H���� ��w�a��1����C��1-n@ظw L��&g`�\2 �u�R �d�� 0@xô�0_g-�� '�U� *8)�⨔�KF.�`h� ��N F��<�`���R.�d���̀j�T���83����tP.�d�![�0�� h j&���bm�˵Ŷ���L�@�.���`��8�A6`Ap-o,����ס%� ��\��8.�� �\�8p-�����6^ l�$��� � �� @��� �U����������@Y�"y�6�����X ~$��3� � թ��m >���ݶ���j[��m㥷ն۶ۮ��=.�@��۾�@���m��\�3�0�8�3�j�m+>������j[�!>��������j�m/�����A�`��>��e��Uiԁ:��JD�\b�m��%0�� nBPP0�A��p� �@�V)��!n��p-1 (��H ����[#2�� ø` �B�@D0���0�%8 �l0 ��0��3'bd��0�G� �a���0�m�`�a0�r�4FC0��a��0� � �a�[|�!&\�i� 7|� 1��Nà�C4 �13HHàc7Ѕ�pf�� �́�pfC�x8�� )�90T�O�Z�4 �3 ā8������M�Y�=u��D� ��r4�%1�y8��'xF-pYD��U�JT�[Q�n�8�c.���3��B9�`���.A�,ؒp��@�u� �� lE�(�QB�����ֆr�ђ�D���a��A7.�,+���[�Aw4`�:� �3���n_�n�An��NZ���[�5 �-@{�cd�[����-@SE ����A=̻�\�6�5xk�&A}���&06��� �a���e�!8��a7<��`�X��C����� b���(0F��� Q ގ���n� �* � �!���k`7�����zU�k�* ح�Q0�-�p�����!� �&TE�V� �e�m_�a.h@��� � 2��K #@{�$� + @r@H�� 4@H)d�ph� 0?�������l� #/ )B p�A #ϥ�@����AJ�q����B�}Et@`o�Z0=h�[u�{��UW��h!�f�&�>��[0=�6G���`o���v��}��m��o�+��$ r���V d�~߱� ea�Ȑ#�%���6 �[{��z+ �!G�`�o� ��h-�����B�����ޢn�r��� �-��c�� JMK"Ƥ&qv� ��"1F����Eb��"1F��[�&f��1�H����66G�����ՑA��B�/� �3��|�8�-��8��`�*�b��a3 NPtg�)5 � �nę8�5UD�ݚ*P��8KU� �q[��g�� ��*�4���E�‡�3�"���Mc�| � ``��;4�аf�0 04F��?���h��0.� g(C�4�a�� � �@Cx ����:�q �aL��1C�0*�e`��Q9*���Q@`f� M�Hl�``� x"+���^��18�a�@0pL�!e�`�0����p!ďѮ��0�\-�^1�B�� ����� �P:o ~�  �I���W� \�[m�4)&y� VA1���p K�Wď�+��p ��'��P�O�Lb�ܲPp �%p�������8�G�ZV���� ��,LV�<� 3�^%(�qk ZH��5아�p��`���-l�PFA��+ha�������(0����ƏX � Z� `%�� 1�J �-0\Ch�[p���*ܷ�p �!\� �Ɓ�.Z� -��^A�J� w���Q�����Юn���� �C8x<�:� c�x�9PG��҉\� ��<0F�KW�5��<0F�K���c�����4D}x��ƈ4\�\\I��! Q�琸y`�H���E��4� �x��ƈ4\�\\IC� Q�琸y`�H���E��44��p�p�E�58\\5��A� B܊@�8�����W�Lܲ�+����]Q\��x�%0��Άgc .���e�W�+�[8�B�1J��.,��P:��(֐�H�r����qq�58�5d܎~H��˅���d �������T�P.-�x���6��ݸ3�㦺��,Z�OiI��Xx�������̔�Tx�A:H�J�� �p�>ҿ�.����� &�؇�E# ��K��j�$up���!i��P0���d-����x� �?T.z��t˙r��G*>�`��Ғ���+> ����4�X.)<,��1P ���Ez����@1(���Ř%�(��3 ���-�t��46�' =���x\���^1PWit�2PLK�%#v���r @2��D1��#��~P �&���,A��P ᕖ���b�"Wp��&`a��+��5r9 � Kbi,�\`rד��IF1��3t�DX?g��zfx�‚�p�Nur�U.0]�R)��ڕb ���@l��8� (����b@���6�\e�1�F �*w�(а��Y�9�İ܎0��b(Ӂ���rm �"�o��;&��8 >@y���+h��BD�o���""JyC^�W8��#'�����r @�!����XsY������{�wԑ�M��"rA <.5� ��_-j�$J�̝u@�� �b� O��8 �(��ŵ��u�� 5���@�4��Wj.+ �G1ğK  DA8^Gj�`�^i h ��$�:�F𹹣�d��`�"B�h87��ܜ{g*ZE�8w��s� x��¹�^��g(���āA�[�s�t��?�- y����?���8�s��t����l�" �x����-g B ���R�S��C�-Yg���܆0�Ҙ��3 dDp���� �l� t�.�-Y<����;t���8 �[S6Ą+�F��,E�?��X �G�5�-��?l� 8w0D� ����ȹIW68��sm��\ ����Q�lͼB��i�F��[��K�Ź(��ܞ��r�VH;��V���%H- 0t�;�lM(I�a����sY�� ��hb�v��a��@��t;I�๖��\KjkZ@(��N�D��/r2p.|�������sOƆ�pO�����s��蹻�CAݨ+u9�G� a�ƒN"Z��%�Uݞ[��Fյ� ���\�`r`���&��]���?�.��3T��me�;pn� �f��� CĀ�ȹ86� ֝W��!�/ِ_r��H�Y� h��s@Y8HԠ $��(8H�@���TނJ��-|��p���"����i�"�.�;�b�-����?�.��Ob�^��„) � � ~�Cea+������`[)���UA8H�J@�b��A2q�t � ��P:��0 �8��EY@ o� ��+�� VP��l�&� �P A!�� X�l�&�e�Ȗ\4B��l�&���[t,�H� J�\�"�#[r��@�L��(t�� 9�0�i���(�;�7a�r,XA�an4  [��F�P�1ɖi�uB�&s-�2Md˱P ,�#0&����4���'Ȗc�zX�l9���t�Q�,Xc�C� �t�N:`LwG� ��u�l�-��1y]��B��l9Ĥ�ԓ�Ø���;��>��pw���;B��9�8������0&���c�7����-v��e=��떊�˘BB�-��+��NF�h6!�1���l��(`L_� 0&�` rG` �)`Ȗc![��xw�1q����C`Ll�{� Ƨ|��m��J���,BP ���� rw��l��@�( �`xB�J��o��s�� JM.���4gQj�w ԚK�h���X��>0�e�oĘXD\��m�t��9�R�ؽ;h�ִX��>0@�e������.��1&���b'@�u�.��҅;�� :A��5���p�.�����b'@��i�(ò�x��U�?����pP�4���3(�Z��� "J (�`�n�԰t�쒋t�5�˴HI# �e�6�F��+��cd�lq����nM ��-p�^iv�ح�q�BV�v+m�e8 �!QI飾L���4��^Q�iCjd��™@}�{�n��Cp:���; ��8�@BخAz1���2Rz�$�A��#�2IFJ��3��h!2Db��� 똎.A�/� Ā 0�@�C`�"��@(!��g��A(1�L� p&@m��0 ��.�aB�!�p���e);! ���;<���]��4��D� ��v/��B��ݲpc d����'!��Kڮ�$A�=<��P�Z�/g���K�@BC%`����xB�`8m�F��p��%� �zL\��Ro�?�`���` �H ƀ5̂�Kê`8�ò��b X�,��Z�������V�+�a䙺�f�[l}`5l�Y�U� k����ō"$N�@1�V�p�n?��'�ݻ�w���"ø0��� ��`@5]0~���{ ��]�����{��� @��,P�yw� ��%˻�F�9�w/�c8s#@�ݾ�wW�,P�nX��w��"� �f@#07 �63�f��h�4` `ÒHy����F��hf�� ����h"Eb�'V����L�FL��,.�f�h��6��_d�6Rh�+r!���bJ�X"���K���t���vB <��ׅH�>� �F�g��cx ň!ȅ���X�9�.�ɰ��� XI��BQ�s��&}��6ڇ.�(?�75�a��qQ? Ӹ�r K p@*��z�+��7�Y0 ��@`=M@E�{3���}PQ!���҄��"�$<�m\�C>�*���@� 9?��� :\ H�P��\| o�8��,4��a=m��H"X` �7��G��q!�@���x��:Ȅ���N�x/+�/����/��;p!���v�C�@P)k ��?�ȅ��p"�@r`�Qp�/�8H����1�r����5��K� cJ7�L �� Q��4���A:H�#�!�?��AS�%(��AP ��#8:��8F/ �<@��p`Gx`&=L��{Q)Y �8/0-�O�P� ��u&��XCm����� � �5܀��,�X �a0��>ڇ*P`�p�?p 7`H^��\�2��L�0 F�����$���4V�k�+�l�AyW�k���a���6���1 ^�1(ϡ1 ,@�E`Y�{y� �J# �*P& +�#| Py-@ +� � �,�G�a nc�@?!�"@]�A8  (�o Z (E �{y[D�)`\4���%J\�cq,����8}`���UxY��#���e� ���x��`0obȼ�7!����;�S� �p^D�C b ���kK� ��A0t�@>� 6 �j�� 7��r�7�j�� 7��(�`^��l��� ���� 0����P� �/0 B  2���p��Q0l����(�]�y}� �G'�j�!��mcW��04��� CS5 ���>/���a@���y�����%�.H�p �����$.���^P����qc�`� � g�cL���1~ �HG Ä���A8�����f>/1!�?��@�s��U�c0���yn�`��c0��@H� ������ ��'4��o���j��{X�f oh/I]� e�X��? �a��X�J��/I���Gn�\0%�79���B.�)T�+�8�q�X`���̂5�#�m~�B�!�>���8i,7��Q N�Ic!7`��������b�n@��L��`�vMb1 �`L� &�" `� �@'�Ld� �Fɒ #�F��%AFɒ%Kb�<�%1J��3%K�$Ё<�R�1��]�!0 �� (C�.L4j � 0Fdp��jݕ���8̀P�G� ��ʈ� �$4Fdp��jݕ��w�Zw58@�C� �`���@)�#r�� +3���`D�� J�̀��@G�!Ch�pf@#l�/9@P:��+]�f܀��>T�@��fĔ1�f�����w����f@La�@�=B �l�F�M��0 �I ��A�4e N�c �3�@ Dgp �3H����B>�-��/ � �Z�_�%K�:�"�;B�.@��`l Yt��;:� �` �� `(c �H�H �DL l p����b����Z� ��r �I L %N�E��`�� p��@A��I L Ԍ�9)t�È��;�X���^��b�읽?� � �tX%$� �Tw�P �"�� ��(B�7��T�!`@�����^�[mn��3@���kf���� �;P��#��p�28�wI@h��4����2p������Cn� * ��)�p��6��$��$$(AJ���L���p��� �dL��pr&@ �@M��C�:�/�� @���I@)��c�,���! (������f0�ybL�9VM�"LJ�WaN^9 ��#� ��8��� `D2ܩ8��\�W�{W�(н��U#~�A*Դ�͑@�A*?d��nBM�Z@J4i��v���=s��U�|\S�"�$��c1�����Xh�$��±P �B) *���1H���� �3P ���p,.�R"m�(p,��R8J�X� � ��68��td��EV0�b:��c�u2����Xd�cQG B8W T�PnIa�� �A,���"��d1P�|M��Tgf+��*� ���U�T�*`E@j�C`���Ū�(��-� 0 �H�M5��%�� �a� 0�JF ��'� ��0�;P D�6�� J@�3 è$��!v��`�c�0�1�A{L è���0�N��W E�qckF���7@ E0M`���׺�4���-Yo`��1|�� � ,� �B��(�h ��߻���P Q�3�A � �� ��p��������6�OG�� ;�.` ����~~@` ��5��@/FA�ag۪!�&6X�Q? � ���H���"p���E�=� `:�AV�*`�dF(�Ah�kQ0�m)`ǜ�:���!M���&���C� �53�e�̒�+k�x�� G#X ^��X�v������q�D.��aس0|���iMd�� N�8�2��\`� ��@�[�?6��@��  ��� ���>l��h�������VI]!�ېiH��K`L�@ j@�5����:����6�F���A|�1>@ �� L�P��e�@��Mɉ�`��2 �M 'F�O�B�5���܁�oM�E ��#�*@|�I � pbDP>r0@ 8rgZ~@�s@a��$08:� hI`�ز@0J`���f�o3�������E��묥�,ƙh���2�Sx F�� ��eR!o�7T �@F ��a��@�Ae�)5C0�@6 !3��P/��!���$l0R#���!+�@�}0RC���|��|�R�t�Q 5��Ԑ`�@f�`X^�0 �F�8��D0̀!�� �aI,�C�|OĽh6�e`� �A2Hπ@��3���9���AN9�"$&b��Ah� ��٠���5�7��̐^4��>��;n@ 7D/:��;n"����7��uz���Y�g/��"+  �U�� + � �/;���*f� �/;����8� LY=��S�Z� @��{�U�ܗpd� x��L ���`���Ś��]�����G�� d#+��0}�� s Ё�� �Opj�;����Jc���%В`� 5�qs "H�9Fd�D#B}aC�Է֔���H1?F$�8�Kc�JY�-�� ���!}/A���� �/p $��@.�E�%����pn�2� ��� ��@�]Q�*L�;X��l����F#��Q~� �E��1�A* ��t�88H�#Ꮓ�?� �1�)5��Qp����g�)5Y� Έ� �1�(�\��`L��1�,�̀cN�j�%}�E(�Ձ?b�8"1F�]�c�׷�c`K�g�wĘ^�#i~t�&(y����q$l@� ����`@�p"�(�a_���q` 'B�T p3� �%�j��bR5l� p � )ن���ݢI��X*�F�ʾ� ]�|�� x>K�z���PKg�H6H� �FA��b�%����;�+�$�d��X�<��Ðl@� b�D�0n"H�k "��q3�"ȸ�`�&��/�}%�(7�& �Y�3nF��t�%��Q�c���IwV����6 !73����/��M���!� � Lk���@�������E9Bl_}�S@ � Ja�]���>�� ����>ؾ�@o�q2� d��3�Y&�f�x3 �=� ax3�H y3 ��n�����A�v i��/�0:���� �&@'�� ��N�f@'NgĀ�&���iY� ���L�I<���!�@Ob`l� ��7F @��7����"����bj�601]�o���7���� |��t�6� �D�� &�+� �|��� ��� �?�������DV��� ���Z�H.^�‚?�BFC(�����?2��D�0���A�c�y�Q�}� ��^�7�p�N� �5@.&�`Z�}[���� ���}��A��r��m@T���Yal�2 �JV��6��Q@T.� �D%�~�lƆp!`f��R�舆i ��4 �Q�4�{`D�=0 ��0��eG��8 3��j E#i0 d�-�/�8��h ��0��p � 8 3�!8���_?�~5#f J��036�����E�D� �BD�nQT��p!`f�S���P� ��ߛ���p #�^�@��H�`$Z��@�(�$0�)��z��0h��H` $���c6$� ��o'�n���P� �D ��� A�և8%���� �t �3��"M�����±(� eA�x�&���g�hS�����s���N`~k>H �W���h,�L`&�� X��4��c&n���}���W���"�4��� ����Q�b��`&�� �[b�L����W��M�[�� �tP_��(0�@��3QT�Q5Xb���W*N�V3�fK�R3�J�o+[ ����K�Zh�*�ހ����J���s���L�7 l9� �eY���-" P����2k��,�"�h!��e��/�Rv�q���7J�((���̲_ra�" �Z�H�:�Z���V��w��قc��b�U' �����:p�B��~�2 �U5/� ��l�o�7 XFA�=�w��_4�f�/ @�>$��ߘ�f����h6�_�e��/��G ��"+{�~��������;�/�M���Y�f�oLI�iv��4��ֲG�\أ�Xfٯ=R� a�_'P��V#`�(�3����y ���ܬ�2y,ϙQ6*�ب���) #�Y4��0y(��z�e�X�0bo�A ������T�'�UU�.`U� �*83k (|��� |�*����"U� �(������Ƀ-�o���@4�j����1'���ܬ�2y,ϙQ��@`���-�/�п�D����k�|�*��a����0�M�h c��/An� 7t �p r�0F�sf�0 AP��+�� O�4 ��4L�`C�a���a�7�a0 rS/8��i �h� �0��0 �a�_v�a�8A,)�-�v���[�����D�����5���>2+ը7�� �n]lȬm���[ _��p��w�`��?�` ����p�pW�i}�jt��V5��p��v��4�1��Gf�U}��,���s��-��Ε��$L`�ۛ���M;W�+��< o'���$�d�0�Q:����$����n����i����>2�M� 7�\�z;6�nj��f}�ua����x�k�y����r��k�ۛ�>�� ����YoZW�i� k���?����k `����@X+̡�5cf��Y_@V`wb��(����:,�|�t��9@����+�0�S1���ш��xDx O�8����W���Ho{>3XO�.�7m�@8�^Ix�,���RMVc��>��A�>�oX G���A�W� Z��悙[�WvZ( m'x0�B� ���W�W��܀��p:P�A�{e\��a �2������XC.80�@5�9/#N� ��2�B��/�\��E� ̀16f@� s=-x�!������<��O0t�l���0R��}a�Su��`:�� bl̀�e�LO�^&�y+Wx�hL��(�� N�L��E�@��0�e�F�'^� ��`�� �^�ˬ� ���cy&Ŋx�M��PS�`�j�,4���"�ˬ+Wx��"�h�"/�4�8�2�D&�/�@��E�@��A�B�^`$ @ �^`$ �%BHMd̀Q�D�� M�A$�d� ���5��p��k� 7 Y����H3 Y�&2�� h,��84��,n�8i,M�A$ g$ppn� �$0]�r�8���/� ��F.0�!�0� ������7��X �@� |*���� � l�/��x#g X� �>�K`X�(p0����h`�00p��@�^ �g!(��ѱ�F�<�x7�6�0����D� ��8p08y���Y ���yJ�+� �E��d` ��Mѥz* 8��L�!D ��,� |20���㍘`��> �AK܀$@�ݏIZ�A�` �+Dg�!�c�1`C���Ah�` ��@�����0 � $���d� ����%v �@�| �� nx6�f(�b3��"B���:`�!�HIK ��E�P��@T�J@�R�A�Ac��J��"[(�j Q �g�܀"� ��Y)7�΃[ O;L�ygk%Σ;��" *I��Σ�T0�)h��Q@TF�J"*IK �n�"4�\d� �R8��P*I�`x�� h`kM��P��`h�(Ac�E��@�D�*�@J%��|:`x\��� �|��P��`h�(Ac�E��@���eJ��pI7� �pA�8h)I�(�l�"��%�B�0b�%�_�EKX�ĀO�P1`��q� �z�T��"�� b� @��3l��G& �!Dt��h�,�^E�aT`� �5�aԀ �8� `��q�B��;�`�>�$�� �����PGhm�$��5��_0!����\�_0!��/AV� )�A���p�A�L�q`8��S�Op:&D���Wh’� p�&,��EȆ%��fuh���� � ����0 �����4����Fh"Eb܀&�`� ����$�H@)�X��en@ ���s^H AaI����i’�@iH����` �A������k�s$����u��?�>F� ��6RC�>7�&Xm�Ç��6#c�y4 �A�h�"��u1�� �4aI�0 �B �?@!D���������� p$8��0���� �$�H� �`��8������d��J@ �>d���d�`pP� �1-�_�nk`x�4d�@h ����Z�ޠL�0��H��`���8� ;�5�� 0f@��`t�P &X��7M�P ~Ȓ��D0�B�����E�V��848F�(�|H���t�P b4���( |4�� @h ��( ��씄�~@�`����P��� ���� FAQ`'͆�4�p���j�bL��R1*@hB��� �48A���?�R�Jn� ����W#��A �@�o� � ���QEZ�-�����br"�Ib$�9xb��WbVx+'�`t�v�^�Y�pd܃}�^�M�Hl��|��p<�U���V@l�;�A�/֠�W� � >؍N8 &���`����l�͈Ć�3>� � >؍N8 &���`����l��06܀�������`�� �v0�k� ��`L� � >؍N8 &���:x%�ذtp ?߀�������`�� ���[�k� +@��QP�n@W��nt��`0A����%�5��0 x]��� ǃ�8����V�Aئ<��Uuo@W��nt��`0A���A�5��0 x�C�]��� ǃ�8��>���`� <צ܀�������`�� ��sm�k� +��>���=FA�x.Bx߀�������`�� ��sJV��6����\ .E�t�F'�`��P�3�t1�F�t�F'�`��0]�p�x+'�`�r� F���b�� �� j��L�6H3:�$:u4��a��=r5@J ( aQ0���$%a$��B�a J# ;��@6Z� ��`L����@� ��I(�����( hA ��H6����IȄ��4�VPƒv:(��-��;X�"��&`��8e!(܀rtҁ�� ć�p�� �]+[܀ҡH�P��" \�P^�hT �(�`�@�j�$��%a��p��Z-@�$���I2�KJ8[t��H�YY�7�2�%�-Z�"����>PH� �)F� 4�0�G��4�%l������d ��oZ`�� E�rZN�,̙0 n�(@`D� �*$�"��DjH E„�0f�"[�4�qȅ`N@G�&�� �(��5�е�Fx}�B�7%�$4����"[�4'P�� �E�\)��tZ�L c�@Є�Z�h!-4�`,F J�k1�l����9@� �!5��@Hj0a&�-��J�7�\H&`0�� ��� �_a�/�``q8Q����`�  �a*�V� �aX3`��� ҃8���ᄙ�� o��p��%x@̀3 6�g@ �x� l8a�p�8� ��!D� @(�p�"�g@ l�3 ΀@��"��f�g@ ������UF �!tlvuf�H�� �+v���(`;��]�3 "�#b;P�T��^�N���\T��%ؕbW-�]yv��UzaWb�]���^�nbWy�]���%v���� �/����@f}d��p6~HIK(��@UT���"��qx�����pHa+�nÿ�d�1��`&�E��+DE}��A�W�� ��� 2e&N�. g�/u���F>�� \�l���,,��� �HV8 \%���=��ۨ�@��$0[�8��@4�K��Ɔ !t�f<�̲!f�*h��h�̄2�_��( '0%�J#�i�rU�!H]�O�.�4��Z�%hE`�j��@�#�A ��da䍅�^�3(Sᾈ�� �s�`����P:_� c�b���݈��,���Y�X �06�F7�6�A�'�8@�$D< ��E�0 +6@l1�эȊ ��XxI����0Y�cclt� `� 8 Blaa,<6���"W`�%��0��Xxl�� P;�0v�%�0�@�T��8��%����/�|8��0��l�"A��� B�a(��Ȋ�b���,���Y��X�����э2�� ����tt" +b�A��n��4 #d c�%��04 #d c�<���!+cclt�<06�� �pah@F�(X+`��@��(X+`��@�~B��,p!aB�X%�p���X<�Qb��0 �& �`6L�Q��ɇna���3 8B Xo,�b`xƌ�¸g��/��01X����<@ �@ X���ŀSF�[�+�<�KGL�Х��`��Q��E0� ���d�W�`����f� Df���08���p!p���A8���p?��@j����h C�ɳ Wʂ����pBF�n���l��6!��Z�l8�� �pX`�l�1�� �q� �a ܰ(H�o�_��8E��A �B� J�9(EU � C`��U :�����߱/�� ��3�Q��F�8ra����"Sr�!�����i���Ð�B(��@��Z� h�[u�@��� �~ha-4��X�BZhj� ��!k� ı6Ǐ�`�!D-b���_(�X���!`8�D�8������O��� �����(� ]�+BHT�] * ďALT"A� ) ~0�vT�@W�~?`� ����]�+X�@,��!�  b��$��`�cbA\�BW� tA� @k�B��t!ó�q!� �#~@^@�J` Z�^8� ?�F��,!'���q�X �0~b��a�xB���&e�$��^yB�dC��K`fJӆxB'�h�'�H���8%���(�'�>�,w$��`�W�@Ah(�!�&pb���1��3(ó�%�X���K6��Ї7@H�4,�H�o����%��6� �)(��C�6@�{� ���PƔ8@F#�H��2�L��؀`B`@��ʐ!e8 ��^Q�{�3i�Hp� Q�7�� �� �@�P}�:�;��x,�� `��CTJh /� ���p����I }\��� ; oA��$� �F!0�jEB ��v`:l���$4@P�Ih�H1)&���A����b� �)M��&q ,A�Xe�I���2 � � h-���F!h h�[&A.��)b�.����K ]�I�� <6��0<�B@���$��[����G\�� ��y�-��,�s����oap4�� �7hX��L�oE���2p�o!���$��CQ.� e�$wAf�A:HE `$�$���UV�/��8U)&�z` L&L)&��@%�|���V��(�@���`#2f� 0"6X�^0� p,)������lp ���8�6�X(���ѥL�/(����0:|�%��A �@x�/"`� 0z�/�9�`��� ��(����/`�I� C�`�/��"�-4 �#l�k` �����`rkhCh����0"��54�t��k�Fd�� �\�XF�5�pA4��0@w ����[C�jÈ���f��ĸ����\���|r �����f�|��@>��\���w0"�!�r���zIK!���AzN�?��,�6�Z@ h!-�M��ZH �-p+b�C�2�-����&F h-�b��2� � xA N�&�gl �����B@�&�M�gɉ;1'&��X���B�ha����A���k����rD ���)R� �7���` l� �bO� �B��!z��5̂�)G���O� �50 &�M�O� >11�!���L"S/� �������&� (>VV����T��Sxvx#o!�<����'&E G�<����Q2J�#pH���F�@�32N�?8'�` �#�)�v`�P�sp"N�(&@��b�Mi�� cS��+�(&� C3 l fF)��tdS �ME��& 8�OR/(̆ =�I�⤤���)������ �S�Dŧ����lA0|�OI�� �la��(~&��b1�-(L6Ź [���&(� �`�� Q�66%�hfЌ��vCh�8�l�!�*n�����C�D ������$V�7+C�i6(�00@ 5�`�{P<�l�5��s|��ӱ@ h6��p4��j@��`��V�_1,nůXz�bX܊e�+~ū��bY�_�Z5���X �[q,^ůX��W��Yq+�ű�#�5�wBB ��&`@�󊟍+~Ů8py� ��83�Az�p� k��ࡨDy�S,P�����#n��9%�@@�Y|"�S��a�L��^�g:���Q0y&��:7� |a*o8��� 8&�n�@Ch?�d�Z��ӓ����<0 �1� �� (�S �(P2c2�t 6�$n@� !H$���4P��退��>�͸�x0�q�F��R�U ����Q�7E���Q-.(q��|P�7�(Q�䱤�MbR2@�����23hF�� ~� ���@\!��c�CX� �ccL�1"@f��< ��`�pYcg&+c0�膀�3@ex��E@�fc��3�`�XX}�ah�l1 &1&�bh�ɳ�1h,ĸ�L��b���y �[� a@ ��I $� Cg�����8�  c!�h�CK:BQ( �@��c|��G��k@vl���e��VC�Y! Մ1�[�P��PJ�1+�Z��V�����D�X@NͣI�L �P �{hL'b3cp"b<�x��ԓ�$:�Q>x��4�l �(P>��(�5�� @#��H2����#7@���s��@�Q>6��|l�hЁ"@�H�x�])�.I!��'6�僷� )ϥ���f�� F��-�pJ���8T �� ��Y:�Ҡ &%]��~p"�ޢ?�t2R��ۣ�f����@i������1�|��s�<�@��僷� )ϥ�(0�� P7��� r�n@x.d(僷�� �)�Z<�Σ|n���[��� @R@? �Ϧ� d��� ����6`V�4(���rQ-�K�Q>7 (�.I! #h@�q4@F���ʀ���8�Rl@� ����y�Bx.(�.I!x.���P�� �`(��0�Ol@φ����yR �/t`̀��9O�y.6��h R ��a�X�&� ` ����p���;�C��Q��W]}E�@� A�3 �1T�k a#(�12H1�`�cp �A�B6F a#+dc�,���d�l�@�E bf6�l�@��6'LP�@�)� ��L� ���H�'LP�@�)� ��L� ����  �zA�I1�  �⺔ �!� ���� �`���� �`d8F_�� _� n!��Ƥ�2ܸ� ��[�$cd�\��Y���!@.�yݸ��5@.�� ޸^lcDbD��6��Fo�olD�F8� F$l�cܐ�@8FD�p�"0��p|�d�!02���/8q��8)�/ �PHÅ���؁!@.�8^�r\����e!t���!F�=昨dZ�-��f( $$���{VZ@�( ��t�Q���q}X}R�� ���q:�)e�,���1�:~M�,�0 ��9��WH�`�Z�"#��^E� @�c��j�իZ$�4 ��(P���[d�Q��ڻ� ���w˵F�h�v���x ��(h���ح�e��&#7}䞰b�&@_��}�n��v�1�V_��� *���I0I_�U�v��r��q`����(�;�l��*����(0o���E���-���l���1S!?���x�L�P��3hCħL�5  @/` ڠLg0�E9�sL� �rD���#��1>G h9�6<��G�8�#|��8r��9„���A:�6�`�0�Ar:�� � P��3h)L��t N ݐ �o��I7�ݤ������QA�p��0��t�5��J0�:l&�h�`� �Q�nҍ�`�F�Q�a3�@�`�c�L0P��X ��< �o�Ծ� ��R<����O��R�M�B�O�c?����t6�#x\��*5ra�LW �$� �� B�R?�����X��x�Q0n��(@7�F��t#��1�S����}������~j'��:l&G~j'��J��<�`�#���BGA8.�h@ ���(A��p[��m����� .1@�e`��0�&�m<@@ ���-� <���D*�m��@� ���+�1bP�7���1d�"�M a�a0 :0�ƄcN�c���>΄����a����`��y �a0 yv�ل��������1�Ǻ� ݀&�1\�=��� y���JP��$��1\� �ۀ��1��Jp ��5l ��0&\�`�L�M8|L �Y�`�L�M8|L �Y>V�C4 �13hF�� �a�_�?7�f�"�x7�}���� �ǂ�#D�!��I(&�`I ��P\@XLd��%�@1� �� �`�������4~^�p ��{Pf�q�����^���lGG�a8���@g�a���e"C�fy�����v� �c&�,�]0(3@�� ��6h�ج@x&� �R�jrM�9t���4`pȩY5���D�TmVM���/�w�B(>�h����?��~��x`¡��T��פ=�I��!^%�p�Tcl��S�bh�T@� ���� Ps�#T�902�@� �-e��%�'���h �Ms�|פb�jp�W�6\'մ�"@��?>tr���6B�DŽ��� N��xD����12�֓�b#�����q�I58D�B�@@���4�p�(R�툃|��C6������?6<�8����Qb�HE����18�)�ǀ�8�<��H~g�@P��XA1ev��9� �7CmV�ı+h���!��M�JL���㕘H: �v� ��@*���^s�p����`{8����Wb"� 9ƒ|���y�G�� aI,���K�" �Gdxcމ E!��1��ي8Y�P����D$�$Y�D��!�� �� �v�� #�p]J�����|"�Z���Fz|���I~��H��Ut.���(ԀR����rl��$j!K���Cnȭ%�d��B�$ol���!K^�n Na+KbI(���!HT��ȜM!Gd�<�@C``�ݤ���> C7��ی�oc��F�7z/��!1�XD�n�F�1�"�J �F�1�"�J �F�1�"�J ���e��R�"�$ ,�L��oX�X�dAh��nɮ��΁30�`&EV �f�� �� &�6�/`b��$ � ?�4� 0�)�I?�L� ��BB8)�<�SaB��8��U����Ҡ�"h\�0 ���/�CV,���>P a� ���`(@� �D�$��P �!0�1'b��;�)"[����"��a0�1�x��+�?��"�/�CE.r��+&���E��!X����k����.�?�,s� Ё3���^���_9�*r���(�\�+v�'#h���0�\L0'����0� ��a@��12FnjB����eṕ�ȷ����R��nP?��t `FA�A��Z �粷��nx.{�a<��02 �A�'��E��j@�8� d�CFdE�� 1V�ra-��nx.��\��1rv@���`�܀`\$!)����"�\l)T�����b��2�Ā\e@ �K�10�P2�\l�!#E��8O� ����eP^n@ks2���� ��I=U ����N�?��fq����T�2�!�| V��7�F���`���Q^n@X��4�3�� 8�1 ���: `�0<����M�4��BA�q�5��Q���0 G��5"N�Z�Z����嵼�G�%x�`�z~��&�"���`/�EP �k��%�MRI���#Ëc�R��FcYx��z>�j��ky-�命���d�Ia�X�-�c�`���1��(k�`��!V@H�wg6�� �Y�*q�cP�΄�Ps!�K@�lb;Fa�����s�!� ����2��%]'��=�2+ � �-�����Y�G*ɬ]�܆�YQ��q@jx���+LHf�t@ih�Y�G��!��۠4��S *��b�� �d�ݐYW% ��ݰX3+Q����,���+@f�De��BT4@$x�5~��̚�3Z���/ÓYwC��!����"AY}�c{���@P� �b�ېYQ���L �����k(D��$��D�[ea�@����œ�q K��9�VY�3!nqѲ0g B�"*b@�dV�v�b�e���^�Y�J�Ȭb�d��0(�� �U�t���Yw�l��CD�?�I���5~��P`����R�X�� �t �@(EP��f� �Di �����3�=�3l�q C6���e@� �IP�7�UA!�g�A�B��2@=!�� �@� ��䁕e�Ax+K:@��A��Ё{P�l���'+ E��` $�����=x�ae��\��U��@ 70Dh?�؀B�2@aHV��B�� ą؀�� �� �%��^�� 8OA��!���j &�� '6 �؀p��6`>���V�AP����ñ. 6 P@� � ���P0@UP�Ḁ 0��H"@p����@l@8wwPE��$��p&� �1��0� ��� '6 �؀p�p. 0�J ��#�(� 8b������ �a86�� �Zq. 0�J ��#�(� 8b�� �� E��  ЀU��"U�TPE�J�"U�%�e!Ò8���Fh4��|��1&�O�).  �z�".@���*�E��".�T,R@qj�T,R@q.� `�*�6� �)�����\@�"U�T�\@�"U�T�V\� �X� �*�\� �X� @�sA���)A���tt1\��+<�T�QP*\@��/�˜�P�H Ud� �_J�1�.� h�*@��((.�c��RaLk� �Z� �*2 J� �/�˜�P�H�c a#��S�@ Ud� �1�K�0�5�ā*�E��"��T���R*�i pq� h�*@��((.�c��RaLk� �U@�TPEFA�p��T���@�"U@�H��!Ud� �3 8� ���T��]�Q�X� �*2 J�����RaLktF� `�*@��((Ngp@�1�K�0�5���\�H Ud� �3 8� �/�˜���r�"U@ݑ�����A�H)d$��*2 J���t��R*��s$5���\�H Ud� �3 8� �/�˜>@R8� 0�U�TPEFA�p:������_J�1���*�E��"��T8�Q�]@)ƴp@`���@�2B��((Ngp@�1�K�0�5���\�H Ud� �3 8� �/�˜���r�"U�T�QP*��(��.�cT�RaLktF� h�*@��((Ngp@P�J�1���*�E��"p�GC�I)�\�;_���!Ud� �3 8� ���T��]�Q�X� �*2 J�����RaLktF� `�*�e��X�IY!���"(����]!` p��T�QP*\@��/�˜�P�H Ud� �_J�1�.� `�*!΅��E<�T�QP*\@)ƴ��*�E�;��h"�S�2���X�+� I ţP|��� H��������l�\h`����p\�e�j��L�<| �҃�R��}��"�Ԃ�Z�L����R2��"�:�����ȃ� ������;�jeB�m�2�>2��"�:� 4 ��@�y��:����{D^S.�L�A��S�N�9���&�`�u@�%x00#l�[� d^1?��;�jT� �'|pD�u@" l5���-����&D�u�V�G��h�{D^z�VO9Z�����s�� �)G+�qJ�@�^�@䡁h�{D>�V"!E+����@�yP D+�lK�@k�xÁ�����-���]��R��q � ��� �R�u@8����؂p\�eC��%��b%�F�z��"������y�[�������H`"/��2��r��k�d��<�FF\�##������+r!#�x�12��gX�����g��\�##���0#�{�=�!�He+DB�V"!��h%�2�V�@�!�h����@H E�<�����$��s=�h幦r�b(�0q �2�V��*G+4@��`(���v/jw�D "�D��#��A��="/=D���P �$ ���d��<��Xht w�dג���k^ D+�u�2�p �$ZUe�Q�E�U���Te��؇��L��T� �>2@H�V�+d�5�@2>�V��D����W ��@�d|��rVv y Z��< �PJԀl�#��<�BB��4Y��O"�����^�D`嬌���Wv !�!��ܕ��WX�+?�q��BI�8������l�^!9ZI�`A��8�B����>(�d�[̆P�HY�3� ,�����@M�Hl���h�Xˮ6����1n�"�d�,���`���+N5 0��r�Y&�e�,����`�S�+ui��p�Y&�e�,���`�(@ ha���V� ��,��F� 7�h�C��1ҲZv �at���n�"�d�,��̖W�k� ]-d���W�B�]-�dE��rY ��,�؀�ZH7Y�e�\Ȳ�)ˮ6����FXF �#6��9��2Z��aW��Q�-F�8e` �n�BXm9 ���Q�̮��5��\�`�8kYa'��k #�5)�QP���H�$��e@1� ��>�1BL�� a~���\P]���FW(&cd< �UF+@w��l@�vC��Z:�[�����P/2�C(���0F��[F#s!<����H ���4����k�*M�`0�5`=F����[�p�-� \���$[L���I8yy;p��-�/�H�)` ��T�(�<�"�` �� �I�'p.��l1y(�k'�$�_p�xm�n�S^��b��,��r�/�� ��0����N�d4�ab�E:01F�́;��� ��@����Q}�k�e��&�'��!�  7@jح AT�� 4��Q+ c �Q4�2X �Ŗ� z�|�q.���� 0�r��'b.��� Fh�M���Q z��ˊ@j�Q���]4Rù��|���\��!V��e���C,Qy R#[����3@�4w9d��|철�3@�H �#0j�� ��.�E������"!H Y�1�8�2|Y��AQ��#����3Fv� Չ8��1b�$,�}��3� s?v�;� �$���w02B�#�J���@\��nP?�� b�t,�)�a��Z���c��� ȍ1�p�E�c$wp�`rD��AO��B~��� ą���E_��C��!p�_�Pd�lP��0F.���t�&���*FA��b��#��nHR���`v�n�+% t��.�p+�y�4�X=�I�� ���\/sa#��5�RV�\Z `��{��@p+@}��&pb� ���5�]Vq���h@�!��W� C��� wY�%�>vJL� AT� Q�����zB�h�!����x���@�`���*L��#����V1y�� �J5V1y���>���-�c�X�\�*�h����efLc)2R� w~������j4y� �rW � �PFAE�.���1@0�J$�G���1 ��a;�A�����%B���V6�[5�<��"Ё����&"J�<� ���me�7Ȅӣ��&:�>6���Ӄ��*����#��&PTA���0S U�,4�ܥ��>���3( 8���kw�E�D�Y���3�=̦�,�]�U�œ�[pG沰+\b�w86oi"�;g�Ð��*� aHObn$�Y�lBi��#�ُ,f���m��D��e �� ��T,R@�X� �*R�H U� `�* EL$8��X舯�p��a8���O@L1a8 ���p� q��$6 ��Pb�� %6 ��PbC� % �LL�U�) 60b�N�`�@pT�N &����N`(����Jl`(�$Z%�BPbC� ��D� 8b�i̯A�`�3E�DB�� , �/`A���F�i8�!T�*`�@��� �%Rt�Y9]��1뀳��~�|* ס+pH�ΊY��f;t����e X" �P�W����+2��5�|�&"�@�h"��$�3��2�a�Vǎ�u����w,APxbF�]X`���d��Fi��H Up��E0`C��>P3R��8+�9Qb��*�]u�Ӡ�&"�!5<�c5��}b�=h"�;�FYP_N0�c�x� �37�x�ҘbF��'�� �b&( @�"�k��g�<�gvb@,�� �M�8&b���%!>�8J4ע�����?(�(�B��=�� ܃<� ��ʺc��xt#� XYaE<E��"(� � �2�8�a� p��  �|� @2��C n��A�@�8"��/� ��~M�`��2��w#�� �2�,���k~M8 A4 rD�Y�5g!�ќ2�U �z�e�@�"�y�f�[H3>��S�,H]/3����4ρ@��n�(�!� �e����Y�f�L��.i��Y��� � in��mZd��i���n�� ��F[1�a{32���@1$�� ����I��$�|D�9 gA4�fd���h> �9܍��.��@�` �%�>�b�{@CL)���\%X�-i�y ܒ`�[��(�!8�f�@��� G�4��� Ps�@���ᑚ�% �3)��@�e� ��t fk�7[�PG�T�- ���Z�[h���Lsk����5��^�ڀ0 �pJV �0�@� @�*����6P��y(Y�d�� �� (Y���� ��=� �)8Y�c��B-�4 �(�^�i�U7�e�4����Y�����}�< b��@�E���T�Pu�l��q�ꚇ�[̃�Bt����$@yh��8�*��l'A0ЁPu�l��v ��fE ll�[q��:�8p�ny��63 �`����4�n�� �@#0!AT]��� ��3r�������@��0�@C���T��Pu�C�-��n!:��'��y"��<�-8 J�h"Eb��Pu˃���6��6���DA�0��iU�T����3h�@��f���`�"��]�f�,D`��rq�H�Pu�l�Y�b�0��-��5p;Z��Y- ��0@�I�` bԝ� t�������Z&(��{6b���9�`�������*F��X�`�s-�6��l$Z�m���,��������5+h:��G e�,0 �1\��]� � :�g���p �y�4��Av�k��M�Hl��+\lXea��Q� v��Z�`��lA ���'��lp�iA��nL�&� � g�c�a@��H��d p&���e��8| N��('3@�d p&8 ��p&��b�L0�c�I��lp p&����L���1�8�lp����� [�p&���ea7�N�8�,�fp&���e�6�j�-���!77�"�n��p �a�]�n8�lp��0gv�Jp �!슇� n8�lp��0gv�Jp �!�p� � g�c����`�`( E0���.� �E0���A �`� ��沰�@3fF�d���0�B�( �a�&P�LV��6�� �k�`�dp�*@�0 �`p�n��E� ��<���I�'����ș3�!�̊�n��:+6c� 6p &��J�uC �̺�^�݊d�jT��ja2+Q�EV��@TlbC����(@��7S |\5|�o����\� A@.PEp�͙ ��)H5�Fը�\l�Y-LfEK�\�� �!����K ,-��v�m �W܆�e��Q���p +2h� c�@ CD�Eh�&8%�"2l��p ��D��Q ��Jp ��5����'��X��$H ��?f�p��v��Q, ��!8�Ȉ%�bd|��$��i�aI���"��o�"9@0, �p��`p �c g��nX�5�Q@?���p ��t��1\������<��k(��8gp��0ǹ8a���?A�,]�@�7�k�6@0؁���B� � ����F�`��y%��0 C^x��8p0[J�H�����A:IrNΚnd�N�1Ò�_$$�fl x(`f 0 �1H�p �,�O�ǘ`�L 0cD@.0"��0��A���Q��L��0�3�Q�A9����N:P��a���0�3k� �و��@��Pή!쨂���]�*�و(箰��H�P��94g:�S� p$'1���s��љ�P��A2�s1Q$C��H��\��j��8���?�zĻ���k��!� �����2�����ٱPg|�H��"Id�F����:�zBo� @F>P$>�}( �`�a<SOT��|�ll8��q�Ug�H �-� � 6�<���y�`ѹPgE"`.Xt�d� @Ill�C/�:@���[ֹ}J�HV ��3�/���< 6vV$�9�uF�3cXRv�Ίd;�����?�β^�yC7��� �����;���H�� ���D�E�n��w&b�o����` Q$�L<�g�� 4���6(�E .�(�ja�,R�@7�`+�F��0 �Ha�"1���;C���Mz��9��g��n�H�`�6x2 o��L̆E <�z�Ί=��i����'S$�y;{2E��ӳyn���P0N�"�=�g�ܞ��)z�ڙ=C� �s|na (U0��|� ���9ЙNQj�1-BH�@ l0"A$��98-@0��B bCA�$Za�  1� �h�,�_�*�e6�g�L �1@K�/�hU�"3 ����P�Al`(Ȁ�D� �pAl`(� 60d@L�UH8�` @��BF=�Y��07^I�`Oe�>��gXm������  XvE�d� �����`�-�B�얝"P��̍W"=�".@� D\��H"��>�g 2|JA8.@����1 �Ā8�6r�?@�� ��p� >t`$�;� ���U@�!�;�X G��`{�����:��, �Z�q�R�X�x�R�E8L�>�����S0�"�\u4��H"���� 0�� � ��J` ��s@0���S6�X�� �ASE`�����*�#?Þn���bj�Gh /�IĀE �)�F�V͘�&��3n�C���eA�Ճ �S6�����A� �!�f4'3 4�1r(6`���� n@(D�(7�O� xQ����u �eX` f �AA )��n���W0�� ,�� H��<�9�Rn�2�^H���p�j���Y$��rX�%����I� �3����@h�`�,�V�U%� ��D� 4��@S��Q�I#8�z?�>@���N.�cA����` ��8,��=طQ���@M@5��Р_�6jZݖ!�32�I�~ �Ao���F�)��54�b�2�}��B�b�� �ZHhl1%�@���p̂� yÄ^@<��ܞ��=� �!Qh9�f�$�;�`T�v%!��%�@n�����>� ��(Cp$%�qX<�k �#))�F�2���^��� @~@H:}�5v�V�-a$cd�LCz,A���C�|���0��] :�!����t2�̠/�6�A,F�BX@Co�<0?.���z x<ր2X ��,�����hd��wW}"P���7�3l@zB� ��0JD��! � �*'�(͡G��X$ u��W�]`.@�Q�P רV(���5@��(�k �%ר�*�T+�\P�Q't +��=��s9��0uAUp�j5 �ƚT�^cM�@���T�J� �%ר�*�T+Ԁ���Ȑk���hU`74���=�A �ՠ�]���ъ� �Q4� B4��g:�w)�8��0���@�A8+a|�"���0v@�6�0 �C� �7(�8`�� G�xZ���/�A�9�9@TtP�^�'`��� ZC`p(�BI `�4��QH�2 �0D� 3�AÀ� f�i`&5����*�O08�` 9p��%  �VA^@.0"����Qp6V@)�t���X�1"�L���`� ��t���X�1"�Ll�`� p:je��˵���Q+Y!�VA�@V� ���t���X�� ]�3�h#bD���(#��� p�1%Z) ���d� 4 �1T�L�^ �`1���$s��q2֎C����a�l�-��X�M���iQ.R����![`�lqаE��7@5:��@����4� n0���$�q�#��DU�d�����#��l�Xh�bZ��NX1E 5�@\��p 7�5�l�[^�k'c�5���\��-/�5��VN�(��d�q2���X���܀���o��e��`�k'�"��Q�-�� p �d����6\� �3�5` ߂-|� >�F�� � ���!�ns�Xj0-��P�� �Y+ 6܀� @B���5��0 V��+׸��W@?H ��hd�a Nb�X�⹈�3��ڂ���\�\2��ڂ�܀�-p�k+�d��kV@���aZ���kpk� ? ���kX�%Y��t��� ` 0��`Bn�`I(�pӒx����{� ��8�u;P�a �J�8����p�,�FHX� (�n�}����M�I-T�0 2�:�>d��L���� PG3�F+`Z�'�M-�d�Q� p�PG�/x�P�DpS��>$��#u�f�: ���/�z���`f��yX�Ѭ'Y(�>�wXOAH) 5�%���X���4�gC ؘ���AL�!�$��s+`6�̌��XO�!��밂Y`��j�Q@G�Y�B�0�����z�0�����C��a[����z~+� �G���XX ��(ᨎ���(��C @X?��4�3ҏ a�8�&@ �a=6�-��z�0M 5T��1��5�� 1_�,p`��p�YOj��_H�iA����eZ:¯�i�J]�Z%�X^� abZȇ&n���8z����r� �abZ�>� tt%�R���%�3&L܀e`�R� ӂ3L�m�� �/��@� _0-��"��_< \ã��6��>�`��1-b��� ���i����'��D /@�Eph���m��� J�M^�0�6�"���i� �"|o�ּ�Z�� @@h!-4��~tP �p}��xx o�W���+�N��-(` ��4y o�� ܷ p�[��v�ND[�4�p.�#�"��A�@ oa�"��"�-h����,��y �@���@d�Zx o�-���4t (`5`aQLn� �)E ��f�� P7�L7�?Bqa b�� ���P��2 �)��&@�n�8|� ��t�2 7@d�O2��@B:����λ�l�aH�&�t�90!$~܆��tn���� �@T4@$�D��D��AR���D�`���+�`� *�@ď*X.N�OPE�Ho�*�"�ǑF��h�H`��J$@�H��D�x�4IA�L�Hi�vS�&*��Hi� 8�$�H3 $�� �E�H���#}� �"!H�?�@��%~��*�"1@$@U�E67A�A�`�, �#� �F�� �d��� �V�\[A�]3a&�Z_!!}E,��0��%'EƿbU� �5X�L�]��0�� �k�L\�K��.�m� �����Ś��*�<���T�F��pJJz �V z� �++8�w��� t����5 ��(�k��L��&����[`% ���D�Z yKI#��D�\=�4��pzG8�T!���Krނ� ��E �DO�Z=bȞ�����G����"s��I��01$���_Q��I�ޘ�-�s�Kdl|�#�H��kb���!� �H��+�c�11$�����b��1� Đ�[��� '-����[3�L��A�^����q��� �c���{S�fJ� � e/��\.�8H�K�\�� ���%VT�5� 2�r9HE ��� �;�@�+R���xD����>R.O- ����K�h ʅ ��`�?� ˅7x��F�?6�N�` (`�J���:�&aDf�� }�� j�����jX��0"��E`ò� ��T2� R l�"�aYȆ%!d�'� �2�� nl� B ��!�Rd�'������J&��l�$��q���In���R���  � B ��� �l� �A6��">�lX0`�t � 2@ǀcąyذ,��@°A-�z` Z�� q� �K���l�$T��z2�PYZKR�-dCUsP )�� L:�� �s�<�@h@F8�s�������\�K #6��<�BF܉ H)�eh�\���8C��� �4B�P��p28� #6 ��1�Ȉ ��T�@F8��%ϥ ���8O)�8ذx �A�e~�T� i"Eb�'V$=����j@V��#Z�y �s�<��4�"�n�� +#��yRJ^d+>�@�粥y�x.�# �'`�s��������4 I)6 ��A @Vx �G]xA�0���`]e�/ 5s1�'+ԗ/ ������KÀ �B���]l�F�I���K���ХUA�v a�K� ���n'L�1��k;� `ti#�a��p!`ft1 6Ą#bZLÀ 1�g��ALی �B���*@L�iQ��ʴ�>Ӫ@L�e����@�bzc8�& �7�k�Wa�\ ~���a��4}��++�0-�F� �5x���j���2�����0�� ���0� c{8���0 �N@����Ė�;Hc��\'�|�A2`�e��)n�`@S�?�@��M&�Ajj��/@Ė�;H^���)/�M<���[��\�4�7�# ax��4 Ҙ:o��5��$p}\S�׋p� p���&���6f��,g6P��C.�A*|Il�g�|�[>Nlp�F�ASʥ�$�\����qMmLq�{ �|\SS܄,�P0~�r)`�e����a�|�[�e�$/�M�kT� �= �B�XT� P�7���V(�Z���J�\����7@.����,�IÅ8r�j��:bK��z� � �P�*�Zo@6 �@�ހ"�� l� @OR���E l p�$��@6 �@���w �3P�7���i�X�j�����0pYe ��F�\S@��b@�~�i�`3!$� T+H 0�.PT�I� �8$�xz��Q-D�j�zz�P-�`�̄�Z3�ju� &.xz�� � * � �@R@�ހ�#� � ��*� C P�7@��� �!H� @�L�*�C` ���)�X�l����7�KbP�7��6��:T+��!`* �zzHdR@ �@ Y�n� ް�@��C��d&�E�4�"s�d� 0��D��"s:K��@��C�����0����UAC ��0 `���L�m�% �D괝&w:�6�����&��B X��@�Y���L�OO��k �4�,a�OO���D:N� C ��W�m�E�H��� ��! �H'��̀�0���B�(�Y�n<��@�Cx�'d����_Ha��� ���v�Q�1:�@A� �3�g��4i�%0�g�~�����i� ��G��� D>�8@g)����^@g��t�A=h})L����5~n�v�%$`�:���%4����,�!0u��-�,���G�@(�a�`�5�.ԆZ�$jC-5hEQg��2@��t����?X ��&�X �<`� 0 ���- `� p,�B�h��4���_���,����C�AB�` �'�.��%�~�l�bA3�F~��hCМ��!��?�O03����!�J���6墁P̒�C���\��_��)��n A�!bTQP0H�t�0���XC���!�sѹ8��+� �R*�D  ��(�}Ш����$0@!x�N��~ԐZ�p/��r�`�-`]R�/(L�-�"@�10"mA �_P��4�1"��r�Eh!�X�&�$,1(��XB� ,��b-�X$�cS D�����X� ��9̀HM \C�9hZD�1 ���*�b1�@ �����V� ����܃�p��ĂX���V�ʱ`"�bH�[DL:� k�܁K�Q&���I�&��� �`Zd �/���� `�i��E������-�����B[P��-���[uI��U���pA�����?,��w��mՃ�?,�A���h� p~ǥ�aQ��^>���؀�q0u*x��(��V�E�H� Ё r��H�H��$�aK�A�J���g�,R�H�U��`0l=��䗿25l� �6dj�2� k �0 @^l� ��m@?�"%@ P[��X��X�p�Dx8YdI4�$�͸ �hbA ��@)� ��]�6�.  R��/t��bD@�٢cЁ5`:�x 9 [�l�-:�F��lj�cDrɉ ����G�vV@�d��v* �٢c<(��-���r�� ��c�:����/�0vm��3�a�� �'���W2X�"(����"��@�~�,�,ePZ�gx1-f�t���G`��&�ot�"�7��V��|j��7�`j1Y�,��0 �B� �S+`P�8C �� 0B�-�'�,T߲eA,:@��'�X�h�,�E��'��Xt����w�X &�S��(� ��X��h� ���g��X��h� ��DA���=L�",��`X `:�h"Eb�'V��H#1�^�"P�����1���4�c@� �:Cp�Q���X (�� pj����0�H�!3@$�T`+��>���pNZ� ���%1�0@G�-/�=��6Ґ�IS�4�"�n�� ��XH�pҬ�&�ieT��FpҐ�"` �@�Z:� `�t�5��!�`È�j�aDJ� �a��`�M�C(`�� �kD8C��z\���1"��!#R��H36"�T�\p@j�7���Ԡ4|A�����P� ���9(�)���/P/��5��� L�0]�h�c�H���hm Z�6� @ P|� P�@�m�����5T���g��@5Āc��ȩ�`�)!m0d� �!�W1~�_@�>�3�� 0�� ~�3���� H��"���5�n� Hf���jU�H�@2sttU+*Er��"�4�HE���+2�ȁT�8�ۀ�!p�i q��,�m`��w��4���B������t �c�f�b����c��s`;�:��� HÅ���bЪ@`;����ʑ68�H��� P �b �3Qr,�J@-J�� �R��>4`�����\������U�j$��`uS8} �*�c�;����w�)�v,����)��p,�±�^JA m��X��Xh�p,2�%��Zhm�HA8�B�� � du�"�a�Y�^��i ���p�� ��+ +��P�o���d#, 0����7����AV����V?! �a�~B� ��'Q�P�]�L$���x�F��� ���`&Q� ��+�� @Tʊ� *]�Ld�Tbx����t���X�ճA����tf����j �c���!@t@�` �#(Ȱ��R�`� z@#�!0f� Ť�t���@��BW�����:�B�}`dp���U 8C`�0�@1)&�a ���0+�4���@30��a0� C�E��"M�5 "��/l���0�Z�l�AxB}� � b �k����a�R� *��!p$����@Hi�C�|�I� @C@܀��vx51`�ܔQ6n�-R ���7 8+a@pV� �� �1^��x!p`(:�B�E� @P�J���0��J��؀�`�� � ��@h0l�j�3��h`0;%@�l�P ��$��H����02�8l ,:0G��t�a�^@ ��L���%�K� �Qp��A�^��W׀^���AS�e���}~�A:H� L��p��r��:�i�B�h ����?�GZhjAď�P�u�ȷ ��i�6� � �܆�� A�' ( `��( ����fl0A�-�+BZ�[xG"Ԁ$� �KbI,���@C�1`�0b� �4�!�`�� 4���k���lb��( 3�؆9P� �#�`��Ď13 ��� ( ��� � �D �_`�5&QH���\ta��l�M P��%�{`$�1�2��.W� �`��u���IL��'��J@�6����K 6 �����R��7X))�؀< �1�X�h0n� �Ma���2bf� y�a�%/ �A,���c�����8 �c������N�; �t䝘r���`��#��4T�����a� ��1�R�i�9�*@�� �� L��u�U���*� &�;P���ʐ&b��1 M��PY�D �!`L�4�&f@e�`I��@xH?�� h �Qۮ��9y� �;Ro*?$��ƛ��ȉ�Hy`~0w�xS�� �]���xS�9q)��o*z#v�A��@o*z#'�#��� �u�MEo�0w]HC�MEC����"�xS�9q)��o*z#v�A��@o*z#'�#��� �u�MEo�0w]HC�MEC�]�ƛ��ȉ�Hy`~0w�xS�� �]���xS�9q)��o*z#v�A��@o*��x4�T�FN�G��A��ƛ�ވ`�&��ƛ�����-��7r�b�b7@0}t��5���6<� �o>"ð ���Nr��V��5�}��¸��裓\���{u �� ��s�G'�^��{ ~�k� �a�A���I����^�_��`È7@0}t�뵽����a���0��  @��zm��5�e�6�q�G'�^��{ ~�k� M`c8����7k�2Y�5�u�eM ��l �v�� ��7�k}��@0��]�7r��0w� 4�T4~H)�7������`��7b��� ���7r��7������`��7b��� ���7r�:���^�k��0\l ���Nr�����2 ����pFY_o ��e��k�=����ĵ���]��Xh4��~ `c����>�EV03�\��t �� P����&R$6� ���-s ��Ž��׮6�A��i���e�a4\C�1�Z_���F7`_��v��Z[kk�\kx��9��p a�hd<��� �� � ��q�5`�s$�繨n@1q�υ��@�l�B�6@<2b�BPH��`�H� �3�<2b�I���@PH5&� �@����clK@ކI�&���nA8�6�&�-��� ��0=�� 0 �BF����QT��g��0LBCx&� ��L�/�3V@��� �8"̀}0L�/hC4�"�n� p �à� L�[��cX�� �>0 C���a0L� �3�$��" �8(��T��AL���� ��c�[��l�2|T�FI�������P�8$%@�� H �`B�yboz�k ��t����ʸ!�i$�<����`x��<(��<7D>���:yH��G�M�sC�Sc�<���(��(� X �!����BG��@`Ǐ��X� "J���1B�Љ��-��PL��� tA'��tbZ��@ď��"�N0;$B�0�GZ`�Ə��t"�Q(�~��5`0 !0x ����@db- 0`�4�k�<��<�������+P:@��� � ��B~�Cq -`�0 ~�"�����AF��Qp����_�P\Cc�<�6(�ƒ ߘF6<���7X� � 6a��M @��)⤱<�t�+�k08� ������ ��C ��x(�����F�8�5`����X~�i�F 6��Q0y��<�W<��X&��6(��\��k,�d���p��`d�ؠ� x@���o�7��(�< n�P�+�kh,���(ؠ��7� )���`D`�C�e� d�N� � �ȁ�B��a��0���`̐g�$F`�#`���46���c �ak�A��T�����Es��a0 0�l �3�=0 p�0��3:��0 �1�n:��h܀�_DI7`����l� ;��a�d��B�n�a4 �n8� pF �p �� ~��_�a ���Q�� ��@ 1@`ad0�2 � �6 ���!m� $d� B� Ȁ �0S�@ `;e��5����~|# ˱������!���X ��� @BA� �!���P����Qܦ\��4�F<�(H#iB��5�F�B(i� �� ���PEO�� @ �1@�(�!� 8����,�� B��&��Ld� ��yX�`a��#&@�F>����M �m@M�`d�=�AH�a5�5� xq����� 61�� HN�0M`W�0�NWH�U� ���Ǯp ��4@l�qw� Gp.M�L��p�l`g��������x ������Z�^R�+��p�*��"8]!}� ��H����Bi�):��^�"8]!}���>�I� �+��]�^iX��L�0C G e�`�2�*�I��5�Ҡ4�B��),� ��iA�N� 8e�U3/��"8����VAN����_Elka �BC���5�SfZ��<�{@@Z8`d�K7�lX@�݃!��Ù Kb��2��2�ľ� ��Q��g +܃��pfÒ8��< 0��U�{I��.A��s0ig64�����ɒ��Y<�Lt*Z�=P8�!p��� �¡ �#�D�D��5���v�� v�h��A f�%h�! ܀9P�� �\��2��Z�#7@@����ŀ6@�� ���vo@�#�lh�g/7�Y �cK���j!+�.������-��Y�ˍ���R0PJ�cK���FA]�u)c��p���"h`���"q�J>���q$E��4������$E��4q섓�rA|���h`�D�qTƑ"0�� ��� �"͆X�"[� +��%�x���S���$���_@�hD�lOh #+( ��F�h CaX��0i�Q����0�`�Aa���?�{`ˆa����T�� ٩�a��!��)�%[5( ��?�{`ˆa���}JFA��(�ԥ��UC��#�ԥ1�U����`d ���0��`#{d3 �C�Mh e��q��0��'����a~�`(#`h���2l��0 �=!�1l�� (c�� c6 �0#��<���B��a#[p��W�� (���a��>*�K�` �M��0#p��P06��� d7��x��¸� �ae�lP�~��?A@��K�v�/{���� C�z��!���wm ���FAVX���TAT �H�C���`x`� � u� ΰ!H�%U�T�^� �UT�~�2_����TATFA�� �bCp�3v�P��DT�*6� =�bCp�8JC��p��@kq8Gij%@��@:J KPmep���Lh-G�)%�� ��Q:Ju�$I~"=f@�>Tm��p��I:J�b( b �= &O����f�؊�6IAat�bQ,,�hA��0�@&B|8JC`��E���Q�Jc,\�tAS� �!���������� ���@-a"&�7�F:p�ކ:�(Q���+�8(CG�j��4�B>8Je��n3�2@\#m"������ 8� ��5�06�I���2P� p��3վ�GiP��4�v(CT� Qm��+8J������s��D�(CT�(1�2D���Q:JG�(��3Ҏ�xO�j%����&I@���q�X 0I`���@L��y�aY�!@��xE�(Q�wP���؁`�@-v���2@��%`؁ �@�E߉C��;� ؊( ��[2�AC`A�9� ���q�k�0Hi��ā!� �����B4�p������B ��V��3h*�u�&��XC��f}�����D�3 �Z�j �P��g�I�d�0&f�L�g��,���fT���^�$���4��jg��4�fT@?P`�k��3@L�aM�vHnM9�Q��F�C}��Ĉ�p��X8���1�N�E�3�#�� �-�L�hg�0C��ɴ08��L���LhF%���� �A:HO� ������r��8(��r�b�P.��j���0��AzjÀ���,��X.�!(���rѓ�� �� �A� �U�p�F�A��a0�8�?T.z2^����Ad?�%��\ � ˥�́$W0��-�:�@@@: ��a�1@��k� �h:���kx�@i _p3�@x �6L@4B!�p�ǔ�{�#[�\�-�����o����Pkn~e$��F0|A� ��̧�p3`�#M�)�?�03�l�� ��HS�"ؚNb:6� I@�m�a�A���$�oq��c �A�������nbf�A�]�]�vt�k0��� �T8��A$��ֶI��o(���?��AJD��i��1�7�`j�cm�1��߰%)h�Ѽ�8-/��M�1 a����h3�mg�}�Lh"3 �0M��˰�" �, �A��mr�:� `�-Ѝ"��f �p ���"p2ZPh t#d��}��_�E$����y�3F �F�[7�����X�[Pr;@�P@ ߀8A�J �� �� �I�7@ 5�xC 5u�ܑu� hmn�m�T��iV�h������ �&���7�Qj6�b֚ `�a����y[o;������f" `8�70�ӈ �)��& �:�["C�H, �� l�Ù ��2&�h!���x;o�m=@ X(�o���!��B���x;o��YW���1��x��D �@xK�)Ё�XX�V)h���t �'KD)�[ ��NI �ً�5n��1H� %���B�M! (��>A ��h �9Dx,���8��X��p{,��'���XL�O�8��A2H�X��c�8�EA O�XL�� @�k� �s 6��e#�� ����F��tJA � 6���v�`#l$��m��� C@�& �FբZ �:�6����@�Z � 0zB� �4��&R$6� ��`����N�}L��`C0=��B܀� &�\�Z�6���K�wy`��p���x�y��rF�+�:�D=`�բL�3�F�^�*�1���b2J�'c�d�! �!h|�W� {�)r�dL�g����A$��o�80 ����`p$���\�(iB���&z�\S��:�����Q!!�Pw��>�c(� @,�.���e�yn�=�\ �ЃȅD�<7@����yn��� �� ΓR7[�A5�� �r�A�����:�6��Pb:j3z���'(X�?FF���'��2b8� �[��'� e@F:�s#� ��e@Fl@J!���@G�p�K�=�� r!�;� P��̘�n@J)Vѱ*���::�O{. CLG*�� �`��^@ �/ I�%�K���-idpÖ�� 7�!c�#�/�C`�_�0s�`X�� >G/@-��-�* ��/��$��|�J � 1@T�H��5���`� >X}�q�Bh� ��`- �>� *�k)�#F�H��7���ذ Q�l���A���H�!*�5�� � ;D�!��@Tn� �Wt$����`Q��`_ё�CTЂk� v��}EG�QA �6�s���#a�����Qi��qa����@�B U�j!uF��a�XK�&��҅g#I@ d�P�\� 6� �������;�"��B�XO�1B��p�E�HZ(؀l��o�B�7������A8�Q#�(�JRJ�6R�0Y��JTw �Fm��>�Ҹ�Q[�5��q+T����gXk7������ �z�Y�q �� �{d@�Ѯ �� �{���$w���{ ��]<�� p p�3�  �)�-�ܔ[rπ� DL&��}n�*9@r7��1�EV��3 ]��q�f� C@T�K� �@��|�*`�) L�>$�`P�AA �-�*� b4��{���� �����q|�=�P���L8�F x �a�3y6�*��g C&L�H�F�P������mH��H�L�M��m���~B �Z܀��0�����fd������ �@0d�a���°�A04�� ,�R�6p�q� �g��t�Z�q"FF��c0( k1 8����en%�&\���,�X��Ў�ل�ܖ[�+�v,w��Ăsb�l �ۀ� .� eP: �0"2�l�έ|H��Ԋ@Sw��4u!���sw�oй;@����t�� f@��Ԋ`ln@,�K����!�Ғ�c!@|�02��@ ��B�@9���XL�B,��(� �� @,`�?��  JP��$P ��bQG ĂX(��0�E�j�sw����E!P  ���oй;@����t�� &�l�� EP�@.�(���Q|A�7�,��1` NXa����j�k����� p�@ P � ԝM� ��<`2�s�^K �.;��L��|�2����$�p:w���` ��ҹ;7\�pe�� W&@B�`sÕ �|\�Ģ b�j�Z�+�LbQ���+�L�26�� ��@?6 | 0l�i�X�bA n�� �`�b�?���ܟ�s��M,��ܟ�s����?��&C n�Qp���!Ld�<�12F,����X0�c�C^ű���X��cA>���ܟ�s���������`|�_>�)e!,�� B7�( ��B���Dw���"~�Z�5��@����.CH�IT�X �.CH��J �t_� P����^ ��B��za�Fw���to��?Dw�&*����n3����ďЭ�@���%~���MB�B�6��#t�n~ �k� ݦ;�n�R�SK�Y�nd �%FA�0e!~��Q�������<��!�K7Q)�5��u�PDwP�!�@F�GAx.����Q Nf�89݀d�ԝf�[�>% �\��(�� <��4��Pe%���h��H�`a�@��s��E��q�X�  I�`��p� �8R���3�\ B�� $$0 �� '��t��e��Ij�`���2�ڠ�R�Yal� �@Ό:R�<0 �� '�幜�wB���$�#+����Iz.���� � Xoj��P�D�� �A͜�DF�]�I �pⰷj�3N$a�^$���\&0D�!��3C0�K�<�� !K���sY�g�`ppf��8i,�% ���\:�d����\:� �3��Og&�<��@f� �3�*���lЋ�$@�T:X.?��i�`x����`���p���/�Эu�x�zP�� �2r����(jq"�Fߙ^��:"�NDk8H��&�����A:H )l1�n��A7��Lt�:�6�e�L���RJJ��y�A�@�'F$��#�T��=���b$�m F\���݈*t#Ff7��*h��M�#V��ݷ����ܭ����F��w/���oY��$0x�l��7�.ު2bo�w��7*@ި����䭼�7����:�� �#V���{zS��m��7�Fu�[{G��ͽ����X�|�o�=�#V�"���|G,{��w�(�L}�o�M��w�r�D�}���-��w ��Ļ~��������������������\�p�� �?��%p��#'Z ܁�҈�8���hMpoM�ML���^����F����w����{��,���N�s�ϥ���@~» O�*|��p��]� ��1�h��.�ix �.6��K���ÁU��;�����8�v�@<� �!Nċ�?�H<�G,%�'�8o��!b9�'�v�.O��'�KqR�Φx�7�ݤ 6 ��^� �݈12 ��`�OQ01�o�Y�(C�� �!"Ffw�H�,M��o�&҄�ݜ.M� ?%��^�z�N��)��G9]��`�#q,��G�h*^����U����� �Eh[�2� �A  $',29<@CLR\bhlpsv|������������������������  &*/4:=@GNRX^aitz|�������������������������� "(/3:@GLRVZ]aemquy������������������������� !'.5;@EJMPV[_cikqx}��������������������/49<CHOU[^adhpuy|�������������������� #'/4:AFKQSV]bimrv{����������������������� !$.6<BEHL^bgkrx������������������������ #(.6=CGLSW]bgmsw|���������������������� !&-37<ELRW^bgquy}��������������������      " ( - 6 ; B H M O V Z ^ c h m r x | � � � � � � � � � � � � � � � � � � � � �     ! & ) - 4 8 > C E I M S c g k o x � � � � � � � � � � � � � � � � � � � � � �     $ ' . 4 8 : @ D I N R W [ a e l q w  � � � � � � � � � � � � � � � � � � � � � �     # ' , 0 5 > E H L R _ d j q x ~ � � � � � � � � � � � � � � � � � � � � � �     $ - 2 7 > D G P T ] b d g l s x z ~ � � � � � � � � � � � � � � � � � � � � � � � � � � � �   $)+039<?GNR\bglqux~�������������������������� &*/47;@HLS\ajow{�������������������������  &/39=CGKPW]bjptz����������������������� #'38?CIQX^ahnuy���������������������  $*05:>ELOSZbimqx}��������������������� &+0468?EJQW[`chouy����������������������� $*05;?FNU\govz���������������������� #+2<CKOUX[`flrx|����������������������  %,39?CHOU[bilpuz������������������ "(.69?DINSY]`hlqw����������������������� #(6=DJQU[cjnqu{������������������������  &+/4=BDILOUZbfmqu{���������������������#*05=@GLU[bjrw~������������������� $(08;>@FIMSW^adginry|������������������������!&,06<BDHNPT\hlqt{���������������������� !%)139?EMS[adkrz������������������������"'-26;BEILRUX]cfpsw}�������������������� $(.4=BITXahkquz���������������������    % 0 7 ? F N T Y \ b g n t { � � � � � � � � � � � � � � � � � � � � � � ! !!!!$!)!0!7!?!D!L!Q!V!\!b!h!o!u!z!!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!"" """"$"("0"J"N"R"Z"]"`"e"k"p"s"y"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"#######+#0#4#:#?#D#H#L#S#_#c#l#p#v#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$ $ $$$-$3$9$A$H$N$S$[$c$g$l$t$}$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$% %%%!%'%.%5%>%C%M%P%V%]%b%g%l%q%v%}%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%&&&&&&#&'&-&4&:&@&E&J&M&Q&Y&^&e&l&q&y&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&'''''!'%'+'7'>'D'I'P'U'Z'`'j'n'x'~'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'(( (((!(%(+(1(8(=(A(H(P(R(\(c(h(m(s(z((�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�()))))#)2)<)C)K)R)[)`)f)l)o)y))�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)*****&*+*3*<*C*I*Q*X*^*h*n*y*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*+ ++++"+++5+>+E+N+S+Y+]+b+h+m+u+|+�+�+�+�+�+�+�+�+�+�+�+�+�+,, , ,,,,,",%,,,2,7,>,C,I,N,S,Y,_,h,l,r,v,},�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,-----&-*-0-4-:-C-H-J-Q-X-a-d-h-n-r-y-~-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-. .....$.,.7.>.F.O.T.[.d.n.w.{.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�./ ////%/'/)/-/5/:/=/E/J/O/T/Z/^/d/j/o/v/}/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/0 0 000"0%0+02040<0D0I0P0W0\0_0b0g0j0m0q0v0y0}0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�011111111 1#1&1(1-11171;1@1E1H1I1L1T1Z1_1f1j1n1s1x1{11�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�12222"2+2.252<2B2G2P2T2X2\2a2l2s2{2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2333#3,34363;3B3G3O3V3Z3b3e3n3u3z33�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�344444"4'4.44494<4D4N4Q4X4]4b4f4k4p4w4z4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�455 555$5,5/54585;5B5Q5X5^5e5h5k5q5x5}5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5 66666"6)6.61686?6C6I6O6Y6\6b6g6l6s6{6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�67 7 77#7(7+7-7/71797>7I7M7Q7Y7\7d7k7q7x77�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�78 8888"8+82848;8C8J8O8W8[8c8j8p8t8z8~8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�899 9999#9(9/969:9=9@9E9K9M9S9Y9_9f9j9r9z99�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9: ::::$:):1:8:?:C:J:U:X:_:f:l:t:z:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:; ; ;;;!;';.;3;7;:;@;F;K;V;a;e;o;u;y;|;;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�; <<<!<,<9<=<H<L<P<^<f<l<v<|<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<= ==== ='=.=4=<=B=H=N=V=[=`=d=l=q=x=~=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=>> >>>>&>->1>6><>E>M>N>Q>`>e>f>n>q>y>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>?? ?????'?.?0?4?8?;?>?@?C?I?K?M?R?Z?^?e?j?q?x?}?�?�?�?�?�?�?�?�?�?�?�?�?�?�?@ @@@@&@-@3@>@E@J@N@T@[@c@i@s@|@@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@AAAA"A(A.A4A9A=AHANAYA`AfAoArAxA�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�AB BBBB$B*B/B3B9B;BGBMBUBZB^BfBjBrBzB�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�BCCCCC"C.C:C>CECMCRCYCaCeCnCsC�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�CDD DDDDD"D%D,D1D8D>DGDLDUD\DbDmDsDyD{D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�DEEEE$E)E/E4E?EDEPEXEZE`EgEmErEyEE�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�EF F FFF!F&F+F/F4F9FHDHJHNHSHXH`HeHjHoHuHzH�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�HIII IIIIII I"I%I'I+I2I6IKEKOKfKqKyK�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�KL LLL L-L3L9L;LCLLLPL\L_LdLmLwLL�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�LMM MMMMM#M(M/M3M6M:MBMKMWM`McMhMpMxM�M�M�M�M�M�M�M�M�M�MNN NNNN"N)N-N0N2N9NANHNPNXN[NaNiNmNtNzN�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NO OOOOO&O(O,O0O5O:ODONOROXO^ObOhOkOrOwO{O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OP PPP P$P&P+P/P3P7P]B]I]K]O]X]c]l]v]~]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^^^#^2^9^=^D^M^T^Y^_^l^r^}^^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^__ ____$_+_5_;_>_C_F_K_Q_W_^_d_h_p_w_{__�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_` `````$`*`,`5`<`@`E`K`Q`Z`_`b`e`i`p`z`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`aaaaaa'a-a3a?aEaIaOaSa]abavaza�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�abbb bbbbb#b(b/b3b6b8b;bBbKbQbTbZbfbobsbb�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�bccc c*c4c9cBcFcIcNcVcXc^cfcicncvc|c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�cd ddd$d*d/d3d5dEdKd_dedldsd~d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dee eee&e*e2e6e9e@eEeLeOeVe^egepeve{e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�effff#f(f6f;f?fFfLfTfYf`fhfkfqfyf|f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�fg gggg g"g%g)g,g2g7g>gAgHgUg[g_gegmgsgwg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�ghh h hhhh$h,h0h5h@hKhNhRhchkhqhthzhh�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�hi iiii#i(i,i1i4i9i?iDiJiOiTi\i`ifimitiyi~i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�ijjjjj$j)j,j2j8j{B{H{P{V{]{a{g{l{u{z{}{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{| ||||'|-|2|6|=|C|G|L|T|[|`|g|p|v|{|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|} }}}$},}2}=}D}L}S}Y}]}a}d}k}q}w}|}~}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}~ ~~~~~"~(~-~2~8~A~I~R~W~]~d~l~p~t~z~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~ $+5?HOQV]`iov�����������������"�)�+�2�;�D�O�Y�^�i�q�v�|�~�������������������������ĀˀӀ׀ހ�������� � ����"�,�4�9�I�O�c�m�s�|��������������������ʁЁځ����������� ���#�+�2�8�C�I�P�^�f�m�t�|���������������͂ӂقނ��������� ����%�-�8�>�G�M�Q�Z�_�d�g�j�s�x������������������������ǃσۃ������� ��� �#�&�+�4�;�D�P�k�|�����������ńЄ؄܄��������� ����'�+�5�8�?�D�L�R�\�b�i�p�v�~���������������̅υم��������%�+�3�C�L�X�_�g�p�x�������������������džʆ҆܆�������� ��� �%�,�<�D�G�K�Z�a�f�j�o�u�{�����������������Ňɇχԇ؇އ������ � ���$�'�/�3�7�>�B�H�P�W�]�a�i�m�s�x�����������������������ÈˈшՈڈވ������� ��"�)�1�<�?�F�L�R�W�\�`�d�o�v�|�����������������������������������ljˉω։݉���������� ����#�,�4�>�A�E�J�P�U�`�i�l�r�{�������������������������Ȋϊ܊��������� ����"�+�.�2�8�@�H�P�X�_�g�o�w�~�����������������������ŋʋЋ֋ڋ��������� ����'�,�4�7�>�C�I�K�R�T�[�`�b�f�l�s�w�~�����������������Č،ތ����� ����'�,�0�:�E�G�P�S�]�h�n�t�z�����������������������ōˍҍ؍ލ����������&�1�<�B�I�P�X�Z�a�i�n�u�y�������������������Ɏюӎڎێގ�������� � ���(�7�H�M�X�]�f�m�p�z�~���������������������ɏ̏Џ؏ݏ���������� � ���!�(�1�5�:�@�F�N�S�Z�b�e�i�y���������������������ŐϐՐِܐ���������� ����%�-�3�:�A�K�U�[�`�k�q�v���������������������������͑ӑבޑ������ �����$�*�-�1�6�<�C�K�R�\�b�i�o�t�}�������������������ɒђْ������� �����$�-�6�;�B�P�V�Z�c�l�u�{�����������������������œʓϓғד������������%�,�1�:�<�>�@�B�I�Q�T�V�Y�`�c�e�i�l�p�w�������������������”ȔДؔݔ��������� ����"�(�/�5�<�C�J�P�Y�c�g�o�u�|�������������������ƕ̕ӕە��������� ����!�)�/�6�A�F�M�S�Y�`�f�m�v�|���������������������Ȗ˖іؖ�����������'�/�:�B�Q�Z�b�i�o�y�~�����������������ŗʗїחߗ��������������"�(�,�/�8�;�A�H�O�U�[�_�c�h�p�{���������������������ɘҘ֘������� ����%�,�3�7�@�D�K�P�V�_�h�m�~�����������������������əΙљؙ������������ �'�.�1�9�A�H�O�W�^�e�k�t�}���������������������ƚ˚Ϛٚ��������� �����!�$�2�7�:�=�A�H�N�Q�V�[�b�i�o�y�}�������������������Ûӛٛݛ���������� �$�)�0�6�;�>�B�J�R�Y�\�^�`�b�d�k�r�u�y����������������������Ĝ͜Ӝߜ���������� �����"�)�6�>�@�G�L�Q�X�\�a�i�u�|���������������������ŝ͝ԝٝ�����������$�:�I�Q�X�a�f�r�x�}���������������žǞΞӞ۞ݞ������� ����%�+�3�H�L�W�]�g�n�u�y�}�����������������������֟ܟߟ������������$�+�1�6�;�B�I�S�W�Z�a�g�j�p�x�������������������������ȠΠРҠՠؠ������������-�6�@�J�S�U�Y�_�d�k�n�u�x�{�������������������¡̡աޡ������ ��"�/�A�M�R�f�s�{�������������Ţ͢բۢ�������� ���� �%�)�/�3�:�>�C�J�N�T�\�f�m�s�y�}�����������������������ˣУ֣ڣ�������� ���#�+�2�9�>�G�O�Y�_�a�g�m����������������������Ťͤפܤ�������%�5�:�K�]�e�n�y����������������������ƥΥԥܥ��������������!�&�1�8�@�G�R�[�b�m�q�w�}�����������������������ǦͦԦۦ����� ���!�%�+�0�7�@�F�M�S�U�`�h�o�w�}���������������������§ŧ̧ӧڧݧ��������� ����&�-�4�9�=�B�N�T�\�g�m�v�~�����������������������èɨ̨Өۨ�������� ������ �#�&�)�+�/�3�6�<�@�D�O�S�W�^�c�k�n�y�|�~���������������������ũ˩ҩܩ����������� ���� �'�-�4�:�A�G�K�Q�T�W�\�`�i�o�s�{�����������������������ªĪɪΪԪݪ������ ����)�.�6�;�@�I�P�U�[�^�b�g�n����������������������ëɫϫ׫ܫ��������� ���&�.�7�=�@�C�M�T�X�\�^�c�f�o�~�����������������������Ŭά٬۬߬�����������"�&�,�4�7�>�D�H�M�U�Z�c�j�q�|�����������������������ɭӭݭ��� ���#�-�5�=�D�H�N�W�\�d�o�t�x���������������������ĮͮЮ֮���������*�8�A�K�P�Z�f�i�u�����������������ǯѯ֯������� ����&�-�4�:�?�D�I�O�\�e�h�t�z���������������Ȱ˰ְٰ������� �$�-�2�5�;�J�N�W�c�n�|�����������ʱαֱޱ��������� ���#�%�1�6�A�K�P�Y�^�b�f�i�m�p�y�~�����������������²ȲβҲڲݲ������� ����#�)�2�=�B�G������dictbdictayellowgreenwhitesmokffffffwheatvioletturquoisbfdthistltealsteelbluspringgreenfffafasnowslategraiacdslatebluceebskyblusilversiennaseashelseagreenfaasandybrownsalmonsaddlebrownroyalblurosybrownpurplpowderbluddaplumffcpinkperuffdabpeachpuffffefdpapayawhippalevioletrafeeepaleturquoisfbpalegreeneeepalegoldenrodorchidolivedrabolivfdfoldlacffdeadnavajowhitmoccasinmistyrosfffamintcreammidnightblumediumvioletrmediumturquoismediumspringgreenmediumslateblumediumseagreenmediumpurplmediumorchidmediumblucdaamediumaquamarinmaroonfaflinenlimegreenlimeffffelightyellowlightsteelblulightslategraicefalightskyblulightseagreenffalightsalmonffblightpinklightgrailightgreenfafadlightgoldenrodyellowlightcyanlightcorlightblufffacdlemonchiffoncfclawngreenlavenderblushlavendkhakifffffivoriindigoindianrhotpinkhoneydewadffgreenyellowdaagoldenrodffdghostwhitdcdcdcgainsborofuchsiaforestgreenfffaffloralwhitfirebrickdodgerbludimgraibfffdeepskybludeeppinkdarkvioletdarkturquoisdarkslategraidarkslateblufbcdarkseagreendarksalmondarkrdarkorchiddarkorangdarkolivegreendarkmagentadarkkhakidarkgraidarkgoldenroddarkcyandarkblucrimsoncornsilkcornflowerbluchocolfffchartreuscadetbluburlywoodbluevioletffebcdblanchedalmondffebisqubeigazurfffdaquamarinaquafaebdantiquewhitaliceblucnamedarkgreengermanlacedilemmashortcomelectronconventionindependantliklingonstitchgibberishgetdefaultencodserviceformsetaffilismallfieldserviceoptserviceformformsetalphanumelmnitpickbadlisthomeworkbubblbedbzreditableaticketelasticutilmozillaforeachmindfulliflistinvestiglexiccertbypasscertifipemjudgmentattackdirkreitzkennethjspringsslerroruninitialisconditionmetlolxefnprocparmapstrgswdefaultvaluheadernamoregontexaohioutahbdedataframeamckinneiwewriteupmydbconndbconnectdbconndatabaseconnectcleandownsssbabelhhmmmmeeeesightlimanufacturcarrsakeyfilservernamforecastbitprophetmyvenvpostactivpositionsickboughtbrokestrawcountlesshansenbiggerarondcopysignsisterlibblanotfounderrormiserinitoxgistcpuinfounamtblfmprematurstackframconservsetrecursionlimitunbridlguardspitfibbeliefinequbuildercompanionalienlispicourtesishootremovemethodpyshelglamstriplistcheckboxpreconceivpreconditabsentarrowfuncdefunrealistobsessillusgiantathomebrewdeblibaggpycxxmathtextpyparswebaggfreetypamenbiggestcoldaccelervectorizklibcylindcabrioletfordtruckwanearhammerintarationinexactsafestcronlogsyslogendlesscleverbarsslatemaptestbishtritiumpycudapilexreadlinteesortatextinputsearchformgetjoinncludepensslcvarsalathtilfindernstallasecommanddistutilserrorommandetuptoolggorassgetsliceargptrcdataowncdatawformatmiscetupryptographipacoocalppdataacodadcdecafebdcfaecafaccadbfbacbdebaaadedccafacdbcpnacondacryptographipwriteerrwriterrreaditertupladjclosadjfinancmsftfinanciinablisdstydaiwdaimdaigmtimededicneatliwhatisthiclipboardzwithdrawclipboardhackersampleclassdatelistnumdaigetsourcelinjessitackrowellibsasllibldapopenldaplberldapobjectldapboguharripotatonewkeioldkeiarglistgetargspecbmpavigoodvalaesthetiterkeisreignorecascasesensitoverflowerrorsweartallisnulandgtedjagnobyetodaystrunsortinputstrasfasfaweeknumbisocalendarwkrogramjamylakascendscriptnamextinctactormaliciamanlessenprivaciisminlevelminmaxnewboardwithmovcurrentboardnewboardplayerminimaxstretchhorrorardentdearlicontortbacktrackrebellionloverhordcrawlskinglitchrepentanomalieyesorbeholdincrapplyresultnowadaiutcoffsettotimestamptoordinlocalzontzlocalutctimetupllibevgbwaehymabdebacebbbambroffbitbucketgreenletsecondlifoptiplexagrovherdeventletawkardsuperflufinesscaloriwoopavgpaginviewerunordertypenamlexicographimplementorideonencouthandleerrorstringifieoferrormultiprocessinglogrotatingfilehandlgarblbannedphraseformexpectedphraseformbannedphrasexpectedphrasauthorformunreferencfreedapprovkoortemailfieldscrapdirwimpriscotmpdirtemporaryfilgettempdirunnamplugrightlinicknambendsnazzigetfilesystemencodfrozensubdirzzenvnammutablemapworkspacenvpythonelectunpicklbethardpicklablslingpicklingerroriowaelisptrunkasadchevdespairspeechnaturallyspeakdragonemacinjurisportcomputingforquadoverwhelmprostheshurdlflashinvestwhatevlandrsimodalpredomingpavoicfingerregainbriannagirlfriendwrestlergolferswimrussianwaterdovegraduattownnearbiripahonzayounggodquadriplegaidduratweakenthedictdicimportantliquincunxcommmentsplinedatarangplotrangimagetransformfnylistinterpolfnxgridcentcenterofgravhorizontalgridlinemaskcentroidcaliperlengthverticalgridlinemaskcalipgaussianfiltmorphologicalbinarimagemultiplifillingtransformsortbilargestcomponconvexareacolornegcomponentmeasurimagedatasrcadjustdiskmatrixdavemarkcolorconvertmathematicaoutlinwarpcoincidgogglsudokudefectconvexgemrvmrubygemdbrtvnamerzookoverstrvsrertverstrlinversionfilmyniftyapphiddenpaghttpcookieprocessorcookiejarcjmypasswordcookielibunodpthsysconfigcollectstatstaticfilebigvrewumredactspamexcepttbdcoroslidecouroutindaveprecludwarrantjusticrockagfuninterestcoroutininquisitprisonthomotheratleastmsbflipcomplementscalablpymplerwiserestimassistwebfactdisappointmpmdumpletongrahamploughleanertrafficbiggifruitxeondissemblrotdeployintegrationwithdjangomodwsgirunfcgifastcgiformuladdtypexeccgihtaccessbluehoststmhealthbbcnltkntlkslightiurllistgetresponsnetlochttpconnectourldosomethingwithresultgetstatudoworkurlparstwistedlessigorsbinpluralmetacharactsteelrumoruthontribodelegistritmportlibonfigegistrijangoanagteelrumorappregistrynotreadiendifgetflagifdefhasfeaturpyvarobjectskeettpflagfastsubclasspytypsetobjectfromstrindexerrpyunicodeobjectpycompactunicodeobjectplausiblisuspicionnoncompactpyasciiobjectborecheckconsistpyexcsetstrbadarguupvotbytestrcompetitmaxlendisagreremarkformedunobviunescappoundsubsectdickinsonrecastendblockregistrpreprosessorcredentibrowswhipaudiencsomehshamepipsessirmezzanininstallrequirhachoirtvdbguessittraviowoftwarhkcuhklmamdmoebisectlifetimspraiarrayobjectpylistobjectpylistindefinitnobreakntkitnulpingquraunicodedecodeerrorwordpressxlibsdkfontproperticirerafredgibgibibityobibytyizieikifmtkilobytcontraptgoldbergrubegutlexerimmensirreducengagelidnounslewsubgroupcleverlifuncitonaddernewbranchmyusersdistproductnamprodblahcoformatstrformatttickerxlimstepsizfilformatdcommaspacmimeapplyonatanredirectviewbarrobacarlurlpatternmyviewcoldfuscflocatfunnipayerpaxdeclincrosselroomqsfgtainsurfailpythonversgypxfaltinstalvpsalamdelnanlegitimmimojibakcodepointlatinrecuresxxxxmasturbintellectuhonkdutchpuritidenssparsretcodfnullsilencalsaespeakdanodonovandownloadfillivejournjcalderonuptimeboxunutbustarmapharveststrengthsubvertlenientsimplistpackageajkpnewrangoldrangoldmaxnewminnewmaxoldminoldvalunewvaludzoneghostdrivgbqfbasbtnscreenshotphantomnpmnodejphantomjstartmigrkfbyourappschemamigrgeocitystfootwounproductingnonlocstealunboundlocalerrorflakitimefielddatefieldimpetustampreliantdownaforementfoldtwitterptarjaninvoiceidpkeipostgrpubliclidoesnotexistaddjournhiddeninputjournalformtankprofiltanktankjourndisclosurcheckoutgratefullipurgxaxiyticklinxticklinxticklabelryoffendticklabelnomenclaturtickmarkdevshzipfziphzipdirzipfilservnamnodenameggnamuripublickeidqbhungvrsioonrvwrujcpnhmcbechwebcementmotediumroadrtypeautodocmarkupprioritynamprioritiholdermindsetgrainfcgirecomendvisitorgetframeinfocurrentframdedentpainstakcachedimagphotostumpimagefieldasmeurassumptoutstandlocalenamgetdefaultlocalgetlocalerroroutputerrorstrfrontendpagesgenerarticlesgenerrichomyblogpelicanenvcommendpelicancruisstarttimbiglistafraidkmpiscircularonelingigadupcircularliintermittdamaganalogtwodtwodlistcopyfileobjdeflatstaticmapepytextrejoicsocietisocialeconomperpetudogmaimperialistexploitnewcomcrazycodpsstsurfacknockrepresskingfilthdigdennipeasantdropdownpycharmmyproductreinventtrousernecktijacketuntrustpylintincomattrdictattributedictisalnumprintablalphanumerehlostarttltoaddrfromaddrauthsmtpexceptemailsendscikitlibatlasigtermgetpgidkillpgpreexecsetsidtransmitleaderhasherafilhashfilgatevulnerbroadertendenccryptographshascarifnamelstchecksumasctimmyloggspeediblazinglimultisetforbidtermiminuncompressasiinvoicrelativedeltaenglanddickpamreedpwcliiterrowinpwtithreimportquickerzbybzayaeuclideanonardbastienrsplitabcdccmdlinelsonrmvirtualenvvenvmycodshutdowncleanligenfromtxtfromrecorddelimcsvremakgraceutcfromtimestampshlexmyitembarfoomyfuntbodispadsoupsunsetsunrisdailiscrapebashrcsomemodulsubscriptpercentagerasftplibselectiveescaproundupnohupbackgoundinteroperbuildoutmklhdfneglectfocuscondatmplclosestseeminglipineapplsquarepspongebobinterpolsomevalusomefieldsomeobjecthellomodulhelloworldsuffixgitignorenddatstartdatradiccffiprimarilipygamjitterimpractintensdiscontinutheoretdrawbackmainlinbizarrchequcoodbanlethalnewspeakbrachagiladiowcallesubroutinassemblianalogivanishbrilliantbuttrephraswsgistumplspringpythonzopeeeiocmississippinginxjenkinpragmarigmeantimthrewembarrasssalemultiindexthirdpseudobeautifulliprobeoccupipydictminsdictobjectpaymenttermpaynowdaibackticksupersetpayoffwriterbridgfiltknifearmiswissscholmdishkludgiestspanhardestembfenctoctrecommonmarkrecommonmarkrtfdgrammarpegparsleiremarkdownsgenouddialectsubtlipandocdocutilrestructuredtexthaterstmarkdownappspotgrantdatastorphrasemyopicsaxonsigheuphemistcheapertraspardiscounthamperjniwashrichergwtloathamazingliinventorboardteamperchstrongerbiaspliappenginmuoveppurpocoolucumrlupefiascoendfiltescapejadminmediajeremicatalogwirestylesheetjsiurlconfmydatetimmytimproductformmydatadminsplitdatetimadmintimewidgetadmindatewidgetundocucautionmtvmvcrelevantliendfortdstatlibinterchangallendanncolumnnfkaccessorbooleanfieldisacceptclaimergameclaimclashsendmailsmtprecipimimetextmimemultipartmimesmtplibhereatrippablmagnifiaproundoffquantizpipversschemamybarpackagotherpackagmyfoopackagautovivifsetdefaultobnoxiprofessqueensalesmenmiddlesexplumbercountimercerzprofiltcshrccshrctrsymlinkquietdashhorriblichmodrollbackerrondatabaseerrornetbsdopenbsdsolaripsutilwindllmemorystatupystatgrabpsiuseradminuppersonadminmodeladminsttypropofloordivtruedivaccustomdullsubnscannerchoicefieldmodelchoicefieldredesignpromishttpresponseredirectaddclientclientformmodelformlispuptorawtexthelpformattepsilongammahadnfoolderthercoltranunquotllermaftestspecifixxpercentuaevalutsadlixwindowaggtclerrorusetkwantobjectscreennamtkagggcfgraphviznxnetworkxroadblockcsrffirebugchromedevoidsiftaboundenvatogonnastressneatrecievdudealertspiritassociopportunpuristgeneralisturecompanisendfildispositlighttpdxsendfiljanuarifebruariprintoptscientifoptionsainvolkntpqescdisappearkeymapvimjonelojacksumraabfrerichhexdigestbufblocksizrootdirramhashlibcheckequalivohashablcheckequunequwijkderivokennytmadjacincurprintermsvcrttcsadraintcsetattrsetrawtcgetattrtermiottygetchunixgetchwindowgetchdepencvelocvectentfriendlierentiretitraditionoccasionaspxsoftmofeelhspacerawsignswhardenylimspikeherokuapachrpafsunpymoduldynloadplatfluphomepagmypaglonlataddrgeoipgidropnawouterrptstksipcapitanxrlrwxrpydevlitoomdlopenamespactestmysqldbcvdvconndylibbaconrecyclambitiunladenespmultithreadnecessitbeautifzerodivisionerrorpublishunprotectclumsiindispensdecouplmidarosmotionbakesmellctorendorsdisclaimtitlesfontsizmplylabelslugifgoldslugifidefaultfiltsyscalparsonnatefilehandlfutimfhandlutimasmatrixabidconjugndarraiinfluencmatricraddrealitiiaddtolduserwarnististutilctivepythonoauthpypmproginterspersismethodoptionparsastypdcountaggregseanteddifreddishopsalesmanliblapacklibopenblagfortranlapacknetlibblasnotfounderrorblarcparamfamililabelsxticktickmydocxpathevxpathnewcontextctxttstparsefilxpathfreecontextfreedocubiquparticipcompliancxpathattitudspeakerimpossafetielevenpleasantdistastinterepretcoerciongeeviceversaprintlncoercweakliinstantlifirstlivestigsuspiciousoperemphasimiddlewarwildcardsubdomainrequestaqualificommanderrorinterrumphandlecommandlineventloglogmsgsvcdorunsetevpendreportservicestatusvcstopsetdefaulttimeoutcreateevhwaitstoptestservicsvcserviceframeworkappserversvcservicemanagserviceutilskeletonpythoncomlogindemoninterrelsketchnewdictolddictsynactsomedomainuseablfavouritsettlcharreffedmlstripperhrefsomewebpagblorkersionpylibmcnewesttttttlookaheadfinditrfindisincolumpayloadaliccherrypireturnmatchendlinsuppressexceptiontypassertnotraisalwayssuppliesavalidpathsvalidpathpathisnotavalidonalwayssuppliesaninvalidpathsinvalidpathestablishloadmatunsuccessallegmatgdpcomplaindebussizorldabcdefgfartmillisamplebiamynamsystemascatterpointmatplotlibrcnumpointoptimumfridaimondaisundaiweekthskurmedelmanyargdisregardvarargreyricardomemorisashamunsatisficanqtypopulinfinitemindexiircbetwenunpredictsilentjabberwockisetlevelgetloggpopitemitervalupaypaltangentlaboscarreponibptdraftcloserfillcharljustleftovpycachinterpreteradontpythondontwritebytecodpyyamldocumentyamlerrorpureistreordertolistrearranguntouchbakuriumistakenembarrassinglibacklogenoentsilentremovoverusserdaliindirectasencodedstrverbbytearraipycalbloodireopenwhollispendwariwhistlbellbackupfilelinenopredicclsmembergetmembplentitomdottomincompletopenssllibssllibffipyasnhttpsclientndgpyopensslcertifsslcontextinsecureplatformwarnwheeziinsecureplatformuncompyinstalguiprogrammoinpyqtwxwidgetfactoshedconcludnbdateranglinerisharctanharcsinarccooverlaitrigmathematscimathifftfftrandoldnumerrcoverarchwholesallinalgexplognufuncoftentimtolonensehistormemorunmnemonuncertaintiblamechromedrivgetattributouterhtmlinnerhtmlfirefoxwdwebdrivseleniumwebelwhitespaceregexprogramfilmillisecondtoprettyxmlparsestrminidomdomplatformasomecoolexceptmytestcasmymodfailunlessraisassertraissimplehttpservsprintgetsitepackagrandintinclusedgecolordpisomefilrmdirxpkilometyesterdaimergedlistjoinedlistlisttwolistonorangdelaimynewvalumynewkeisomestrindexofmichaelsetloggerclassaddhandlsetformattstreamhandlcoloredlogglevelnamcoloredformattformattdmresetouputforegroundcyanmagentayellowcanamonoprocessastringicwritecreadtoolchainstringiocstringiomiskufmirecameriruamelyamloccasstilsoonerfansymmetrijnnnnnuglierwovadzgridyaxixlabelyticklabelytickalignptpbarhgcamoduloasarraidstacktimestepcontinclimxydxdyecfcsuptitlionvastgifsmoothlispradiusmoothregiondropboxjoepacefeethollowdownsidwxpythonconvincantipatterntwiddlnormpathexpandusfrobmyothermodulmypackagrunnablrunservtoolbarmediascoopwetsumichiganstarkhawaiiarizonaaleutianalaskaturkeirokrocportugpolandyapwalliwaketruktongataputarawatahitisamoasaipanrarotongamoresbiponappohnpeipitcairnpalaupagonoumeanorfolkniuenaurumidwaimarquesamajurokosrakiritimatijohnstonhonoluluguamguadalcangambiergalapagofunafutifijifakaofoenderburiefateasterchuukchathamaucklandapiapdtpstprcnavajonzbajasurbajanortmdtmstlibyakwajaleinjapanisraeliranreunionmayottmauritiumaldivmahekerguelencomorococochagoantananarivoindianicelandhongkonghstzurichzaporozhyzagrebwarsawvolgogradvilniuviennavaticanvaduzuzhgorodtiraspoltirantallinnstockholmsofiaskopjsimferopolsarajevomarinosamararomerigapragupodgoricaparioslomoscowmonacominskmariehamnmaltamadridluxembourglondonljubljanalisbonkievkaliningradjerseiislhelsinkiguernseigibraltardublincopenhagenchisinaubudapestbucharestbrusselbratislavaberlinbelgradbelfastathenandorraamsterdameuropzuluuctgreenwichgmteiregyptedteetcubaeasterislandcontinentchileyukonpacifnewfoundlandeasternsaskatchewancanadacdtcstceteastdenoronhabrazilyancowinnawestvictoriatasmaniasydneiqueenslandperthnswmelbournhowlordlindemanlhihobarteuclacanberrahillbrisbanadelaidaustraliastanleihelenageorgiareykjavikmadeiramayenjanfarofaeroverdcapecanaribermudaazoratlantyerevanyekaterinburgyakutskvladivostokvientianurumqibatorulanulaanbaatarpandangujungtokyothimphuthimbuavivteltehrantbilisitashkenttaipeisingaporshanghaiseoulsamarkandsakhalinsaigonriyadhrangoonqyzylordaqatarpyongyangpontianakpenhphnomoralomsknovosibirsknovokuznetsknicosiamuscatmanilamakassarmagadanmacaumacaokuwaitkuchlumpurkualakrasnoyarskkolkatakatmandukathmandukashgarkarachikamchatkakabuljerusalemjayapurajakartaistanbulirkutskhovdkonghongminhchihohebronharbingazadushanbdubaidilidhakadamascudaccacolombochungkchongqchoibalsancalcuttabruneibishkekbeirutbangkokbakubahrainbaghdadashkhabadashgabataqtobaqtauanadyrammanalmatiadenasialongyearbyenarcticvostoksyowapolerotherapalmermcmurdomawsonmacquaridumontdurvildavicaseiantarcticayellowknifyakutatwinnipegwhitehorsvancouvtortolatorontotijuanathunderthuletegucigalpaswiftvincentluciakittbarthelemisitkashiprockscoresbysundpaulodomingosantosantiagosantaremisabelsantarosariobrancoreginarecifinletrankinriverrainiricopuertovelhoacrspainauphoenixparamaribopangnirtungojinagasalembeulahdakotanorthnoronhanomenipigonyorknassaumontserratmontrealmontevideomonterreimonctonmiquelonmexicometlakatlameridamenominemazatlanmatamoromartiniqumarigotmanaumanaguamaceioprincangellimapazkralendijkmonticellolouisvilkentuckijuneaujamaicaiqaluitinuvikwinamacvincennvevaicitipetersburgmarengoknoxindianapoliindianahermosillohavanahalifaxguyanaguayaquilguatemalaguadeloupgrenadaturkgoosgodthabglacefortalezawaynfortensenadasalvadoreirunepedmontondominicadetroitdenvercreekdawsondanmarkshavncuracaocuiabacrestonricacostaharbourcoralchihuahuachicagocaymancayenncaracacancungrandcampobaicambridgboisbogotaboasablonblancbelizbelembarbadobanderabahiaatkaatikokanasuncionarubaushuaiatucumanluijuansansaltagallegoriomendozariojalajujuicordobacomodrivadaviacatamarcaairbuenoargentinaaraguainaantiguaanguillaanchoragadakamericawindhoektunitripolitimbuktutomesaonovoportoouagadougnouakchottniameindjamenanairobimonroviamogadishumbabanmaserumaputomalabolusakalubumbashiluandalomelibrevillagokinshasakigalikhartoumkampalajubajohannesburgharargaboronfreetownaaiundoualadjiboutisalaamedardakarconakriceutacasablancacairobujumburabrazzavilblantyrbissaubanjulbanguibamakoasmeraasmaraalgierababaaddiaccraabidjanafricabtboxtimtestersupposedlithreadpoolsocketobjectocketlinkservibotdministrsermimicpathsepfpathlaunchmissilkeyboardbuttoninspectorpanelcloseaquotatsrcrootlaunchaiconuncheckexecutableainfoarunaschemeaproductanavigemptyacreateaunsurnextatoolapaneotheraprojectanewafileascratchsignifigetopttightliflagfoundtheflagdeciphercontinuewithtbtextboxfortrantightenspecialisthickspoilinterdependffismootheraheadhighestinsightfoglebirdchoselibraryastandardiswesleiaddisonstevenrichardliteraturzombicontradictoriwormadvisoricooperinetddetachsgidsuidelevrelinquishumaskgaolchrootfiddliunderneathexcessreindenttidimixturmidlenoldstrnewstrwinscplfcarriagoriptoolkitdatadictfromdictfromfilenammydataneatertransitunspecifibomfreelibbfeffobsoletregregistriblobnvarcharoctetcuriosinfrontprospectstraightforwardlisusceptspeculinferrpythonimhomisleadscorepypypypipypypichancspeedupattainyscalelwlogarithmreluctindustricluellvmcibirxscsubjfulldataddsecinclintimevisequnumelbinarmatlabartificiinteriorcontigutolerwandphotoshopsliderapproximgrayscalimapvstackrgbplaneasdirectthescopfrontierbreadthcoordpypngmikhailhinderinefficiwoefullitransfercurvbeziercubicaccurtravelcanvadrawnsvgunintendcolourmazegeorgsomeothsomeotherthmatchamatchobjectasciiablgrokvitalxaxcacutrefmimetypspankdjangoprojectborrornathanwhatingenuunderestimdisposblowlikelihoodpoorsanitisearnyearlisalarikidretypisuppnonsensdicketicanyouvotrojectshortenipythondirkointeractiveshellappdreloadautoreloadsubmoduljchlmartyalchintemperaturownercelsiucontroversipythonximplchannelterndeducsynaxcheckerternerilaunchstubsensibliopaqusteerrealisspentlessonteachledspeakservfctnlioctlthinhasslplaceholddimensmultidimensionmscoctumpiorkspacsurfidliellipsiantialiaoldsizmaxheightmaxwidththumbnailquickstartmonitorwatchdoggratefindnextchangenotifpywinpartliyyicycliccircularinstallationerrordescreqbasecommandpymemcompatdunivdbigdversionrefreshcrxuviuxchangelogthunjwjohgvdpthreadreturncodforevstderrdatastdoutdatabenhoytchrispirbprojectitemstartappmigratprettyprintdaylightconfidbkludgidoctorterribliastimezonpytzdarwindemonstrlegacizoneunawarlibmariadbclimariadbsshbeazleiinfilpolishtomzlibcrcibguptaankurgzipplaintextjsondecodmynewlistmysettrendthenandnowpbnowplaiincidentbaggagflavortonetruthibzrlibpaidrxlpredefinangularjbtfordterritorijquerimongolabsufficimgphonecatlayoutcssminitwitbackbonemberknockoutfrenziangularpeacflaskmicroframeworksightimmediatellisaucpizzaculpritjunchaoguaufziehvogelnoqabazaarsubversvcepincompletereadlivetkintercoladequnecessarilisettingwithcopywarnslengthapplymaprandnvolumempnotepadspawntailoroverboardrewrittentrickierpipelinridvictoribadlitextfilpyapycamalfunctpyoacompiledpythonfilpytuttheorifaqtypochaseridiculsenderoffloadcountriinactiveuserdistributdenorminactiveusinactiveusermanagpublyshexclusmutuallooseranalyttiembarkgeographterminologilibertitestablverbosusernameselectwidgetwidgetactivateuserformpkheddunusudriveninfrastructurconfirminactdeterministuniformunacceptceasedghettingraymondtirefulfilinaccuracisufferdomyspecialfunctsomesortofselectphilosophidiamondvagulcsetlocalstrcollsensitalphabetalistpyolocaltimmktimedoinstinctfancifyimenuinnermostunionmutablesetorderedsetinitialisuserspacsuccesfulieventdescriptevteventnamsubmitquerystrurlencodpresencghiswallowwontuncaughtoutermostappropriunziptransposunindindentationerroradabdbbfactivepythonuuidmarkupsafexampleclassinflexlststumblascertaincautiouhuhuhyupgroeelectorfederinforskramkluftnfkdgroalectorraldafapainfaskraftklafilepathpossessapostrophbrowninvobligrepositoriinsensitelibenintersectpopleftdequprimerstrerrorifffreebsdvistalandmarkoriggetanglebetweenpointtruncleschinskiericradianatanarctanangleindegredeltaxdeltaiquadranttopleftangltunecommandlindoesntbrewscrapidepthmaterikeenthelistwritelincleanesttotalamountpurchassoughtssddthhjsonifisomedatetimehersomedmemoalcormenmemorandummemoizsuccinctlifromkeidancusaorakevpiconstitutdoublicomposcurribdflunpleasprettiestoopromotalgebrapackgnutxzfprivilegpydistutilrebukglyphfreshannounctoolboxnollerjesstelecommuntprereleasviicszdkwwatchyoutubunlockidlprotipyourfilmenbulkcognitevolvskycakyoloderpherpforeignwatchoutriaawesselnuclearchekovmoobarmylibcryvixenfoxrobustprofessioncodebashastilimkdtemptempfilsnamekwdrestorredirecttemporarilicontextlibcontextmanagfpraiilightlisolidealtimproperliimproperlyconfiguraliacontenttypcontribklasssubcommandtutdjjoerobinsonsyncdbsomebaseclassgenexpresumsuspendparagraphgetwrittokarepetitsetdefaultencoddefaultencodtemptbtwcalcsizffffffffffffffffffffffmaxsizlinkagquentsubsfseekintervenirrespecttruncatmanpagbsdfopencolonarrangasymmetrscatterprofitkevaptitudhoopwaitersubstantfloatsleeptimemodulsyntaxerrorpreassignlegbedputtextuintgeneralresponsgeneralsamplsavetxtwaitkeinormroismalroiboundingrectcontourareacntapproxfindcontouradaptivethresholdthreshgaussianblurblurbgrcvtcolorpitrainimreadimclassifrectanglconstraintcontourpaperhollandpaperlettsofworkoutdenotrevalravelnearestneighretvalrecogsvmknearestcvopencvocrrecognitumlautminiquarknonspacgreekmncategorinfdunicodedatapyicudiacritaccentmembershipclearestneighbourparticlproposunderstoodillegalargumentexceptannoybadvalueerrorillegapologostreamropesublimthinnercheappruneunrollepyunicodnotimplrichcmpfunccircuitmacroleaverecursivecalenterrecursivecalgenopeeqrichcompareboolpytupleobjectpytuplpytypeobjecttuplecontainobjobjprocdowncastitersearchsqtpsqmpysequencemethodincrefpysequpycmppredictopargcevalprovedispatcheywolevlinearlimaxcachcachekeiglancnegligperceivcapzillionhttpresponsecodexyzhttpresponsecodgethttpresponsecodcamelcamelcasusecaskeystrokrewindautocompletbpythonintegrgettingittraceclipsgraphgnomeshineimpressreinteractitchusamazdiiidealpicklnoisciaoorthogonimperfectslashbackspacbackslashcharsetahurtrainerfishcowbirdrabbitlpfulverxtpfulhelerichunkerneedndummibrokenezpackageresourcleakunlinkjsonresponsrequestcontextvldjsonvalidatereturntestusarraytojvalidateerrorvalidateidvalidatevalucookbookintruspidsigusrinteractiveconsolirreproducuninstrubetaoctaldtypetommihauxdiffxdlngwikipediasgkkrenzelatkinsicedlangcompdickinsmcpomultlastadtmptktkxtkcsmallestdimposmallpdotcriterionzerovoltceilmpsycohankwilliamrobertstephanprimesfromsundaramsieveoferatosthensieveofatkinrwhsievambihardwarprimefolkpartitthrowawaiatomtbhmymodulreenterlevenshteinsubgenerdelegboostirregularlistofthbuschoolboatvehiclcactuplantbearkeyfuncuniquekeisebastjanprerequisitobjectifigroupbimartoffenbachcharlfeedbacklibzlibfreetyplnpillowlibjpeggetdecodpiljpegquitmeddldeadlionmountainxcodekuiperthijsuperuscppflagqunuscflagpriortestutiltestconfigtransactnotifilobjectdictcursorcancelbugxgctpcdbapitzbnwiwbdowngradintelmacosxpsycopgmodulcellarpqfreememdhavedpgpqdtpydatetimdpsycopgwshortenwstrictdndebugdmacosxdtracedenablfwrapvarchstrictfnotinognvhxjzwmljjwsjmnwunusmaverickmaddfusemnounknownclangamberhgmercuridatetimemodultarbaldesinmvcrucialoldstylalrightrevisjoachimptextparshtmlparserclassobjseamlessmichaeledgargithubccdgenexprjavadocfrobnicanamthemodulpollutfiberprocstrikinglithemethodinterestinglicallbackcallccgluemungregexprailkakavotetastsuckunhelpleakihypothesunexpectedlicompenssignificantlineedlessbrevitilshiftpynumbfromlongfromdoublmodfwwvvintpartfracpartdiscardrecalswappedopimpossasdoublexcenumbitirrelevnbitwsignvsignunimplgotopylongpyfloatfootsummarisrichcomparmetsignificandfrexpheldworstexponfractioninaccurnightmaracknowledgunfortunsoleclickstandalontornadopydocopcodpredecpreincpostdecpostincwadecurlhttpliboptparsdiscouragblendappealcondifprototypcoloradospotgplwakefieldmatthewcogentmaxwelhuttleigavinknightrobauthorshiprapidliautomshoudplanetcopyrightobamabarackguidelinloadlibraricdllfoowrapplibfoosonamwlfpicswigquickestcollectorsizeofobjectapartigetsizeofgongpainucqwbamffrotzbriestiltonmanchegobrethenfillvalulongestizipunnecessarilimassivunpythonwebpaghyphendowncasslugfieldmovicomedivirginslugvisiblpretenctaughtmsgshowmsgboomeckelbrucegranularpumpuikillablipcprimitmultiprocesssupersedsimultanunmingldiscovercomprisembodibundloverviewdivestraightripmodulenampluginfromlistargvjohanncouttimerlottrepltranvinkochbeatmaketrancategorreadiliunbufflyckamagnufilenofdopenpythonunbufftimetuplutcnowtimegmepochminutcommonlidiscoverigravitytestcastestcastestloaddumbrealistantigravunittestpauspressanalogusigsignalctrlsigintoutfilgrabsimplejsongetsocknamgmaildgramsockinetafhackishshufflminitenthfinishhelloapplapplsplitextbasenamforanoneinfieeeisnanthinginansdsdresearchgethostnamchathostnamforgotoperandunsupportbitwisenterxormystructobjectstylsphinxguidancagrewriteablenclosdatmidnightdanosaurjustifipunctuatdelimitjmoddhalvabspathamodulnotifinotifiisagetsizdaniwebemailreassignggggggggghhhhhhhhhhhhhhhhhhhheeeeeeeellkkkkkkkkmmmmmmmmnnnnnnnnnnnnnodordereddicteasiestlazilianecdotapparkeyboardinterruptdosomethwhatsnewmyvargitsubdirnamsubdirectorixdeadbeefdeadbeefffffbenlambpairwisvoilajunkproudmontieexistpydatainplacdfdenominremaindratiodivisconfigurationsyntaxerrorimpropcorruptelucidgapbiaenrichabordmerrilumindrawrectfillrectlylxdrawlinxffffffffendpointstartpointarraylistylinejpgdrawboundarirecthighlightvalidlinxexstartystartgetobjectrectistregetintcoloranalyshashsetdetecttreresembllinearmassxffbluegreennewcolorgetintcompongetwidthgetheightouterloopxffffimageoutimageinbinarytorgbgettruematrixmarvinmathsaveimagrgbtobinarimarvincolormodelconvertdisconnectsegmentfloodbrightestsetattributloadimagmarvinimageiomarvinimagmorphologdilatboundaryfilmarvinprojectloadimagepluginmarvinpluginloadmarvinimagepluginchristmastreframeworkmarvinseekbrightprogrammatredtechnologiclassificascadhaartrainchristmainjecthurtperfectsemislopeslipperireachablgoogletestindirectlisinkoppositsanestemhasnsingletonmetaharderintermediarischemeenforcviolatredefinleftmostsubclassofsingletonemptaughtdebatoverwritteneughconbaseclassgetinstgumphclutterprinciplwarantischtaskmediumcrontabceleriamqpretroactdeploicronclarifibasiaayaihafuinteractwxtkqtosxnbagggtkautocaselessstrenumipkernelappzmqchirpsinpilinspacmaconotebookuninitimatrixdimensiondisjointsomeabstracthairsplitnotimplementederroramethodbabuncygwinbafflinitdpgsqlundertakweenifreakabusanytimhallenjacobuniformlisuboptimleapweekdaimonthrangcalendarsplitlinexpandtabtextwrappostprocesswasnahonestlicoghlannicksubxscreencastlesserinspirfiglegendverticheightaxiwidthshrinkfancyboxncolcenterlochorizontboundarishiftixfigarangpltanchornaviinalikindliserilegendajaxaeactionscriptuttzutctzinfooffsetcomplidateutilrfcapolloonurindenttojsonfileitemonisetattrvarnamidiomatconsolstaightforwardwheelpythonlibucilfdfussallevijpypewhlapriltutorpipermailmailhackiflyweightstreamlinfnmatchiglobsubfoldculturadaptmccutchenabbrevinovcrashhabitcastearthwonkisuddenlitodaiquadratouchoptimisempirshashsvalobnewrefernomemorireallocforgetreferreftotdecsymmetrnewrefunrefxxxbadinternalcalpyerrdecrefrefcntsvpybytesobjectssizenewsizdeallocresiznotionxdecrefconcatpvpyobjectconcatanddelpybytbytesobjectamortoccurrrecovaleksitorhamokudorotatnontrivioutperformzhangperiodprincipregexawmertzlowprotocolconformfunctiontypoftundeprecprevailmixedcasthisismymethodvoidthisismyvaripascalcamelcasfdbufsizenqueuimporterrornowaitreliablasyncprocfcntlmyprogramavaiblmalformerrnoonerroroptmongoastmoodcoworkkittilolzmuffinfilterbyvaluwayacaveatdevelredhatcentointernetutilcutilsmodulserializisoisoformathandlerdumpserialsendadditionmicrosecondqueryperformancecounttimeaprocessorperfaccuracisomedirvinaistoreactmetavardeststoretrueactargumentparsnargparserargparsstfromtimestamptimestampiganciogameloopevnetrctimeoutuploadmultipartdecompressdigestverifsslpersistcookisessionpoolalivdomainicebergjdoelastnamfirstnamuserdatamywebsitrespunbelievhuntbriandestructthrownwindowserrorcddevnulhallaaronfoofoomyargmycmdvartecdeadlockpopenargpmysqladminurootmysqladmincmdcaptursailorsuperclassaccidentscramblehmypublicmethodmyprivatemethodprependmyappnegatboolnecomparitltgtquerysetreaderaprsingletonwinnerexcerptreimplementevolutdictionaryalostunordhonestwerentunreadobjtypdescrobjectpypropertifdelfsetpropsugarffdelxsetxgetxaltogethbotherunturnstoneretrpasvsystxmlsoftftptechswwxmlversionfatallibxsltlibxmlxsltgacqgiudqoztmpbdisttgzcodespeakparenthesitooforverylongdeliberenergiroledescrawkwardpythonicestgarbagsentencjavascripttokenimpersonkostyagetusgetpasspwdpoorlislartibartfastgetusernamgetuidintegrityerrorcomboadmindatetimefieldmanytomanyfielddecimalfieldforeignkeiblankpostgresqllibpqgoshawkpplicatnlopeocumentourcmanifestependopkgsycopgcfgpgrcesoudddacfdcmdpsycopgmethodtypefbarfightbebfoofightunboundbcnonethelessryanattachautomagdowneipunchtearspellradaranyoneaarenabringunwittingligaeburiproblemadoorhirdargucohermaintainnutshelbriefliblogspotmrorefactorwfixerrefactoringtoolhexxlistcompmicroscopeffeciversaviceseafangipythonipdbhttpresponshangbrowserpdbstraightforwardineffectsattightinchundesirvectorrasterpdfsavefigpngfacecolorbboxrainshadowautopctexplodfrachogfrogfigsizpieaxpylabaranonymfreedomgoudaparmesanholecheesafaikunresolvrealizrevealfabfilpreviousarchivanyjsonamqplibsouthpygmentpyyamljinjafabricsmithbobbidoehourtimedeltamessincrediblihairilikeincremendprecedinventshorthandsynonymhypothetunariclarifdeviatdecrementincrementbulletexcpetsomeexceptsocketraiseexcassertionerrortodotobjthreaderrorisalthreadwithexcsystemerrorrevertinvalidsetasyncexcpythreadstpythonapictypeisclassexctyptidinterruptissetregularlistoppablethreadintervaffordcriticabruptlikilluncommonvariredundintentionarrsvnkpfcuftkomodopythonpathquuxarchitecturmeaninglessreadmepydocapidocpydunitcruftstartupbranchsuitablmaintendesktopsaareputcruelexpirratevaluablabsurdwastincentrefuspriceconcealsellfeecomponcommercioffensdmcaspiteencryptaacdvdfirmwarenginshelfstolenfeardecompillicensrestrictemployprotecttriggerwazreconstructrebounddropreclaimmoduleareexecutmyfoounimportrestartservicreloadunloadmultipliovertakenmentalmandatstrongadheractivestcostlisequniqifiplogpeterbfastestavailunwinduniqrolldestroisegregselectorprobreindexslurpstrictlichunksizhmaiessentiinvertstoragmystorpdexplicroughhoctoilategigabytparlancequatcollegloanobservanalyzwhichevcardretailfrequencmannerintuitstatistcrosstabrepeatelifnewvarcompoundcombinnominbankruptcicriminderogatoricharacteristssnphoneriskcreditjeffpytablfeedpermanmongodbdataframpullhdfstoredrivenetworkworkflowhorriblsashallowremovekeihelperminuperspectroutinevitpreambllengthipredeterminwheragainconceivuncomfortfeltexposurtaintfavoritlizardoverlookreservslotplumbreturnvalumeaningincreasproblematbarenamdisastrreseatlennartsomelisttupcriteriameetsuitlibmysqlcliposixmetadatashkbmtzjmmysitconfigenvironmenterrorelisdirpseudocoddirexistwisehundrcheaplirmtreerfreinstalundoeditorconsecuttiptweetcreatorrossumvanguidotriplstudimultilinbracecurlisurroundfieldsablahblahdostufftruthfalsiunichrordrestructurdirbardirfooharmshebanghardcodpubsuccestdtypestmtscreenappearsigndeletastringexamplmiddlthedztabtrimzfillpadnicestpowvaintypecastfallrepeatedlipropagzweiterlindsomepropertisomeclasssimplestunintentionollehdlrowdevicioerrordestindstsrccopyfilshutildescendfitzgeraldsteelnewlistcmpbarthomernthshorteststftimestrftimestrptimeconverskickshoveaugpmjunfileinputgolfisdigitunsignclunkistackexchangjoinerlstripwhitespacrstripchompworlllotillmystrsubstrcompactdatetimdefaultdictbooshowcasinnovrapidkivirobotsnakeandroididxoverriddenconflictwindirtiorientpathlibfnameislinkmergerrecognishighlimaturcorrespondingliaugustoctobcommitgroundbentosubsetaimdistlibdeathabandonrenamlayermergseegotchalandscapcredencrecencdisplaireadthedoctrustadvicseptembquestionatadcircumstforksketchimodulesawhatadoctestsympiiadistutildistributextenterrorcodglyphtwistedmatrixonlyaultimunderdevelopundefinabnormnonzeroterminationaattempthonorcleanupsystemexitearlidieovercomaliascostcollisdiscrepretrievpushworthscenariobracketcounterpartstockcyclgladwasnforgottenunboxnotabladdressbackendncgtransformworkersufficiluckineedlesslimisdiagnosidanielroutinrecompfforcfllvmghzduomodfloorfromintegrfromenumhaltnexttrianglremexportldisquarfactorcountadmitframeunnecessaritaillconativnicerhintsealprobablbrakemaxintrichardchsxhghcaborteshelpollkernelhipeasyncrqsmperterlerlcdecflmenzolorenzodivisortrianglsureexerciserlangasdictrcdtyperecordtyppacksqrtmathptreciprecordstructdeferencreferencgztarstalefallbackverifiivadaptorkojiroinodnixmtimeatimgiduidnlinkdevinoctimegetctimgetmtimmodifproperliconsumptukunencodwhilstdivtelnobarfbeautifulsoupwebfetchordincodecunicodeencodeerrorlegaldestructoromitlinesepmyfilorganretoolinertiafourthliprejitthirdlifulcrumjunestablreachmomentexperimenttenuousheavilipandaawesomcythoniffitenuouquickadoptwiderchallenggilinfamparallelhearszdlgetheadwbmbthinkbroadbandprogressbarsongurlretrievresortstrugglentiritunpodcastschedulwebsitmpcontractclientpublicsettergetterversudllimpsourcefileloadmachineriexecloaderspecimportlibfilesystemthresholdutterliwhitecontinuumtransparfeasibllightweightceremoniheaviruntimvmotohrecompilsuperficivarietijvmjythonclrironpythonfullisimilarlipaperbackmundanpointerverschapterthumbbookmarkmarginwritablaspectmyriadannotfootnotphysicsimilhardcovbiblmistakmemepycincorrectignacioextractomvaloriscategorblablajsonfindalatypgetrootthefiletrechieflicelementtreelementtrefoobartreexmlbailworkaroundalphareleaselevelmicroassertminimhexversubuntugccjulcoordinintersemaphoreventthreadsafintrinsfarmcpythonemitresolvwaitsubthreaddaemontargetyahoogoogltheurlqueuerespondmultioverlifrankliutfdecodqpbinasciimarthomarwpipelpopensubprocessauthenticationmixintraditwerensubtlauthorizationmixinuseragentmixinetagrequestmixinagentauthentetagacceptmixinbaserequestresponswerkzeugoppospresumheardlutzweightlightnamedtuplmentionsubstanticornerstoninconveniforchomogenentriheterogenguidforgiveafpemploipolymorphinterfacemphasquackrelationshipinspectglossarigracefulliteproofmyobjisiterpypabootstrapwgetuninstaleggpkgrmexplicitdistinguishbelongadmittedlimyfuncillustrcontrastpervasattractdictmixinuserdictmixinplacementarguablretainversionacollectdptmiitemplatregistgoodisubstitutgrowmarkerconcretoffertreatasittreatasscalarfrequentincovenitypesascalartreatcaseamimickarisdesirinvariseamlessliakasubtyprejectcaterstringtypdicttypfragmentbasestrissubclassvalidationerrormyexceptfuzziliughforbiddengathercrazideprecationwarnsandboxmyerrortripprimariresolutconcernfundamentadditdescriptorbenefitmotivunifiunrelflavourdatamodeldollarcentcouplcurrencprecisdecimfloatbuiltindisassemblditoplevelabsolutjumpconstbytecodprefixgetenvhomeproportroughliadjustunwantbunchnoisiimshowsubplotplotobtainartifactbordersubtractsuccessfullierodtechnicisolbackgroundfootprintpixelmaskusingthvsplitsqueezreshappppyplotmatplotliberosmorphologindimagscipinumpidatasetscalebinarismallerneighborhoodimpactdidnstaggercausheelnailarbitrarilihindsightskydrivspreadspatialplatecontactaveragsampltrialalgorithmtweakaccountlowestfourthleghindfrontjexteloadtxtnpmathematicianscientistmovementhumanconvenioverlapsquarneighbormarktoelocatshapedirectcolumnlargestmaximaareadrawexcelsensormaximsubregionanatomdividanalysipawpressurmeasurclinicveterinaridetectpeakbalancimperstrategirediscovembracclaimmatecubiclwhatnothighertononlinincorpormasteritrackstagegraspprocetacklmanytimattentpaireadershipenjoienlightenprowessworshipworthicoderconstantlidictatexpertisstatuapprenticeshipjourneymanacquaintquicklicentralforumseldomworkablbeautipermitlovefelllabcontributcoreinformatbioslowlibiologisthalfapprenticprogresspyenvbashproceduranacondashellmachinvirtualmymachinworkonswitchvirtualenvwrappvirtualenvdeactivexitmcsemiprivsuperprivsoulaccidrulemuckprivatearegardtextualtrailidentifimanglindicweakprivatetceteraunderscorsepeprintflexibldisadvantagzencontradictstderrmetatextfieldbookmysqldatabasoverkiltoollitepeewejeweldiscovlifeadvisstronglisqlalchemifamouwritthousandclosefetchalrowcellsqlcurquerijonhydbmegajonhipasswdjohnlocalhosthostdbmandatorirebootmacportmacfedoradnfrpmyumdistrodebianaptsudocasualmysqldbsqlitephpunlikdrivermysqldacabbrandomliabcdelemabcdefghijklmnopqrstuvwxyzconcatenyuiocleansystemrandomsecurchoicukkletterlxmlcomntoolcorrectstudiosearchextdulwichchrgencreativcompositliteronwardblahmydictroottraversendswithmydirglobextensscdywglanyrdpyconvideolsprofexecfillinenocumtimtottimncallbatchmyscriptinvokusefullicprofilkludgeiboastmaximumeulerprofilsyntactobligatoriparadigmencapsulreusablcarefullioverloadinstantiparsyyyimmddencodtasknewliinstancemethodutctimezonmonthdaicookdealboilerplentitislightshouldnbeginnpathnamcanongetcwdcwdchdirincantrealpathfashioncompressgetattrmethodtocalarithmetfocusimplifihashnumindexindexerrorgetitemablominimumsubrangindividuregularscanconstantdemandwimpokelackinconsistfledgabarnertchosenpietermartijnhistorianticiptopicnuanchoodcrappiteninstantinstantanzeroquadrillioninordinflushcorrectlistdoutprintftitllookuperrormyapplookuperrorapropoallowincorrectliconsumreviewolderbewarruntimeerrorefficiexcloseloggerapperrorappbaretracepreservreraisretractencouragbaseexcepthandilihiddenhidebadvalueerrorfitcaughtpositxyzabcsemantleeusagmixsectionparamstarderivisinstcoverwonadeterminroflcoptinfowilknowuglisuppliguaranteannoisophisthighoccuroutcomslightliandsenpreventoutdatnewerawksedjawachvariatxargcutgrepfreeztrackerrequestupgradfortunsignificpenaltimillionisnamountoverheadachievindependwouldnmyvalustreamiosynchronfairnaivboxupdataddendumtiniimplicnewlinhandrawrelevbytesafegnusebastianeducvalidexceedfinitlimittradeoffworthwhiloptimbottlenecksuspectrecapswappagefaultminormaxresidavgdataavgtextcpuelapstemptroubleshootsegfaultutilwcunsyncfastgblargerperrorferrornoobfellowsaferwrotebufferunsafunsynchrongraigandalfposterapprecigreatlicatovaughndoublconfoundelimindisablcomparisonimmedicuriouranwideshortbingocharscanfspeedestfebmonpertinbeefipromacbookrheldeltasyenvusrcppreadlinendlsecondcerreofgetlinlpsecstdnamespaciostreamtablbottomscrollfgetstdiosynccindrtlmisunderstandexpertrustimagnitudshockinputcomparbazorignunavoidslowestdeepcopidatatypsloweropinionmartelliclonehierarchiconsultconceptsimilaridiomimplicitverbatimclearersituatsparingliidentancientyepclassnamxrangpprintsuccesspythonicacouldnwonderexpenspotentiroundkeepobviouchunksizeevenliapproachadvantagrecommendbeidijohnsonsubjectmillerdevluckadventurepicmidstcarrihmmcontestdemotilesetwikibitmapfontimaggraphicmodefortressdwarfmodernibmbetstuckpcasciiintroducthowtogamesoundcursormoveemulvtenablansiconprovidlinuxunixfrommetunderlinendcwarnokgreenokbluheaderbcolorblendersequencescapansisolidsymbolunicodtextcolorterminresidplacetotallosssimplicnecessmsecsumusecmtimeitstandardtimeitevidflattenfastersublistnonetypattributeerrorstdintracebacklambdareducflatpairviewitempooptestrecogncorrespondkeyerrorthrowrenderiteritemconvertlensequentienumeraccomplishinverslookupdogcatbeeantanimstdlibincompatperfectliauthoraenumpypibackportpepenumdepreccommaseparclaushandltutoridocdistincteffortactionyouarebeingmeanexceptidontlikeyouexceptladderyouaretooshortexceptsmilemakeupidontlikeyourfaceexceptwrongmultiplawarfewernegbeweenselectpastarrairestheadhavenextremnotatslicefavorsideerrsummaritemptatresistambigudisturbworldmoshdoesnaimprovsupportpretenddigitchopprogrammrepresdateabstractlikewisdifferentidefeatcharactinstanceaformfuzzievalevalastepnullweirdinfoprojectserverfiredecentlifebloodfervorreligigalaxinaturfaultdonadebuggreportprintaprettiusablcopactfairlitendobjectsacontaincontainerareadablunambigugoalyeahwouldnaalexareitersuccinctsurprisinglisummaralexreprcumbersomavoidandreaaskdavidhopeagoyearseakingdomenglishreflectcontentexamplimmutouterrebinddelightheartmutatarentwofoldrationalpassbyreferunchangunclearknowledgsuggestniceeffbotstatemembersimpliactualinvocsenshybriddeeppresentscopereldeciselaborutaalbaczekbreeddoubtbindinternunexpectpuzzlunderlireplidramatencountminenovicappendtornbittentinkermutablastonishprefershowlastlidirpathbreaktopvisitwalkmypathonlyfilisfilfilterlistdirccoltermmeantboundpartialconnectlogicplainbehavconstructorfinetypeerrorraisdbefimplicitliusualstaticclassmethodsitevisualmingwfixmessagcrypticconfigurcompilbatvcvarsalunablsourceforgcntlmnastiforwardcopentlmunluckipasswordusernamporturlrespectsoftwarfreeofficproxicommonhttpieeditfoldercomputexipcriptythonsetuptoolpopularmsiprepargohlkchristophexperienctedioutechnetmicrosoftadministrpossiblipromptdownloadlatestenorgdifficultironworsmottobatterifaceportionsizablearlieralasystemdiscussfrustratexperisolvproblemmajorcontemporariperlhaskeljjoinpackagsetupdifficultiprohibitexcludlongernewbiwealthcommunshipdecembmarchnewreplacwindowpipinstalsharerequirexplicitliplaiglobvardeclarlocalenvironposeconcurrdependfoolinformplatformcrossexplorportablremotdeniknewexamintrapoptiondiskinsufficifactorfailurignorfoolproofcontinucatchblanketoserrorfailcommentflawsmallqualitihappenopenflagmakedirensurdouglablairkanjamissmkdirstatdirnampathodirtxtfilenamelegdirectoriwishitemgettlistaorderlessinherrepresentsimplerwantoverflowstacknotekeiuniqunumersortplaygroundlargasynchroninlinfakepermissviewcachmanagstaticmethodposeidonmercicursmistressharshscienclawstriphrbrsplitplbincginetsubfusurlopenurllibquotfuturamarandomdryrewritnamnalpeonacatsapsorehshajararutarolocepinelacrepinoracamnatgatananabgabniagarolemacepercsnipturolorhsacrajerostahnoeplanacamanappanamacanalpeonhatsorejarrolorutspampincrepecameltagtanbagbananagagmacaronipercalsnipecoloraturarajahheropastacanoplanmanelbaercountcounteractivlogreclockbenchmarkdryatemporarilibexternpossiblpowermessistacktracdocstrfunctooldebughackslowintroducrecurslistenwhooootuniversstickspecifpitfalheadachsavenumbercoffecupintendsupposenhancrecentsnippetbonupractictrickleslipennihowardrajeshsheldonleonardconfusrelatstackoverflowclosurgiftheishorterintermedipeskiskipmakerevildecoratoragivelabeltellzzzzzzzzlaziremindsolutrushfunctionaacmaristevelinubillplatypublogsaltycranwwwhttpfamiliarunpackarbitrarikwargsayyouraglucidecreasliefriendliconsiderdifferniftivenkmanfullformattakebrainburnhappiexactitalinsertfnboldeasiliconclushamfoodsandwichsaladtomatoingredibreadaccumuldevelopembedclassicpatterndesignvariantshortcutleavdemystifioverwriteasithatadarestandtouchreadiitaoriginwrapwrappershinihandcraftwrappersaneedgavefuncdosomethingbeforthereawildfeeleabeaststrangkindgettalkyouafunexistlowerwhispertalkinsidpropertiinterestshortlicirclweanameerrordelmeanparenthesscreamoutputcapitshoutletaconsequpythonabergantinoapaoloapplichtmlmakeitalmakebolddetailpagealternshownequalpointblockloadlinecommandpyassumscriptprogramfoundinterpretallocreleassleepacquirarglocksleeptimmyfunctthreadcaequivalexpressdocumentofficigreateraloudloudstylisteffectthinkthoughtflowcontrariunwieldireversbehavioursurprisunfamiliarbugleadjavarubipythonistafrownmindbooleanevalusyntaxversionconstructsimuloperconditternaridecorpatchmonkeitechniqualtercheatpurereproducidwordjobrecreatexposfieldstatementdatabasguiintegerfieldlengthcharfieldmodelpersonormdjangotypicpetertimguruexplancertaintiworriuserdeeperfeaturproneerrorobscurdamncomfortpeoplhookeasiertrivialstructurfollowclearintentmodifiinterceptblackdictvarintrospectrelitwistcomplexeassupercleanermakedctbaseclsnameclproductconventclaritisakelongordinarireceivextramagicreusdirectlioopupperattrinvolvoverridrareinitiinitupperattrmetaclassrealbipwonglobalaffectcreationstartswithvalpickfuturattruppersimplstarthelpfigurformalcallablluckiliturnwaiuppercasdecidstupidimagincontextmatchapichangpurposcustomanswerputbigbehaviorsubclassdefaultstylebasiclevelstaidoesnfinddefinitbuiltfactoribobagincludcheckintegconsistmatterguesslowercasheckscenefactvemyobjectpicturlearnstufffinaladsignaturpropereventufoochildnormaltranslatdefinacceptcomplicholdnoticcecmyshinyclassnamedictionariinheritparentcompatbackwarddueissusillidescriptabilstrintletremembmanualautomatwritemyclassbarchoosdynamobjectcreatormirrorfoohasattrechoparametattributcopivariablassigninstanccapablinstructexecutmainobjectcrkindadescribpieclanguagsmalltalkborrowideapeculiarmetaclassarticlimplementimpliprocessmechandcpermutracehorsorderimportzipmaplinergroupchainduplicmanipulspecialfrienditertoolresourcaccessthingbusibackbrandremainposttroublwallstopiterexceptmoneicometruecashstreetcornerhsbcfalscrisiatmbuildbankclasscontroladvancquestionstoricoolreasontypeducktuplargumentcareworkdongoodpassexpectapplipreviouproducexhaustcaseinfinitdangerdatanestconcisexpandsmartlookaddfillremovrefercurrentchildrenarrivleftexplainsatisfianymorempticonsidloopllhitbeginparthardtrickibitrunbodiwrittenmastersethugeuselessxbobjectcreategenerfunctionendforgetcalcultimeperformmygenerflylotmemoristorehandifilestringrangcomprehensprintmylistitemreadcreatitergenermspacemodulsourccompletlinkspacemetriclibrarigreatmadejrschulzschulzjochenstopsubsequelementsinglcallmethodreturnvaluextendobjpopnodelistresultcallerrightchildmedianleftchildmaxdistmindistanccandidchilddefcodeunderstandpythonkeywordyieldinsto��X�Ws��%�h�)l �P P�� � p�  @@  �@��� ��,�� `Ȁ6@� �<�� `@�@� �#@�H����(h@ .� �@� ��.�@ ��.��Z�,�@�\�`-x�\�� �`-x� D���+  �@�X� `���-�@ dP�\�X� D ,`$  0�@ �A l@���8ȁv��>���!�`D�AV`+0��#!:���$A K�����@N���@� Q؁r�)La T���\ `�,4�����.x� `���Ѕ0p_��02�� g�Ҡ3P X���7�� q@@� �/���`�a���<�A{�C��<���0B��@��ЇD(b�CчB}�C��>4� xD!�Ј>@"��#�PJTy�#���K a}��ч<��B4� Nt�@x#���*0�8#B�Pq���0�9Бu#L�����vL��x<�q�c��9^�X��zp@+�Q |�C���pW���@"�6�x�@���1�A < ��BҊ�� }`H%`����A6쀇��"x`�1 b4���FD��SH���ELQ�������E.���h�+�D���E̢!v��)Pa ���#���+&�S|��HELA�WL�#��+&BST�!���E*��##!�HB����$&AEIN�bc(I 1TRb<��HHV��Ȣ y^1��b%`�Jr�3��%/iLZ!����!�h�Br�>0����2�� �̄&�@FC`ኇ��x��1 bp�&"� 9jb��&&� Gp��$'RX.p r��# ��N�@;�A$; .x��p�'"�.~���D$�P�"s E$ �l"���G�Rp�<�@)KQ S�����Iq R���He*P� ��� � U� R��G8�8�JU܁��t� =� $��� pE+]�JU���d�b W���<�,k(�8���E,�C�� ��ia��<�l�C[��<��xx �����x�C\��<��-�H�)��<��-j��)L��}H]La��¸ ^>���T�.�Ћ�R<�xA]������,~i�)���HA0�!La�`�Ø�,G@�<���(f1��@?���1x� Hf2���esZP3�ьR.!��l�3�h ::�l��MhЀ�ɴB4���AҼ��q�0Jc�Ӡ&5hP�Yda�ɠ� �X e�� ��1�q�k`��=�f��A+���P��� m���P�6��Mn>��7��o����7 NI(�� ��!Nq�s� �yMr�����(�iDr�@�9�A�s2!�D�7��A+���"��t�P�\G��Nv@���f;��d���pgAwR"�<�D��rdЛE|"�!� ����G��xfC�v4"�)�ydp���f28z2���G=�a�y����>A�C|� ��b>���)�s3�!>��A~�A�����N&2��>�?8ȏ0�S<b?�IO�S����?�!�y� h@�Y�#��*�� ���@xo� ��'= �$����,A���08��� B)�9O�p <� J΃q��R��3�DT�PI���4Hx�Q�@!T88���.��`�B%���3g8hJ���9� ��8�����hhCZ.q�A�@�NgpС�xH��^>��h �чFD���+���N�!�HE+bQ�R���E��Q���q�D �Ì�B��(E+�Њ>����C9�Q�v�ͨG>���$!�hHD*҉�a�#MI���4%��C;�В����(Mr>�$ A)J‹���\|hJTj@��D"�|�1��=6����JX�I��,iIKYҒ`b�hiK\�B��¥y)F_���&1iaGc"Z��2��L�9��&5��MmZ���r�� Nq����%�ЩNv� 0�;��HxZD��d%!�`Oو���'�8eO��ӟ�d@�6��P���Aa�]���#%|�K�����D%�P:�>�E�cQu@�>T��Q�h���p���5��Ӈ�D$0}���T�$5�dP�)���"ŀ�MP"�A�K}�KJHQ�V���(E-��,RԢ}�*L� ��)\dJS����E%�+�P�6�}hE�RBR�!.m�S%�̛��!.}+�R�8U"O��S����Q(P�I-JчB�.E9+�ԇHR%\�J �.HR%� @T�Շ��!R��J"�*RP��""����!R��T��R�Te*|�T��ԇ>� �E.��vLŪV}�T Xч���q)U�JՇ�#���CT�E���*U}�K-JчZ��}�K�N�>��L}(�·^��ld#� >�*X�j g� ��B�E|�KU���@$,IV�b�%�q����?V�0�C�J����*�|�U��T���!.}�UX���T�"}�( ��7n��|�URU�F�W�*U-���p���JU pDL>�"U�*Wʕ������C+�P�p���*U pDLV��}(U��Շt�*8"&�6��HM� �(� �+G��;����^9�Nq�Շ>�%"��W)jч��_�HN��\B�� X��>4�b�X��v�E�8 Y����E��dY�"ч���%�C�r�)��,hE�C��ִ���j}�C@1����ka�Z?�P���j��Z@i����!=`[�ꖩ��-mm�[��ֵ�ŭn}�T��ַ��e��T�����%�q��Y"ո�E.nm�X$z�����q� (��xʕ�}�:��Z��}�K�"��΅�\ ]��P���.0�`J�N>D�3-���Ƈ>�.`� JF�SY R�j���`���T�)�+^����� J�`^��I�e�d� Y��P� b$f��o���, _������$_�ꗿe�G�$�2K��d� `���P |�Q$Y� ڐ��d ��N>D���`#��|���dU"��>T(��`$I���!�(la�bX���9�akX�L%1��ea kX��0�5,b��vv��Y�b���0�] c0��.��|1!c�ˇ��S%�b�֩4v�S�* HF2��!kc��ƈ�!���Gs�!,x�_��ɇ"ńw�T�8U�z�����>1N�!_}�T��Շ@v����> �D62:] c����0�e�E*B��VЫ}�C����>D�e�b�X�<�1�y�0U�<`�U��C����r�20�H.iC�u^�c*��ʼt(6��3���N:��@��]��Շ�))�;�L�ղw},;.���n�:�i�A�d633Ѭf��dp�� >9�YGt�3��g=��Hr�����g������()!D���� mh��f�3<@"D#DpQ4B� %}0� b&��� 8� ����� mhAcf�3<mh�(!f��>m1�� ���liL��І6�#�i4���R�4�q"%Q��ԨV5&0�jBZW�r��Y�^h�Z�FC%hmUؚ�nq)�q�iw��q)j�.�&3�|�f`{�KpQ4B� %}0� b&��M�P����EM%2�EJb։�EM%����`1���fYI����>e3[ �v6��-%F�Z�n&�(!jh������bNmP���v�Y�m n�Sp� =���8��L���"E�� � \��m3 .p���M9r�!d@���F�[�7\�'o�[J� �ͭn��E܊7�� fB�)b�T�-n��EO�6����[��6�S�m��.�F���n38�݊Ɓ�< j�HIԤ65�U� L��І����"kP�'��5�$0��Ӡ� ���)��v��e�3H !z攔�M�D��6�"2��͐0�>ЍY�YO�6��F�[�z�I4�)�Hl�Fp�$p6K[J5���)�W����pSX����jG��7�Np�f9C���$kPS�\n���1�q�{8��E�;��� B�!|")�)$���Q�����Vp�@s��02��@DI����SH#���6'9�qn�� �9@�D ���m"�0��9a|n$��)<���I�r�F&G�@+��D ���r���Q�A+�F�z�L�{|�Ї�D?8��0��9��� �Deэ�x D��9�q�t��A�:�ӝ�kJA�J���*u.Q��ĺ�q�u�� @�`�ו�3���6p����݀R��d� �Nv�+�T��3�n ]jG7lw��I��+]g�IAw��]�J����w^�>`�H!O��C $����1�b����nx��]7x����+]g�׍��ݐ�pQ�9��t��s���nT�x�3A7����1�+�ks �<[=z����j���Q�z���ځ��]{����Ng��p/��C�A��}�t�� ��'>��{�;C��W�ҙ�x�k�`��}]"^�Jי�O}�!^ψ�ҙ��X� վ�$Fb_��>#���{����|`/y�C��6��!�I�>��$a#G^r��� a��8`��ymhC�V��>Я~00�^����{y�C?�� $�H����o/}�B��Ǿ�q� Q ��E�c� �"p�<� ����Q ������c �� �Í�3@��X� �6��9qܐgMXx6r$0 X=�Ӽ�(�������Ma M�_��6�fR� ؤ�ΰ�3������x:i�x!�DH>�(�c$��(%�(�!�c(��G���P%J`��(d/ŀ�JP"II�$��_)bJ��I�A%RIydC��́"�D���C�+��JV��+�|%+]�&V���r�+m�.WƲM���+c٦����6���a�,� q�,�E.2��Ld6��A�@��$d! �G?�!丏 �1HZV��z`�*�a�nT� g�>֠Bt �P���r��S�<����[�^�%9p��\����F��GG"D�6H$B���>:�DH�v�HG ����!���Q�P�"��DZ�NF�O�8��^�m�e� ��_nf0 ���� �$f1!S��� ���pdV��H&��pe. ,`f3��LA��S8C4�9M|���@�BMT3M@� �� ��P�� �4�+`��F�э�K�6!0�3@�uX�1ӚX�1ӚXA6dӚX`k"�ڤ&V`M�`��&Rb�nB�u���N>���3P���MS���'3 j"��9hV�э.O@D7� �aX�1��ɟ}�s&`�=����j$�|�yOؓ�����``�9���dg?�iO�<���T�?ʔ6T�M�kN9P�⤟� ; ���'�É?�TP��P� ��������iP8�P*(@ jG0�M��S�dP8"���R@ jG)��� T��@�k�rJ� tP�AM�v2�M��# ��&8h3���A�`�&P� X��6mbmj�B`�M`�~v�B��І.ԡ8���҃M<0��(t,�D�6��6�i�D7�u�`�XAD��G�8��W� �@�������f#U��**3U�McR��E/�Q�afM�DÐ)|� aˆF��Q�q�����8����+=9�Aj�\��0�� Bz�\��'�z"HM��'� �ip᫑n@$-�IU�����})� p�R�@�)��R$�t��c)d��D���AK]�a�� *�J����0T�Ka��,���v���ȴ�hG6fJӣ�Ԧ/u_;G������)(�� H�+|���D�U�f6T��E� ��Kyѡ���A���NU���468EO}�5�46��ilp��f#<� (8����t��q�~�������T�U pQ�P�`�5W��@�T����;i�x�^RG5.@�7�&�:G�Cd��.��Lu�@ �TGʰ����@�!T�8�����@�qT�>U���j6@ѷ)<�y��Tm։�.a$�� DP TP���*f���0��"�ڷ*8U�8�(p ��b$2�C�c(:2l��KU�0PX2�KT�JR�ԑ}��U+ �`U���.d�U�J���*����d���d�#�0@.H��)�0p��N���!�y�S��<�)�l�ZȦ��(H$�R��k�����!�H�X�2q���Fl�3��8�"� �Xb�5�"���CtXCטtH�9�W� �x5 �A�%��c$���PlJ84�F?���0��X���alc1��9l!�Ê�8�)�a�ap`�Ls�c�@�>Jm��H��mB���ldG�48���dI*��Rv%�le�X� 4��%�``D<6���cQb��4����(Q2J�������.p�f��9p�*d�8>��k�(���vH�"8Of��Y�l�<���y��Y�pV �!�f��ٳ�Ao�ɬlp��L6�u�B1�dz���}ΓYІ�5sp ��M�v��-`i�c����8�i�s�3(�6�fjװy�8g��"T�ծ���z"x���<�9-H8��O���im4v� ����i���.�� ��i����N���@iN[�3�vg`�yNkܜ6����lmpZ��K68� N�����6��ic˞�G�(P�jk�!�v�Ł��2�������r� ��>�H2o���̶��@�jk�����o�0�ߎ�m�¤ۀ\� w$��H�;��hj$�*�H� ���i�-na�6��6ȸ�nq��ڬ0NkPr����v���E�K�� ׶��p�K�� ׶��p�4����na��%ێ��%�pGR���� h�m��2׶��~;<ùυnt(]��0 ��o�� 409`�x� ���O&�Aja��Vw>�ɍu?�⍤�ֽ��+�`dr��&�P���5�u�{ݑd7�Kv1�?�,��N�C� \`��ȁ�����6p�q <��"^�k(���X$� p�#���X� fp�������}0�#�_��w�(���A��G�p�+��������/�`��gA�� �B�B���g��� �b�x�hE@���NI�=܇s8%�Ç=�a��XO!��]]%➰n�w% �RB����$�������Ķ���=�;IJ'���>��>�ز'�@�p *�j�A� R�b� %|���PD��̀?��@�p �q�)�� )h�(�Z%�L =P���)�� 3�A9=Z�V�`���Sw�U��ʠLx�N��[t�8��� ���^���v �� ,6C�ҕx�t9�C����^#�>@?3��&�@3Z�f| ��Z��6��.���>�p��0΁)^�p��0vD��b�p}� �pp�6^�m� ���Xƕ�Ck�����}80�� R�1�5��h�'=�)le+=��R����̞HA6��`������|xa+�DO8α��Yc=��;�q�}��9�2�l�!B>C+Zq���b� 2(J"��lB.2�1d+�g8�AD��ELqq�@dP0@oQ�`��Y���p`Yd�89pCK�a3p`$C)�80� �� fJ���rЌ~"��K�Ab׌~��&X�=9@4���;�.9 @@P� 9 @@މ�0�hr�>�4� xgЀw�>A��1&s�&R�h����@ }P�9p�';�&���!Rb>s�OV�6� �o�����%@�4�@�q�IHy�a@��x�T&_։�fܡx/�(\JU��#�`9���bX8�˶rlj�.۪˂,���d$Ჭ`�b�dp�)��d$ H@�с�h���x�?��`��� �@_���,�+���*Ѐ94@x@�ـ1���f3�gPf/�J ����|�d�cF��0f$�Ae����,�2���]"�ь�3�9 hHz"�5�b�=��8 � �[�z��� g'ѐW6nٓV��s=iU*Ӽ65�K^k^�p j� �D��Kz"*Y��'�XcO8��� $).15;>EOW[_acglnsuz}������������������������ &.4;@EHNSW[`emqv|���������������������� !%*,06:>EKPWZ_eimvxz�����������������������$,2;@FMT[djqt|������������������������� "&28;?@DNRUX_dhly~��������������������� "&-29<CINUW[ciov}����������������������  #&.2>BIMQU[bgmoz������������������������ !$*.5:@FKQU[binx}����������������� &/6:AEIMQV[binty|�������������������     " & , 0 6 9 > C G M S Y _ e k q v } � � � � � � � � � � � � � � � � � � � � � � � � �     # ( / 4 : = B G L U Z ` d j n w } � � � � � � � � � � � � � � � � � � � �      ! % * - 1 8 > B E I N R V ] a h n u {  � � � � � � � � � � � � � � � � � � � � � � �      # ( * / 1 5 7 ; = C G M R Y ^ d h o u | � � � � � � � � � � � � � � � � � � � � � � � �     ! % ( + 1 7 ; B G M P V Z ^ e g l s w z } � � � � � � � � � � � � � � � � � � � � �   #+/4=BHQV[cjou}������������������������� #*07:DLRV^djsx����������������������������#.59ADINS\cjpu{��������������������#,36=BHRUY\_foux}������������������������� "',2:=AELQTYafjnvy����������������������� %)/8;CIKNTZ`iou{����������������������� &-0;?FOTZcfky~���������������������#(.6<@FQW]dls{�������������������� #(/3;DJPUY^gqu|�������������������� %,38<@GJTY\`bgmrx}�������������������  $).69<>FLTY^ekpx{����������������������  +38;ENV[fkqx}���������������������� #)38>BEKQU[`ekou{�����������������%,5FJMS\cgosy������������������� #(-08?CHL[^bsy������������������������� ")/4:>BDKPSV`ehqw����������������������� !$*26=DHLT[]cfoz��������������������� $*.29<?BGMSX[]`gkrx~��������������������    " ' + - / 1 5 : > F J Q Y ` h m r { ~ � � � � � � � � � � � � � � � � � � � � � � ! !!! !&!-!1!8!B!E!I!L!R!\!a!e!k!q!w!~!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�! """ "("/"2":">"F"L"T"Y"`"f"j"u"{"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"# ###$#)#/#5#A#F#N#Q#S#e#j#o#u#x##�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$$ $?$G$L$T$`$h$p$x$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$%%%%%%&%+%/%6%>%E%M%R%V%[%_%e%h%o%x%�%�%trendexplicitliproblematoverlapjobinvolvdestextraoriglayerindirectuselessinterposminimumlookqueridiscussrationaliaddraddimatmulrmatmulmatmulintendfuturreservsymbolgloblistdirlundefinkeyerrorhasattrintrospectpropertitickrestartinvalidhighlightremotunresolvpycharmwhitespacpunctuatprintabloctdigitabcdefabcdefhexdigitdigituppercasabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzletterordchrabcdefghijklmnopqrstuvwxyzalphaalphabetconstructorinvokisclassinspectsubstitutisinstcompatfrombinarytointaffectthrowexceptutfsepdelimittabunicodordincodecunicodeencodeerrordfcsvdataframpandaygwinccompilcaughtdeprecsoundfoundatsoftwarcopyrightexperimentstatuexitelloeleasamdempncludeicwallmdllingwskipinplacrogramaythoncfgadequactivextenscygwinmnounrecogngccmingwcythonbroadcastforgotdepthanymorlightweightdefiexpenstheoretyieldreferencstrideintroducsolvconsecutaccunderlisubarraioffsetmultiplimemorimultidimensiondesirforumhearlivecompositcolumnrowselectnxnsubmatrixmxmvalasyncdropthreadpoolpoolmultiprocessfwiwtargetlkaebnltuewinterminologidecouplparentmarechsanderkillensurbackgroundleaderpidpgidsidhierarchyasessionunixclarifistumblrepercussdeclarplentiscratchcurioudaemonforkdoublenvexportsomepackagmydomainadvertiscredentialtogethfetchbailinicntlmobviouexpertproxinewerachocalppdatauserprofilpwddirectorideletolderreinstalearlieraccidentpsycopgcachadditionmimeencodbusiaefdeatitlalbumjsonififlaskbtwcomplainpythonpathpermisstypicpythonxprefixpepreliadministrmatplotlibintenscomputationsshschooluniversconcatenliteradjecunevenuglikindacharactsentencindentsacrifmymodelcaredatabasthopkofcvisitnewestwebpagpaintormaptyumaptitudwidesyckpysyckyamltoolpyyamlrevealpahomesatisfiunpacklogicreadablhumanbinarireadiliaccelerundertakjvmactionformintermediassembliconvertcompilisolsurrounddecodgrammertailorsophiststreamdeterministfundamentcpuanalogvmsandboxindependatomrareparlancvirtualgainparallelembeddguivisualplotinlinmathemattextnotebookpowertoolkitrichversaviceshellsupposipythoneviloptimprematurconclusallocpreduratevaludoallocuniqudoappendequivalunfeascompliccomprehensfactorarraylistfitresizconstantliquxbazcapachashablnehashtupldependmutatpromishashcodmythactidcustomintwrapperobjbytedenominconjugxortruncabdiragattributeerrorvictoraprgenderpersonattributsubjectlightshednoobknowbookpopusaggraspgetattrbuiltineqsetdefaultassertmytransformeddictiterdeltransformeddictshutminimtellcollectabstractabcbehavlowerstrlcdictdelitemsuperoverriddenkeytransformalterarbitrarisubtlminordoubtenlightendictmixinuserdictshouldnmutablemapreprsetstatpreventsuresetitemgetitemmadeattemptresearchprimittinilowercasgoalperfectperfectliheaderbadmetacsrfviewmiddlewarmiddlewarsnippetajaxsendsecurweblogreldecodeuricomponsubstrjquerisplitcookicookievaluvarbeforesendajaxsetuplitracerealreplirequestcontextcontextjsonhttpresponsirrelevhttpresponseredirectprofilmyviewgistdesignunappdecorexemptturninformsearchfebcardfailurmemorjavascriptrejectencouragtokenverifipopulsetrequestheadxhrcsrftokengetcookialertcontribrefendjangoprojectdocmechanprotectcompliajaxcsrfsilliaccomplishbugforgetinevittersincrediblilifebunchsimplerstructnoticmicrosecondmacrostrftimeunconvertvalueerrorendstdinstrptimemillisecondtopironmassivuninstalinadequwoefullimottobatterifacevenercentrsharenurturnodejkitwikioneclickrubyinstaldevkitexplainsituatsucceoverflowstackmessagcrypticpopularnumpibatvcvarsalunabltedioueasiestwrongwheelreinventeventupersevergztarahaunreasongreenbrowsnaivhaplesswoesimplejsonnpmjrailnodenpmquasilanguagcounterwebsitpypideterunfriendlipeoplbarrierexperiencyearneglecthistoriunwelcomcumuloutstanddifficultiprohibitexcludnewbiwealthwaheihttpiefactodeshipnewmarchpackagenamgemrubygemrubifreeallowconnectfirewalforwardrouterlanguesshostnamnetworkapachlinuxmyipaddressifconfigipmywebservcomputbrowserpurposproductrealizindicportrunservbuiltinstructworldwebservoverridusernamfilenaminstanclostforeignkeicharfieldopposrootmediaruntimuploadfilefieldsynchronsensqobjectderivloopcallbackpysidslotqtperformhigherrewrittenpyqttwistinfrastructurreworklouiepublicflexiblemphasapparsightpypubsubsenderdisconnectautomatniftiblinkersignallistennotifidispatchcentralsubscribregistractualregistdisadvantagthreadaxelconditpynotifilessonjosipstraightforwardfoordmichaeleventhookspassigsubclassminimalistlongpokargumentlennartshowzopefirecallablbagstylewrapextendeasilibonebareframeworkcommonlipydispatchawareventassertionerrorkwargargstandalonexpandautomparametersetattrpasstestsequensflydownsidassertequtestsampltestcastestsequleebarunittestparametrdynambulkversuinteracttradeflushwouldnrussroomblazingliperspectputhourextrapolgaveunbufffairdevicdisplaihandthousandhighliappeardiscovcongratulstderrdevnulfilenotxtfpnewlinstarttimcmdlinecountbelongissustrictliprogrammbehavioursecondrateconfigurvisiblchunkinvisibliincomequalunderstandblowngnomewonderreadshortfulliscrollbufferframeblockgarbagfasteffectopramscreendiskphysicttysignificdumpknewtrickreassignscenewowfsyncsummarisnipnulldevredirectbottomtimerwrotewaitspentsurprisdecidpainfullistatementtermintakefrustratamazspedslowstdouthatphewhavensmallestinherresolutseperclearremainargminsumsqrtscorewhitenneedstdnpycodebookrelevtoesensittransformelementdotvecbasinumarbirtraricutoffchoosargsortidxlargesteigenvaluascendeiglinalgeigveceigvalcoveigenvectorobservnumdimensnumdatamatrixspeedalgebralinearfancidimenscomponprincipidentfacialeigenfaceigenpawcovariadjacnaturfuzziinputhighcommonchancrandomdistancclosestalgorithmtreatbeginanalylegsubtractsizegreatlidistinguishreshapziflattenvstackmeshgridyilinspacxinuminumxxmaxxminymaxyminmgridmaskedgblanktrimnxnycoordinndimagscipimininummaximumgridresamplpixelrescalpoodltoiheavierwiderelkhoundirishdimensionmetricaveragclassifilargconfidendswithstartswithnegcleanlistringconformfortunhipseverfrequentspitelabelpositlenarangaxidydxsucessvectornpstopcoordcentroidlambdaignorhappennonethelesswasnoccursensorfallgroupmodulocontactexpectnormalharderrecognitwrinkladditclassifsupervisreductrainprogramatfairlishowntrapezoidshapepurepawprintidentifidetermintemporwaioverviewanalysijoferkingtonhgclonemercuribitbucketstandasciistoreexperirarprovidivodatasetsidestackoverflowspamlongestrecordelaborlengthstufffundaipullconsistfinalvealrightblogkeepanalyzwonrecognspacepartialnoteimpactrepresselserwalkclarfiiarraislicepicklchallengoccurrclustermethodfingerprintthereofprogresssolutadvancpeakreceivaccountmessjoeruledoglamecopewonahadnavariatencountfailskepticiadividspatialsurfacsmallerbearweightratioheuristtrialmeasurbackrepeatlhleftlfhindrhfrontrfannotstrugglplatepressurhitdetectexcelprevioupawvirtualenvrecommendmanualhasslsavehappihousekeepfriendlihopeeditexactinvestigkindmaconlintutorifineranbashremembupgradledtoolmixturstephanreasonmacbookhackconsequdealdonttemptfeelreqraisresolvenvirondistlibentriloadresourcpkgmodulbinusrrecenttracebackwebsocketgeventsudoexampplerrordistributionnotfoundbrokepipcaptursimilarliserverrouthelpcoverenablunitnosegathercoveragcoberturanumberthresholdwarnpylintparsviolatcountsloccountworthnotifemailxmlreportjunitpublishxunitaddstepnosetestintervpollscmrepositorienterprefergitinstalsimilarclickpluginmanaglocalhostaddressinterfacwebopenwarjarorgcidownloadmachinslavebuildnumersuitlimitstickessenticentofedoraredhatdebianubuntuauthorcommunreplaclikegraphshiniaimsysteminfoproducguidcentricjavaarchaicrbcruisecontrolhudsonjenkinphpundercontrolniceisnbuildbotvaincontinuconceptbypasssystematreconsidstrongexplicitnamespaccontroldamagbringnameminisculeekidiominsistsourcmultiplcontentlexicdefinsortmeanpartblahbasemapminewrittencorrectlivehiclefeaturvehiclbasemappvehiclefeaturesetmappvehiclefeaturemappvehiclemapplxmlmappermobilescoutcorrectgoodparenthesinteglongerappliforcparenthesitalkdocumentlinkchainnicercomparisonrelatsequencspecialconsidcasereleasqsizemaxsizacquirmutexreliablfullstrangbitconstructfoundqueuefalsexpressdetailhardchecksyntaxplanverbosmaxmincombinrangfieldbaselookupquerysetattrmyobjectdatetimefieldfilterjpgpnggifbreaklargermediumsmallgreatsamplemodeldbrenderwriteresponsdirnamjoinpathdataprocessdaterequesthandluserurlfetchapilogdatetimcgihandldebugfoohandlfooindexhandlwsgiapplicwebappextappenginwsgirefexampltestmodelspecifmyappservlaisendinitirequeststaticdirectyamlvariboilerplemptitroublmentionpatternfollowprettislightlipostllpresentslidelayoutdescribgvrdeveloprapidsuggesttasktrivialmovehandlsupportrefactorpydevgaeofficiintegrabilimprovhorizondjangopracticwhateverpagsrcmodiflotstagehandlerindividumatchheirarchicodesubfoldappdefrestructurnastiviewseriespagserigameindexhomepagwwwurltypesubdirectiholdjimagcssfoldersubdirectoripagetemplathtmlpackaglevelmaindidnorgandifficultfeaturgrownbowlskresulttimelongpettechnologiplaiapplicstartenginappgooglstructurprojectscriptwindowappendargvosyimportcoredistutilziplibrariincludinterpretdefaultstartupprogramfasterlocattemporarirequirapproacheasiersitedirectliquotdescriptcompletdistributeasizipfiltruecompressbundlruntempunzipgivethinkbasicoptionlinecommandsetupsuccessfullifigurheardthoughtfileexecutsinglgenerexpyimplementviewfactoriginexistmapcommenttimboalternassumptmakearenanswervardhaupdatworkpointdinizbiofaversionideasubdictbigdictachievelegefficishortestinterestbigsubsetextractreferdonassumdoesnlistlocalassignsomevarkeywordaccesssimplimatterorderdefinitmodifithingfuncsomevaluseparcreatcopicallvalidconfusdueplaceavoidvariablglobalfunctionpythonhughdbrownhttprepogithubprintoutputsamplreturnintersectpastcurrentinitdefunchangitemdiffercalculobjectdictdiffchangpairremovpossiblfindclassdiffoperinstsimplformatfixinsidadreseteenewddnewbddccdictvalustandarddictionariproblemsetcomparmisskeidictbdictascenarioproperliquestionstateapologi�  !"%'(+/123:<=>?DEFGHKLMNOPSTWY\^abcdegjkoqrtvxyz~��������$&*,.05689;@ABJQRUVXZ[_fhilmpuw{|}������������������������������������������������������������������������������� ���������������������������������     #$()*-/1234567;<=>?@DEFHIJKLMNPVWX[]^_`cfhjknpstuvwxz{~��������������!"%+,.089ABCGOQRSTUYZ\abdeimoqr|}�������������������������������������������������������������������������������� #)-47CI]`ns��������&':gly�����   !�����������������������������  "#$%()*+13579?ACDEIJMNOPRSTUVWXYZ[\]^_`cdefghimnopqrstvxy}���������������������������������'-./02468:;<=>@BFHKLQabjklwz{|~���������������������������������������������������������������������    !$%'()*+,-12356789:=>?ADEFGJKLNOPQRTUVW����������������������  "#&.04;<@BCHIMSXYZ[]`abcdfjloprswx{|}�����������������������������������������������������������������^ghknqtuz~������x�R��Y�E+�D�bYA�P��Q_�u�Gy�}�]:Gr1|@M���L�`��@e\��IbL���k�JUkWU[��B�dw���=499'1=*%5, 8!7$81#$.<0:*9!8(1/6/#10#.'<1#&1fh�D�nYY��L.�P~�m}Sq�q�!�J���nQiDF�`�G�u@�^QV���BkTsgqimqGKC5UlX�EELqfGvOs�NL15?94)4+=% /:+?%-6//5:?<&:'-!,'180)/+/;C�YHf`�G~n��u�Vzo�s@@S�d�N#�`Gh}P��gZ�G!E����|��SxmKaef�\O�NgT~wj�xE���Kh��U�c@�QI�@)25-61,1/"9'5,72);:3"<+21+%*.'.4(:",>1<"�^�I6F����m��<nLTS�e��Asb��[QG�eAO�xk}j���^�T��Id:�|�AD� I�@u3kh]Z���Ez��V   !! T���{C�e�H�ABLYB4?:->&=:5<)7?4",.829&:;-;*,&)$>.4!),$)w�WLyJ[�tCH�EOOA��s��^�FVT���v��lj�k�yBUD�At�Uy��\KLO�k�LEs@�J�a�Tw�Aiojp�A?e^Q�D�@vnnlg&%,)91'!8?$"%1;24<'=.,'-"+?2&/?.,;'22.N�f]�rI�d�e�F��JA��m ���}VL�o�enk�jX��fhL��L�R\?W�~HwZ�Nnv�eJbB_��w�uMg��f��MC@��3��H��Ad�cG�wMDwC�]�otK|�yx�V���w��]v42#%,!:06:6:&9<?>&6>47*.!-3$)=)/<8/=,g`y�GE�QN�g�L�]_��J_�rDZ�[J�N|dHdh�n�~B�qy[��Ah�FG��ALv�kf����_xyL^J�YYk�_PNjYAh�S��:(+2=923+,*:9�� �v��������� fts_main_data�index fts_main_datastats!num_docsavgdl�index fts_main_datadicttermidtermdf���index fts_main_datatermsdocid fieldidtermidDt��index fts_main_datafields fieldidfieldvm�index fts_main_datadocsdocidnamelen��Vindex fts_main_data stopwordssw�;index fts_main_data\ match_bm25B�docname� query_stringfields+Kfieldsk*Kk b*KbK conjunctive4K conjunctive � � �tokens s ) �tstemmain � �unnest k �tokenize fts_main_data� query_stringindex/Kportersystemfieldids ��fieldid) fts_main_datafields"�* �fields)K � � m �&fsq  � �unnest � � string_splitmain�fields*K,system�fieldqtermids �termid l+dict fts_main_datadicttokensQ�dictterm�tokenstqterms ��termid�docid-terms fts_main_dataterms�2�* �fields)K � � e �fieldids�fieldid� � q �qtermidstermidqtermids�termid subscores  �docsdocid�len�term_tftermid�tf�df � �subscore*main t �logmain 0 �/main [ �+main � �-main� � q�num_docs( fts_main_datastats�dfsystem)Ksystem � �+main�df)Ksystemsystemsystem  �/main � �*main�tf � �+main�k)K systemsystem � �+main�tf p �*main�k  �+main � �-main)K �bsystem ? �*main�b � �/main�len� � n�avgdl( fts_main_datastatssystemsystemsystemsystemsystemsystemsystem w � Cterm_tf &�termid�docid A �tf count_starmainsystemqterms�docid�termidCcdocs (�docidqterms�docid��� conjunctive Z �countmain�termidsystem� � � ? � count_starmainsystemtokens)K X�term_tfdocid�cdocsdocid+docs fts_main_datadocsW�term_tfdocid�docsdocid+dict fts_main_datadictY�term_tftermid�dicttermid�score <scores ��docid _ �scoresummain�subscoresystem subscores�docid+docs fts_main_datadocs�2V�scoresdocid�docsdocidM�docsname�docnameindex fts_main_data�tokenizey�s I �string_split_regexmain � �regexp_replacemain � �lowermain { � strip_accentsmain-�0_macro_parameterstokenizessystemsystem6K$ (\\.|[^a-z])+*K *Kgsystem,K\s+systemmain;mainserial����������indexmaindatatext� __hf_index_id m �nextval/Kserial�������I��������������������������� ���������O��n2_@�O��n2_@�������� ��% HYLL�O��n2_@�O��n2_@% HYLLA������������ �X aazzzzzzzz4��������� �H����������� �% 0�HYLLu�1 ��0� �@�0�0@A0 @B@�@���`   0$ @0� 0 @ A@ @��� 0A@ @�� �0@�D0�@@��1 @ ��� @@�@�@ @0P@@@�C @��0@@� 0@ 0p@0E@@@ � 0����@A@ �  � ���@ @����@�  0�@ �0� P@ @@�@@Q �A@@  �@ @@�  @@ �Ap0� �@�A @0@�B0@�0@�@� @�!�@P@� A�� @ @00�@ �@�@@ @ 0 �A @    Pp 0B �  @@ ��� @@ �@D@�@@� @ 0A�`@P�  @@@@�� aazzzzzzzz4% 0�HYLL �A@  �@ D�00@ A@���@�@@� B@ @  00 @� 0@� �  @  �A�0�AP @@ �`0@0��B@�  @ A@�P @ �@ �0@@�@�  �@@@�1 $�� ��@ �!�@P�@�� 0@@@� �@A@�`�0 @�0 0�@ 0@0� @@�@ @ @ 0 @ @@�@ ���@ ��  0�@P��  @@�@@@@@P@`�D �QA@@A� ��@00@0@@@0@@�!A� @� 0@  @ B@�@ 0@`�@ �@ 0 @@@� �0A�@@D@@0��@�@2� @ @0D @@0@ @  @ �@�ACA0��% HYLLl�!�5��h���������� ������������������ ������������� �t ��t�������� �t���������t�������� �tG�t�������� �% �K��HYLL5  @C���A�@0 AB�@@�0 � �@  @@� @@� @A P @@�@ P  ���@@� A@A@BB@ �@0 @�  ���@C A@0� � 0@@0 0@��@0@P� � 0�@ @@0@@�@@ @�@�B� @@ �@ �B B�0 �� p � � @0�@ @�  �@@@�@�� ��� � A  D@�@@p@ @@0��A� A@  � � @�E@!B�@���@  @� �@ @@@ @A@�@ �P @�  @ 0��@@@� �@@ 0@���0�@C���% �K��HYLL5�% HYLLd�OA�A_B<      !"#$%&'()*+,-./0123456789:;Q�t�BoC�C���������������� �  texttext�������� % HYLL5 texttext% HYLL@Abl�l�� ���������� �� ���������� ��  ���������� �% ��HYLL5� ��@A0@�` @ @A@�@0@�@@@�@@�@0 @@ �@� �� 0@@�  @� �p�@ @�@@0@ ��@  �@  P @ �  0@ �% ��HYLL5� ��@A0@�` @ @A@�@0@�@@@�@@�@0 @@ �@� �� 0@@�  @� �p�@ @�@@0@ ��@  �@  P @ �  0@  �% HYLLQ��� ���;� azero ;��������  azero % �;HYLL� @C� @ �@@A  � @� @���@00�P@@ 0  P @� @� 0� �0A�@�@�P@ @ 0@` �0� �@@@ 00 ��@ ���A0�@B@ @@��@� @ �A�0@�0�@ @ 0@��C0 @� �P 0`  @P�@@��0� � @�� @@�@00�@� �@��PB� @0� @��@@� 0�@@ 1;��� [INST[INST�g��  [INST[INSTBF��  [INST[INSTA,��  [INST[INSTfNd�@& [INST[INST9��������� ��t����������  [INST[INST�g% ��HYLL@@�0  @ �@A0��@��� �@ @@@���� 0@$�@$ @ @@`@@�00@@��@@@� @ �A��@@@ �� �% HYLLA���m� !�X��X8(>k�HD0�0 �0 1�!� �@�0� �0�0 �@ �@�0�@�0�0� � " ����� �0�P�0�0�0� �0�@�@�@ 1�@� 1�0 �0 �0 �@ � � �@! �0� !�0 �0 �@ �@C1�0� �0�0!C1�0� 1 � �@ QC1�0 �0�@1 � �0 � � A !� Aa �0�0 �@A AC1�@�0 �@ �� A@ �@1 1�0� �0� �! � ���@�P �P� �0 �@�P 1� �P�@ � �0 �0� B@BA 1 � �@ �@�0 � �P �0� � C!�0� � �0�01D! �0�0� �0� �0E! �0A �0�0 A�0 � � !�0 � � �0 �0 �0 �0 �0� !�@ �0 A� �@� �` A� C � � 1 �0 � A�!�@B@�0 �0 �0 �P C Ca�0� �0 �@ E1�P �0 �@�0 � �0�0 �0! �0� �1� �0E1 �@� �0 1 �1�1�@�0 �0A�` A �0�@ � �@ � C�P�0�0 � �0 �0��� Q�1��0 a� �@�@!A�0D1 � �@ !�01 �0�0 A��Q�@ �@�0�0�! � Q �0 C0�0 �P�@1 D1 �0Q�1� �0� �0 �1 �0�@� �@� !�A�0 ! � � 4ð�"�0�@� �@a�0�0�0�0�0�0�@C! � � �0�0 D1A �@� AQ�0� �0!�0 �0 E01C@�@1C1 �@ �@�@B1 E1�0 �@ �`�@�1 �@ �0 1 �0� � � �P� �` H1 a�01 !1� �0 �@ �@�@Ea�P 1C1�@ �Q � �0�0 11 A�A�P �0!D2� �@! A� � �0�0� a�0 F!DB �0�@DA�0� �0A!�0 Q�@A 1�!1!� 1 �1A1�1�Q �0��@ �@�P�P1�0 �P�P �@ A �P q�Ba�@�@� �@�@ �1� �01�0�0�0 �0�0�0 �@� �` D!D@ � A �0�01� �` C! �0� �P1 �0 � �0�@C@�@� �0� D! 1 �0� � �@ � �!�A F!1 �@�@ !� ! EP � 1�01 �@ Q �Q�`D!A� ��0�@ � �0 �@ � �@ � 1�@1 �0�0 �@1 C1�@�0� �P � �@� �01�0� 1 q�0�@1 � ° D1CA�0 C �0C1� aAEB1���@ �` C2 CQ1 E� �0C!B1CA$�p İ �@Q !� 1 �P�@a B@�0 EQ� � �0 �@!1�1 � C1�01�P�0 A0 D1�0 �0 � �@�0CA�P�0 � � �1 �1C0�0�@ Da� CA �@�@!�@�`C1DQ �@Q� A D1�Q� �0 �@ �Q�0QA �0C A �@ A B�AA�@�0 A� F! �@D1DADQ�0�a�Q�0�0�0AQ�@ �`�0�0�0�1CAADA Q�A !�@ �@� �P A�pB1�Q �1�Q� D1� �@�@ qA�0�01a0B1�@A� 1�QFQ 1 aD!�A�PGQ�Q�A�0��1(D! a�P! �@C! a!� !1!�1 1�0�@�@ 1 � C �EA! Dq CAAQ�A�p ! �!Q � �@ �0 1 � CA!� �P�` AA1 DA�0 �p�@ R�@�A A�AA�@ B1� �`�@�@ AB1�@ CQD��@ �`A ! �0 �0�@�@ �0 A G!�!�0DA QA �aAA 1A�0 �A ! B!�0 �0 DQ�A�0 DAQ !C!B`�P1 �P �QDAQ� �@q�P�@ !B� A�P�0�P A�0Da�@� !�@ EQ�P�@�� �0 �pqA�@ FA� A�@Ơ�1 �0 �01AA 1 � B1 �0CB�0 B!�P G1AAQB�Q q� �pĠ�0�0�01 3�1 �@�P�0C! �pBQ�`C1ADADa QE1 �@�@�@�0� �0�0 B!�@ A�1 �`A�@b �A Qɐ1D1 C!A �a�0 �@�PB@ �@�0�0 �Q �1A �`DA�Q �! Q aDA� �1 EP1E1 1 !�0�P�0EA1 �` �0A� Q �! �@1�P �1 Q �@�P �PEQ �F1�` Ġ EQ� �p�0 1�A A ! �@ �0$�! 11 �0q �� �P 1 �@�0� �@11 AC@A �@�@C1 a��0 �0� !�P�� �@ !�0C1�@!�0 �P�0!R�@ �0� Q �0 �PC1A�`�@�P � �P!�A1Q�@�PA1�A A �0 �@�P�@ � � � �P� �0�1Q 1 �A�0 1�@QC! �@ �0 AA�0�P�@ �P� 1� �0 �0C1B1 C!1� BA�AF! � C1 �0�@ � �0 �0� 1� �@�P B0�0�01 �0�1�A�0 �a � �0 �P�0�` �!CAABA CA�@ �0 �@�0�0 ! �0Q�P1 ! �0 �P �`!�1 C! 1�0Q � � AC0 �0�@�0 �01 �0 � A!�!�@�PB!1�0 1!1� 1Q�@�@ 1 1�01 1�0�0 � 1 EA �1 �` A�`�P�! �@DQ D1D ! �P !B�Q��Q �@ �@ Q a�`�@ �0B0 �`�!�p � �Q �@�P �0�0�0 a�01�0 C11�0�0�@q�0�@�@A� A�P�01A 1 �` A2 �@�@!�0 �0 1 �1�0€� �@1 � ! BA E1 �@ �A�0�P �@ C1�AB �q � �@!�0�QI1 �@�@�0D1 b BA�q�1 1�0 q�0E2A A,�0 �P�` ��0�! �@EQA �0� � �0�@�P DB�1D@�01 �1 �P �0 �0 Q� �0A 1�P C!�0D!�0 �`�p�@ �@�@� �@ �@ FA� ��p�P�@B1Dq��BQA 1�@� ! !�P! �1 �1 � �@�0 � �0�@�01E1(�q B1C0� ABA( A1�bD�11�0 �1Q Q A1��1�1 � �0ŀ1� �@ �`(�`�0 A�P 1 �0�0DA�@�@�1� DA�0 �@ �QD@�0�`� CA �01 �0� �P! �@C1� 1�@ �0 �P � �0� 1 �0 FA�@D!A� € !�p� �0 �@�0����`�P �PCa�P�0 ��P� �`� QC! �@ DA C1�A�@ �A QA1A�A�0�0!�1�0 ���@� À� B�FA �Q �@<q �01Q �0 � � ,�0�0�� �� D1�1 1CAC1 A� �0 �@ �`�A�@�0�0 �Q Q1� �A AG! �0�` �0 �1�B �0Ca� GQ� $CA �0 �0 1C! �0 �� �0 �! C1 �0�` 1�@ �0C!�!�!0B! ! �@�P �@1�0 J1 �PA �0A!1 �0 �@� �A1�A�0C1 �P�@�P�@b� �0�@�A� �` 1�@� �0�qA �`�0 D1� �@�0�P�@�A �1�Q �A�PD@ BA�P�AA �@ DAEqA �0�P B1AA�`111� ! �p� �@�@ �0�P �P A1RF11�0�p�AD1� EA ! 1�11 1A�0�` Aa Gq02!CA �A�a��pA� �1 �0�0 �@�@�@�@�0B!� �P(�A �P�0E1 Eq�pDQ�@ 1 ADq$�@ �@ �A � � �@�0 �0 EA�0 �@Q� � �0� �@�1 � � �@�@�0� �PA �P �P�0�0� C1C1 �@� !�A�0B�0 �P C!�0�@D1Da �@! Fa1Hq�`ƐDa�1CADA�`�0�@!�`2�AÀ�A�0�p�P �`�@�a1 � QD1�AÂCa$�0C ���0!A� A � �`a �P�@BA�1DQ�0 DQ1 �@1�0�a Fq 3�q AC1 1� � �B0��HA�0�1� �a �@CAFA �@�@D �! �P�`�@ �@ �aQ� ! � D1EQ �0 �@ C1Da �@1 � �11 1� �!�0 B1�0�0 � E!A a �@ Gqr�b�aB1� 1 QQDA �` Ca�P �PE1!�@A �0�@ �0! �0DA qQ� � ���@$���@ !� �@�@ EQ$�AE" FqB�A �P�P� !�!! �0CA!BAB1Eq�0�0 !! �0D! �0q� A�0���@1BQ�1 €ÀA �0r�A� Ca �@� �`�P DA��] 4�@ anordelericalaonarsantalvickblnepltandelroasctshmybahoutcuadllhahenourisambodukagidopossuseafeopotncscicngmpbecibipiumosidapuaabkehiwigrfuldilolfrrtowfaflluagttgagujuweulslemppsqbrocptnswoeeupoucrsofowatrmothquessuitclpydageceacvaatmipetosefinachexlocomepasiuntimaradienteinlierstreconstastrcomproenttervermatforfilmanlinexpminpargetvalmartraaccprimeninfcolreachachinamtimransubthisetindtheprecepwarinsattunitriserworessdramonperectlibquepensenturquaingtoltorsiditeounthosorintetionclaslistsomedatapathloadpythdictcreasuccspecsimpllighterroreerrorepreupperobjectdirectstcaerildonpmugfbhvkwyjxzqw�W�LJ�)=�����,�琘�����:�耖i�C^�mnl��%�d���� ����@��Vq������YJ�������y������1���2|j��@� 5f�wN��P�%n�����}��LJ����n �� p/���|�T��p+�|��B� ��y�7���A����KT�|����}rn����������踔�6�U3-����w€������#��$��ox��]�`���Y�����1���l,�^���Al�.s"i��W���A����~�: G�e8X������4��� H$��w+$�n�� ?띗i��V�}�9 �o��(��H��C>�&5v���p+8�(��8w,�!��Yz!�|偌}��<� ���s� ��;����� "#���w �~�:�4C^�pK}�N�#���(=3=G�(G��K��K���C^��|��W��a��b������z� %�K��I_�G�@�a������Ŗ���"���o�T�����oҥ���m5�S�K~�����w+����62��0����5�e,�m���F�������l<-��� ��B1�9�x� N a����z���=���l3�Ā�H�뉁S� N�$�mȌ����h��wh�$�e����.���v�C^�!wa�#�eG��AlV=��(� �YJ��.^��t��������~C^���|��9��n����n���n���G��}�\F������ p���~�����_%����}"��(������~�Z ���.�:n� U� ��K�K2[��r7��z(�P�ܚ�����������y� ���u���,�v��=��U�f��|(�8y�����[���8 )����=�(��!e-����m����m7���@�䌟���� ��h��!Y-�c �������s�� �� �����[����!�cE��.�]�����)��j5���# �:�B��(���T��T��������+���,�������m�� �.h�g���������}����"×�x��}��|����+��%m���z�,� ���u��A���m��o���:����:�K7 ��o�K��:����2 � ��u��<�@[3"�.�z%����!�i�U���p ����b�#��{ ����i�CJ���������YJ����� �4C^���KK �� �:��G����~�:�h�#~�:�~�:�ğ�ۋ^����G���|���K�)�o��n���h�#n��Us��n��wN��n���n���o �n����"��]����"�ğ���o��� p�����������@�g��k� #���~�������䉀��v�Q�6��� 醉�9?��������p����пN�m�������m��H^����l���89��뙇����������_vG�����W���K�l;xy1�?��n���� �E=*v��!����q�$����6��������i=��j����|� �S�P�����w�������V�Fx띇5���3�����J�z���R�*I�����G.�8&��������C<�V����{-n�V�� �3�j)��.����씀���������}"`��n��i�C��+V��T)ѭ4Bg�j��"���8����K����H�{���,��!1�5q�z� �����_�0�����~�*��YJ�9�w+��~�������J��+�����F����P�����������l����"KF����� �t}*������"k��}� ���������-�%��|��)���V�����Cs�D��� ��� �� 6�!�"��zS�I�u�� �ǝH$��� H$ �`��܏z���#7��n��}m������m���b7炚|k ��q@���*���TZ�(�?�K��� ��(�?���A����!���������?���A����!���������H��8y��v��c�n�|-�3��C$������������������z�A�z��)��q� �:���f�������$�vG�C$~�V6��) |�}�o��\�~�֠\�~�����@��\�ﮎ����� ��t���S��}"3�5}�����6�i�������_{V[���� ����v@큍���h���p ���������k�w���b��]���������Td �x�d�����+��x�S��S��� �J���w�\8I�x4�� m���2�m!�xc���������|4*��$瓇� 5�{�*�CsT]��T�w�}%�����v��������������}���o�����o�� �~C<��������C<��:� 5�*����A�w�jp+����j� �C$s�� �5��w�lx鰌��~�y��Us�C��x�Y3�n��G���C^�,�@��S�b ��o��{$Wꅏ���!�c��}6I"�UZ}��R�k2��3����eG��F�%����Vs���w����Al�.s"��Al�.s"V=�W�f82`��������c��{�SW��(������� ��=����u�%r���8���r�օ������|�C^��A��f�������� s G���h�#��뭋�^��Us�C��q�Us��p�������ꔀ�yK� ��YJ��"*����n���9����n�uq������.�� G�e�h�#^��G�������G����yr�JA�f���t�����K~�:Us��~�:wN��~�:�"~�:���n�����~���.������wN��� �����C���C^�KK��}�����K�����c�����4����������������������9�����G��������A�������Dz��L �A��C������n�� G��n��Us�C�����n�� �n��C��n����zZG���I�,�� G���.���z�n���.6��������K������A� 3��n��C^�L#�p���������kz(�6�KT�1���x� ��:�k9 6�����-� �����f�F�-z��D��i���3pI��+pI�xu�R���q��k�+��|�����圃���KT�� ��S*��������A����H$-� ������w�l-J�+�������^^��K"� @�����8�� ����*�΀ Y�@���}��+\�8�o��}m�����!�c���t�(�����$��"�������t�Y<��9�x��h��F����0�f�V���m��#��wz���ﱍ��D1�FM�s~Y���S��8�o������Y�G��e� d�-�Έ{q� .�a|���U���+Us�[i䷂:�1M�+��r� �s�[��x�\��F�������J�t2��_��[�C=A}q�n�������������������y�na�[�C=A��������������xy1�#��n��n���s����Al��%��Bg�� 5��b"p����S�E=/�E=�6�E=�%Q��@����5�����i����S#�T����N!���vn��S���:�#Z �n����/�{C$�$��p{�1䃉7+��%�Bgf�� %��%����������z�� ���� � |����색6E�a!dn�}��v�i5v��|���~�_����q����$Y���8��� ��C^��w���N� ��������'��j�L�x+]/���$�3�C=��5��<�L�}���x��.���4��ꚾ����w�.�1H^����2���B52��5��5�������6H���������?���������9 �6g�9 #�e������u�z���� � ��i�fn�)���3x4�Y�y����)���������������������%�n�<�� ���wtU/�l�������j������!m�F�f&� ��,���k��}��󅋘�v��x�e�愋����b��Yz ��BOʼn���w�U"�Vs:� �}��-艌�t����w���V[c"g��������x�C���t��Ԋ�@�S+ oY�����m��Fo�� 5�N���@�/���%��4��v"-g��O!�C^�m3�F�=G�񒊌������흂4k,��x��v�����.�z���u��������)�6I�~�H����r)�mn��h�,�������,$��qA�q�!�����Fv��Oi� #���0�2씏����������*zC?�������������F�~����e������v8y���U�W����~����p=�?,-I����m��!���D1������ �}��Q���}�����T�X�x苩2�����}�u�����.�P���������A����4Hq9�l��aV�{�u�զ�#�ak3�F���v�А���f)�aV��@�p w��I�r轘 꽈�� ������� ����w�+:ё��艌��"�<�p1������B������������6��D�b_�������0��f����c��p�O������ 3s�t����s�t���� �������,�*�O�i�f� ���������`����`���l-�z���� ���,����5�5�������w�����~�6���;e-�KT�1���������������������������~e�� �������������������%"�����FP�Q��������a���/�����z~�~��B�� U����D� ��z�@�&�t� �D��3�V��d����T���q��i䈔�1����a����a��m.�������T���� ���P����yI��x��#���r�t�����}m�F�5����A����KT�ք9�����ӿ�����u���Q��0�{� l-�_ �!�\��&���A ���?�.�1�������徭�.�z�}�}܈��擛s��씐*V�� ��靓������.�٬� �c0!���y7����_����琘�)i Y��2�9���@���vf���"��b������g��n��� ���}裄�鬐�������8\��~f��؈��@�9��k)����L������������!��vG%�!���������d�z<ꑂ��T�}��k��G��G�d�z`���f��.+�}��F�����댋��5F鍇�俍���Nb� ��5����xQ荇 ����+��1��o���*\�u��� ���������b�����o��j�j�����v'�KT�1�������������'���w������c�2���x�d�謎 L�sU^�V�&����!��#��=��x�v"=���g�G�"�C���9����������`������i�/����}��k:�����!\���l-��!�z���%Gp�mw�1V���$������������z-�����m�}�!�z�5D1������om�_�m��u��_����������)�1���wzXX�m�5���z]��-�z�@���p���F��O��*\�}��O��*\�}�,��@�����C�l����5�+�̈́kz9 �!#7��U� ���"���}�8���8���D�Y�@� N�i`��������b��*\��������E�b���l-�wz�}�6(��k�~��>1w{����젔����=�7���k��_Cf��H^�B�������/���� ���������:�q��*S� `����W��:T&3p�lk� �o�/��������5俗i��V�A�p���l���t���K��"�9u,�N�t��������S������������γ�L��`�?bM�!#�%��0�*9��e-��0�^���|Pg�u�������V� �����>��|�,������'I�������€�#��[r����R�� �k#n��d�BJ���f0��Y<�q��=G�{�-���� mf&�6�g��*GRH�$����l��䗿s=�(���y�}�[�H^v���K����j�x�Q������z���9|(�*m/�+�������z�hr�#�P W-��G� ��o�OK�x��3�)�3�*+�����~��]� 㘌����m��6���nn����� ���!�%�Y��F�����dJ=�����.Y>���a�/�:�k���D1������ 4����7 ����j�x���4�����B�2 �������m�����(y���A��������Q����t�|�m���V��Jo�H������w�)�zf뒍퇋� ����j����n������ 6������N��b� }�Z��8���rQ�2�����kn��2����qZ���H�뉊��.�t������d�"k�� V $'��'���vG�5�2��z�*FH���w�4����v�w��1���||��I���n��j������79���yH�3����������?6�] ��)6�넅��l��3�� ��R��"�t�P���z���x7�����*�������.��b��x�5ꌏ�"����!�n��i�U�(�c ��gm��ї������� �8+��b �v������vd�� 1��-� ���z� �tCs��mP���*��x�n��t~�T���,����O��*\���m���z���|����l�� ����O�v�z� ���~f�vG�����d���@��R���"� �'":����K'�cdt�à\k������u���s��Q[� #���k��B�=��*�l��~�f뛉��f�z�3�x����,�G������� z~��Q�C$.��|�# ����*������!�5s��/���a�0=�������� ����e씀&��)�! `�,�+����w ������&��)���B+ҋ���t��w��by� �C=� ���Z�/*I��R�NC���#�H��#�K�`��)�+ꍇ����K�~�o�Ю���`��>~����� DyD� ������!�!~����p��;��K�#�M�V%"�����C����e�k�=�����z� �� #�f0 迄�����z0��A� �V[��������6���Z��^�x� ��>�ꋠ\t����b�X>��2������(��o!��$��ʼnt+#�W�)���_�)��e/����t�b7����*��o���z� �ĉ��錂��L_��w�b휂7�}�7�u�@����o琘�����"�#� _��o������C��� ��yy��T�s'�T4����3柂��h����B���������\v����I y����v���}�)&��c��)������䉁�s�����䖳뉤��ׇ�j��������5�k+�딀uq�%���j�.�n~f�u���ʼn� ��:���5�2��k�t�Yq����x���}���M�(i䌟�)��6��D� �}��9������v��2��� ��q�j��Z���b��z� �hp+kf� ��$������*I� p��� .��KTO�~`� ����:���mz�}��v�O����w����t#����s��Z�]�6��=� �6�K��;v����%���r���O��~��v4��|-��#ynK�8�z���� B�q��r�6��7 �#���9����!:-f2J���r����vG�h0s��h#�PG�T}/������*� �l��\.�*G���z6����>�6��A�s'Rv~��P������"���n� (�??�?<����-��~�%"�u����'���"�v���8@� �o�y�8�H3�%���&����LN�x��뉓s"G돌���tU-�z;�B\��l����dU<������t~������/�� ���`�0��l3��̈́��i =����m~���� ���)���y!���� %�9���R1�Q����w�+��L�!������?�q�������M�������C����l-���=;e/����u����T�����P�a�[�C=�2���kCq�2�u�n9=��H��i5b_w��^2=�*4�%�����g��t�U���_ t��W"��"��w��YF���T��{������.#������苅2��M��� �������:6� �����4P~l����������!���j��_v�h0���l钖�N�@��������宵���(?� ��t�����j�2��5�U�(xD�#�F��������H^����6���@��2 y�� ���ĉx�@�z 3��<�?������5;���BE�����ׇ��� pF�����S��#!�<ԕKI����4��~fぱ��v���� ��������l�~�6�|�������l,����()�\<���|��o �t����t��$�����~�������rC<�(���%�1�'5 �S�'P������ ��$�3����n 聸� ��*I��*y���R�����N��*��3���'�ń�(Y ��𧌋6�Cs ��"/������������ p�S� ��As ��5������4=* ������F���� Y�O�6����J�w�B���u�#? �Y}��n�0漓��~�'���s�$�p�������u���"� �f��Q���hF �r)�a^�aiv���� �N>���Q�zN���� ��I`��������%�tt��w��zt+F;|�Q7P��v��uLNc�덂���Bg���SU�����8 ��z��%�(��Z��j2�[�1J���x7��v/�2/A�]�D��r������ ��o���%��@���-�������������� ��J���€馉�:9d�z)�x��4�0��w���&������ґ����O�� n��P7�M�(v��"��e��!���v��迱x������ta�H$��������!��9u��m�q���, ��x��[p���������"1������<�`C��*���2A\���T�����֢ ?�v��H������V�F���(�{����Y����+���3��������l��������h3@������� I>����F)���8��}�)��l-�H��}�����c�D��%�nF����f&�p N�����&�!�_c�wVʼnў����In䢟F��k��\���� �g ��u��I��Z9 �(������(�:�/�^�Z~�V�+�6m֛������ � ��������.1v������ZC���w/3���z-����z�|s���%�$�z8�����*}�Mux}iu�|��^���n�B띌r � �n��:������%G-�x�����F ��W?�� N0 � N�� �KT� �~�p��������h���n���w�����bB~f�����m��C?,������*�,v�&��2�����l�f��������cG�襠������x���p >�l�d ��'�����z~�����!���'�&'g�&'����, V4P��&�&��'n�2�n�z��Y��������n������$� ����|4�-�����~����")��b���&��&� ��|�����r1`�����v�R�gT��B���k��'T�����}q������$�%4��I�����N�6T��!I��� �~�3�~n�����0���N>�1�����p�@ � �R���� �k�� � 1��7��!�ryQsV �Q`�C������;���g?�p���������n�b�}��%"}�������%#%�0��),�>�����M�P���)�����RR���rn ��������o ��*������� �!��*I�`N`�!>�z0��$���탸����%M 'M�:�Mn|~�� P%�)>�n'� �Y���� �4��~���jW;��Z@��#e���l;-��3��2 ~�y ��0 �����x7� ���%�� �����c�8���b퍠���(�j<��:�x�뉂�t����vG�kH����s����xH^�.�����r��;��䤊2�mmm9mm9�u�&��2 �M�,�78��2Dn�#�h�:8y��QƊC��2 ���Y-�gm�4t�F8�"���`��0��0 I��z�7�?�C����q�����ygņ�������-��<#_�!\�� �������f&��z�5�s"p������y�/�h���+�q�����+��T�����2j��<�� ���B�gg:�yFh3��ICs�mB��7��2�Hi�ag����������[����1��6���z�9��I=�����m��n�B�������F*�a��������b�}����P��G?�����kB�V6�H���Q�L���~�s� �����������o�!������㈐�-��hp+F鮂4Bg}m��U��g=����G:���F��O�� �m��D1�m��9���m���K�}���q���,������q���,��N���{l,|;� ��V��o�C=���G�(������%�,��i�B�B�q�r�,��滑��"�q���#� Oń��낌Dꗈ�"q�)�� D1��A|b�A�$��句� �6�m�����)��f�,����iD����������A] �����`�f�����\*�����_ �{$���:pI������C���������K������YJ����񴆀��6�*���~�����H^��������6�S�*��e��3��s��Ļ ����|����L���f������a�����.�g��B��偛���(�#��(�f&���1u���1$�&�~�:�bꌀ�f& ��}�m�_��*p��\q���6s���������z!|(����H-��!������ �� �5�=���롒��lC=���Dw�� ��r����������"�K��Q<���}�π�����q���Ү��o�H�|�~"�ۆ�t�8G�(��P��S��� ~%��Kf�a�����>ꍷ� I>�j�}�o���?I�������� ���x�k6�x�� `�WfyÇ�5�ĉ�,>�j����������W���"��5����6�a�[3������9��u�����4g���>���E~~ta��D�a: � ��Sb���������C��2 &�.��S���� � ����#�����������g�� �b��*�����*\�V��u����t����뉔j�r��������D��F�8yX�^��+"{����䁌�7� +V�v���*I0�����9�Ws��S��-����( ���5��s�(VYq8l��!䃋�� ����S+���wE���=� 3�<��p��XEs?u�S��X�zV�.��X�����������|������)��{��� �.}� |�0���|�����m�1 �,�D��D�����U���� ���K��� �6�聪��F�A�V���� q���x�{ܴ z���C�� �w��{p��j�����w�KT�P �Z��5�7��ʼn����M t닂�C=A�e����䓛��kK���&����y�������UJ��j��t�������6�|+���5����l�,��$8Qf����,?� {��6�b��ZY^�d��ӓ�%��x ��+������x��釅`�z��?�V����� 퍂��2�� *I����88O��?�{*I�-艊 暉7�s�� ���C��"|�y��s ��lZ�61���І q�%���3c��v��V6�O�������u���濌����P��|S���}���j�����3 O�u��,� |�qh�茉�(�?�2�����xy�������t�览 }G���E��� S��������3聪� !� ���� fo�-���kR�f�䚊����`���`h3�B�$� � ���Y�b4"ꌷ�������k�*��5l���5b"p����{��������:�\���0��9�j�x7r�����n�*��[�g:�%���������8�}�{���b�x s��0���e��L����F�'�������R�w��舷\���g���������*씉H��}���8y2��˃ꬑp+���N����� �S����}���� ��o�(�*��f���� �|+������#��m%0�=�\������6|4tO��FM�,��t��qV�������(���셬�kCJ�a��e-��e-+�C��� R���������%��v�{p�s�� ��l�3�瓈��1��2��l����v���}�*� �o��������}��s����=� 3iA�qĈ�h3���:�'6���UJ��������� I>����Wq��{k��wt��j���bT�T��� ���r��2w�L{��������x���FvG��S�2���. ����,�p��%0��*I.)��������:8XE�X����X�n�?�����?��?���A����!������������V�)�w��������{�*����Bg{�\2���� �����vO���z呗�M�o�%��T�����P������j�,?�������1V������}��%F��k�`E�ө���z�萱+���~��v�c�:|���:���� &2B� ����L���z;�9瓟���A���7���a=9��� ������L,�)���|��_�=���_�=*�}��|w|�o�=�������#�}"N�������w���,Nt��$�/�f��k}��*}�]y��L}[�JF�!���jW�!�b�A�A��`��±��`�n������dzrs�����䁀���x�� �t�� ���-�����1��K��%�����5����������� .�&�<�t����g�A���d�oKT���������=�e`i0����1���o��.��!��.J .������.� ���1��C��C-�vr����c��雅 ��#��~��84��2��u��i�.�푃�%��� ����,���p�����w��i�%O��2򝋅���17�����tj������,�������������Y<���2/�7�?� ����)�����큚��艌黕�}���=���@�v�#��.������Y-� �����#�Ѕ�G~䜂 �|(��6������u��5�7䉎�倇 j �xQ�9����r� �b"p��� ��y�閳�}u�M �,��*I"�b���O9�cE������*�T�z�/�����ta;����#e*+�醅�x���������V�2,�H,�䚊�b������5��@� N�_��x��8S gp��z�BJ����|�r�*w���cGa;�*I?�f���{$��������x7KKF"cG���@�KF���L���LN�@��)�����'���t+������B��������d �LJ� �h�1�툙K@�t+z���~��*w<~�7��t��������8��(�D�"��D�$����q�����GZq��q$y�P�?P���N����������G� ��!��y�$=��y�����|�9�a�u~����yyP�����u�s"��!��}��}���{��*+�~+� ��)�D1vG��� UJ���0�3�9�K�}�.���1U�������i�)��D� �LJl;"(�� ���~�����@�}���6����������錛��,�D1�������8s����� ���aKt�8���� ��`��M7��Ȋ�������Y��"�W�{q�k ��%E�l,� Bz �Ō�Y-�π�����x���gs�n��v�z��k��(���W���a�����W� )ѭ46���BE.-6�����`�D��A����7�l꜒ �2��9�wh��6�P ���G�Fo ���j�c��U^��| U^[��D1�g�� `�|������.��������LJ���B����6 `�Kt�����#HJ���T�y�z�@�z��h �z-��"猑&������;Q��o�x��x�b���9�u��Q���pI戂���2"n�퐖�u/�-��� l-�� ���q��B��{-�l-�l��l @|4�y�,ߵ��넌ߵ�~��8�]��|���.��9 Dõ�� ��xQ薃�M F���_<�(퍇��z=�4�"*����8��x�kK�%�N���|S���9"��yÑ�����!��E!�����㜒�� ��&�#j2[?F�~��z�;�z�e��a9��4>����%��~���l�5�~�������H��Y댃�*�d�/������^�}������a#�s����eGr1��& =� `�&�{,䤈kn4��7������� ��x�f��6(��� �8�%��O������o,���ׇo薝��o�L�|�~f���Ц���pb"�~��C-���2�T�2�T��Z ��wh�~��������1<�E�1�5��B�z���~�6�:�� Z�趖�j)�����e�&� �C-�F� 5ꗓ}9*���8v9��횾��~���2���)��K�2[�#�K����9J��H�뉘��T9����f���/��!��吱 \s(�癊�i�R5c��p���ቦ���}����x7�����������pn� ��:����H$���L�/��4�I�G��C`�8���&Ii��)��?<���3i佀����Q�=�_vG9�$��V[� ��z� p7� p� �����%G-�7�k�jW�I�Bg�EeqA��x�����Iz� �t����� �� �����n�:���&5|�@�𹋙-���䁉���o���S�t�����*����:�3�� H�� ?�����=�cJ�v���j��?���r���e`?�q�����bM�{l��������2���Bw��n�x����H��@�B�����֚�7����=��ql�g�-�n��4u�q��ta;��w��"n�wπn��}���f�h-����w��.荎 ���K2 ~-�i���`�����䕓��w�?���@���T�����~+N��Y���J~��D�q�E���QJ�I0 'ql����@I�$�l�D�`N�� �` '8��8� N8�'� �C@��:�$H��M$�$��H4BI`�$�$>��JB�%�$���XL�P�`t�LI"��T0��t�I"IP��$���XL�I0�:@���0 d� �@'�@��� ;� I�|$�$�Ē`M�I� s�Y�y��=�(2���2� �A����/�A ���K8��%��#La" �0^Dp ��D� ��������Op@<� +J!P���XA��fP�@A( E�� P�BQ(� �"P�BQ(���BP(Aq(� �"P���(E��� �(D��(�"ԀD1(�BH �BP FqD�(�"ԀD�(Š`�B)(kc(E���1� Z�����L�6QB \6P?�� *D�� ��� �ģ0��@�H�(D�������H!��bH�2P���(b� �2 �A�e� p�2P(p �R �J�7���Lh�0��>���R` L� 2�Xy���0�����h � J����`hn� Ԃ6��p�M� 47���KpM� ��A`��Hhn0@��*�� 4���@�M�8����h�� J���FS����)T�>�*A�l�)T�B�B%�f�)�6"�٨�} �M)�܀h�f� �+�܀h�`� �@���@�n���>���Hh~� �@�۠Sh�} �A0���Hh�R�D�6`�@��}� �MI�ڀp@m�+�?�1 ��)�AP��(�n B@ " � B��!@�M� J��F�S�m�%B���h �z��BT� R1B�#�@� m�#΃@P ��hS� �+ >�"��:� ��0ڠ� `*X�����TpN���Uh��Mc�@ ��� ��>��@!��}�?P�B��}� J�>��(�} J�>�"�(�� �>��0�} �6(�PB~�v�>P��d� xA0X�b��4�)����0�}�)����fp ~�� ��@!�@�8?P�4V� �2`ڀ�N�D2���p ~�m!�� ahn� ���h6@-h�JQ)�M�x6�@�m� X7`@p�J� ��6��bT W� 8@ � l�`�B��b�mm< �x!�!�X��+�܀hV��A��@p�� T7��H�`� �+��"Vh�@ d�6, �?��Aڀp�?���6(�@h�X� �A�@�����6!@h�*ųaڀ$m0+B� ��T�J�tA�P %Ah�}� *���@���&J�6��@p�}� ���ڀV�V� ��>` !�h�,�"��>�`T ��XA���@p���*� ��R0�� R����B��J�JE��!�hn�*�J���T�m�*�J`� ��ٰ#*��8��RV� X�6��VT�R�+*E��?�� V� v���W�m�T��2�(T &��`��R$��+�E��6,!Xhm������J���D�! �ba,������Xh�bQ�7*!!��c�X�t���X�c� ��@���X��+�Ō�Yԁ`,������W�JA,�E��L@�eQ)��#���R$ m�����B`�}���6��(�} ��pڠRx�� X1�ڠY�d�\2`ܠ��@� �zp��V� ���x��%����,���HТR m`,�A�0ڠX��b1#��6(!;��bA,fį(3��c� ��6(��X �$D xI�Th�f����B mP*��6(��X�c� ��@���X��+�Ō�!XD(m�@���Xhc� Jů(�� LhQ)l�D��=H d �z��@ U0-����F8��P)�A�i�ZX��P|~E���g d�_Q,�Ō��bFԁP-�E[��b\�m�-vD���bG�m�,B@�֢-�_Q,fD���W b1#~E��u`�4�jQ-�E[�ŢR@�l�*E�����L��"v�A��b[H�l�l���� j�:�A����R�h� � ��"K4�a����Y� dP)*���[d�O� ��~��� ��,�m\Bx6�B\��$P)�E��'�\\�r�R@����)�.�E 8]� uQ C�`�b]���� �� a!,��&�|bEXp�]ȊX!�E�Xu�]p�:@ g a�T i��/� [p��@�.��^]Q)���B^@�̠ �+8wA�J� �7�bap�p$����! T�yA/@�Pb'T�l ������^��|� ������E�m`/@��!& }qb¾�q�p.�E(u�-t��p��B�u@!(����BX �_� 6�D�2b5��.�p C`l00F�(�`\��0 @j���Sd ��%��� ��"��0�EL��4 �"Fp�a@��1����bL !1F)� ��@��!��h�aH���0��d�+ab���� ���HL�J�R� ��m���&p�a�#��`0�X 8�(� t�2�L�8�� �7` 8 I �A�P ��@ @I`K�Ăq1t(�� ĂT�PA,�L ��2��&t�� ����Q0 ԁ:� ����Ӡ�t�e�@��8cc�nc 8F0�Ӡ�L�`� ��"����@f�"��n0�����2�@08����A �@ �"�c�j�J`0�#d�@P��p%�������%�"Cٌ u�@0�= ��� ��� i�dd�:���(I�d����"�@�H$�d����H�(�F���� @0��@/� �p28@0��`^ �A0�� ��QyA0�i�f�:���h#m���Q1jF�Hj�4��!n��6`"D�n1�M�Hk��L�`0�@� #D 03�M0����$��M0��&bt�� "F0�u��� "F7u��t�1�F�H�&L�`1�A��&L�( "F0��&L��6\�.�6�`"����m��D`mcft�`@ @�am#$��6�@� �&L��6��D�G����m��D`i���� "F0�"�����A������6\�.�6�`"� ��m��D`pcft�`@ @�ap#$���6�@� �&L���6��D�6� HD ��)�M: "4��0t@0�6�B��n�m� �$pt�@�'�&�t�`n� 7��ۈ@�Q�M�I�&bt� �A��6�`nt�Q7�M �G`"4w�)\D��! t�1�+��&�?0�F�63��:@3���u ؍n�XŲpu��ȍs1�F�63�t�� �A���&� V�m�AĐ�&b��n�m�AĐi`f�� "��6Q bH�:p�A��̌n E��6ݦۤ�n �A�CD�`1�A��6�� ��nC�`��]L 0 4@ `��L��n�mx������`��E� z�t�� �M��6_�ۄ�`� ���|� ��� ��75� �n f�ɸ |#�t���7D@0H�@��\�>�6# ��s�f��u�ԁ����>�@�03���i����n΁�i|#ܜ�403D?��� ~����"`��}�ml� �6����*8|%!p�(�7R��r���9�6"�E� t��H3#bH o�9�RCD�s�"�Mu`f���p��q@�A�403"��� bH �AĐu@pԁ���9�6�C bA�Cj� �13��8Cj��(pf��cf�:03�9i@`H PX���"@`H�‘|D�����p ��a�����qH���8���qH��A9�O���r`��Qn4��pC��33fF�H>C�Á8� t>�",�!��x�#r8��!9&�P>��r�ˁ92G���cf� ��9<��7�t��F�(��t��ԡ:V�H��u���|\���&v�١C���fp����혂�C�:Po����#wLA�1iG��]`,쎱���X� u�w�� �혂"�>Ў)��혂3cf���||G}�Spf̌�<���6xAx��n#�GW ڢx�� � �7 � � �A���A���$�?@�@ ��|` ڂ9�Y"y(�` �@0a�/B�c#�` ����ܛA�0̣yp$t@L0�` 䃘�� �D�V�X���� �� Z�� hBY@��T �*=d�҃ p�0=�G�HWPP.��� T�z\� ��Ap�=,�\� XdA�WhT�z�9�= �Eh�� p�@�G��c{dA�Q�`����{��V *�� � |���G��_��P�A>�W���|d��o��Ȃ� p�� XA+�}\[`'�GL���{�1l�Tx�S��,@0`�@Y�`��P�!�`@ @��� 2(�`0�G8 �CY�l�E�X�# ���!և�� Yb}��!և�@Y;1v��7�@Y����>�` `)���C_X K!=��>@�P�cL �1&F�88�! ��� H���`~H�@J��������0:����~$��)� ��d��`?������� =,�B@VA�� �atR@���4a�������� ǀh�2?��Q��},��@��P Ka5���RHK!=,E�� H�����@!�����T�VX �#=,R��q8 �<��p��� ��$�3lA(x �$�A"H� ��@�2AN�8'< R�B(x !��T �p�� ��5�� �A0 h"=l�+�6�R� 0�\��pZ � �,� �}:H98Za��A��ă���G-!t��m� P_�T��$�*��6�dhn������ �m�����`T �>�>������ �D@��H��?0�A,������S�78 �Lm�b�6�ڠ$m���]�Upn$m� ��>�!D�G0q��>��`h�R.(�6@�`G\ "<���������0BHH0HGB|�} >�>� � |�} <�C0(!&Dh�} ��>H���� � ����8!�1����g���CqD�>�8�`�n@&��>�8�`h�� ������ �� ��6(�|�}PA ��|�}�"&��/b"������d"�4�$�A��6d���D�����@+� �*�BZ�hF�FP.@t� �\@����BT��Y!��P��sl@+h!]�Ȃ3� \��86T@\����ű8� �R �O��"�P C� E�3dL�#}2E�H���ԁ�_D0������>��`��bCA�!� {` Rrȹx�:$L�N8a"Z b1 ��|�q�Eh�!TBh�CҀ�u � " 8� ��� N��P�`�x���# ��!BDL� ܠ�� �0(z�E��+p@q���Z"A��!>܅`0�7�_�(�" �Aq�=��!qN�H܀0tp. @E��� ��-@�0%��8��^�����?��@�@"4C$�4���@�4�+�A��&��J���?���^� ��%�� 7@�@/p&�D��� ��(�$���/pd�D��^`"�`x F�M��� �4�+@ " "rE�"@@�E@�Q�E .��\Ez�z���D2�R��\��zH�"� @ "�((V�P$@��+�^�"@@�E� �"`UL�U1E�BP�"`UL����� �P#�H� @�\E�$�|!��\E$@�� i WH� D��T����� ��x VD@ E$@��z�HE$�.�H��`E�9 T��@ ���@`H�����PD� $@��"@\o�B�` �`��E�("z�h��P �K���e���@H�: ���@,�MXX�6@ pm����@/<�\!$����&WH�$03$���@/̌��q@@K`[d��E�"⠋x�/R $��YA ����&�H�"bd��1�� `ed�P1P&\Ǡ�nj��E�A���N�;���^gDP��Ex �#�lj *7�`�� �3 ��`p���`�F8��"c�㨑�c+�HDZ��{��3-����"l��7r���#qDL��1vA_8$B+̌��H0�"��]� ������4"��5�}���"���6� �@�L;���"Q�;Ѐ�E����#bd��m� � XZan��S�X�+5���#��@ ,@�쑧�G�D)���h�i����!#,�E��-���r�8�!��N�$� }��H�!?���$�4��p2D@AX�#��6�G � @@� Y�� F0 �'P�B/ C� <��8��4�0��a H� �t0$�0 �6j(h��0�@�@C ���S�=� AK8$�A:�N� Z EH�0 �#@ `mb ��� �@|$� �Np��!W@�TP�A �>`{����HN#i$�g<���j���$�D�Ԁ�I"ɲp��l�0I�%�,$� 0@M�C ���Sj��$����P@%q��8���S����Gh� � �pI&�V�^d!�I���$�b ,� �LK� f���2�R��G`)��C����V���L��`&!%� ��NrJ<�')9����NRr:I(9�D����I�@' %��h��c;�)�$�d��cӀ��u XA+x��8G�(h� $Ҁ%�� �Y J��(%���+h��<G@;ds�lT��I VP��+�f�(�D�����A>��� � 0�@��Vpg�+�R�*�%p�# 0 (� 5��@>�`��0 ��b0K���lCf���|�, �@ �s@���a䃁@rEf��d�� B8 ]A����Jb�@pu �|��>�>! T�$��$�0z�. �@�M��9W� Ĝ5@ �@Y�H W���p%8` �X� T%!� �X"szƢ�@��&0K���*!� �XBh \%#�ZBW�9k� �2p.zF[x�"#ؒXb6�@� -�lЁ� ��@�f���nI190� ��P#���.��"2i��1h�P�%t �@sr�p��9М�Kv�a�>\|�D/�%� �/�K�BD��$�;8L�1)�� �`2L� ,&���b���+���} �d�>� [�9ʄ�|���K� 3�6ͤ$8���B���6&a��g�� %6'����pr|��9҄���p��w��a:��� P��Q&�����!|�͙&$�����c���9��t���q�s?�Ě�s8��sh �ę(���K�� � �� 2���z�6�=h���6�*G�m�%98l�m�>Ȑ�z�H ���s��6�Z#��� � @�m <�@Ĉ�d�TA� $�6��p�n"]@A|��ďL�&�#y� �y=��B�‰"( �p@G0D���6�p�!nN�8)`�xl�NX:�f�|��3Fɱ�]� v��t��Pc ,�c3N���Q������!JB0c`� ��F � �`|d0�@ ��Dx�� <��6��@x��� D�6� ��ȁ/� x�A�#t�PN��ۀ��� D�A�� �m�A�� 0'�t�C�l��Ϲ �"��� �����E�A��D�9!2|d����H#b; � ��"Њ�����8��� ��(�j��� �� V�"�%! �̒�NB� ���� a�p�ֈ0@���E8 A\D��e3G�. "�d9Ȁ @�F�P#@�����N@�5��L�jD��0��.� ��;�5B�n�\Œ�3" l�:�f�>��`�Q#j& -' �N���4��� �������j�>���d �JX�X�$K� �\�:_ l��rh���D����0O�I= �@ؓ{�OB>�'���}r��x����~�O�A)�-L @8\�tpÀ�bP� @�'-ؓ���?!.bH��%p���1��:��?(u��2P��q9 ���3hA�e����.�E��)�J�A�'��E���" �?�����aP���81��(@8 �?���x�\?Y �:�Ip9` d ��`h�T����PƏQ(��/��` 8H��S�OBp��!�S OBp��!K�����PJ��81���%pb�� ���P�O�����,�C$� �,�~�@ upd �� HAg�0��%pb�� K��P @*: ����,�CY �:��8 KP��0 p(" �>a��p��%~���J x(-�����   œ�r@��81�AOBp��!K K��P#��h�ȅp�:�?�e]@���lBCi0>����� Qh�_ Ȝ�& BI(4� Ќ{BQh�08�9DQQ���(%w�OBp!t9 �8��0�@ u����I �.����@�������"< �����%� ���81����Q� �@�p! � 5�(�z��P���(2ǡl{�M��C�(��t��Q�@>�(C���RJ �M<:0:�@>i8�I�W2 p�)�d�\�,�J�I18���9R"�<&Ş�nONJ�p(a���RJ�p�d� #�r�x �#�0�RVJ p������%pb��%w�O�l�p9��ؓ��?R ��*e���?XJKq)Y �:HPr���$��V�C��S�)��A��RZ� �,����,�C$(��Ex�u`+��Iy �#�0�RVJ p������Rp��'�$���|�FN�O@#��.�����D�(:��$|��� N�)\"K��.!�GLy(%��{"�@>�@���s�M��8�-�#�Q� 4:3���B8:ڣ���AB�DM�3#K,��"4�-|�jpSH�bd��|A‘��X:e��LW�%:�� �D� ��SNJ� (��Ex�u`+���!K�)���Bt��JY)-����R\J����� O�=_` ��@S��8�p�u�ĀO�)�a���0�R���pY���B3���F�D���O���P��cO�I>9)=e���`O| >ل-���3P |�?�)m������JG���E�,AR�N�9�# ���`�>i�{A 셎� 1*�$����P�J ��8�o�P���(�@�ЁMH��O�'�:ؓ,�\6�'��Gx ��=�@ x�B�d���|Q)*FED�Z@Q��� ���|� @ ����"҃HG�&� �� ��A2���t�JzX r�N����0@IE{ܔ�`|�Nٰ�(�Őt��\* �7�����xQ =�b|�JS��~l���Q`���N8\!&\d�TZA�`H����ԐQ@j�� D��" b���!�� �'��|BL؄�ao� -�@@@8Q �����p�$��0U8�D�AP�(�B��ע�d R1� �Q�E� �@q_S�6���q�m`oh�R���*(P���7@V ���@��&��� ��p�PB7�! (��B` !�B>! 8�[��@�@!���@�!�d��#BXZ�G B� ��`�B0`!�� >P �\�� �W !�@CBz0�@����A0u@!p�`@8 B�B[z@����}V�J�`����!5��G`"g� ��X�B� ��>�C�} 5,�Z��=�4����R�ĊX��J��G�����ʈR��=p&BH� �~0VD?+�`� A2(A��d���.I8#bD � 5h��(+ 0��Z�*`���" >U �ԀPj�0+>�TRj�� 5@��R*�BY��G+H��P}R�&��P�B � S�_T�0R@�:�" t�S���#��_�*Pj��95� ��r���*R���+�~�"�E`Y�P�E��5 t�"Pj�fE+��#�@W); $#�Jp0�t�"P8` 0+Z!��PDY!�� �� uC��:S�L�? B���G+H��P}�?x'�D �P���W��r"�( ����PDʂJ0>:p����0j��Ф,� K1���"�8h�p�ZI+����*� ֊ ) f� ��+p�@0�)���qҊ߸S�h�+P.b�Z�h� �*`���Z`Ҁ+� ���Z` �-0x�U� �)���&$> b,�+P.��Z�$�r�D�`�g��l���ieT������:�� ��*`I�AQ�:�� T�p���3e �*�~�B �$3��m�E�U�,��0 B!U@���PR@&T$��>��*P�I��n% �s���;�u`���Q��>8 �D�}�E�+�!��+�+X�Z�$؂� j@:�p%�TPr֊X��� ��Q��� @ ��!N�\���R@ �Np@ �5 ��b��] D �s%d8��S`���$0� ]��s��H�0t��X� @i@(�\ � �` `,t�����`|�BP A��@�(`��`� B���Q�K�H^�+f�El�bWƀ]1p ��\� „q0.�ܕ�&�� xE ��`@�A�+c��ԁ1� ��.(�!!���W�_�*c������W�B� ��P�10 �/D`���� ���' d ����W�ū����`A&7�J|�s�@�܀%�# Q�/�y�`��Z�9(�� ��2� �7�6a���1&򂋈 �� ��1� 7!�)0��0]�-|�1�G��t�-����2 68,c�h�1� ҀK��������t�-P:������E:��X�C LeH��ñ@��pl�h�i`���T�ҡV��S�@H�����"��B���?ԁ�P�th�ң18�1�J�@�EAC`!����  � �7p�`6��AX�` �sPp�C �G;(�^�vp<�f �P!XI 0  @  T����"� �~P�A ��‚ �u �I��@P1��>@�@���X�?��8:�X�?�D�04��� ��AL' m�  @��V0V ���D��@,�� ��`XDI0:� �.@���\@�9�u��#�T�� �Z�� 8�V�+��cI@��@ ���@/0�� ��L��*��� � ����K� �T� lA.PZAd�T�� �G��#hT�p�\A+� `TA��5���c�j0 �`���`G�I� �20>UPx� zROЈ���@5H��2B��UPx�����d��zAp� <Ѓ�`��bh���e�,��1p��Cp �2<��P dx �Ap "�, ��A�\��.��GB"L�u�Y��D@z&��#� �AmAU�b�/����p D�P@�+�%@�,]G��+�H�Y��0@����@�����A L�2<�@ $�c���1��pE"�:@�$�*�'�+!U0 H�j�$@a� �"� ��c��2<�:��c�_G dBn�Āc�fA(l��&��f�#��@ ag��Uh�#� �H���A8A � >2h�7TA��YЃ6@G� fJm)!�1h�ށy�� �4�f�c��2<�@ ��u�0@�� V�cp 3E��@ ��5I�� Z� v�?@U|�Hh�)7��T.BK�( �`t�b|\�(��L�� �C*�|�$0ZP@*p."셰�"�A�}��������e���}v��hIa���v����$�ϢA�hI��,�`��b��$��aZ�@0в�hYL %@d@QN�g�c #�@jy�b'���Z@ 0�@�h�@�@+P-�p���������Cv4�0�� �@�P!e��M(�lT���*`vd����#`V�&T� t�c@+C �0�!`� ��|`� ԁ:P�%80� >!� 䃵��A>(@�� qD>�e� �p9 ���`�ZX��� t�}�K�A���ؐ�cC�D��g ��+�H@� Ka؏2��B�>W�,\��@2�Y ��� ����B*P �E)�An�Z�@k D���=$���� �\! H�  cЌ�@3�@Y�� t���>�B*�K�~,���BɁAb���������$P?�@,Xm� t��:H< ��v�x�#� 9�(<�G�Ar�Qx��p�ȁ��6�`J�� ��1@@}��X�A@�_�J�_1E�k���X���WHB0` AHj�#ԇ�$@x������A��@ԇ4 8�|( <� @�@G�`ᡌ�/(8�X����� �|�ߡ>0�S8��B"����� ~�l��@��_!�l ��N0�+G ꌁ1� \Dԉ:Q'�DVR�X���`�V��_�� u+p��; _��X�-�,̖�fK} e |AV�K��w�l�X<��f��`a����f���A� �lK} �e t��f��- ����0Ln� ��[@ < K��� tKnY a؏��&�B_X ��)���rL$����G���0v oi m��,�2|K[�-Ka��\��*�I!C,��\��R.;����(N�p�%w �[��n1!n���������<&� ��s�+`&� t�3\��ܑ;���@\���;tG��� ���`(� ��Xq�g��C|@?�@��@J��9.�\ ��\v�;i���Q?vAa�$g�[�\�H`.:���0\�N�y pg�m0�NX�$w�]ȕ��\��� �e��~2�&�+w'�̟�0揍�$"`�ȕ��lO�;�a)ܝw�m�G�"��  D�s�S@L�|��s) ��X� D��1S����2b7A�1D�������X�B��`��@�?Cj���a��s����� D �������;�.���@ 8!�.�`x�F�4�.�.�`4���!.�.Ԡ=p��2�; �#HU� p�t�|D% ��1]l��$H��Cn���@:HB(]�����(\ ]��t�?���(r�.�.���ܟ��/���Hh� �P�K�� ��6&��� � �/�G ��p$/�*ڠ� ����.�%lB��U� -���MLm� ҀK�.�;h�m � v�H W���+�GB%`�]� v�l�]��ۅ� � �K��ǻ����] JA�.ޥ����] JA�.������ ����.�%$H�!UV�wY\��CB0P��4e�*B�L� _��h��K�`h�k��A5� 2�*��E p��w� A��\�Tp%� w�W��T� Q ~� �t���#`�1�A�^vABh�|S����~��xI;Fp�60^JY�ߧ` ���8}����?��� '-0#���  8/��٤� �M�I �&��t�wXF(��E�l��v�zi�."\���2���A����P�O��&�%�22��/ |�,1\�{Q2��A �s ���Q _�E(k�L$S�*��(��� ����D+����?��? U�(�0}� 0�`��0Dr��"�Qƀ�ɥ۔  �Dr�|#K8�p?�D(�/�c|���6A0��G���"����E �`Px�*�/��4���؄��$ ����_@���/�e�p�O�_�@<�Ŀ����x�(�/��ǘ=h1����/F�,��S� C0��!#�Z p�GFTĆ��_��^0fD� =8p� 0f/�$�'J,PB0:>b`�A����Ё�S�#�?�� ��� ��1&�ܛ�@�@�1P�� @L!Y|p�܈ nL1���\��� ��l<�4��x�Q��~0����8�����_L���F�����A��@f�t��N����@1�_`�q��&����I� 0E��,J���?D{|A �����䊆�+�`��0�㓐�I8���� W|APpE� 0f�L���A�~�1 7�:��KD�?���K�(L��:7� d�����x� ���q< \��L��� ��h�L� T �� AD1��+P�@���X $  0D�1 `|�T s�A(j���L�@*pOa ��� ��HR�E8��0䀋p��:���M�d�b( 5`1�`e� p�1! ��cց3�nB� C X�=��A(\bB @�,��-�K���%�C�<�b|܄��,O0x���|� 2b@�La�@����s��#x (v ���#�T�I�$���@��p����@'�_N�� Y�^�#�&��q �@M���$� ���K� z��9" ��(�sD@�9�@(����0&�����pbځ$8���ZQ+��h ��Vh�j�6( ������gh�P+�| ��VḥB����@DmB���"w�V �� �G�! �Z� x�H1�A��Z� `�S�!�H� mօ6`�B���,�6�*�G� m�LR 7 �����#p >�l�!����@���ڠVP�Z� XA��!�Th�3�B7(� `� m�j�68: cd�PX 7 �4�v HE�A.f�r�#@��oa6pmP+�6� ����p+j� �"2܊� f�2b6̒� ��������bVj� �`��0í����� p$���7�hK2L�6x15 ���P�‹�op @X,��?:�6P�� ���$*�6PK�*��<��H�18@c� ^�P ��"�p< ��t��!H�� 6O ���Y��71�A��i�%��+�ڂ6!�a�$�Pn��W���+P�� :���A��`G�nX�!��� � ,`�� , �0d@0B@/�" � 2E@�H]2X �%���\ �6� �H��K �% �%�0Z�`�nb�B@(2! �`��`@����A@�8�"� �%�#��W�G�-h�� B�1'! ��#cf���aG�-!u��0R':��0c�Î0��_� �DH ���'B�D�!@�Pc&�]!� ##r&B 2��ƌ�� �%���H_BJ�!��7��SÍA �ƀ�1�"�Q�C���q�@2t��Ё'C@p2C�4��l0+��a+������$;b�0�%��b6H�=6`��<�! 0��2@  �� ��� �@6 #1fCcuH����S$�$87��$@�*ce6`V/g6��H1�Cca7 Y�H��a 4��p+>` Wf6�_�e����g��e���!=��(�lzQ��:���?���� p+0��y!+l�U� �M��a�Ĉl� �'� A� ��6@�pdl.S��x��#�-8��H�.�|@D����c�t�1݀�dp��Em��@@T� RBm01�@��"�.` �A���`$R�0)�Hȁ��R|A)��t�R�� ��0��� �/(��1� � J�~������2e!��$�R�2�g7|�`1�_P `F(��4E�EaF����zP��������R��l2p � i�H�ڐ2p>���d���="@�� l2@��!`�2�8�!��c��� %�2pm�@B�6d !\2��M�HPp�A�)l�@�p h�U� �����*,�c�`O��=�'NO�� x��\���2{h� ������[���A+N�6!!`��N[���H`�@ d� |�K�&G0���X�$� �5c.�����p�&�$�� Xi�.� 0ya�ȟ�s1�� 0� l�8����`�x�\���C�1�t��~A l����5�a+�@n��{aͬ���n � �̀`p ��b�&�`R� ���� �{A��.��(`����( ����~� b�`�lpa>���X�l`$>@�9 ��B=�eڠ��8YK܀ 0��$ �@GL�l� U�l0�@6��,Ct7Y-z!ː����2��d�A �A�9&]� �l��D60�ƨ���� F�Q��&��l`Tތ���d]@lr��9������S���.0*� ;`�m}�S�3ف��7s ���������S�v���,A�,�,� ����q��k�k�$�+���,i��ș� ���3r���Qr ��'�)�@���q � ��3E�@:Cg�Lh-U�B�*�+�@�:Sg���8t��ԙ"P0�̝95�ؙ;� �� 8��Й:Sā�3t���PS�M %�G|�g�Ld C<�� Bt��a����gF�a={F�(�g�*Tʀ0���HÈ~�όS���)~�B��*��1%&���@�*:��<����H�33�6�A�4��9���a\O�y� �������@�"@�� �@�`H�����R 9(� ���f��� ��@��F �+P���@�\��Y�����2�@.>�'�6��t@��� � 1�( �F��phH��bp ������`��m ��>�� %��)a W�m+dI��&0�kq J����p$N`$͡e��C�hL�I4��,(�C�hb�80���р��h��n8#�� ��Pʁ�)����Fa� �0�`���hdO$8a��t�Msp4�V�%,�����pA P�����$VGS" ��8�"� *�C �0���Q{0LXx4�'����h�@p4\0p�h�(��T P���#�X��,� @�D�� ��}�� @��Jx�OX�G � �|� @� $�D� O�ϥ� ��J$�4�g�d"2i�A �?�'�I� V��"�����X����$f�%P���&V���7���H��e``�AF�d��J�.B��!@�F����%*MP�4�f�`�D@���.�Q!ӬPqU����4B���I@��Cdd�KvÊy8�`��|cvXB40;,! ` WP~�D� V��܄:RG���#�ԑ�� ��>l�0H A�Dz� 5�����L R&6M�� u��� �].��Rp�� $ ��4���d b%��� ��&�����M(V�؄"p���9؄">4a�)�� "�s�'j/��G6H-���܄: ��w����a�>M��4CD]��.�jPa��� � >MP,�o<� �A�����DԞ h{4��]���Q�B ����k��A"� -B5� @�4 � >@�h�`zBW 5E�h h D��0��&�$�A>@X�` T �$��E�n�7�@��8��Z@�X���Y[�(}`q�`������Q��>����Pj�A�Y[�(����6�$@�S�LMŰK` %��� @��@��"pj�� T|pD�cŶ�BdH`��6�h�X��@,��6�w  b�m��C�S�M> �  % RAt&)! ` �P,�X L�(�Y�f�� %l���t�IJ���x��� �zc%�\�Z ��?1 >R(@\�R �=I���CS6@�Y5�A��ph���Ֆ�� R�I50��3!X��E@��j�����&���j@p5�&դ�T#r�0*�è�ܓh�AH��\@YP��恴�"��O(^p̟bE�O@ 5�/X�`���'!p,�tGi!E� �Q�QHG�;E� �"�sO��}��Q�wB@�Q  �\�?sIZD����K\�a_ZD��3}��� fs)C1�"\�s@E��5ɢ<�TxI*D*�$P� X�ʬрLE]�@$.��$�FԚ�Z���X9����.�^�;�3���.���l[��� ��0�k!�í�5� ��K�{F�%q1"t p!�*8��z\�]�AH�6���E�`��%� �����O�۽�����V.�,p�$ �~J0@�K�Mp�TИh�D�2�B��` ���p���$ ��@^�J���!&�)8ANq9�;��_�?(� T��_`�BN����;��_ @f ��~@�ƀ�1?��;8��J 1�� � � G�1ja*�����T�2t����� <�C�-�3$@�ƙ#x�-�3�0���(g� �3G0��Bޑ��1���:1@@� T� lV*�xa0�T� �]D/�\`�� \D/�\�8@���.��B4n!0���P�B*�����.� C9� ��p����zrEg�w�[hdBԁ�X `)h�A��R �eC @�&Y x� P J!p��R�-`)T�2�����~(�`?NK� � �rKzX �e��AzX �!=,�b�[ ���G�[�1L�d0L�[@R� ��Ѕ#s'D�H�bdAv�R�-����0�[@zX �0`��A"p�0�e��� �aR�@ �,1(��A U ތ*���# @>�/�Ȅ� �*�B� � �P��U @�*֠/��� B�*G³r� g�8��>�f���������$�� <�g u@4��'>�g� ��*ˡ��* �$x���Jh��!@>��>�g� U��"UG �$x���Jh��a �8�D�g� ��3��� ��'�_`���.��!���`� ��r�@.i��A0��@���� ��$H��@�U ��$H���J�g�J��J�� l g�o��Q0*��I0 %�3��PX� �B ����� ���0Ŵ8�#ol��ԡX��c����XC�W��|��e�;�! x�aZ b����6|[�gFi}^�1���&4>�� $��aC�"p�M�����$�`P\(� 3G̜�3s��93�b)���E��$� � pgp�̜#0sf��93'��3s��H��8d�0T��&T�$0�Ve� �̩�!̜�@83g��|���̙9 �#0sf>���T�$ �9 "(��� ���uw�0��v�S� ,�)�]"�vb� H��Z%��9�`"r���v�N�!b8 �]�E�� ��qbY7����5$��w0�E��C���@ ��v��"T�W8We\�� � ��@8:�]���.W�,Ԛ� �� �.�"V��]�A( �p 9�����lb�P����VH��}���P�2�< �%dD��4�5؈�^ !08b8I?@) ��A����Q�lD��V�F̈�axD17H�G<��%d�X6�3� Qg�� A�H '�18��8�G����ؤ�����O�������Ȅ��F�sK|0MA�.�~�D��g�r���!00Q�$�����c D�0*�F�)�`�� p@�H}a)��0��K "��'8�������U+��q�G��S�QD����O2�R��A؏��3b�P6�!dĻ@0 �@�KA=hķ��CF�%�� �Y"�F̈� hĔh?�+�%B�p� ��I%������l�Y�,q��]1n��r ���K� T��%B`*l��Z��( �`1hD��5"�p�Cf*���p ( ���~����)��- �U�8L�1`" � 11��mB4��6Q��hD���`zX.2q�9�M��#�3Q=dD�8@@t0\aD#���\`������S0��.������\� p����t�� 8Vn�Z��k�\�p.`��0\$��� @� ���>VA��&�I�HI��p�9�?��\q.��|�+r����$   ��X x0�&Pkl���T���1Gh@ ����@h�:�Pp"�ٴ|���Mĉ!8@��@�����]�v!l��` ��mX>! @ J� ��b@�- %�0���#p@ �B��d@0@>�!A D�|��ᒀ�T0Э# � ]A��\!'�DGv� �@�֩` vO| �܌��S�1qT���T0��v�7;�'��W˃�� @>�(_ ��| ����$���| @�� \!�|��A>��`yP|��@>��`y\A��dk`@�Vٺ�T ����p @� �� ��E� \�N���A0��E��C���& t�`� �@0��(P�@|� h`�&���� L�t� ;�V�gkPI@5G 04A(�0h@����/|0��C�H90�"2�(�V��S�P�9�H��H$Q�Ȁ6��A��P� i�(҆4@G�!�� �F; �A���'�C�"�#�<��e�#:P%��"�#Ԏz�.�Q| K���8� .�:A�F�@CC.p D��PH :H�#�@t�{� �`��;� �ԁ�@U��-$$vP �����,�����R � E��|��B��)� @5tI<� K�����|-�� ���P�8@)��?��hF@�0fI ��d �0�f"8!�"S��MQ٬ ��8��q��8�#cCH8>s�)� t�`p �@0@ť���XP�.��(�aЁ^�� ��0:A�- ��p�!��� t�FI�G!t�#�Q��(t�LA�@ � L�@����*� S@c�T� �Z��ZMA0�` t�󨊦 ��|�<��$�VQ �` �bU4��y �j�5� �@������܊[�bV�Q���hTAV̭�Gj�P�"WX ��|�`�X1+rU @�b(�`��`0�@;0m��LQ$�2EBl�P"�!Pd��E� @`H� F0,����R'�Y, +p��bW���8�6Z�7h�� \�p K`\�VL��X.a �w� ��i����� ��ԙ)L�t@&��� .a �# ��G�n���*�@%|�u�vHF���&�J��P xA%��m� ^� �,ǪF��݄���\,H5 ,� s� ^p�F�EQ|�Gb�m� �7��-hmp$���8=L`X� �̂6D�m,�6���?�@8��#��� � m��� N@ ���$�`�c���1@ pJ ]�,�"���W����X`� 4ЅE@ X@hP88�" � ���Q`��H[_�Y f1B�ֳh� ���� ��H[� !�hQ ���;��w��wD��'Ơ ��D�HF�$@��cP�H���t��"@�E�:A(�/t�P���N@�� )��2:�(c d8��̢��*���$�“��!$�@��w� O�;d�'�0���!���%;��!� ���~���S�B��a"���  ���&Z��� `���O@� �B���B!���B;P��L�� "��  \�Z:` L��BWDES`��� ��-� @ @L�!���`B�-#� @<� O�0P8 ��"���r���� �����(n��� =@�9! �|e��bGP !3���EI (��� 0"�H8��J�((W�.p1�"A���X`P������A2��u�q����1i �$C���� .0����t�,���>X�y��}��"?X��y�~�nH:� �.��%`vA+����0��w ��@  a� ʆ}�`@�Dy �<��`Pt�w Buq"�ź�Gt��a ��  ��zD�� � `_�ED�� 8�.R7����A1Hh�"(��,���+@p!8�� �i��� )8�� @�8@��E���"^ċx/*��j�3 8@Ԋg�s Ȉ!�����6p@�_�@ �| JB> �!� ����4"�|��W�Ј|���*� @���0$@Q \�@!Qঘ����8Q@,�����^d{�M�A�P#�� x{�;�A��K!!��� @܅K�L� ��  � �cr� �z�� x$@,�%w .A+��� H��8l �hL���.�� ����G"~q J����A0`|Q{���n��� %0�Z� .� i�h@Ho�E �����R�cԏ%�� � F���g��O F`06C8�D3 K� ����B34�0� ���I��&D*_�0��� �y��|\�� �yXo� ���0��h ��<�p[ok�m �D��Z~A �q����a,.8`,�.�"@C�IF`�l���� ���Xp@F�.�jB@ZWT� � ��T� t*p�aT P.��� )�)�V����\1���(�� &1�BM��R�-`{�[��[)�P��q1���HczX �e$�{�[@R�- *���[�B*�K��h��[c�-��b�$����L���Ÿ �bT �eԏ%��@c����Ǹp�o7�ŷ�#P?���ŷVwK1p�o����V�a\�*�c �-�q�o�; $# p0 f1.F��n�c �&��o5��1.�[� n����Ǹpn�U��R ��[����-��b��P?������ |.a��Y��!=Ÿ�]�@1����[@R��e����L���e0F��[)�@I�H���Y���(F��[@�X8� 4F8�[�@�p�K��q�[|�1��1.�[|kp���V.�nq�o�F���P?�������V���@00#b�b$�Q)��P?�`��V#P?���u���:n�@�p�K��Z�-��-�� �[��[)�*�c �-�=���F�8��Ř��qh= ��V��?� �-�u)��쇏XK�1� ��[�a� �2���0@e ��v�Bd���q?`�����d _�/LFa�B� �~��Q"@� 8�_�@�ZP��]��z�^n� VOe�F���0�; +B�^|��0'�~�*�Q����e����@�PF��'7� ��:P��Xu��L��" ��w��9�����U���y�)h��`�j��@ ���A ��e��D �:� ��p�� ���{S88� 0#7H.! ��8�o�8x0���0c�I�d�n�U�6h�3r�̘\�� �'3F��K�Ќ�H� !�>`G��gLt��:@C��� W�x?�AX �3��VB�� ,A�B� ZB ���(؅��&�&��p:A��t��N�h��� �.(�@ �9�(8�P�i܄kC �18H ˘�7�\�+ B7x7�Lm��A(�`�U ���X�7�P$AH��@�� ��a$!�@'� u@ ��Np�ȼ �@ ��PB'� У4���� �B'���p�E�^8u@ �!��i�� d�:�D�.@�5bP�Q#������� � �`@l��PA�@;�a��L�@R ( Wd1l�0  �I�0��� [q�AFT�F��.�=H�X��5� �‡q���� ..� `7���X�Vb�m�� �3p��x�뀸�p�)�����xB�#(:�#�%�m�� �� H ��&Y"�^�"HA�`�'�N@ h�� �����]ɕ���Lk<ZA)��\�ʸ����F���9��D��6��� �?P0a����#�H���8 " |BL`b]Ą���E(!��@�z;B��1�@4���lh����.�|�����X�º F������h����#@ �!a@#�"� V@ �����*j#+�Q+�k��kn��Xܘyt#�H#��@WqDL ���[��S�`6��X D�Ga�a~��9؍�"�� @ X�2�¹�ڸ XA���^�����`��<��H ��.���j#xa��C��/@��'�#KtVph��i�Y"�Ɔ����ɂK\ �1���@@�@ h�� �"&t� ��� "&t V@ �����l��j�m� Z������#Q�,)[���fh����V@4ö 9�����4CG@ �"�J��o�cػGA�:�wu��� ��l0E��e���tA�(��!� ��>jJt�.�p/�6�QH_@�:C6 �Dt� :'�� �@ �A �"���K�9��h�*C B�6P>��(�@ �  ����f��!��g ��.� �� ) :8��Qjx!�:��|�ڂ6�2x��Jw��� qA���� �J�AX��8���H@��@�ho��>X�";����>� �:2pGL0:`(�Ɛ+��>���`\�erj����$��^G��H�Q�B9��A_��ʑe0��XA_��0���#/8 ܀⨂$\B0P-L �n0�w� ����&�O�$��@/pU8�@w� ������ ��qp�}� p�>` � ���KXF����o�@��`�0z�t��` �z�K��;��ĺ�4�N��;�%:`��D�;��5���C& ������(P���t�.iҥ��� L`��!��aH�Z�t�C����B�x  #^�[q]e�Xy .��G#����F�/�ǿ��Cx4��~�,q+�� ��@��C�kix �������M�� �(�(0ʣy<��E`�G����P��q4W��a���Y� � i��Ax�"8�p�%��m�=������q�.�J�G-��p����<Eلvŷ ��E �QFy� ��>脝�Xi�����` �#� ��(I��Q��DHP�$v%�@�"B��7b�� dF��6�H�Ā�t��@��|�A@>x�p` ��RL�!��N�|��+�}���0�I �(D��!h@�:���6 90ah���>��� +h���)�v9*ףaD�� ]�v� C,Ȇ�0�6�ȠaD�.Bp �fA���0^O���(��P���I�?4��B�vم�aD�p=���$ ��a���!�ʹH � `�*P@�H� xWYj@� ���|WYBH�GBp��a���p!�X�u��b���IȐX�a��4^d�!�W4��am�GpCC� j�iW�� �!+����uC���0�C�0+L!�^�$F���a�#!��wu�r`H�0���E�A*��n�@�(Z���� k˪@� `�ہ����v�Ƅ=���"�B};pc��"�bBL0'1��ޘ���$�/�L�G �Y ��p��Gщ qVܒ�4&�ڭ���^16�Y�0f�p|�xcBQ �7&���q��F��C�� �+`�W� �0x� r��0>1S������V,��!H��WSĄ��Bd��BDܘ0FdE��5D��Q�(�-!�%�/�0 �����~���Dp�C���=R#L�#�&�Ԡja"��"�Ԑ�@-D�? ��" ��1����;&Rj�$ �@P ��q"Q�P Cj�H9j�"8�0����x��!���4�� )RE�HYwo�t� �E��� �`��.��4!Cx���J���x��p�����I � E�w� q@*�K��h��"�Ix}F`WP�V��01cW��%��A�%�@�TP?�����#�Fi?��.���bx�� ��I K��b�@�?�G��x��PD� �" �r�����@(�l� ���< /�V #��q8 hF��Ē���D�G ��*#G���22 ��Ē�K�G ��X�6�@��4�KJ, �(�H����L.!bH��!��D�AL�Ē��FbI@�!5�1�F�Pi bH 1"�ԐCj�Ȉ!5j$X�R�$� 0�^hC ��� y<����D��PklbD����K|���$ �:@X�Ȃ+W��. 0��F ��k#m��(�7���# ��ő8Rl���\ё7��H� �A ��a��n%ϻh��� N@@���G�(�Z|�>�>r�H 1x�� �<0��Wo��$m��G��#��{$(�� �� .�M�aq�p�!�ý�@����H��")sD `?�� Ȝ��@[h ��`��/P0��!�@ a����Q�E&� ��@B� F ��� pH� �@�W�zn��������cM�F�_ �e�M�z�G��Sj8=��W��MB����H"ܽ�4��^@&Hrt�@���0�x0Ir@71@DP�2�0�5�+�D�C���/��9�) ��@�`0�ʒ��.I2@K���*Kr ��%Ih � �( ��WY�c"��%Ih \eI��%Ih �D ��� j�0Đ10ƀP\�$|�T0�2�0�_R\���N���1� �7� ���t 5�8ap �� A@���,�=0h�ri�. ,�!Vƀ`�e��4Ɏ�$���i�z�I����$�d%` Ќ1@���c ��0��Pc� `�p�@�@" `lGPv�ൢ��0 �M0�ڠ�m� ҀKڀ�� �Ap ��%��� v�A�`ۤ�� \�&�� c@3�1 P|%J"� ��+�7oWJ&� ��P ��%h�R'x�6,A%\�l�#����;�Hd ��1��� �@����68ڀ�� �Ap "@�� ��I.a� � �$�$`J"� `@�(B� ��B�.�8PRp�4�D�6H.Ah�4�D�?/bT�+B�@�m�� d�b6�l �!\PIF X�Mh��T(�H��Cl�$ \;�4;",�`P ��R���@ImP �6(ڠh�R��`Gp� "Î�� �E��6��� ��� �7��@l�Z� @Ȏ�@lnP+��6��B� ^���8g��rZ��$��/Vr��Z� ���ڠ� mp%�W �� m0.�!��` ��%i����f�Z� h� L�-p�Z� ��ܒY�p�i�����pnp$8@��Ȁ+pm@+@���0� �; q E��%�"`PȀ�`0JB��B �,2TK�b�d�S}x�6�� h�|��A�  ��pc���Kd� ��Cx#&$�� @K��} ��6H�@��} �?�8Ȁ��#&)2�8��H�?0�A�6*A|�#&��6�i@L�1)&Ť��8�@L��#1&Ť� ���H8�iQH`�J�bR�|Id��D �"�L�I2I&wHF���&BȤq���P�/� �� d�L3 B�!�L�3I&�$�A d� 0I&ɤ�8� Y�����p%8� ��#��$�Yb�T T��L .4��B�$�؏+�&�d2T�iRM�ɲ��A�$�؏+�&�d2T�iRM�ɤ�&��2���5)����L�� � `?�+�D�h2*�4�&��h��5P ]� ڤo�� p80��P ��M�V.�&}�Rh���7i\�*�c �-� L�`���h�7iz�@IH�G �Iӣ�( g'���`z���4=Z N�MX�]H�G �Iӣ�$]Є%����`z���4=Z`Nj�a�p��,1� �I� (�.hmҷr�I ��c (���&}+h��U)�I� ꇛ\�~,ӣ���\�(:y�${�+p��&��K@)��6�[�@���JP�E��IiP8�U��Ґ |�zX � �#x�# ,��xK�>b=,��ʃ>b=,��ʃ�<�#T������q��a)�I9ƒ@@ ��*�� 8�? �$��v�$��0PW!�I���< 2�1q�� �I*�'��{���5�Z���L�/X�c"D���@���l�S��������@�t@� ���BGc�>�G00`�� � -��b����0(A�2!@���� ��pe@!��D�BD�pse�̕��� ` �&�(6A�e��2� 6 �Q��� p� ���Pj�. p�� ���P~�#p���!�R{t�#p�@q�'Q� ȀBx6��"��g�=.³!"�� @�e@!<��@PG�|B� ���G�hB� �8G{JB(�Gp!G�|�� ��L�J�$��� ] �B�:BLX-�'ė/�´��A�W.��p]`ZH��j(��� �@�JI"_ł| ��P�Wb#_%I 6��4�4@l$�| �U���*�a �U���4 $�X���$ H� _%I� b*��f���X� b! ��4 @ɨ8@��8�`�Q��0�`�1t@H9 �`��&A���+ ̎x�9eZHD�M\�8`L � ����)� ���p��|�����X $@GX �*`���S@�Rp-=�~,���B�}a)���Z�D�$�ג%Ľ�eW����\K74�e�.ײpS�k�K��&! �@_X �ҵ�&��Rp-A)�+�;#}��cL�Q_��RP ľ�W�]�kQ4Xѵ(�4�(�@}��F�l�c_��R��"(GY��}] K����c" �p�5A�ץ��k�8&�`�X�G )@}��W"*�qbB�@��!���/X_�D2T�@����+� ����W"*C�AD Aa���������Pѡ� rH@}��R2@�kK����v��B}�A �G�Iy%��R� �c=���P_y�}�A�%�� �k���a) ��B�q�@���^�6�a"Ȁ`�m�6�i�%��IY�@~M�2d��I�_)%^� aR�WJ$�� ݆�/ �A0�ڀ����^��6 �42�-��6�`m�� �mX1�/�n�|��@x��dY�7X�x!��d�m�7X�x@�d �7X������ �d� �`��n ���6���T�C���>���4�4���>�xa�`���>� �`d�$��-2�u�F��m��b�6�����I�� 2`�/pȚ �H�V�(��/@ֈ�O �B���U!D\K��-2��6�F�l�m#n>�� !���l�"��T�@dq#.�7�@V�q�k�U�R����8X1��(d�m��J8 B�n�"�>��(�~p�A��@��g� ���b/�m���2��!�H�4��~��A ����_-�� �$� �@�� ԁ|R^ �T u �`�4p��~���(�������� ��,%H�5�ԁ�O��� i ���:�~��A KYB@>ѯ�2���) � :���@�2�M��B�!����M�GG�(l�@I�+8 e�p������ �J8 �(:@36U�GaS�M�_��QP6`jlV� t��8Z%Fd ���@���|0�@A �:P#8e�k�:P8e>X �� ��� VOK�%w 0��"@� ��p�pn�7� �$tJ�1� p@�p�%�@���<Sp@d�)�D� � F1*H�u� i 2���0�[ �Z� &E[��,�'���AX)��B3h�*� �>�%l��0B���s���u����DpT<�I��]y.�{8�����Jk�+ ����J]�z�į4�҄���@ ����v�v��.a ��K� 0�q K�=��%��@;` ��%�v����=��|S� ��%��@0h�,��#�����݀����� 8��t8\FH�Ck@:@R8���@,0�%l�Rpt@ p��8`� I�~�#� �G:I `0tI.I�Y��L ���{Ę����cp�5��!\Dm�H W��@���� �� "@0aI j� �!e K����` �RX"�� ����P�XY K@�0xA��AP*pe�,)@L�+0@��,��`"�cI�� �:� �bI,1n��A�p �``�8��r*��BX8��RLY`,)���H�+ ��� ���p,��Y�ɲ �Y�,B�4 � �Yb�B(�f!bt�~" @ �]��,D�d�OdA�\��,D�d�Ċ,PA���P ��v�E��"���."޸�,����7)�E�� \��H).�EH�"�%A.b��,GxuL ��xcL�`�.�H�#��� ����{}�a�f�� �>�AP�1��$ ؁$8m�&�b�Eb`�3� ��/@A�� �P*X� �A��#��t�fY( �=<�rÂ]X 8K��`0X@08�G��`��a�>�(�!(‚ i`�bl��e��r,P�@�!��@���p���rh�W`�V�ڇP-F��#� ��h� 6��+Po����� Bs�( �R�p�3D�1�E*PHv�R&F������HX �#���[|�zX � ���#��R^#� ���<�\��k��@0�0#�-���r ��3��@V��`�0n��\8 +T��-%�ɖ��,1g��3L@:����\�> K̕]�r|@t�@�)�����1�.�h�9�z�e��+s��0W\и��. � a�P�1��������� ��4 �0���3�[��g��p��q �&� �@�t}���gNX �g[������J�����4��-]@Ę+�P!4�ʃ �Cc�8����,σp8�U�m��P�AU�m2P�2\ 0a����@� ��A �_�V 0.I0P�"3��2}��=;��\�  T�uy�a/H���E��!����y�@��� �����6��@td�Fh�# 6b����&X 6b ���� bԁ2`#�M, �@t$3�F�����96B#�����96b������9, ��pf��Xa �����e�`$A0�" �$���+��&�p,B@ ` �hcI�e�� �_ *� с$��m�@�� l�n�~��V! `�6�B�6.P!����D�h���/�"R@ظZA���(�� �2� (�`��2`a�5@&Ƞ ��:P�Iҁ �:B�зU QԀ:BV%� �� ��� Gp �� U�J(u �4�JH@���!D�( P�艀�Dž�*@���rl�"@�����v(���m08����ep@4�� ��q @s�`�62�� $���߁ |��n��1$�\� � N ������t�&�A7�6��%@@�( ��)���1�@H���Rb�t�"��h,�.K��� ����jH[؍@]*�v�.�%���7]��$���a" @@�"�!`A� �d2zA �m �@�@bB�,�J`Xq)0�e�q���8^�9/9������t\ ���`��� � �� )@��/ � �4Cp�[/9�Q]��:0N��mo��Tx`S��+�6�K�ɂ/�]�^V�[e4��3:,� k/9���7_�}�/9���K�_��%�/9��u� �h�/h/9�0p�!���:�vǽ���.�/x/��4��^�K��0%��P,u�/Ä9f� �� ����-!`�2@K���9j� �20f� �� ����@-!:@(̇`@c4b aL" �� �d�2@K�&�9j� �2�If� �� `����@-!���5@� ���cabG�$�O��$E���B_@��+C��Wy���AK�_��⯖�!�Wh  ��8n07 �H�� �`N�y� \�P�! ` p��`��c�p��s�H0�(�����7��` �A0T�D @�A�-!7{�(\�-"�c�Ӣ� ��+^�c��� E�n�M�t"@0��Cc�Ah �D�c�,"����,�1��@`! ���/�������1�_-AC��"�1p�D@a���0�� %&�`��1pPX��( ~�1D�@��� Q�0� ��i�Z�| �B��@ԁmS-�Ep "�%��| \�K� .�+��'�őp "�x$�EP=u�Hh��XBP=��H�(Y��l� !�]"�� c�X�;f�"��A�� E0+@�R�#c�԰��� �}���p@T���<�cinL��2�7F� `�1�@P!�c�@�1�B�4r�P�E�1S��lK!c�O�A|؂&H F�~d����GƔ�߈AZ�X �a)`���܇ �5"c��g�,�=F c����R�F c��@>���c���>� �`p ��38�VdH�� �N �@� �&�#H�` 08�����cp�/p� +�6i������9��dցsP��� ap��}���`p��w�DLh��0 |�� 5�@�9R#d��Q�A�6� �4�����c � ������`hh ��6�i�%l�-�\��AW`d�G-A0( � �Ld�h��6��G� �A �u�� ����)� !$�f� Jl��$����L@2]@��$%�Ă��,��cf��J� Bŀ�`��$�ɴf��  p��cp H��{Y��q :�dK�Y,����A0x �i2��Yx�� �`2��Yx�� �`2��Yx�� 8� @�)�`��� 8@���nNf��#r���A#ʌ)���I8LA8��*rd�n0@(�LS��� �S �AU4'3��!0�)� ��LɃ$�!�AX�L��"r�����"��Π2y��Y<*S�H��s��t=@e�/�2y �G@&肕�4w$�T A(��b#��4��Oc�|�]��D�`BAe ��u�0-S\ݠ0��l���F��C�l��/�F�̖Y Îd�ja"�L��ld���´Lp t�n�.�e �2����Gl�L�2w$�l�� ���bO� �� `P]c���e�K�t&p�-SX�Ȗy����Gl�L�2e&���;�e�̚�b�Bh���b�L y��)P�7SX�haZ���A7`��2���l��P �H�#6^��7���H`#�� �)<�����3O��7�F�L�93�Ďd�-��<`3%O�=(Ve�-L���@7�L�2[����-��`#%��x�6�L��Ox��T6�(���Sx ��)��S�2��ʹ�*Sf���#Yf�T1@!�̖Y ��|-3g^�a�&@@g �1���A"� ��3����3�+�A���@�t�T� l���6!\܂).r���R��?_�(,#�A�� $��%����T� lA#�A��١\�#�Y�A��,�\�#�Y`$�k`� �%����@�h`���%��@>\.a ��%��ȇ: �݀���S� ����`hp K�<�m�>�G� ��N��IL���|�&��$G0��U�� �� �"pJA���� �����1�c�O��@�)L����\�z���&#0�`?�s�e����E��39�95@��y���ل��Ԁ�Y�xT� �h�"P�@Lp�)�hŘPbB*ъZ1�ԀP�b� �D+:�SR�V� �D+�$pN������]RA H��h�*�D� X�`�E �*���� �d p�iH�pʘ#�����>�8���!^��)�K8.���pF�؂4��>� �#H��%�Y4 ) h2�{4���$i�,���Q��Y��bX�.p�Whb��pK �` �C�x ��#,�p0Jp�(�!��`q�S �`iC�w�\�pq�Y4�f�F�E�hiD��t� d`����U�A( �a���L��� F��}��&@I�h�� CX��2��d�Csh͡I4�&��D�1@ �-��v(��ah��I4�D@pF 0@0�I ��`�D@0�� LA �>( �@  b2�G38�G ��p.�E�����p%8����`� ��J8.�E�B(]T�mP �F0��)l+�Wd�q@�D�IsUd��!�A���G%p��A0@�A�A��n���Q���4�w�27$#3把� 2c��胄+u�D ��⃄r��?��̉��"Df�J3��6�[c�H KM^�����h��5P ]� ڤo�� p80��P ��M�V.�&}�Rh� ��7� @�X�G l�+��@zP hR�I��R��i����8���&}��i��� �7i�•0I!&�����( W�5��6�[�Aq��j^�  h���N:��ʃxK�h�6jJM�P�6��%�m ~��5pP6PC@/b����Y��,�% �; VC��$�A���0IxA���A���-�FK@ ���6>V��e �`G �r�#����K<� � 7H@ h-� ���Q�jj�?� � ��2e��S�eXA�� U�H /�� "M�8�8 �� 쀦J�� �Ô� ! �� ���` ��� ���!hMpƀ&�)"@�� DS(�pmԘE�� ` ܫ %��@�Wk� qN50:�K�t�0-�j<�*����]�t�� Y�eJݠ5[�\[�eV�s��p V&�p�!�$��x D�q���u�%� :Z��).94��"� |���kR�����4`�j�M�KrI�����"h ���1���/����KD��E ���#PF@84DL^T�D��e �pP�܀�� �BX �0G0��p�@ d ���BP�B!H�3�(�B�� ����p@H8 �G^pG@ � H� �G^�ui Rg�a���P6I�"8 f�(�Xy!H��l��C8�����m‚� /R��8*䊨�kJ�de�B$�� �@�Y0����T� ށ���%���P{bl�@�d�0r����%$m[:�.� ڂ�%�� �}�K�>䈌�7 ���p�����#�Mt�F�f�@7b` �#� ۔!�@�J��Vt@��Ƨm‚�m�2�6iTj�#��fĐ��H m� "�ԨGB�� *��6x� �t��c�����܀l�*��6� hd� �A@mAhP� �D�Cjmp$��68�@D �Q�����T��?�P�6���`G,���#ڂ6@�B��p$�@�CjT�jq$�ő��TV�$1�F�G�Z m� �f��@l��Y)@�H( A|i�UvD�X��J(�� �M�iTjm� ���H� bH mp$����6�@h��!5���`� �h�#�\BĐ�lm�"��`� Ah�:� @�6�o�$�� >���*;n V� X�6��TN��&�[�r�/Lt# ءJHȠ-h�m����� � �P)� 2�mA�1� @e8i T��!5�E�8��HT�m*�E�R�T�#Q-�[��Tm�V*����%�m�tA�8��%D �� @e� ��Rhm� �D� �� ��RE��! ��/��G���m��J`+led�J�V@��9�b��e0�Ah,zA%l�P)�c-�ڀ�Z���tu��1^� f8*EÈ2��R F��Md@�� ��� �A,pI�n��$� ��8�"  Vp+�A�� p�]@D*����6��Jq+��6��0� P� h�L�ˢ�J���l`ڠ�]*�Aݬ36 ��#��D?Y�rg�P�n�&GP=lS4���@c��b/p�J!����n�V� f�"��`{9� ��6H� RAJ�#�@'d�P)fC͆�ܶ� R���o�؀ʶ� �f#�2�`hP*+�mA$�#��@��R�ZT�#Q-�D��6��Z$��!5�@�8�B�JPi:���lT����l���zQ) �u@!���NE[�b�f,��p$<�6�6�� �?� �2("ڀƲ�$�B��Tr�#��AĐ�@ mp$�����@D �Q�����`��?� �M�4�$h�it2�6� `P�-J�©�ڠ-h��0G��l0'ڀ+h�@ x2HȠ-h�m���6�_E��$*� a`�Tj���}����TJ�~N�8����t�eh��h�$�{@(�ʼ�,�����M�ͷ���SP !/����&��6�\��7� ��>��)� �"�Sh����*��.�`[Ԗ)�@P�4;�r� P *�&7� ܀/�Je!p�B_H(T��kyA��� RG�ȁ� $P��)�!�P����  �X� �87�b�Je!pAߴ#���"P0l[1lEY"P0؊-`+���Ph�d+rq�_�����^�[�_�����G�!��;���3p N#�+��@�bZ��+�J�����-X��x����^�/�p� �!@@h��aQ, �! �Qy���ذ ���B���� gl� ��`��PT �X ��C,��s�����p��R8]���_��h;]���.�%C!P R��t���qzb�K��$b���I D'1��hb�$���%�tz�K�K� ��sI.ɕ�r9��+�sjb�y���������9E'�� �3trN�:Cg�ͼu@!ԁ��lT@l� ذ�N��7-���8�!�͕��F���}�A�̱ �zy�8� ���3�2��!r��.�7�&��0���%�u�@�ř8s,���t.Nb�c�(�X���8��=R� ��)|��2���,�� ,@!�@Ǣ\ �8w����8�&���sq. P-@�ܱ@pX �8{�б��H���8-�(���X�ƹc-��@�H�bb1@�*�(:�8iF�t���X��y-�@��s�� �a,@�.�R�2���8i1@��@uՉ:U'�$�Su�Nԩ:Q'�T����NՉ:Qg��`uJb�:�OwX��zI�:�1@��u��:[g��S�N��:%��\�s�NI�:Q����zJ]�:]�$��@� �) $�$�4�uJI $�p��@HI@3\�$��@� �) $�$�4�uJI $�p��@HI@3\�$��@� �) $�$�4�uJI $�p��@HI@3���t�Āb@ �����u�N� ;��y��tz���:=D���vz���!�/����C�_�:_'�|��3� N�:_'�|��3� ��".c'���u�C ������u�NԙK�t��q^N��b�� ���*��0'1���\���b3���t݁b(���������C�Nb�K<�����tz�\R~���%�S���(� ��`�t��8=1�%Ās1�A�$��x��K � 1X��`�Q:=���%�%t�Nѹ$���]��sIrΕ�9� 1ȼ��C�_� ��䜢�sr��:9'� ��3�f�:���B�.���2NA r 1 Ā1���(����:@ � 1H�� ����K�/1М�d��͙K���Ԝ�ssN�985��Ԝ������97'�� �H���c�I7� ��CYno�Al`�~34ȁ��\��( w�7t�� �-7� D$� � ��]�r���?�썀�܀X��?$�$` b�tN�iV�"t�vJ��!\`7����/�CE�1 �� � \Qh�G�G��X�*p�����_� T��Ph�C05� ��BC.B������ N ������ JB0�����@������ ~Ǖ�G� ��Bt�h ��`[�V�X: �%0�.�k���%�l�Zi F@���kD�؅ �"�#0~ h� �H��� �x��~,�V�-� a�� #�t��\� p[�V�0 ��<v ��9N� Yv „x0�,�v �� ����;����C, G�؁$8`����-� ���D1 .?Bl���@3���B\~B3�* Bp���P �A4��H DJ$^"K�b�� 8�@��\A!��� �2� ��x� �@x!��+�A�X7��* �'>(��b�(�/�t'>؝a �����@ ��Y�́-�w�2 �A�IA`0! ��9� �p�� (�8@�;H�q\�Z�.��!C8H�1 ��0�C� <��p��p08<��p�"`p�XA^�!/ ��� � 6��H�=HVC^� D�@ �ڀh�}� ���$0/ .�N@�BX �,����B� ,���BXu`!(��B1!D��oC�BP A!,��z�$�&%A!��� �A� �d�+��� ~W��c�'1m!��)b@����b`dE1h ��)���P`!z��-h��ZA���V0@4��X@��T��.�;��T� t�-�9f�ʜ1�@�`` ���%:��%ܠ8O` B>@�aQ���P�%@ lJS���7�� �l���<�&�l@�T0�)!3��$`�#x!(� � �x  ��� @@�pF@��$g�0�^M� /�+t9-�O�).@�4� ؑ] ��w.�hBWx\a�X @� �!�AGP%BF� ��@��A ^�#��6�Q] ��<�@q<D����f���l�+�8Bl�aI Dum�f6��c ��|�P@Dpm�|�/�#l�-8�!:�/�kPԳ�4�!���ȓ (YU�`\@�0�\�d�A+H�� p�tL�X. ����T�!�*��؂/�p*��� 2� � �@�Q6�El^�����E>ȇ�€7�P���-�G �e����������l�M�?�� ��QRF�(%�Cց+pN�@�N0J@��� �$�����K0��~@ % d��@�_�@"������Ht��!D]@��`F@m�C/�B��y@f8gc��.�&Bf�]���@�BX�:�� �h.�8��d����?zd�T1�A��`�Z���>�4Y|�'@��'�^  �H��3�^��y=/�QD0�4�R>p�'b0ÈQ �� ?��c�>��`�|@�Z����E| ��(:`p ��18�5� � ��|`@@ ��`�� x�(�� XNi�S�����(!�� �NLȞ��І���p%8� �'�=C ` U���A5�F80�M0��()������h( @`Ȁ`���;"����}@ hF @H��w���c{��'� �j �)2@��Բ�`{2��R�А"@CjY�+$��P8�B���=%@x�,�|�~�( ; $#Ђpx%,�����+N@V��b��K,`�@ �� �0N �|��F�@��|���@M"�@�n��XD��9�A��P$��� ��{Fv�=�@�4 �w����=���� 9�{v�:�= ����{BC�@�b]�;�q\ ��MB�6�\�2��j� �.0(2HT� x^0�ZtH\��&��yA�P-:� �*��,0:@��*�t��M��ϫ A�� �UT�*Cf_ �� >=�(�U�H��@[A�_��!B���ħG���/D�<����a|��!X@��#x�. >A��� �� �q �H�E� 8�L�9L{��/�"P�@���"\��("1�!\D�@ơ|��@�8�����@%).{�F�)�aZ���JC��!��D�`D�`>1�� �� �0��? ���2��@�m�����a{����7�A��1�D0�r�?8�P@ `+� NB� $����Y"@�P8w�G�4��ԐRʞO �>ӧ Q�"`}���-iCp8 �%<�,;��ȲL��0�Y"�,��D��G�e�'y4�'�rG0B�u�aPB��e�Y'�Pd�G�-u��%��\#0�����`@ ��@��,�/�&̀X�$\,�$�!����vnny4&��G�K�x4.�hB��h��`�r���U9e�#A:,�`B�mDh���&��I �K)�.�P���?�2 �}�O��; ���SL�4�>���"����)�]ܧ�t�S�}.X`ۧ���_@b.�I1@@*ȹ�� �Z� ��H@+ �S~.@���K`��gr`��I�舟T0��\����=����rq$(�ę �E<��@��Ũ��51?��$� �@:$�+A"R$1$ <�T� ( �$� ~uA+�\ �\m� 0���K���%� &�9���V�H��t K`����KX��� ?�`=�� ?��>:�~����'��:@~r� ?�����:���@�@*��  ?���$ � ?�`: p@2H�~r� @�%@~���s ���� �T@�M.��0�� ����z L1rnrI` 0�@����!�V�#0�`/#P ��0������V�N+�xS0@� 0L` �G�X@hh��) L` �&�`K'|�V@X8� ��rKH�J�� ��t !�@e ���y�+����XLc0���H���Z0��a���A0 ��p�@ �A0��0s�̭3�0 ��0s�)���i?��` �S0p��P���4��|\������t�Q�E~` ̕��dEA��p3� 7�+%�(�ςr��\��w ��y����S`��X�'� 3���2�� (��� ��`p@�\ S`���AW��6��� ��T�J( ��� T�Jh,Ţ4�R,t��s��N��"@��;@����� �B�?�4#`v����@ԗ+`l�ԡ Ҏ �zA��J���s��8W����#jȑ"�8�L(��H��+��E H�T�@��Q�L����;@L�gSD��<@L�@��`l $��H��+8/X�Q���S$@L%�D��/�PBO���(H���g�쟤A�,���,|��]J�_�"B�¹�8ὸ�/�$�̑��4 �y����r�� �y�8 u�#����?IC ��4��:�.���u�� �y�����4Hλ�8 3��@����r��R����`��R��9"`1�Z t��3�t� (����O( �'� H��$�e� 2\�Єu�ph�@�F�@0���H��� �'P7�d��1Px2eh�]P�@(܀���@@�a:`��` ��*���.�U` T�.`b`�R` ���.a ���V�XK`,~�l XL`��1� ��]L@��U� h]��^��� �@*p'� ��Ir��� )���I���H/I�S l�� P�E�&`|@���h�7� ����: 0+;�@ε�S� �\&t��%�5��0L�����S`?$E�q��}VT��0�a��hR��Ɉ_��j�������`:1�A$�~�'��A�4>p������0=6W [P 0=B�\��`z��0=Q2fľfh� ƑEp�V`r��Op��@"�R(,��9`z����$І1�7I� #�* ?1�I�h ����P�B��_�HnR��ل�P����Sh���$,,P$� $ � �� ~F�4D��,��@��P!%a�}t n@R���i ��\�.�a�G���@�� pQv��i��F�0�]81Ta*�5UP[7 �Q� ����>ShX�3L���jK�6��� ��iN �E��7 �>���X �!KL_4Ѝ3�YB ��p$�������D@"���j �@���"`�V����6�h�R D�D ՠ˖��@A��t�@-�"�"�6��� 01@ ( ��Hh��Jh���: �P]�,l9+|D��G���t@�\�@]T�E��~m�UVxt�F�P���a�J `��~,(H� � ��$`A!�m � KЊ38�L� �D�#!W(� DžZ�` W2�8 �G�<��+W�� ��_6�X��pz-� aAP���JXhM�D���\��a�6 �����B,@@)�\Q��1�^�!��L� ����@)�����|@)�鵠���� !�� u�� k@ka��2����e�6��Q�D�>� `�~ f�� ����0 �@g�� �A��,�� �n�t��A�r�:P���A��~ �������1��?�b����}���\(xB�r�c#T@8 ^t�0 �@�A�� �,��`�<�f��`��@05�@��EF�Y0fu����Ss��(�Xr���s�nN��9G/H�B $� +� � ��� J�6�*� ���m�����Y���,���l�ZH/ j�Th�|�$�Ae a��]@҉��`G S@v.+("2e��ij�6�6�@�~��IĨ�f�������|Ab�P� 7�N`��`S:���/���Y@4_ W�����<)��� "��� �@>������@� �` 0�)��E�_��n�� �u���T�<�jZ�"L^P�A@&��!~���@���@d� B� 7 �������ȿS �N��;��ȿ L���Z�H��ƅp���x �Az�3�},��y��$�� �"��8�`<� � ��6 F ��� �6��F\�@��@y�$# ��8�>�u`��}���>��`��!Pz�A���#��P*B���) `f��%� u 7$���Pm��Ap X`��4���>�X �~�A�&Q`�`��0�`|JPrGA�v � n�I�� E�(4���Y�������`2�E�0��`\�`#�e}� 4u��F�E�#�B J�((`�#��!��W� P*���g��`Hr�x:@����7Ġ�v�`� �� ].:@0���<\@0�\�f��P����P"@`C�$(ͶP�.�, E�/�D(��fՅ�m�.����(C Ux@i6�>�5;C��}�;��5L��@�E;��`����4�r}�"���v@%@I�D hMrQhx�$�� ���@�(8�"�Y2-.��⇆�:#h茠�3�!��"Il�E�>�g���kh茠�3���:#�&��qp �4tF��ACgD ����ACg �4tF��ACg �4tF���Vb�x7���:#h茠�3"���ACg �4tF�:#h茠�3��ΈZ� ��B�L�@3�H z#KL�0�����2�,�0���b`H�P+V��`���0�� ���0D@G�t �0�@DX8��) ��f6 3�@�?0Ԛ E H��� �Z;Z �B`� ��aGJB0� 1dU���`m�(:�vԎz��?�@Ԏ�R;�J�I��d�EP;�J�1aĄX�. "���^P�����p1�� ��.};p�6�)�$4b0���B؆C�o'�D�܂�h|��!��"&h�jzy�6�:@�PL1)H �5�Qh��o��(�����n�G@8M�o��� Ն�� |#܀�n��Af�6i�8��4p"��� ԁs1�F8�! @�:��a8�`1��@ D�8��.�{�F��(��M�P: �E0�1��q0���" �7�!t] jD0�!��n��Oc�: ܤ��p��9H�!bH p�@8Cjԁ�p�4�"@�� �!8qqD;r ���v��䎂2 C�@A�;"~(���c$���"�X%"|�X�fcA4�Q# 8�.|��]#�y�D��8@��BPrGA%w�@%����䎂2 C�`,��;@��a{��QPAa�c�v�&��`9��8��`�Bq0��ꀙ3sfN**.�8*!aH��(���̜����̙9�@�抉���8AT���cAR$�9�2g���&p<1%�0��0Z�Z0 @{ �+��7��Q�O؁�� ��F�t젭\�]0Q�l�dN��_��_�� �!:�:�"N :l��0�<����v��q �U '�&�� �BM851D��P���h �(;0�Ct-� �3D��PN���xD;�9 )&W5����*t`�����l��V4bSL����h09���*�C0� �c\�a1 ��7�����h@(�" n@�<�� ��B1�!`/4��0�D ���@BHb0�e#D���=?��eH��:^b' !1(4J4:(QB�D��%�K��,���D�������0�a�  Ҵ��Z� h�D�:0Q�ht N�<�%�Z� %Cԉ>��f[+Vy*�Љ�'�D�It��5:�#�&��� D������}�P� z\0-`�|�U���@-�S��50��@��<�� �N��<�'�D��t�DMԔ�@� ]�pV�� �Qh<� `��D�5�o� p���N��E�� q)�$N.�)'��e��� Q�Z��5�{���":D���P��“���(;�0�:�!zԄ�Pt{D�`0Du�P���QE����L�D�8D��PN����0��>����$B'`t!��X�S��9�*�,BHE !�u�t`8�a�x��0p�VttP� D}�!�Ut�rQ�;:�(̌j������:X�Wt��9kE��$�N����u g�l���`��*J��.���`t`Q'2�� �U� V� ��.�h0��+�2H�A�ԁQ"bD�/��@�&����H8!�mpg�RI88�2�vd, �#$D����8��_�mPp�2���� � 0���ʀT�|������$0�2��2bj�/0d��*qaLͩ�+D�Ssj���@0�_`j�`�gSoT2" ��$pl+��2" ��c��>8�0 �4�g��>г"`�M:pFy�����V4@TP�D����K T���8��؏V�\�0�o� �%�@0@a� V�V�Xi��4j�����х�F�?@� AF��@t�2x��� �+�@9�2WȈ(#�P !5h����c ������`ϒ >dD�� �X ��6��7tV #����%ȈwVB0B ��+#hk8HV���Y #T�0�O�R:�/� ��@>�4�c� ��@�@��4pl|��0��tA'8����X��O�R��u@���!$H�Z� �M!iT�Qm�g�hp ��Ϻ� �gCH�������m�@���.<mP+��6��`Gp�F��B��&���m�g]�#�!D��\IP+����� K�M�6j�68�-p�#A�ڨ� �n�mS+����Ԋ#� ���Gb�.�#� ��B8�Hp�� �O��` �Qn�Fk�6XK�pbP+��B`���Vhmp$B%Y��`��n��;�X�Z� X7G�VhV� B�68k���� �6�܀p� m�A8'D/$��F[B���"��5� �A��`�����A��! � mB���� ��0���m �,#@���F� 4���@�@�m�J���@@H��u�L�C@R"F`p�k��m]&\�}�r��r�0�#� ���05� ȁW`��>��u"� #�����.X��@J$ �5|\� ��$�� &p%���0� ,d�>�ɕ L@p����`$�J`_# �� F@�`�ǕH �Jd�H���`���/0p�$��Q�@  �����(�?."� �@8\��.b���X f8 A`m耙#f���a����?)EQ�! \���.B:�!��p"0H�X�"Ch�."�ZcR��u�@�6�.�]�Ԁ�&�� C0�7�El� ꀢ�7�!�$�`�$�h 71xX�.��W@�N�9 ���K�{\����dz�q� �щ0G!�����L6q��%��W����R@�I��ɤ�&��2���5)������t9 ���Q;zGӃR��h�~,ӣ��\ �~��TP?��R@�JM�IՒ}m�=���4իz�@$����ӚG�(��V�Z�=�(��k�{4�RE�G_��գ�W�6@?J��%��_���H �����ŏv�CH��@�q�W0 C0Av��`���+�#hR�*�u0H )��q� �щ0G!�����L6q�E�l� �ab,��*�>�c����VA�@�Bi��Ah t����;��E��c �� �X� t�F K,#@j�B3< ���Q;zGӃ!m�K�jB�@�H� �`)��� ��`J�(�q3H )+P �f�R4Y#ƍKXJa� RB�&kĸy4K@)��AJH�d�7c` (�q3H )���#.�0n)!E�5bܨ�%��� %�h�F��7��¸��Mֈq�+��R7�����1n��P �f�R4Y#��!]Ja� RB�&Y�R7����IP#�KXJa� RB�& @� �t (�q3H )�$5� R���¸��M�A�8\Ja� RB�& @� �_�%��� %�h��@V�P �f�R4Ij 0h (�q3H )�$5���¸��M�A@�XJa� RB�& @� ��,�0n)!E��F���R7����IP#x�t (�q3H )�$5�͹�¸��M�A�"]Ja� RB�& @� � ,�0n)!E��F�H��R7����IP#@��t (�q3H )�$5��)��¸��M�A ZJa� RB�& @�  X�%��� %�h��@B�XJa� RB�& @� ` (�q3H )�$5�0�%��� %�h���H��R7����I� �BkQ hM�V��� %��@)��AJH�d�!������lT�� ��>B[hOk��H�Z=j}���࣯����Ħ(�܍�Fć�K�����#��R�<�G,��B'�A�qD���0)A7>“�qsL�Ϣ%(�G� �I ʸ9&姓�q�#<)A7Ǥ�|R�2n|�'%(�昔�EKP��`�a) Y0"B�+@�ڃ�6]I�ԄB�C���@i!!��\ �J�A N0���N�_�C[��e@?�� #��aO�p�(��F��,aA�25@����`����~(@�� ��A(���|�@i�e��U�t(m %���>ai�i)m(����RT��(m k�1����.���>Qr���m(����RTZJCA臁�e@i00��`��@��A�|� @i��� ���@(�e ��p����6�5`L;Bch �A�cj!\@�!�|���R�PL�)E� �����*�a{����@ipS�P��>H��&1��� �� 1����aa3*���.YB����>Ab4������'H����$�2@��DF���0�ML����C�JY��I� 1��XʀH�,���O��MbY�@�9�d�`�C��x�.q1�P�-���b hFĂ/p��VD� 4��0�@�� ��0�J��G �,a\ �� ���`^A �>�#� ���(?�K���`��!��`?� L`��+`^�0�@�����J��0�\G� ����5B{\� @ @�!p�#�`}O�p�؎��(p�� j�@p �@�0�$�"����Q/�� �@?q� Wp�� TA�`�Q/p�Ol�G�� ��8E��.�T�B������\�hEA�.��N�DAh�K@� �;p-h��6Z�pG�.`P�/�t��}��(��R�m���@�?pB�Q�%����� @��6_� ؑ$�=ُး�� ����bCl8���+p�&��� ��_pic!�.�@@,�i ���0b�84"�Ґ#��Qu ���ci,�: ��*!s�@�8��(��#@#�B�9G���#�b)��G`��҅K&3�HQ��)A�1 Kg) Q��T��ReK--}���c��Y�.��}��较Ki��,�JF��H[K���U��T��ReKI�@��*�X 2���4�:ZeKgi�T������YJB- Ȁ�ReK�#2���4�*�X�Lc�,혴T��R�h-2 g���H��5�FW��R�V��*: ��Rd� 2P�t ��QP����t@C o���! (�X��� �� ��:b�,Uj���Y����i@����6N@t �tԁKg�BP�`��҅P��,M�4�&�q�c���ԁK��,U�t!�b0Kg�B�� ���3K��,� ��ցK;&�E��� ����+�7���|���+���M�Z��"]\�1�`؃���^�[.���@���@@.݃bS!�R��r��T�Tl*�\*6B.� !��M��KŦBȥbs!�L��ե%�>�^��a/앿�Wp�A�!�@إI���R�)6Ŧ��bSl�M�K�� �4Z�B���ҡ��0J�f � 0Zq�� 썥�Al��Xz�hH,M��W H�Kc���J@ ���!iy�t��b���DCbi2��J@:��XK� �UJ`� I�K�C,��7�� K���U����X�a�P{0dHZ^*b�؄���ѐX�L���7���={��؃!C��R�K�&썥'����d*��t���4��Aث�� ���J�X*6ao,=A4$�&S���썥�t�^%��`Ȑ��T:�R� {c� �!�4��_% `o,��{�*%�C����!�*�3 6�-셽'h�^� {c� �!�4��_% `o,��{�*�=2$-/���E�FK��_�������Li�Q���w����a�؄�4��M�KCN�؄�4��M�KCN�؄�4��M�KCN�؄�4��M�KCN�� FG���Q{a/�%!�ցP�-��u ��/0i�'�L��^�z���u`���30Jf�/���t���_�O΀ �����3�K�@bL��41�G -`� ��0KY���4����-|� �&`��@ ���Y�z `��a�.�`�$(-1����Ҫ�&Ai�1���A�6�&�$���UJw���&Ai�A4 �V 4 J�$�A4 J�I4�&�t��P��t�6�%Ai�A4 j�IPZJ �1���0(]5�t��,���0ԁX�$� �0��XJC��0�j@�a:K1���!�R5fi��i@��R2�1Pu <�&��� �� ��#0��l����&��l�G ��@�뀍8� ��Y��o�,��p�!�0� u@7����� �� ��: bi�����������,�� ��ݰ�fi0� @m���b�hu��Y���n��t!�b0Kg�B�� ��ݰ�fi)��AL�4@� u�D�sp���堉%�L��r�Ab9��8ZZJ�,������YJB��}����ҎI��%���G�Lc)p��4�G�Lci*�@ X:ڀ�9�� 8�s�, $ �])[i�`�<@���oڀ�!gp�6�y���`�~�A�G*��R�J ��C: �6�yΠ�����0�#�;�AXT��qR���D�"H��~� �/� PƗ���� ��2 _ :��e �� `��&p �A*�."���� Ԅ�t���O�v��L{�}z�� �2��� /�h��� (��,�`_@Ӗ�)�� ;�,t����e! ���>�g3�Uf�&�w $*�wÃ,�� R�$P�ˠ��O;���ݴ�2Z�$����D@)8�@4HI�>�4p� "4R� �A�np� �(8�����V�hTHYA����z"H@�G��A$�]��. hME4�O<]h�t�)���3��*�:�8�4}4>���P0N��B�������[@�� _ ̔�pT� 2X���, NKM��QYД�^���(�)(@8�T,P�+���4G!dY� N@���,�,�@¹W���S�����HTӣRP��)C�W�jzT���<P`���9 ��PM��$$�^U�P=�\�s��( �$ԁ:�^ rP= ��[�h@�5%$$`M�5��0 8��6�i�%�42���������Jj�4,�=pe���!�)Pv7���l�� D�� �2�e�…�HbB(8�T� 6�6@�m� ��Lۅ�����H.���Y��v�!��#`��55�C����� �`?��D���$Pl@7i���~����O;`�T��]����� 9�� ���0�C(m�M�����~`�Q�Hۅ���@���~`��@P`� �M��Vx��W ����4�@I�Pv� ��00�u��H=��[2Uf� �y�j1#��@h0���KA=�0<�����1��%`z��,8 ��A4n����A؂� �y�B� �0���!�2���`?�08� T���ԃ�Mbf����Z?��H�v)P�-��̘�) �~,�0@|��%Q=����)2�#Ȉ4�Ť"��EcЦ) �2���ơ'����H���� @P��t�8��1 Āx�]Pt��� Ζ��V��> Āb�X��9] x�/�tH�v�~�:�wa/����W �����A_(���8�a��u"`��O jC�'̴"�#xZ�M��s(9��tS>�M�i�����Ӗ�<�'�|›~��uA���H�3x/��)ྀp:F}�.A�x�p�l$���%� j��s���( !�S$N�gP�A�� N�gP' pG-5�S���^�K�HN9��Ԏ �T!��%��P:�_r0W8N� ���3j��a oAMlBB(\Hp���p�Q��)�q� U�SG0q�G�"ǦH�Nu�(c � l�P6�F�T�#�S$@��� l�T!��M�%��� `S$�<�m�(D�P1�@�-�S ��S]� �C��أ%l ���w�Ԇ�g0��K�(py1�H��9A5�Z@H.&�2�&J_�w "�s��)7( !ND��� ��P0�~��n�*�����7�S�+P�H��t�k �����k�L ��+�HH�@a�|��+��H� �©+&N�`�۷ߺ� �H-!I6^$��[j�is0�`\��h\K��� YA�� .!�w��6i� Z@s�͡��;�p��9�e`�Z�@� dp� CV���0�4��B�6��%�E�A����!+�Z�!9CV���0H�A��;M�� dx�T�� �4��/�foP=_��$�x�"F�A� u�4� ��BC� �ۤ1��B`:4��An�q m`l�]�vv�K�T�AХ�=�K� y��l���P��0OCC��AEd�/0v���$�]�+���,��E���G>%;�&��G I��H��Q6���B�� ��Gt8�����|��=�Ed� �1<6�%���o1<�i��)���6ˋ� �Ȝ�3sf��q�t� e��̙93g�̜�3sfN[@��,bO##�E�4- Z?h����6���`NH�T��@:@Tx'oBNX�$N:^�x��p��ö>�T'���K_�3 8�0`�W@�҈ �T-�� ��s�<8 �p�4��Ɖ3� ��������8a[��q�����8�x/1E"N|J�)a����� �:0 \a�����]A��E�qRp,���X�u� t|�w���u�{���%�a��Cͧ{�`���K��0ȧ�tԁ|�O�����w��]���iX5��ҁ%�a����� �ԟ~b�OQ��M�K ��j[m������F��P�`�u�����x#�ߥ���~.� ��1!��{:b�d>է� ��S�:Q����qr �Z�*8����c (�%����]�2N$�g���Q8�Cp �{J#�dz9�Ƅ%p�dt� qr �a0 �@����`��bBt0�!��"�{:b��0(��!ND�� �͈�f� g3Q�`�e;p�%�j� �K@�j���e�H�f �ˣp�����F��j3�B�%���3 a�H$�  e�&*=�'�4Nd�L�H� (T�p�� �9���x�R� `�(��)@*X.J�}�ʰ)�@ �'��?�O�\`�R .$$�z�!t!�@�OG�>]�#�!��<z��A������D ��'�l�.�m� ��`2h�n� ��.�p�#�|���yhnp$����@\�!��� ��:̒^k|E�� �vr[d� @�6 i`���X@�0$ @"`� �- �@�yX]f�X2"�l^����",@��P��՝�a�vs$�D��\�`�t��i A,�8&�+͡9nP��x�:�� n��MsP@!T���C8>��HT��ZP] \a5�^W�jYP1��*�~�B H:��4����hU�4���$�@���[� � ��1:p���#W`���`�@��A|�Q2�9��A|��~@n@O�8�/P�@��E0}z��ё+4�� \�V��@W�Z(����@�`-W����Q �C� ��@%�� T@�D��G!.��"d��%��\���@@K���f� �l���\p�R� AK����lRHMP  � "Q��28 ʀEHR#D��Ԉ�`@jD�9��( HM��2 (����@�\� r���%�h\PB*�6�A� N �� Ƃ� �@���l ������ J9� �Gh3e�HRS�7��Fe�A$G 5�G(9� 耛���� 4t��%`�� �(-��!+� 0-R�� �a���tI@KA`�0K���r`~��*�w�@ ��xG�!� ��b-EuYw�� �b-E�U����,j@�)(?����/@����9T���m@0 ��f� F��u Uf�+��Fݨ� ��A���w d�a�E �7B�X Mh`�4��j� �z�ύ�_`�j԰0n� :��0T�� ��@7���t� k����Yn�� CU�r԰�7o���t@ֺ_&H|�"� p �` �'``� `���G�U�[�!���e`� `4�F������p���W�n�D�Q��F�W��A�Q/�Ȩ7by�#0� �Â$�F�u1�G�Spˆi����� � �@z`-x<� �e���#P��o^3�7/� �&_� � �7����1X � A�%{�.�96�B�/���ȆA@��%>.���|0x !������x�(��{P�z�(� ���C�!���o�H�A|<��@PLp t�� u��T��#A*H�e��T�:Ts I�(%u��^��u��I-�$��v�t2TO*���7 �e�R���� �A��1� ��P���`�z]_0TeH��\7�U�u���Q� 5 �ܛz�&��e�|�zh1 ��F��Lp#t �7B��P�zt;P=�'��/(��Q� ́�^����Q��{�M`�I�!`�Ϳi14�h�� ��Q5�� �\a1<Xb�DB�}���8<�q��c@��Ѩ$>���3���W��&�_@ Up t��4 7B7�{t;P=���� �؁�Q=�@�|��0T5jX��7B��R�jH͚=R7��tì�(Cu��ԡ�KH�F�Cդj��N��I�C�����lP*0��w�v]_0T��/���~]��R�* ��)5�f����AJ�t@ֺ_&H|H��:0Ti��B��ԡ*d�j�ut�(KP1����@:��+��"�e����6�_ (�/��� � <�+a�A? �� ������@���5 ���h �@/l������# �NX�D\ 3`׺h� T�^P��eO ��T�i` De �g0` !�<�`��QL@́3���� �" 0T�J��� ��1Pk ���� ����� �m� ��@x���y�4�|Ҁ�� ʂ ��\�Đ c �a�"$�h�����X��0 �T�j$FL7K�M4�%�8; ��� 10�@�����6� # �5 \���/�a��T�D���i D��R��h ���0��H=b ���#v ]ta������Ka�a?��Ka��@@�.�# ����CzH�7l0!�n;�#�����#����!� ��z���/,����zH>�/,��`!VAz��a)`�� |DzX �c) ����;0;0���2u�!�:Z���2[��p����̘�2�A��Yb�p.&����4�VC���e�̖),\�.8�g N�L]pπ���p�� �� �>i�� 4d"�򄭽����C�kcB9�?���C�@�p�2 ��3d� H�%��E0)J�p�F����xA�.��T"�������L�# $@��%��;�_����@E� #��DI**�M�y`�+pF�$�&�� �%���0�� hF��#� �PQ��@��` F`��Z��\`�( F�p�����E�$���������U@H�jBM�*~BBH��� � dS�@,�<DM�*�F�2`3j��0n�":` ��)pS��M%� a�) ��M�7u�*�)pSy� x��lC��@0C� q���P0C��S/�A@t@�*@=��%(�c�)�oD�A@Sপ ��z J�:` ��o���jb!����~|`�+���� �X>�(PT���p'l�f��*����Kv�#h�>0$X@=�xp���/0�t���S` ��!$vAt �4|�!$|�b7�F�@aT�@�( �b �� | '����b �)0W|�_�;UL0 ��\���u`!���[X-��H�| ��e��"�P��>X �8,�T@� 7`���P��>X 0�� �A`�@�|���B��`�~��B�! 9�VB@���,�n�&�m@ `� �F����i�%l$����i�%[������aG��qD� ʸ �l��#`O `_�-hdP*��-;bۼ�����E ڀ|J��"D !$��0��WH����BB,��@j@D���Sb�>нK `Up @Lb��` �����]X5��X2ALb��,�`�Uu��]T�, N�I����.�4pD�E���$�}P ����'����X2ALb��,d�vyA08�K@耬������$�}�l��HZU��Sb�>(K@L@��!T� (O����ɪ:@����X2ALb��,�����h:� ��V�.h &1�]� @Lb��w�#� \�ؽ��d��ĸv��p K 1�L����3.a �Vb�>ؽvծ����@b,� &1��kWo�KX��d��ĸv�]�3.a ��ĸv�]�F l�%p Ҁ�f������ ���5�����#b�>(K��^��Uu��5�� 1�L���(K��r���U��W��f�<��%`H��San�`?�+XF�$�A��H�K@P*�?@�]��f�c�>X孼w`���mX]�b�ڂ��"\D`�`�1\���E���\��u� ���.ˍp��d 0(B�$4c����\�#�.�ٺ!�� �R0a�lk�����:��� B`H�@��X �!f��N��X �!fD7N�6Y��c)�� �E@�!�Lb�֏%�#�B�K�G􅥐|DzX A�f�MQVͪ�X C�o�����~,�����Ɉgu�V�����a)t�-�@Fd�~,12b�X�/,�0� vD��w,�-�@Fd�~,12b�X>�/,���#��R�>"=,��Vժ�'�)�U��#@�XK�$�]7y ��R`F@,������ �1������ i 1�(��pҪ��4������`FKa���R@h0K!��cp܏�aA�इ���BL�d0L& �~\� ��2���\��{�/+�����#f܏���!#���Ō�3�PNB$b��‚"f���g �& �~\� � �tآ�-A�� �a2l�A� $Ce� Č�A� �% J x_�0A����� �%w��� B2T�b��V`paA�Ap V J��K���U9P1B$��zxg{}�Ȉ�@���3 .. f@�C� �� P�p F�� � ���슳{B�8a(�`� �`A7���^��t@0@��%hmp �*��bT S@� � YS<[� P�x��832�*������& P0@��$�m1EI���^�)XB[�:�o L�l�*(%���`���@7�j(@0A�T'�m0���6p0���� �nv<��`��ã�J��#�` J��x6�@�j BA���7����P�F� �=��$�C���`��!hk� X)j�F$� Z�;H����w�� �E �Pp�C����B _�,V r��8`���PF�PkÀ �Z0@��6�a�@X�/��%�� �BX :����<�[���;�m���y�@�� Z\��# ȁE�~A��@�H�?��z��Dt�? Ѓ@�D�|:��2�a1�U�#m��% �~�6D(��� ~?��"�U(�Cy���� t �%8��R�o+������$��@t^ �yY�/�'�;!s����胹�t@�\E z�S����)�2Hm��:�)���Ё��1h4�y�2+���,. ̊:0+Xܬ`q��� �m8�\]�@��4�X\H#b�81"F`q# ̊:PfŬ���TV�  ��܈!W$��Ы{U�݈"ã���FT�+ n�@���W�n�^u @)`PڂVh�YA0n � i��4K,�h�%7����|�C��β4�*BB��сpm ���͒ <�(�Y�_�:Ȯ(�B�-�%��_����`�5���$-C�`x4�2 �@"9��h�eƠ��� G@1��5+�� ,0D�pF`�@���p�.@:#P��������)��_u�8#�]�&tF�$�U3�W��X �B$���\� Є��8#P������\� Є��8#P���u<��z���M����f �U#��( � ��V�h,� ��`�@`����`|�@��)@L�@#�h\ Єd` �ES�@�"`� ����A� f!J@%\�O��K��$h � ����%�&�)@�0L���%�Z�GL� p�`�G+L �%`"��haD�Q�2i.a J���0�'�&`?�+!� �`?@0�.a �� *��`��~ �Y"M+p K���V�h\�0�p ;����& ����9�; $#�Jpx%L��E��� �Fф&�h�)�H W���+a�@%�B�h�) �Fќ����9�f!�� ��@)���\K��K��,���2D���ѵ\#� ��kq-�f�(���̎k����(�4�(�@}��F�b���z_��� �l���w�R���u)L���Z\�R�la*,�K�.ia�p�M���@ �r��4�r��8`����!lc `�1�N@PC��r�"�|�e������F���C 0"`�p@��le�Kp@:0�Ox�S�Ğp,H*H�E����@@�@�8��LT�)V ��؛�!VD�@�4���#H@K��0H$t��bhI ���)^� M !�c�5��XBȄ -����H�� e�:���zBP !!(�zBu�6!%���buB��"V�� b}��:�B3�&b}�5k�ĊX�P���5k�Ě5YbE�N���Ě5��@�Y3k�ĊX�P���5k�Ě5YbE�N���Ě5��@�Y3k�ĊX�P���5k�Ě5Yb% ��� ! � ���2�R�-$�G0qn���؁�Up}��� K� ��B��R�- �P����n9&=b`����n�KF�޲p�8&�������p�p �~,�FP?��c #6���X �##j�Y�( Ka؏�0��X L`)$� 0�R(C��r`\��%��)T�I~(.0 (���� �c A�Ҡp@�( .���0�j��B$, G�"\`90tad 0��h�-�`l�1 Z�Dx ���`f�� �p t�n��@��'X�`��4�e�_��0�A�ݠ�X�B `p `Z�F�p*���` <�V�h!�*@���\@y �Z��T��# ]@@�Y�J|� V �X�FpT�) �E��\��x.�B�\�*�!@H(4 ��,����p%8� d�B� �@Y�({�,��!PP�`P,�) ��F"��AH ���6"@�+$$a�B `�� D��! A�* B���'ʀ`�G� A�@�a ��12�ZHBh! Q@�\A <蒉�� v�r;H�t���@��S�Z��C���� j��F���#�!f~:�5E.�+X�Q�BB��!�  1p� @d� j8�,@�np$X�.�_��]2 2�`����X�����Y%B& ���QXGa�.`bADH�l!#� ��H a $���BDXI ",#�"��a �"0"��T���!"�F*���YA�H 0��.� �D���0$�+��q!LKК^jq^��5/��RP��Br��Q`��jz+/ �!�$@wYAt�@1�KX2 ��E�1�A(O$��{D!(��́B#x �!���B� ��������l��<Q�B zš�%�[�C���!�&��q�vL��1%�w�߁��P;�6�0���0�Y@LD�@H�a,�� n�- a��@ $h�pL�� �`�@Ap���@A$��p�C/�<�\D�*��0,� 4�‘��`B ��Jt �c)􅥐H��$�c)􅥐H�RȈ˅0��҃ t`)��P�8 '(������%`��w�&8 `�Mp@�&8 �P/ �E� ������(��0��(n,aW�W����i����6��[q; u�����v��Q8 `� Eb �� ��D� ���-�Njh �$���T/��]� �  ���20�Kp at� pB p!,���e@���.p����2 S�p!ON����C0�(ڡt�`pp%.�w���$+u�������"` ��SZ��)-@�!1�D;8������`XFn#�j��1����!Ph��O�! �x�(aw�Fx ��B �Al��2��t�.d: 訅Q0s�: Ag3MBX &�E� �y�� �@'@G0"��o� p�(0�@�\�-����� �@���� +0�B�x����( !Dp�h�p'�`Tx0 G��@ %G"&D�MH(�#`�!�@�)`������!�!gs+�)� �!`����2����2�Bc ���������(�|0>r��+d � 2�4� <���p���4Z��5�m.�'P2�$h S�X���& � 2ڂ6�;B��J�6!"����/� �Ap "@�$m�\¶q "@�$m�\¶q "@�$5��� c�h���mX�#8"����$ �`H"0� ��v�:�ZAကm2B�6��fۼ�Z ��6�6�`����s@� �� ��7���` 4A1�$` p��&�8�` (�N�� ��b ���N�L �!D�@VDt� &(QH@'�%��" ����t��"� AW8`�0_#Ȁ2@v��DA� �G� ��#6�%ԁ�� �aW\�0q��9���*�((��t��J2����#B` � ���X���`$A^�@ * �F\�4���?�������P��&0K��D�Hg�:�Z!T/ � �(: �^��z=��?�0������;Q�z��}���?x' `/X�rhH( $$|#��X.�zM��#)IU 8!�Gp8��M�GW`Gp����)!]!�� [ X��x ���S� �BX DSA� `�‚6x �%,�!R�o@�~6���S.a! �@�*g��QWԁ�+��S���7 �@d H��- O����`/&T@�Iv/L�/0Y8g� �`��kSBp�.���݈�n�'@h  ,���@�M �,�0<.q8�0 '�Tx���T�� �,\�"�Bc�)",\IrP�S�.O�)����3*NgXcH�U��wy �1�����C,DOAO����P ���O!��q�I0Dɂ#���P �S������PhS��8��� �+�-��<�6� @B_� m`�8���J7��(;2��� �X{$`�%�P�Sx b�)<npܞ�X8 (�z<��Bs��OA�^L;��*�!�$?��� nC,X3e�!� ����Ȏؑ� �"JD��<(A8"�% Q�4��Xx b^�� �78nOA,��*�d� ���<��b�,AvDW̍�i.�� ��,"t���OA,<��� ��S G^����Sh�)(؋y0:Cg`D��3Đ�s:��hD�3<��p�A�.O�eD��Q@� '@�t#amJHg�D�`��� D:��>OA�kSB:ÃH�`����p�$r5��It�Ÿ��)��?�T�M����3X��D7x ��F�@��.��a�08p+"����A�܊�a$l��O!D�ȱ���H!�)ԁ�+��S �t!� :v\<�3,&��@(DO�<n`#P�BHO! P����A����)�Jtl��� ',� kSB҈5�r#܆����A% "! t����¶�D��(ԁ�pl \�@{=�����A�y (p!p�J� ��Q�!,t�{�-b�� a�3�;��n����K셰$ZX�'C&,t���'����(,��K�.��)DO�p� �@XXa!W�;���!�#v$ Ă�,7`��)\�� �S �!,48p+ܧ�����}r�r���=�a�}.��k��� ��}.����'2�O�)p��L"�S�# K@";bG�@,x (P�[���BXX����� � LO�=����S� a�qVp���%� a�=���Bs�&@��L���U�@{�����d 8���4� ,����A�� aA/"�p1#�*� ]��)���Eg �f���NX ��}"���"8��'B Tp��@'@ >!�"�᭼5�"�Y�@! ��"�Y�ȡ��!a��g�,��0 ��$�� k~w�+��s�)�|v�P��Y�!��i�P-��?�!�1��j�����X-�J|�&@�� :� � ��M�:\�< �+�*���Tc@ ��!�����%�3Q. �h P#t�I~�)\��8 ��DF�����Ph��M�*��,#�A��M��c��z6�O�*΂0ЁN� ��� 7��DNdP�����%���%<'2Yb{�� s<'2 �bD�T`!V� Mx"Nd����1g�|&�=�LD�L�q"#� V�:,�"��K�R���&�Ba(���" �`�<f0CH�K�: �B"0��Ę��9#X�ථ��pLV�x "� �rLV�`����* 5@D̙p[�H"b΄��^��9 ����V`p@Q �A�T�����ѡ��� N0��\ 3�@uv ��U�WR@I A9؁�PB� ��D��E��Lc� !����l�@*X����e�|I*�5.�U@�E�Z,�;�tB�`)�-��t�@ �%a0�ŐtC \ K%� o���Pق $Q�  d� \[qS�(Z����B��� ��@���� �� *��#"�*@��:�^�����q��!�c�T@Z�@/ASPP*�?ց��78�8]���#�T� ��u�� Є8��T@�B�pȋ�B��X&� Bp8��T����opJ �.�#�)�����e �R$6��s& lB�c~��� � H��P���3s& ���o�&Ƈ@p�1D�PB@���s�@���><4�aD)Z �Ad��i�FI����><4S� W�^ W\/��O� ����+�.��\�/ @3D `��A��P�)* ���4r���H7 �`�FI�h ?����LQ h%�A��@N��%DB΁ X*: �q!��T� p�0� �Ef ��J@����A7ԇ�f�J@�( �.,d0 ��%�/N���oA�4�`�}��K8 `\�Z� �H `0tI.�m�#�H1��a�6H��Cn���@:H����ل8q���Gy΄6 '�HU� TBS�.=@p[��m}"!��@�Hn���S���%�#"U�"����x ]��f R,���PEK!=�����; $#@PrGz�L�b�I�ZPDHF�����$��y�KX��# �@Fd#�H�`ʸL�~��'�p��H=���/�aʸL�~��'�p��0e� &a?҃KX8� �����]E���2n���!|��%��@zH :� @#@P��`�#=$�%���Q!:@qK��z��h 艀F�#( =�/��!��_�a)PB� H��RH����]2��%����`�)t`��0�a��NF5�����AsH ݦ1��C hE)_� �q�4��@Hg�HD�`���8g����4�E� 8-�E�4 #뀌�hi�ՁW$"��|E�  m� ��5�! X�ZQ���E<�۴�(�t@,Z+�h���4P�CB�֥+������H��X��:��9�@�:���2b\,�B!��H"0��Eh���A�8gK�E�X����h�DK��B:L�T#Hl�,B8�F���lH�Ef�K�"��V�E  �D�"Y�pH ��E�h�`�ZT���ih�C�!`���E�&� �l�Zih�ጛR�@D�G�9bZE,Z+f�/�"��V0d�@)`8� G -D����@ �H�Ek� �`Ht-D��0� Y�p0��+����+d��8,'��+rvq�0�A�8��D�a+Ģ�2K0�ZY+K��4�[�p�D���h����"�R� 1�A�#�J�D ���"#�"�IJ@% �ҘJ@P�F�H��! ��F`x��3��.P=.�H��!�%��3 k � �V��� �!���p��7�H!�b$J��%`��g"V� �F�"�$A!� �DW �?Q�׍��~� 1`Ht��EkE=A�N�Z1قp��V�_,2 ����X�+�C� (X�"0t�28L��p ΀`ڣo0e��2:�Y�k� t6x��+r�4�� �A0,���6��� $� @�%��P�S���8�"0,�S��AR�),�S���2 ��|��� � _C�!��@9�B �8 ��KX8H0V����װ� �MX�2H���D�p�D�u ����p����!�ԁ耾�@tPnu�x�\�p�2�rH`=JC���$P\�}e��eS�[rK��"ԁ���C.��+:(���@�0` sҗ.�E�K^�N���A��E�btR�/�ԗ p4D��l � `�J�<�AVGAK�/]��җ����-!*Z� �&��P���9 m"|pԗ �"�H��@h�&�G<��fx4�3��G���� � �ah@7X �f"좻�4���E�`-p����>��a��?���Hy�H� �h �� ��X�}���Z�6�A<�p��>���b\�Gc1\�o}4�`-p�B �E�"��=��c-{~0��\ P��}�ϒ����W` �$`��jw�v8^��`�E�����]���9�%��`�%��ҋf��%�a>_t|Q� !,@;t� ��a���Z�t� ����/r�`@f@��>K�MAnC� `T��}���X|�/C�"�_���>P� ��~ �>�'I�)�M���~���"�K�!�'���Ј�8��"�4B�F��ry�F]pi�@Xa��� f�=�4�� ��fF.8�4̌�1CfF#p��F������q���N#��P$ ЈU�h� Q��F�(B#.� � r@D�m@#N#��0�����@#.��� �nKo�JA���+ *0&q���8��[ڣR�-�A�%�� 7������x[z�*�:� �"@?�� X�� ��"0Pč�-�~4F%pz���-�U���"n�m��1*�p[z+h����-�noKo�5� ��t��- �ޖ�bdu�*�-�U)\/�p[P�m "��U01� F�-��~��[x�R�-|�G��p[��m��C)P���#z�zP �q#�n *��A)X��t �%��ʂ�6�-"i�wRYI`�XԂʂ��`��(��8h�gRF ��&W�8r@`�����C`H$�!0#˒HC`�@�%��p�@h%7` ��w]N�M$���bD�,�8H�����O1�.'0�֠=��b�  0��ʒH��b�@�Ȳ��Ё, H$:� �"�Jn�!�$�����H�b0 Hl�DR3ND�Qv, T��P2˂[ ��k0vI ��@���"@e� �X+�ܗ�-�)�/ ��Mex0� /0*�`x�й/ `,��u" ��u�� �%�,�c�C Fx 0�D1�,��Y���M"I$���,���Z�9�(�D�,K#P t 0���_�a���X ��8�%�� ��<�G�h��>p' ,8���hB��9e�|���>p' ,GS1Z�Ȅ �,8��r>�G@�`�^\��X��,���.X���Wd}��$ �bɆ�`'�]�@��� ���C���D � JjEH4 *�J��@����V�$��%�}�:�GX�$|�U6�> �@���ͰO�G j%l�%p��B6�.��`��1�B��'j%~E�50"B� Kt�" �@MX���1PS��h���,QS�MM�)X�٨���Z`+DF5K�gSSj ���` ���EH�@���pS��O�)ߧ�l�zaZ`+DF5K�gSSj �PFd#Al�@�.���9� �PS�Os-�"���%j���)5K|�% g����@j�: W,��� � 9�zVes�3r�Eȕ�"W�  a��e�]*���A�D�,��,=E�U���Q��P���R��� ڇ1�(����!rEc�#�a�e� ��^`9@�0�l� �h �rU�Je�P�D* 0�� ���Y� !!(�Q��d �a��0�����a,�0s��2�9 �#�e��T�*�� :D�M� Ƨ*@�R�`�F�wa�ADe0>��d�AD��� ����`|.:���̡^�� ���TA# $C0 �� fNv��A)�+`�bT��V1�Ĉ�BkA ������JO��%)����v���q��։� �B����U)$� R_����%�ZKRh-!)�+�;�|��CH��A_�RH ��&�֒hRˠaF��КV=�G�u �w��p[KkI4IA���ZZK������$Fi��9V@ ��]�NQh���(F�8#�9 =���H�I���%���R�p�f��C3b�J�fB�L>�bT� 1��"�BkIa�Xܱ�ko��@*��Z_�BR� �(T�PARP� )����ZMj4�h�ZӪG�h�أ���W �bki-�&)�cr[KkI4W����D�(��� 3� ��A�=�K�QF1*��q���|Ũ@bL ��~(�P��F�#$0�$��3T �0*`�a�b��t�=���E�8|ňЃqh�Q1*Fw�@bDJ�� {�ZP�P�' ԏ֒Z�@H �')l����k}eE�(P?Z *�J@)����ZBR�=Ia��פ@_�++(�&)��D�Z 3��ִ�Q<�(��k ���ׁ� �Ul-�%�$u`L�bki-��*��֒h�d�XU0h��v�;E�����H��C��P>�bT� 1&��B?�J(Ja# ��a@ΨI2C�� 3�R&F1*��]AI�� ���{����I���WV0P� *P � )����PAR`-I��$��2h�Ѡ%��U���D�G]�(���W �bki-�&)�cr[KkI4W����D�(��� 3� ��A�=�K�QF1*��q���|Ũ@bL ��~(�P��F�#$0�$��Q�d�J�fB�L>�bT� 1��"���[�(���z0���(F�8#�@����`n�@�C ��,P?n�@�' ��Pz��m�' ��Pz��m�' |�,@��MH��d��"JO07!��3�C���E��,`}�B&$ ��d��"JO�2Y�$���� �C���E��,`nB&$ �g.��ғn�(=Y��̅LHn@�' �Pz���Ȅ¤� YR&�h�E=��,p[@��V"b��[$�0)CW4\aR&��xz¤L ]CIB�-��d��"JO��P)��q[*�J@)�� T��Q��q$F�!r@z(F1*����m�C ��"�6�@!�&�`ј�R`��P)���H����T�PAR@IA ���� ���1&4��%�č1YIA��B#tKKPIA��B#t VPIA��B#tK QIA��B#t�2QIA��B#t��PIA��B#tK�PIA�ݲ ���1&�/�݂Z�H �Ƙ��@#t ^�FJ )�c�[���-x��%�č1�-x�F��@8�@R7�D���[���PIA�݂h�n� �H $qcLt ^��/�%�č1�-x$֒nKjYIA�AÌ-�5�z�&�=�Ho���f Wp[�+�%)�cr[�G��ִ�/c2��Ip��1J+ 4�̱�`�h��w�B PF1*��q���|Ũ@bL �E�%���R�p�f�ЃEc�J�fB�L>�bT� @1�2R�RHJ!(�%� �+P ����R��R7DŽ(�qsLvK��-.a (�qsLvK��-Ya (�qsLvK��-&d (�qsLvK��-�d (�qsLvK��-c (�qsLvK��-.b (�qsLv +P ��얼P#vK^p K@)��c�[�B��-y!-�0n��n� 5b����R7�d���[�B�XJa��ݒj�n� �c (�qsLvK^��%/H�%���1�-y�F얼�j��R7�d��T�Z�R�-��(�upLM3"������<�(��k(�2N 8�@P^n!(�`���� nY{����J�� �:&F����(��� 4� �B�=���Y f1.F�s������Ÿ �bT �eԏ%���R�!p��f���Ek�K�j¥L@�b\�@1�2���5��$���Y���(�q3<��HK������p@)Hp b�#P��fx�����I�`),� ��QX K( 8`@�b\�@1���A�GzX�'=l�%���;X K( 8`@�b\�@1���A�GzX�'=l�%��d���F����\YF�,��H��~��%`z҃KX8 ̙U0�z3rw��,��Hc�:@=�#P�J� ���R�X � �� �@z�h�p)4CM�� �Y���(�W�A���_삩`?�}] #𖶐}�zX ��Wd_y��AKa𖶐a�R<P#��@�a:�*��P������� @#:�IO����h�@ĂT� �`S� �V�R�`�� 0�:�'��F� p�)�t,�L�(���t@`��<8�XRP�@DV�0O)���5�&ª����eV]D�Y�,�+b ��5�b�D#`���>�Z�\�X�@i` ����DP���!��k�`�ܯ�+�@H�4����� h�� ��芐�\R�*P=�@:�`��@ ��*0�!+~��.�F ���/�@XА5KB��g�3W�tnCV d�!�Qh��@P�)�<�FS@��O*��,0�F��}�T��H�F_�Cl#����&Պ"�d#`@!�ܨ��S�d�A(�AY��H1�F0��Pn`|0�V����H ����y#5AHob@��5<�BP@� @0���B� �'�~�^� �n!��`n���Zt�7!��l!�C 0����3'/0�� � P@ A40$��܆I`,�����]0 ��%�w�3�q �!( � ���H���hG; np��xgP;0(`�@ P�f��|DP�|B��*�C��k0tAFa�L� @CD�� .�fJP�"8��P�`8��U�� >(7@>6�K� P�Z�G8t�O�#@�M��׀�x.��1![TH v�����_ .�� �% ��=�_��@�E���_���I��`�����aB�|1h����\G�����,���a����H�J��G���_hd0��@�h�`��6@� �m� >2X #� m� p��0t�b�,�s�?�6@@ ��2@KD+��� �Ac������ � �@l&��AL�����\x� � � : �� 0E"���~�G)�7a4���'�n��ea����|�G~� T�}�"B` a{ � ���S�q�\��+���;�'��Tp��a��Cpu� A�@L�)@�@:�\� R���-��#�@��n f�p�B���� � �ֲ}1t���� 4�������������p K :� .�jm���@_h�j�K�~����BzX �~��@��M=���!������0sIXCHK�~���@LA0�?pI��D�K "PB����Rx o��ш�@ C�pԐ�Q�b¸IG�~��0Ԅ�hg*���!��%�Oa) ��!�@�1 ���+��Ā��a�#@ F �q3<����( �3 ������/� �7H.���#ѿ�@8 G�h�u� ԑ:Z1ڠ��upzH `� �����b�(m@+֑6X�h��$��h^�+F%�� �đ�a�/m�b�ъ������3Ġt�#`�4���t�zI@$Ġ����&��x �SB^hN�� @��� ����G�}���P *Q=G�H���)H)Ӡ+�T�z����G��F��Gh8*�@, �������q����S��� ;bG����u��#q�8���ԁ#c$�������k@�h$F$���JP�Q1�W�(�X+��Qࣞ�JT��� |4#@�@%���#!xői�D��T jB5�G���>��G�+�������1G�Hp���>!A%��TS^�~���؄��-p��`IPI� |4#8`W�xI����j:-����de��`���� K��`��G��c ;d���Av[�y �!��.��,�1B��茼���,�1\`���Ȁ��,�g���p�Y"� !��� �4�hjB�(""=B�s0��)�����$�b@ >� ���y�n0�`�9F@dY��<�0Y9 �,k1\��}��d@�� D�� �Y8 ] BI K�K�A���Yh?�F��Y8f� � p��@]�"�̅�MX~��N@]� � 5@@I��!�`�y>�� �YA0'�`���@u83g���pHBO!��6�� �md � �n� @V3g��@u8�v�IA@K?pW���+��` K, �<3�"�� 4�B8.���]�2ۄ�)�fW,���&$��p m��t$���F �]!�Ϯ�?��� a���)�t�'vE�GG�� �+Ѝ �gWH �+ڄ�9@� ���Vp��j�(�cU�1�-8�6�+�îh�F�]!E���%�@���Į��/���S�]Lp��fWH ~�� ��w"�I2\�� ��# v��)�B� �$rʲ�"`W$ �S���"�$ �SH���I��H6Hc��"`WH���+D���9�� �%@Nዻ��@%�A��`W�h`��)-�ĊX�A����"� OH@�HՀ]0KU�؏��?pT�2x�� ��� �� � �,Њ�@�A ����f ��@0���|��9�Bs�@��!�C���<�&�Y�,\ �?B�����<.@Aw0 �>��PO@���x��scaA|<�� 0.� Ԅ�� "�����Y���`P �6�*�A�y�I�E� hg�� l��K�ABt�.���`J�HtЭ(H���IJ��6T d�̃��+,�l�?B20��AE�GB�P�c� �!�=�'f�` ����cP $41.A��&,c�GpE�@�I��K�gbH��y�:�R+��Qj��x�����@�^-�'�(��L�� "�]Pu�nh!R��BC�^h!i��HU X����ПVh�B��F@�y�K���CB����H� ��t ����!��a2n&�8��!�ݏ�b�A0�d�E� ��� �<���@�riCҖ�B�7�!����'p! �z� |�B�!�H] �`H��G ]1p�~ �ꌘ"H�ҐjK��}�)0� ���x � @�`��GH�EF�%\�[Ro��E"M�ܢ�v���t ��!��\� �`H�?�&8Đ��O���08D� ����?�F�(�C��\�|*.2 I:��0�%�C ��f�.@ ��E ��"�,�N� �R�# ."�8Y��� ��EB��� ��E!\�`p!��j� \�`p�M�4� ���(i�D���fJ�a(i���: \�?�'��`Hp!n���4L�82鴎�E� �` �0 � \�pt� l��@ �-D= �@Գ2�$" �`e ��9 V&"E$��!�?��E��"��.���$�_�`H�Ű�b��`��w� `� �K 2`���� 6�~AGx(�6��2�s�C��p�;t:$�Qx(�#L0�D�$aA�����y�:`"����P��D�`���\��,\�Sh#����&E�H��<<��0�~Af� ��|���Hᡔ� �P$�Qx(u�#L0����C�`�����P&X� E�L��RzIGx(, ���� l�{(u`�����P��_x(�@�L��RJ�`�@̜)�>K��`�/��3s��{(���( �AS� h@B$�C� �І��J�,� ����/�)��/<�_�KD�.���� F�*�C� �"U� 6�m�,ᡔ��Y��C�%��/<����/�%t�"�BC*ħ���$D���R��C� ��]"��C)�蒿�P~�.�l�ЈO��tI�� � �����/�%�D���R��C� ��A"��_x(���X�f�.��%��E�ɣ�l$�g鿛 9@���� 3$�D�����-��!�c�eZaa#]�.8�8�FJ�\�9o\56�(`$d�+&����@)���p,& 6�)8@�ȣ����p(�f8L�/@^u����1�2-����.SB`#%O.ٜ7�F�t��$D�����$�r ?q/��O4��M8g�� A�f �����-� {�� �&4 L#m$đč��S���V&QiF!���I~���qn� ��� �Ƈ1���k6Hș� �8nS��q_`|�`A+p���v�L� �&�8� |�:R � �1���`0���������q_ U �/� ��$ 徤��J�/��aZ��W+Qďu�H)�"����_  � ��k(���@cF�&���lX"x���D� �k6��2Qa���)v�LT�b6���&0 �H%!�]��k6�, ~���8�mp����LUp�/@�?@4���k~�4�dO(L2�@�g�F���z����� BA��~��?�&0 �<2��"?�I���F; N�p 0 �� &A ,|s�@���@ ?p*H2�Jx$c� *�9 �;� p��L9@|�'�5����a p$�����|RA��)`O ����@�����"�H��1��� �% ,� �]����>`�ؔ3�K.����H�bS���a ɦx��D5�c+m�ؔ��y������H��`S���x{,`�8`S�ȅ� ��0��� �����,��p���P�lt�+�� ��Ia%��F����`; $#�Jp!�Ҧ�O�6lJx�~�(��l�B�� ��2(�s�<@��A_�K� `gЗX����$I>p�x� � �� ��Bޝ�C0p�&��G�� X�� !+� p�i�4� p��g�/N�J�$�^�% m0$���P�� @ �":�m$��י!�/���t1DH<��$��p�I�%�T�4����&�\\N�� ���T-�_ 4I�` ԁj���I�& �)n{�?x'&�$)��q��Ѐ%�����D�LCxs����c�̓8!��� �K�D�a ���p�����|0�%P� �$��@�]8%�_ ~�%P(I����ZA+� �x������ �x���A�]�`$�%�P����� x��0�@+� ����%�;PR��%,���Z� F` p}@<N,  �-h �(B� .a ���[���{u0���R�1II��}#p�j�0&<� k�`�)����\���@p K wP���J���%,�V�@��`H���[�C �`��`f����; P#t�w@�V �+�A-�?�����*i��4���TKSIYD���K �� $h  �/X��wg1B삷�?"D8H+_���B�A8+i��/,��$`�D�V0�B�K�D�p�&��w0�8B�E����y���\ArJD�beS�V� �D�0� �@:����X���/p#n�"x7� ��U ���e��l��� S��h��f���&n`I��)�V� � �A�0����! �8��v~!0t��%-�`�vsI/ &a�������Dׇ0�!z��.����`Ya�� ���:K��+�+΅.��'hN�ٴF��q0���b�L� #dU��e@sX�2�l�,c���*0&�7���'�<P�����m0X�Sx�N�\�Y� ��� ��1���F �� ��� �] ��M! `�����&*�@���/n�I�1 �IJ� ��A��Y"����Vpn��B7�&�! E�y��04S x������B �(m&E@�$�� d���(&��L�ur� �y� ��@.� 0H6%�}26�R�>��$!�%ȀT��. 4INŃ̳�� �<��BCY&�H` I f�I��D`��� � �z��$|2���4F!�p��@8�I�$�/���=��&�̓� !��OQ� �p*|�$�;! �l���$��Ys���0 _��l�M�$�v#�D�ْ X�ȳ�A�|a�%��̎k>X�=_���C�$:������ � ����HP@E��H�%E�5`��t��5�� 0 @E�� ��$D�s�)�T�Vj��IF�� � �B  `0�x@0�;� ��,���W�و�,�q�� l��p!"�(t�0 ��' ���7�����3F����v��Y"� ���%�X�c|Pnxq!���BȀ�q!d� �B�2`׃K@�K���` ��1(�X�c H�P@\�0ͅ,�*�~�D�4�z�d�t*e[Z��0��B�A��'L�As�a��ǑGp����Kz*�"x��&�y�%���&� ph"8Ԓ b �� � @brT�D����\ 8 bBN��y�����L6���!@��KRJ�%��%B � ZA+h\b ��Q ��SX��)�Y���,�%��),Y�J��@��%���Sx K��Y�J� (Oa ��� ΃H.a �#���hOA<Y�d�PF�w���~�S���z�� t����,m���,X�@hm�t�S��@Ȃ�'D ��OA<Y�d�� �ap.)-pL�M� H��  "��:� �B*8�#"*.����^�MA���x�.�q��'DX�P �cQ�y��VJA���@PB����0��N�c�Ѕ�AZ��9n�� h�@T'u��Du��@��;�� r0`�`�Q���HDq�s�W��T �qԋQ�ƓBO�=)N��w����@4'��X�C@+@� �N1����+-�� �; {c�\R �&��It�Ql( B���fg�)*  $L.p��% $BL.� ���i��%9�sDP�F`��EhB�8 aD� �@��Ud�'���`5�y ;�����` ����~��,���)��a$�z� z|�$IJ|��!r�s��80����sDP�������I�Q �T)�+�b�#p�S,G�0E�h� -�X��0���T���*��)�r�b��ۣW�0P�*�T ��T�X!B� ��D���\� ���oPA@\� .�� �\�w�#@�@G�����#P�����|�� JH�! �d"L. r�Ia�������X!T� p�B���X��D'UX��QK�q�!���D�@%�0nm���'hH&� 4��ԐRhH�!5$А �%P�!5�6АOC� �!����x�� ���0 �7�6I� p&� B@c�L L���6�����7� �Ѧ�$�$�����6@C� @�ؕ�!���]� b�� � �Jm�d Di`Z��spTaݕK"L�TpƀPa�@��`�S(N03cb��" �@Ih�P���v��M�L��E����O t�e� ��h �-,m@1h��R2tZ&P���m  `~�H?j �A"~g7F ̴%@"~� �f�-0�~�73��$����Z8� �q3Ӹ%P�f��0�~ghp K@�1�fڸ�i:`��4+g�\0�c8�� L`l�S�p��*p K`ܴ0�Q�,���L� �Qi8��Ȳ��CJӀMR4m�5�&�h�Q�iG��%>���h���i���0���h�̣iJ��-%���h��iL�� ����h��iN��%FFӠM{J4��Ѵ�FӲM�c4���4�FӠM;|4ͅѴ�DӤM�J4�*Ѵ�DӬM�J4 +ѴE��M�i4-+�4 LӴM�J4�+u%�敎M�J4 ,Ѵ�GӚ��za6 �٨ e�b���a6*,���d�’��Qa�,٨�4�lTX*K6*,�0�d���Y�Qa���%�h�� K� �٨�4�Ғ� Kj�F���d����"o6�F٨�f����RjD�F�%U�l�R�Q?��(�W�lT[�Qn�F���d��S�QU���(>f����rr6�-�(�d�j��jj6*.�%5�l�\rj6ʆ٨�f�꘍j}6�.�(�t�lT]�Q��F�>�l�]�Q��٨�d���ƳQ��F�%�f���KL�F]��d�����K6�/٨f� ��z~6�/�(f����QO0٨'��lԓ�a6��&��̛�zr��F=��f����L6�0�(;f�ʒ�*L6�0e;e���L6��٨��lTb�Q�Ŧ٨lg���b�Q=�F-&ŘlTc�QP�F�0��l�Y�Q��F=&�ld L6��٨�f�����L6���(�f�Қ��w6*��(Pg�B���LBl2�(�$�f���LB��(�d�6���L6�2٨�d�"H�SL6*� 1ŕ0���J��Fm��d��f�Q��3٨�f���r16��1U�l�3b6J��(!e����Q^�3�(�f�Л��L6jXV55,ᎍ���F K�f��e��Q�2��(�lT �Q��F )�f�D��M6�4٨�d�N���Q6�٨l�LS�CbQn�E���PS�KMQN5E���:_� ��.�%�(g�jkjM��5�����ZljM��5��t�Z�kM��5ͦ�D�Z��kMJ�5��T�Z�kMj�5٦֔�ZS}kM��5�֔�Z��kM��5���ěZ�zkML�5�&���Z�o�t�ɉ�&<֚�Zkz� ���Ԛ�\k�z� 8��<֚�SkN�����Ԛ�SqjM1�5��t�ZrjMɩ5����Z�rjM˩51��ԜZ�sjMϩ5�>(֚�Xk|� :���Ԛ�Sk2r�I����Ԛ�]k�N���&)֚�Sk�N��H��)֚nMש5Q�֔�Zv�b��ʵ��d�ZӽkMک5m��ĝZ�NkM����+���Xw�b�=q�����S�kO��=������ӆjO�=u��D�ړ�kOe�=u��4��SkO��=y������jO �=y���BT{rc�ID�'�֞�X{� #�=���D��S�jO&�=���t���jO)�=q����T[Q,J���0֢�������ɱ'~��~��K���=���Bך�O X�bdYt@1*F���5��hڒ j��X�QR��e%�Ȳ�����Q �$��0�� ��p�bE�t_�l��p����y�!Ԉ� GB��Z!4̒�p8@ P ��(��n@ �(.a�B+ ke������KXma 0�%p��HXma �p��ѓ a ܇%�A��Qh F�(��%���X+ a*#p� G�-耽���Z�Vo�0��`��Q0G�>,qڂ� a)���rx��B�Q G�>h��s n���F�*�����F�8�F��,L�b����A���B� &`1|B��)`��@΅Q�����&��Nj���:<� \ ��r K��.��� (��� z �1�Ā&�@�!��Ĩ%@PrGA�Vz Ҁ.�Ā�`��(4���R�J�((F�(� �@)���G0qRA)X0��.���b�G4Z@ �A*0*F)"�V�" (��� �C�h��yl€�� ��~`�l^A+�� @¨F���#�)2*@~0t��""�*�� �Z� p��@n �3�L.@C��vT� t�� �G��Q�V��sMZ�Eh����УJA�! � "T7��@+��m� ~A�B*�=�~�7��.H�������p%��� ^\�O�/z����_����?�¼D�"[��/fF5X�y����A@�A��=>F@sP��# ^"�u�ؚ���A@h��X}`�'! �A@(��� ����A'���'"����p��'������_�.8�H��� ����?�D�e���X<^���s��t8 bp/��pjAq`������4E��\#��K5�/{��pQ��^(0��(��` q�;*�K�=�.@�?^������d�lP �����s���c D��@�� I��10(L�!�L��<Ac�5h�i��� 0�p��n-��q���@���d��� ��~���X��[ 2bC\C�ւ �_���n`Jj �jb����aI!�@jP� C��Cp�_P�@�P�<—�^y�CеPd���"�y�A�$`/0$E��Kb�/n-Ȉ yP@�"�G@�1�Ń<���/�`�0$Ev �[ 2$�|��R�0�@�]��r.�!��G6�C`t�#(9ՠ����_.2p��!�����<x�/�e��1 2ƹ�k�#K��]Pr�H�/8� �K�t�qk:��-L���BȆ4PrZ�/����r�@ 0P�8�n�+���nPr�Q1- 삒�T5h�H�e�Laa#]�.8�.3I�0� � �ԣ8A_8� .�|��A>��@ `� X���� ��|��@pdA����s�>����t ���@p,a ��� ��Q�G��|C>��� �@�!� �h�_���BV`�!\aZ��1�C�!uw�����K]�0>4�y1�0, H]M��R��G��T`9<�@@��b��j��ȡ1� � ROx�����e�K��S\�5�b��h�@ �<'�b�(U,�Ah� �,\�#p�TzX �.J�S��6 �)���`\�S �����D_� ��p��T��0:!'�Bf�@��`ΰW2t��!�:L�֓t�ʜi��L�����p%8�(�!��sf �����P �.C �q3���!'L���JH�"�*AY ��K@3+�� �8gX�#���,9�`/@�r%���pW�C!b�4@��`= � �V�- �a�!A!xKo�J�+&�ĕ����%�K�؄�RTP��Q�@�M��z�\a=Ig�4@W���\I:s����t�J�@ p� ��RS�h�}�� v���� ^2� @� @@���`p��� ��RS�D|"2�8A% ��&�6�i�%��?�.��A;h��,K�LGh�}�ҀK�i���:P,@@.���+r�lA.q����Y2� ^� �+x��R$` ���\@.9W`p�9��; 4gҜcH3�� �%A;�\���'����}���`�ǁ ��sö���Jm�CV�*�p�G��,�Kr ��R{7��]2U4�n�e�,���K�BYX V�J���P4���- ea1X��P4�@Y�%ÄJi� �76翥RW`pj1u�Ap 4�(��`\��%�$ D�fH��!��%t/�н\�K�n.�{t�J��fH��^.���D�f� �ʭ`+ڠ�Vm�Ȏ[�E�Jѽ�P4��� �$ ؃�Bp ǁ����7r�=S�$ ���p�ZP��%��L��:p�"# L��,X1�+�!7� 6,�b�J �%��lBX� jD3�5D�=�`�螞�Q@(ׯ�=@@t��D��D@8?�;��0@ �-! B @ �!�0�@ (A�!�� P���@H/� @��:����  %` ��?x'!���V�����~�. @��0tA>��]� @@>�`Li)0��T>fA�b0�B ���,H'`؁`{�Hb�1` `��-5N���R "��"\���R�!�"� ��EH�-u��` "> 1S��8�� �� `�/� B �@C@ �H�p��ԋx*i  �]0����;Sh ,���!��9* s�z���� P�a)���BzYA���r�Sh�W��_�*Ԕ�jJ|��@��! ����x��>P����@���@ 1����a� 1 �M� ]aI�!�#�@�0 d ���)R��`d1��*������/��Vp[�/�hQD�@0�4� �*����`��*��,y� p�gTKk�H��0�`��p�D'(:`pl���9�����cpl��I�@@`Ka0�0��X �D����L`���r� �/(,�"l$V!,K� �� ���QfL"G�%I,H4� l2P\H�9ۥ�Ă��)DN,�d8�C�K�T��N��@J$�#+'@-�����D@�j���"�)z���,P X� D�1>`h��:�� ��ߙ�``��� '�Hɕ��:P6}�,�ȊZ ,�.��3�# � ���P�9!�@�\���ˮ��"��� .BqX�g���T rb� Qۅ ��p��BH"'eP.B� e�"(2�R��Aۅ ԁ�pR��!#�"(�2� x��P��L.A0�'�!��K�(�>pyJn`!��%8��tOD2(�q��� ���>�q8��8��K��(��R�O!P��p ��%�S����)��k�IG6��J�.��'��% � �T �k�,�K�$.�|P����K@a0pс¸d .����P �t�q+B�Cq >�%7����! >_ 8h 4܅�pN�q �@\�]Ba"�����>u t�%�: �=�K��t��k�`�@*p����R}�� �B�H�0�� Z�)����w�A`��O͔��-����`��H��4�S�0k*�P ۂ�;��*0��q��V`L R��K����q8��8��'�(Y#9$@�+y1��e` 8��*� GRq��! � �A:8����tp b �����1�O9 � ���08 7H������c �T�2�'�(�1H��!�@a " p X8`<����?�x����0uPC�A0���@ݓ�08�1@ �c���0��8�tp �08��Cݓ�08�Cm�S�B��`P�C3 ������0@+x��|��w�V�p���[Zh ���}���CIx� �H�#ޅd��l,8��]�p��1� �������@I�p�͒w!@(h�$�ߵ�I�@BA{$!�-�\�k&�� ��D�� �`�j�q�X�>�@�Q �O�*� �� tK�߬�c�o8B,�K`�8�%�oV@�� @4�(2Da d�>�!p�P.����wڽ� t�� � 4#@TH1\� p���@��+�p*pM�T� F#�nk�5\���~��8*������Jz��!������p�@��]���Q�o5� �ڑ��R��� �����`��؏ڑ#���k ��q��R;8H�5}�ׄl"�jGId�–!`���A� �� �jE&ȄR�D[AzX G����`��ڠ"T�`)��a��ڠ"Tr� �������`*�MU��R��~���#�T<�P� �\ ��VS9X��v��244# *°��T�p�� pT�G�8*��vP�a�6L`p�D��E��L`,m��X:���}�N�����b�z �@� �%�N�6� �m�N��:=� �,@����@h�SHH�S0�)�x���' �m�N���L��|W, �@$;=�j 0���]O��2� ��ŀ�� Q�9��p@I���X #�%J���.���r X ������l�p J� �p��P�J(�@4!OP"@)J2@3��2�rF`����J3�ʠ$(�a���cT? &�)1�@�� � �� �b��� aS9�/�e��p�� �[���.X�a|�������Y’u��`8UI?% Fec` ���$�%p( ʆf9��#�6�[T ��"� 5�T"�*J:� �M p ��% q.^#�6�D�$ �M^�� :L�#� �2À�&f8$�M0@�@$�E��D�`��$ ��>8�`�$��� �� �(���)!����Q�/2o�]��B�� �C�" ����>� �P`S�]�7�� ��� ��/�7�$ �l�M�\ �A�L��+��]V�6��@' �` 6��ˎ"~�DG��Ц��2P���QLP�Y�M�`$�z�D�J �}�!�@�@xNl�������������D�@� ��>�l��N�|�_��D�@8B�M�y�2t�0\@0�V�\ P��pT�/��,���*�0&*����6����� tx�i�S�*��@̂��>�W�x_�hU� Ԁ+`@��~� ���.Z��p���� d��y6-�� `z� D@�]�`��p�-�hA����$������䊬? R��h�,���=�?����b P�Q-���`H� �2�$`�/(� 2����\�F 2��`�p����( �̑Q2J@�@>�`�X� �7@>2`��$��@�e  �$m�AP&,"E�%x���m�0Z��+%A\�)0WJB ��'|�]@D@�G3# ��1r `H%!p�� ��\�F@�@#� ����L�����`B  � �A00:@�D@0ʀe @�� W�8L �@ ,A��$r�&"@4p t�ñA ���C��b4��LD�9 �l�@@_8�"��� ��j�D|�����I'P��{}���D�h߫A4����� �  pKg� �8�S�l�A.�:pAG� `�Ȁ`�$�H�L�:p�Bq"�� `A� �����X��4h,vj�;�'j�6��䃖�X�Tci *� R��#�8��C%ة�PDT7Xb�A�;��B��_�� m0.C[���V� m�:Ec�S���|1 �E�@1����@@c��f1��as$�2�� p��@ u2�I�?�p}���f1\d��@;�@�d���]X � 0`��f!J���C�&��H��; ��Q�F)�"���*QJT��@��Ah��"�!�U `�B#� ���w�M�$�B���J|��@��� !����$�>1� ��������g ��M@E9e��pT�@I8e���L�:( P rT�N�%ǁ �r��0���8���ª��0�G�v�uqTt�qXU��U�a���A�F{$�q�� �:)�)\������RgH������@ሂ+�%���x �l��o�8�@5^r�@�+8.�(`2��7d�(� W������h�A�� �] @ ��� =,�� ��R�������R�"F�p�! ���>�Q�,8P\�.��~,�� ba��V��ch ��0��� �`���18�" Ja�)� $� 0� C��}�Z�>���h0��( H� �#Q�`�dy ��O�����X��"m��A`�u@!���@�%u��d0@(�\P�%�` �@Wu @�@�@@�q@�%`���W��@��U]P#Bh���%�"R#Bh���|��>���|�� �Fp�����.� Hp&��7�F�g�o�>����G���B�N0Q��[8��<^�|���!��ߓ�$���G�Y��R���ܙ��{�:�@�."@L� ,�4�k���� D�a�!@�A � ��U�@@ȃ 8�Q%�V9&�=���"@�ļ 4$c0���h 8����pJ h�����h8�����¾��- b�y��@Y� L �#@�闹# �+"��@Ddk��5 �(�X��.dZ��r�� �8�l0����V<��bH��8`L Ppz�X�{Q���2��������C�� �<1!&�Pp��e��J�$@�!DB��v�*��G�0@�� �`�*4Ī�Q��I���HЃL�>$�4�#h�e���y� H��؁F�"�-�� ��g4��`V����6Y�I`�D��16Y��, L�`!8��ja"��PD&9�k�� ZA���`@+��X*pq���i�F�N��z@+��X�V R�H���,�hT�┆EAT����� C`s �8�� C`;x�0�����cp� �� ��` �W0� ��]u�06'���"�F� ��!��!`p@T� iW�H(y$��P�Oe��S@[T��}�"�G�2pN�8@e:�# T&�UF�"��#yt]�A��� h�WH0"� @L0�@��9@L��X%�0v�*� 0�} �A,�����}���H�@D�01l@�8=i`��ӓ<@p�m���m�Wi�"~1�9.�E��_Uk����d�B� �\� =�E� �\�|��ha@�| � ��@F2�m W| 0��X �A8�U�@@ ����� �AV; �����,$ ����(0"BDH $D$� 8 G� p�$@�08`���p@��� pw����@ �C����S*��m�$&��� ��`� �20$��W �8Y�� � ��1 $ �@H0$��@H $�� ����~ �H"�~8���BzX A�PB�� 2�;LApp���҃H��Lb?h ��a)����>��*�a)�����"�LD�O�, �D��{ 5���*0 a@@��F`����%��`t�.�0�n�"�A�~���>��`��!3�>86�`�}�ʁ9x� p�2�D@��� "��}���>�r�E,�]P��l �(�� d���`��r`J@�(��A��Qbݱ��`�~�@ @q @$� (@QHP(F h�A@��$�� ��� d�'�)��`� ����+��t0l�O� P`� @$˪ ���' �%?� <�V8`���`A�:@z�~ ���C$� ������R T�2�0*F�!=��B��� � ��Rx|���'���+x�u�H1���%8 ���Pk3O 0 ��(�|���b ��*PkA�@� 8��!X�@���+�|`:�GA!(�1 �BP A!�r���@82=� T��!X>0����a�H "`G����Q@�C�q.�P�8���'�ߘ� P-��Q���8?���hDX��� � h��h��?�*��;��� �vL?�) �e��ĀI��`ԂH�BC@���}(�(ܡ��ր���"�K�J�����p��H+`�u�M$e:�&bGp_��V:@CjjuIYxzo��[�ӀK�7��u`�1��M|=�LC"�4`��MĎ��?\���z�U�J�jZi�i5؈@�VK;J��W �@)���&�2SF��@)@(�N���Q�V���sT��B �$ȑ��R�&�{c!# G��X�����pv���X��츝p^���9*�$� �Ύ� ����UA�A��������v�ήp;g��L�E`�4xe�@�]��N0! W�D�6�.��)� `[�  z��Lq;��[q����A� l5��Qѭj@p;��%� s@@�`� ��)x�Z8�!B20> d ��6F!|-�x���` � � YCC��[�x2��> !ct������s`(�/p�@�� �p�#[�U��`����O $��L [V?�HP U���� �f؝P�@I����d�g ,�1��oV1���pE���-H�Q U�B��$ �[�X@$$���)&� η ��˭ M2)0ES�1���5�V!@|��)��x�b.$��&�U���)7awB@t; ���L�B�P��[�q���s�S|�`wB�������� ��*PL� �ev'`��)B�� ������ _os����d�+�*O1'T��U0v'`���y�k��f���o0E�,��� ��UXe���AB�5St���)L���!�n6̘`7?H� �&���p�M*��<��7��  �K$������p�i�͍!��n��W���� .���6��6���LO0�q�a�D��C*����[�LO0`HR��H���@�H \ !0 ĀH� ��n��+ � �d�5�03Ā���B@��D� TYc-���"���.��;�;��؂�x6} �ع�� �9p#����epNp7N�+����2��P(HFt�_��ވ��t@} ��\�+Ds˂���l���!�Ug8 �(|�)�]G�@���p>�Q��%��[f�n�) W���S��N�(W�Ʊ9�}�D�\q WL�/%O��&_��+�!W����Jl|A �BW� b*&��r�!pLu�*�L���SM�ir��@�&R�L����2@680M� �/� �1@��0��hD���.K �1\&(F+��B�hD�&��3�eG�� ���� �@%$�~p�p��� lp) ��+�W���a)��vŃbZ &)P�+1��X �a)P�:�~ �!, nP���sW�N$��w%��U� � $����ː��!�G$@�p �a ȅ|jH���.�0\‚ C���Hl��t�3�N G$�WCB?D`G"��W�@$�+0 r�"+�=�����4�� ����@���+d�@�@ ,B�1�"���9 �A �A D�`�܀p�� ;hL��v2ڠ mr����-�- !�2�`020R!7@$p�0��O(�`��E��J �@�2���J�P�t��9=�*^-���\B�D��%�8&�A��p@��&�A��p@?�8&�A��p :��0� �Ut0�1L"�x�)�d�a�+�2�"[�l#L"�x�&[ĸaī+�]�$2�WۅN�0� �� X�BQՁ �H(�b�N��*����@60��R�r�-@��R�#=\�����K`)$�V@�!I�~`������x =�����B��\��# fAM!�����Ф+c�F��� �CIK�䲤p�J.K G%�%Ce� ��0=Z�~�\�z�U/�e�n �?9���,�)�d�LP�+�z�.�uK ��ь��;&�d��e�-Y%�Ė��UbKV�*W��r�-`\�*�c �-�z�U/�e�n �?9���,�)�d�LP�+�z�.�uK ��ь��;&�d��e�-Y%�Ė��UbKV�*W��r�-�BF4=Z����3b�P� ����h�z� KA=��0��,��\n� 2� (B������.@��4B�l� 7 u�0]P�_�Ƞ �w ��'GB��'0�@[� N�0�n�'���D��S��A���5�<+�\�H �O�h��!�]PjH�0�#���>` b@@>:��?8��}p$@@K�� �q$��b��w�V��� 3�^"�y @�%�l�\P� �&������ �^)�&� �!�$� 4A9�l��>�K�t�� �O�� �ЫkHp[��B���V�+��D' ��;B]�c' ��P "��@7 ]��nL!-A�MP4�}zu�G� @�i ��=�0�'�%�p�K 8 $�l�=M� ��&���hn�^L( � ���]�\�| ���:�^��A�in���'���^Mp<�%j4t���|�nxYaZ�H���7Ø䈣�mi��0@�E#��+��C �`p>��Q� ��a��$�� �PP���T ܌-�"\���m ��CtH7c ������l[�E8���v���,WLh�\�� ����I�e�7�9 ����F`�P��-��l�l�U�Y�W2��i�fl�# ��ԸT�PB�/p�[�z\�~d���ߒ T6�I*��r ȂoI�÷��Rj��� f  ���� ��� B�=��w�� ̔r���8&� �# ^�\�Cـ'+��S�9XPB���WK��`��(�,A��8~�4��R�� ��/H��"��)(��/�Ã(�%����8�"��% �( �b#��4��� u��i�.�e ��)y.��LR@��L���Z&��W.�G��9M����+7SlL�/x��4�����M�/x��r�f������qbC����s�&_� �<�,L�t�-SX�L�s\f�"re�L���F^��W�j�LIR��8 rEl|�^��l䂳�� c��G���+62]���'6�����{�F.�d���Q > `���nҀK� ^=(�M�Q����p�b�Hi@&�—�dB0�A0$�` ���hF@x'!����Ѓ�r_`_���H���8 ��4h�4��F>�!3H�|P�P�f�1|���!���P*�>�`��W�)xӠ\�pJ��x�?rjEؐ5 ��gS�@ ����D�@5�'�?1�C (����v�B (�V�Z�)ʀ�M� М�S+������h�@�W�D�1�=�g&A ȰV� ��4�W�\La]���T�RDX��`|���`b�T�P�D�� o��/�����F |�Z` � Ӡ�� ���S(���&4��+rȀW�����2@c����N� ��p >E� !T�pp�S�_ |kSBB��8a^�saq�> ��y��@ B�� _�)����B>�(�O�~���Q��+�P0�:���_��j@ ��+�u� j��9CW�8� 2�p6���/ r�r�5� Ĺ}aH���}��lXB�I/��/�,��� ���`j@�q���{:�&p�����A �:C���j��Ճ�Tj�S� �<��T�jp?�eH�+�Lh�Y ����������p@��` �p���M# oG*�m$"T!��� �� )�iè)_@ԗ�w�H��#�C��^�� �gn�U�Ncb �]�!M ��� `�!`1��� Ka� � AX0 F@�݂[��*��P ���R0_@�ܒJ���-&D�!]����y fg�RP b�( ; $#�H��� �`-�t�n�-F@)�AJHM�nq K0��U���R8�����ܲp0J��RBjzp��b�[�������-` RBjz�n�1*?��0�0=�e,�AJHM��-�CP�ҠpB�i��0�2n�:%$�(���pX�.� B��\BPn7�`���2nV����!��q��A7�Q�A:���2sf�c�Ǩ� C�-��1*?G0qBéH� +CP��AQVhu6#�O�����@t�� �X_�ba����g��ݳ{v���=�g3_ݳAT�: �X_�ba����g�'���0�h���!Gz\�W0�d���7�d��� 8 h�1@������� ݳA�L��=��� ݳAt���=�g��ݳ{v���=�g��~�U@tOs� �_u%ݳ{v���=�g��ݳ{6���u���0ݳ{v��� �_����S+�,r�g��ݳ{ �D�d"�8 ������F�x +� ����ABW`]$[b�#t�� FBTS��3t*Q=i��5�jV�Q�?�a9�i�V�Y�u���1��`W@�@��Ѱ� 28*$�J�B �����U��b�X]a �0bA�`��#Aa�f0 �q斀�!(�f�q3$�1!(�f��IP��7e� �q3� C7�I��2n��e�p� G\�/� ��xT*�Q�? ��T�XA�� <*��|4�:�w��p8�A��̶(�d ���j� $�+լ�5��6�Id�џPAV�Q�?�a���2R� <* `�Cxn�8 7s ��&y.�pF�|O�UD.@%� aD���0���F p ( y�K�b�@�f.`��l@0f�@/L��!̨�.fu`�� ���0� �k �,a+���F��d rp�D��� Sp�e�)�@�����d #�5�( _#�4�%���K� ~�`������",�/�.��Yb�|� �B��p���8�L�%��2����y \��0�3 d�:�%2E���d #�ڂ�_���m�p����:A0'���:A �AA��O�!�, �Q� :����;��k�"��U@Di •�2P�@Hu@!�CbH�@�H� ԁQr�@�HN��A'�ZA�pQd�E�W"�/i�"ʰ� "�h #� �/� ��h.����B � !�E���+6 <�9t`��p��Q8 G!�E���"\-�%���ВZBKh -�%����ZBKj -�%����ZBKh -�%����ZBKh -�%����ZBKh -�%r ��4��]t��p�Q"���HN��A'�F��t M*[a�f[ ir8�����)�"�-M�c+���� � �I�b,�� K����`H�F�|�4��ҤB�Y�|� �BҤ�u M�J9� \�HF.�$�/� �4i2d�����Ҥ �\�#�,0�����cOd� ���smA{ ��7��`?�},���@�[..M����Y7\ h0��� '�"X�p����� �LT�5� i�dԁ4`2���)8�"(3��p��-�@����o��8@{�@�!�'��'<6� |��-��<�%\��a=I@����pD T@Pr��sfΰ���+@�̙$�s@����p�1g�� \�� 0gt@tp����@J���3s�����2g �!%:@9�V�ʒo�����VA�"Y "ԁ0 B�`����� �@ 7��"�p1a�A,d� D `��2P�a ͡K�� s�@PY!��� D�l��<��� Ј��@.��(p @o"��v ����l"K\XH .(8�"@�\�f; ���K�tC}� "@7�vyD�BV�`�#�@�� G�!+� ��Q�lp`O�8�����A<է�T�f�R�f�̦�f�R��膣��hF���Y)����C}�l�Y)EP6�(���� x``��(`6{��@0��(`6{��� +� �@�.�1HF�$p�a�IȰk€�AH��g�}ݳ{ο��=wM���Sl�,�) �����@���l�,��q���S� I�pr� �‘� )�@�$(�� ��@�Ka Ŀ�y�D�"��0&W`��$���Z8� �:�cʸ�~t6�LOgS<���.�x�!y�YF����7��Y8f�aaʸ�~Z�%����0e�p��@�YK ��>Ħ�4e� �q#6[��.Al�P�`!���p=�:�XKb�qAE�,��`"h��X%� �,D�biX%�uf!bh��C�`�8@#����4 ����@�X�`$b�:(��`"$��$ �P�RL�Dp`�$� �X��B�P � �ky�`x � ���A�X@�  !;Ь:�F�B�4�,�?p.�Y>���A@혂��%�@��RK9�$��!�@혂��,��$���%��|�)H��ܘ�\�@8PS����<�a Rj�j���c P;� �)8+T��4rd��04>pu��1s���CH�g����Y:+z�] �G+p; a��]� dX+���.�ǻ` x�O���`pK�;� p�+p��*�Y ������8 �� @�`���H/�Eb�g�,.�>��54��@� �l �8b9�B �p���]����Xb\PA��.�`�"��:L�A���,D b�;rJ��t ) �% V������$�0�}E�����@��"�:�gK� *�=�> ����`U���@xf��$L���B����0 �@�� tIptk'���;@�0[�"�p�$;7P6�u @��agTH���z� X�� �F�I�~VXXڠͅ��� DX m.,��6� RMX m.,��6�DX�����1p RM�i ⯔�6w �܁`v��������'�����9�!SXhs ؑ%`(K� :$��3�Yڀ���T���5 =C��� ‚�#: �����B��mN,�9�pT�afGeQؑ�bG�CXxm.�@;���*Q=@k�;���H���H����6�͉�6'�L o.��6'��#Г��X���\ wr��;"�DX �A/�;d2��hP �ǎ��p� ���Aؑ17�mN,�9�@~7�#��@��|��0 � � 6���&t�:P#0��1l�Bh��.0��O6�*A�m�4�J�mATd�B����pd�J@��_ ����.0 @%l���pT/����Ȁ`�������t�)�����J�#8& @PA ��9Z_0Kt���WA�3P�c���\F K ���) T��Z���, �1P�C f��hn�d������$�;p���?`a����:���-F�̒v�����?�$�[ ~��#@ڀ��Ir����$ �9m���$� �V��M���?�D�lP�I4����`�h�N�+ ���w��Ix� |D��n$�0t�F&D�(L � ڡ��������7Z� P֣Fy�0�J�A.-r� ����7�`h�/@������4̈́���D��t ��i� 4c�D�>D"� ����D�K�� ��c].j� ���"��1qa�1�(皖�Ph��0pZ@�}�UH��W�,8- @�>�* $���&� $�3��/�(H��� 8Ge��Hh_$ @�H�5k*W����H��jN�Y3�T� �XV���*f�` ��V�-����\aTB,XT�̙$@��}o � �A, ��A��` �Ɉ���U�'bAm�s� �"d�s& ��e��]��c�$��0X�2 � �@VA�� � P�Q40eA��� �e0�x,)�'؆��B�{\�8����(�{\`{<-0�e�ps& ����zhP� ���~r�0� jQ�Q������Z~`"(�9��^�J$�ߜ���b�,������� ��v@/B;P&p>��"X��0�@蚉� � D���SRS0 �$e D����((`�D�p%8@�Z yCI Az������"(�����m@!\�6��P&� �@ D@(, �@��#�H%�)(���؄8#��0320 ad* �B��`BR���Z��|�g) ��`?8�R� @ � �1��/`�"�a N�e�@�q��0lA+�_�0ڂ�v ] ( !wH�@� Aa�#��9'AH��/Ѕ�IPB�3�!䎤#�@�a���8�T�Lh ����#�@�� #p}B�����Q��"�>���� `��2P,�5�e� ����D9�H�, k �(�����"��e�9�a ��PʀV�e��dP�/P�@���P�N � 3� p�2P��Ȁ @��!2H?` ��eP�P�̠ 8��PB�3�%!cLkP�A0@��� ���� T� ֨ֆ�f|��m8>R��6�p׬jQV�Fv��8.���o�B4+>�H� Ṕ�b�jm�k&֨ֆ�#b��m8>"�z݆�Z��m�kf�ن�Z�� �`�}���m �.� �#p�A�D d�tn��ŀO'.�AEb�X�.��@ ��E|��W ���s�AP��1T�@u�\- \�����@vAz`� ���o�Bc� K��,�����R��A����Cz }a)���T[zX X+=,���C��|.=����R�Z�a)d���˜I�5c�`�Lz @�����@z �c��$:,!���$�`�j� ��C0T%0�x��A<�� �`D�6�sW���@��.2]a�0�#` ���a��-D�F�W�.e�~��R�K\`�� 3xv tIAΦ�P�8Da�@"�u���v�!�*@'���3���=Gk���@3�� =G� �-R;��:G� �;��P�C �$��`��s`$YF��X�( ��8�@Pr���,ɒ�_�^�%m�A��$K�^�%�I6ɲ���"�i ��bLІw1&(ϡ t���4QH�s�9Ѕ��`C`�4�&��XPl @ @�G�͐����H�s&�9bN�_�$��|M¯, �a��2A��I��_�$(ز���f���p�``&��#�D� �+���� 0zt��6b��]�����%���X���=��݈��A�)�$� �:�T��XфT@x $@�%�ޱd�X@�%>p��� T�Ma#�E���A�b܀.<m0��BXXa�N>�r��SXa�k]�T G��?X]K����0͎�.7�V�����]�7��)L��� ��D��\�v�m>x ���!n����f��(��ivT� C܈��h�6�fa!,���p'����f+�܅�;���4{ �/,x- ǀG@@�1 �2@�A�2@�A�-�A8D _�Z�+B��� ��\#pBC@0;�1:4�FI�( 6��Q J�i� -A\ݠ�pl�1@�L� D�� 3�A�2@fN� d� ��Qf�(i%� �=2��ؒ�c�4�� 5#��{���@X � ąl���zH >b=,���B6�=�q�������R� ��x� �#��R� �3:0B*X8`�҃P� K!=��`?Bz���� ��҃ L:�ŵ �ZD�k!; $# px%L���� V��1 a)(�`p��q������@��p ��Vؑ�Q(��@DAOފ�0@�YRr�a�'Q 0{ŽHd�(���s�L�i3m��?i!`� 7]p�($h�+��RYz�>�V� ��}X�!��-���Yc�   �` ��"�; zҦ��0�1�d )�#|�00��`��!*{�œ��:� �X�pl���J��N���`�@�pu����@(�@�, y�1��C$ ������pL|@��#��@��U̓� "@��U�oy������$C�"z`.��CKl�-O2�:����1[ �90����$Cc m.��CKl�-O2�d����1[ �90����$C;D MR|�< ��$| 1�-O� �Qv����H�E b��ɓ�l�������� €P�-%�'k�,0y��E��Y���E���V1f�(g� ���ly������$| 1� "�-����Bh�E`��B����El�P,�B�,0���"�6S[ ��ҵ6�C����x8Ņ�",K��e!���� �D` ^�� E��( �!�% @�F�%X,��*�6�^���f��1� ���X /�*K�:,5-�b1�,5��4��S\�a!,��-KbX��#�B[��,��X��@[?�P ���x� y�@5���UCTA ;��p)H���'�@�@~8���N?�0 ׇZ!�l 4��9�Ȃ���B�ж@<9#�D5as%��TP �� 8��%� k"�^�ئ�j�n� hT b�P+�Q����� �*@�u��-p�+y�8�E5�G=�X�*�46aJ\ �@ .E�:#/0�� �%,�N����ն �j� ^`n� H,ƺ�����s+8�jXm�b�-�pp(N8#�O�\W�a+�Aڥ[�F���_-��j[AP(�w�u†����nh �6=!&v�]�4M�f/0?�.�a� y,8�0(7#�V�CP&m��uQ���)8�\�Wk��ll �[1�h#�X�톛�`)0�*����j��P����BK!����j�Y!\����@� �����JZg ��[���t���V|]�F5�Y0X�D8������Zy�`K��rȶ-w9`��`^y������y�nV�g�����}UA��dm�� p b)^�Nvv- ,���ڔ�V� �D*˩G/H��[X��u3?�͈�V`m��X��90_�]�� ��ˡ� l�)�I�y� "�B7K��Ͳ6\a$ h@�d4��3X��kms� ����:kK���E� u���@���m%d#�@U�\{ إ�v�H�W�p�L ˕�� V�>��\0���f}� ��͌�`x2��6=R=�L|�[��o���W=S��bm�g�6�n�"0 ]�%f�0��c(>.�`_�L�A� g�C���@��pA}p ���ym�������v:�М (ed6�C`m��4����?X[jA������� f��Mh�ڈ�$�[m���u��S�����n�6�v����-��*k��\��z�6���$`m �zN����k//�z"�EX[�0���C rrAv�f�m.� `�+&B���fW��`�Yv�n&�l����>�G �b"�C �����t��M1�,�ɉnB0�g�¶m� ���p34�W��̰1X�16�m� 0�� ZD.`�����g� ��&����D 7!����1�@`�~��$�"�a����8?@��G � /|B��0 JAb�'�d��Y>��� \�@b�'�e�$r;I�Ab�'a����Ԃ��D֓X�-#\ �쓅��D)���`�}�%PO@=�?��Ă��2\���,�X�I���3&�}�enŖ�'$,�IJO >��0:`��U|P�>���-$|�gab���!f��'���hPO����'�����PObI,�3>�?sI�Ib��D�Hԃ��@=k`p� ��z��2A=k ���+�C�*\��bF�8�f�0¡p=F�����3��pч…��ߣ������3��� W����<`Ɖ�>It����$|�X� ��3F��50����w�h�zV�8��o|�����a ��r�z�Ab)�"'����z��M1�F�! �� kaeqv��g�� ��A9PX ,�� ���F���RXa!����8C=`@(�� ʁ��`a5aP�0(!NC��@7[X Ka�����@T�`�1XX Ka�X���G��"õj;�E�h#x!p1�C;8#@�"A�U��U f�1� �`"$ ��!�Gj@�m� ��A ��a@��6�a:`�6����8��q�&���Zp8UC��]�V�YX �p3�� ����uX&�&Հ��pm�f,��@w�gd\'�-��Z�N��&��/(��0�XH-a%�f�%�Ē '�q9(> �<��@ Iy��\�gE�����B-6��� ��l(ϊ��"\�ƥ.T���<+���l ¥vS�аCp �T�:�R�r.�tۀ&���K1U�D��J7��n(��@5<�0@yW ���(�>�U��8# ���4��L�hu� �M�i�\��B��9�y &�<#�Ϝչ$ � ��`u. Ȁp���sI�@�P�gN�<%�h�9'�P�( @�`�*�L����$�s�s��ɳahO`n"�2�P-O�a�*�o� �$�&�u N�.�)�����c��aDXd _@ 4�c PQs�� tAap _ �9���! C���=�d7:@0���!�` PQ:8���`�����8�.�G )���`f]1��t� A�fX�l�Qv��� � ,@��>��l�g3n��y6 a�<��&[�H�` �]����}{@@����يd+1���) |�h>P%U�)��/��>�� ��: �@�\ԁP������+D�|p�@>� ԁ|�L(B���&0 T��_�6` ҅)�9 `�؁p� @�!!$��c�A�3g �20K���@��}c�(�C��:�f�̡�c��#��_�K!=�� h���P6��>Ԛ��@�$�b��{��� ��A"��f��X �4���`?��K��A&��� �ɡ��Kpdt@IF���,�O�D���A]� p�@rP�{���f��@�%|��(@�QI.�|����@0�g�� 2��!<�%`��� ��T[�A@!� 7A�@#�D6H)�Ma��%�i\D*�: "l.>t@���!ʁT�A"��я.�%l�� d Ȁ n�2�B@ܠ/Dd ���� ���7�� Y� �Mc�� �xd�1@�v;`� ��\@�_���]�����l�lH @�e4�"P���* �`�)��@)(����_����v�;@�#0���.����X ��@ �/0@�2 5`� 0Z����ua�6�%l��� p@�U�O{~���6A0�� @�� �@�c`��1 ����?��<�K����0��f@�� O�1� ����K��1.(��� P�.( u���/XX� @/6P` bx���(��lph�7G�/�$�vj�M�:4BD��\�)�Ԉ��B:A��G!h�`@�_A��U {F� � vv?ZAa� >����.  L=Bp��?�#X��X�]@�-�0�/��0�B*�}��0���p�� 0@ @v �#���$����;^�-���!�j� �)�A0� @ ��DA8@`,t�S� ��I@�������J����߀� [e�l���`�/�� 1��8^�N�l��7����5 [���J"L\I`��ye �� %�$��#��W��w �������p @����\�=�R��%�S*t�J�;h�_� T��;h��:^"Bh �D���:^"B�������� �1@C�]�z���!6B_�d@@/!x��  ��E� ��1�`<ʼnc�!�&`f� ��� ,#p��Ф8���@���U0����A���� \ #8x+A����K@ @������p(��@섘(�Z ��3(�@/Ԛ�1�hA'  ��� "P�X�e�5!�r���`�@I�@� ���8ڡ� �0<��S��a�$� �@ �1H�� ��p �`H�(��`���1��(�� �*:��@@"@ 0 �c�j�1@�.� \@^@@ЂN`� � B@�! �� '�B�D��Aخi ��#��� J��h�K���R�;��P���@H�� $�8` ��D�q% �ܮ� "5x��:D�,�}�b��  ���qH�P�f-^�����U6kQƜ�Zt@��m�2P��i���4G�EHȈ+�B@���pgu������#2Č겒8��*C8@G3[%���p @�<`�0�K� @�%������p����(`6�{ ���!� ^p\�%8 �M�v�I�@�0 \��/�Q�lC � ~`�h_�B�� �+~ �z��F �Xa@l��}� +pW���b |0pW��] `��'p ���v �>|I� <��Z�� �B<��+���u>:H@�   <��%�O &�B�$ �� @ N��xD@�@ ��@8 ���C ��"��Q� G�9>G� ��Qx�� l�ZZ���u��a#�A�Y-�`��*.O�F)�c#J�py 6b�<�#UN`gh��)؈����py �(w��0� p �a0�0�@�p �8 8�c� @�1�L�����#:�����4(�`2U�`���d�.�� �c��� 2p�nb�B�( !��X���8�c�]�A08Ǡ� �`p �[2UpTR��W� ������0K0pT�%PG��B�$�`��6���HKᨤ��6}D_X G�/,���>��[ �樸�������,9���R�75d�(B���M � K!��@��*��fD� ���/I���%�M\�JPA�!�D�$�`� 6�GR���w�8V� @�XK�w�0B8 !�/@`������&`�E�|���A8 �0�w0�Y` �l �pv[ l���3� �@"� ���� :���Pd+1��pD_{�A>Pq%�8���"�qp�' C�0)�)l���|mt8 ��V\@Y�+��8�p��.�1̕�s�@6Hle����V��� ��F̕M������Clp\@�Y���8\)��V8PY�s�"8�cv؊8:` ��㰪��:{��+5�J�dU�ao؃�`z�+ �3���S��'��iҷ`��C��m� � ��mF��.�8��-M��I��Q��}��Ͷ4[�t�[ e�^��z�Ԧ*-�Y�a����l[@��6��Q��[������+{��@�bwN@��m�bZ�I}�+&γI^��w�@�"$��B<1�(d���Y@��Md�.� t�fKN����'��]�{�Dd�. �D���c���^��� ��H���-��Ӥ6}:@���?��~��Y�.K��Q"�~�Y"K�e��W~W���n�d��x�`� �95�{%�9`�4����ۜYs���ʹ2g`HP�����U� �`8�9�@��U0gX��se�4@��aB��@?��>��~��w@,��e0���2 �a�@� ��2��.�!�e����:�}�9C�����h�AjRAHH(s���ʹ2g`HP��hP�E�9^ eӺ�ަ`��2� `)P���.AzHK���Aa��R�0��� ���>b=,�`�U�k "=, 쇏HK������a)�8f�#��RX(�$�>��P�IV}�+��@0�k �& G���8F���� ͖@~U���?�Z���f���/բ���:@����>��SP�T�<�q��f���O9���� G�p��e�&�Ѥ (�$�%��9iBH3��������)�@���9<�9� RD�BY�9��89"���S�r����'G���| �P��U��J�b����`/fa���r��~�H��f����?�)G�/ӃI�ɑ�����SP��������I Hr��*=9�~�VY�#�W�ʑ��D@��� �w���"�@q�A �� D�F8���0�0�a �겒p�)�A�����$�8^&AH&0f����O p���!'�� ���$��`�\/2@K���9:@H��Eh 3GH p��-!`�� �n6��Nj �2h>�*a��$H �A>�� ��B���i���:P,�@�,Ţb@���I0�)��n�|������1�ƶ9�.!bH |�P�@�� �G0qT�@�' ��+��� ��+Q%p�G0q�_�]�����Q cHXMz!m�ùp��.��*��`�|@B��� �`�� ��!?��%$�m���!!$�`�,��"�f���K䃩��/@?1���C��N�)x ��� ��h $���bF��}�J$lŠC"l��Z���V�J� G[����}�,��6&[�8�Zi $����O�� ^�����@"H�-�٠����V�JXH�'fJ���V�DX����<��� ��#x�.�V�E ��HGH� k%l���@��.�`h�U�"B, �bh��2� �.ң%� A4i��5ڈ QD�&դ��l�`� ��h �c� ��I5�}����0� ��v�@�T<�� v�x !�,��]�K���E�n7!u��Ќ~`�x&0�K��5� RM�] Np���M(������e���$�Z,]�'e�l�@�XM�P!����`��7!u���%6�60�� ���.��AL��mRA��:` �XP+�@ $d0��@ $d�7pH;� ���@�; $�x�0�c �&`���F y,�v@H" y8� ���+Q���<���+; $�Xp@/B��d�X�X@#� �^�/ ,BP_�(�-0Lh�J` \=|�Ђ�A �� �a� �Ep �"V� �.^0 v� � ��ap5&�%$r� �A N2��`}\0zp�3x��`��b� v�I��#��Y� F�b�"�<�@��E�� �h0 �4X%|�ЂO�0I'XZk0z�!@7L����8��� q�k���18 �`����e*8X���E��[��.�]��.d� ���`����bB� f8�o��0��r9 }# 0n�j�"%hD�" p� � ���C`�A;<� Xp� `�Vh��7��%� ����AƸ )x���������0G�nQ��7G�C�(p\ ( �(K8�/pT��Q��$ \��nN�.� ��[�T�Q��nPT���)F�P�<�XT/��l�W�<ET�B8*Ga!��p���|:�2 �� ����B�4� M�� $����P��9q�bp1� �ЍSc`1��@C��p�����3�8_@�� � @�Ă��\�U`YĂ�q.�E9 !�,L��E9 �",��cHPA�Y8@�.�@p� H ���(!G�6 u���RG�n9�Ac �<� �@�8 a#�&�� �쀇0,ð�H �T�pH: U�is�I�6�Ѵ{�@��7�]PhX������ḥ�P8� 4�B#� @!A~�6�0�$�`�e@! �,#�A�@*�F@�4��(|0 G\���C�����@���P���Q." ,�\�C��d�� �`0!@؜(��|r5��"\j�����$D lN�@�$\�3�pPu`!�w��`fL �!����@��"`  hj*� �"PG �!���"�C֡b �D@G�, t����� ?�����!+� …����B,�U�aH���v�Q�]GIw� �t���+ ��t�Q�F � ���ޝ�� �TX�H1\���� �����1AT܅��t@�h(��!vA�H�ް��hD'�!��p� @D}�������0&�4���"�`��� �0��˃P0s,o���L xR��@�jF����#|���@?r�! �#���FW�\�$ �#��F; $#�"w� I8wal����H=�����p���x ���Y�$�H*�c�,T(�RA�ad.��p�����@Xh � dVA �DX�j$�#������:P;\��� �@��znT� x^b\ hjbmװ�&x�0 ¸�B.,�����٧���qT� x^5Ў0����@->`X0��@(m ��BX� a�]4 �<B OXFa.�pB\�C0A�0���D��@��� F�ҁ�p����p�8A����� �&� T�]��E��.\d 1@|��� !��n��ʡ�M�և����P��!�"cP^ !� p�� �&L�p f� �7 x�@n�7�܄ ��n�l�^ !$�@nBB�&  p(�M� �`��/�B� �&Pp0�%��7a��AY"�`r�A��A0=9`P� p�D0=�;�|'LO�v]�~pp%3�pP��A %��pP�'Z�� `P�ppD���rr���@��M��!�X���AևT0 FAo$+P�H���!p2�C� �XnYb.�h��_��a��F% �8�XX�����`H��2�wP P�#kƑ%l0N�� �#��) t�X O�yF@�ĩ�~�$������.8�@ЀY@�-�� ���2�ʀ���I`A$���4�n� h�4��e���G ;�O�B*�,��`[�o�>����M� �`0h�CW p2t��P���p��b(A� ����%h ���D�+|���W�W� �@�·� D�4q'�J@�(�"�p9�*�_B���m�J��W�|�p���W�d�,|[:�@@P�_^�+LC� V����/����W�,�:pn�@9�'��@���7�0H �:TO�����z���i��Փ�h�0XH��6 D1 hP�ʿ����~�+|���W��W�����m��� �P$�A9�*� 4�o �� �%_� _a#�� �%_� _ap�W@.�*d�,|[@V@.�P `��K>@XK l�p!�AXK l�� ��T����#D�u�/��a��H� S��,!,�%����1�"Ђ��}���̓��@Xo,}���¯',�. ��>X9@ ���@X��m �%�r@2`+�Bt [�N��-=�,��^�Q�9� /���U^�P,]�" ���|���t� �+�� �t� �o�,/P� ��AJxϪ�>�.� =(� <�B���8x��`�'� �;s��I����U!sgn< ��_ �a1���z�I�(�U0P���xV�̝�q�4 � a0���#J�a 'FI>����� 0�/���pÏ( ��1�T�@Y�xB�Y2w���� 0�/���pÏ( ��1���� aH��uL| �qV=ȸa�| zP �S�U�̝�q�lH�OW2w������%�B���8x�0�b�%�P��BQh�`�,�< ��� �;s��i���`8 ��G��CN �� 0�/���pÏ( ��2����0Ì�|�2�EU�@Y�xBW2w���� 0�/���pÏ( ��2������O���Q� �A)O<�B���8xϒ���(�0����(�)�4w]h������K����;O�����AO�13�gU�ܙGO̊+�C��2��hϪ��77>&`�� V�,p���� Z�"�`%0Y�X]`^`���"r��� ��-���p+9e'�)`q�@(j�$L�-��N k�� Z�,��i8 ��5�"&HlX�5����l�/�D�`ц�@���qf��?7 *�ߒ�܏'��������<�� �2s}1)���p �p�������#��p;�,ӏ�.P#�p~3 T!�7� ��[��r/���ߌU� ���m��U� �H�m��U,�0�0��`� ��f��� z�Q�� ��DC,l��:�@���.P#�Q�� � �H,g(�B0 ��<�.P#�Q0W]�Fb9�`����o,�^傰Q#?���= �c�b����A�(��SP�wy���������@��@ˡ-w� ����au� �R�k��Ŷ6`r@)x.a����t���!07e/΄���0 e����ml@�X�P>�����gߞp{r@�@�"4��c���) ����xq{P��jíg� �>�Q�u���l@��Xp `�N:�: �$�^�`�]0��W��`�M����B6��>�בvq��W��,������Q�u��`@ �CAwب���| PxС�`;��Bp N�)l�fT�@X0*�@Q�;lTE�)W��0����SX�-"��+�l�A��N�)\�: ���q�#?�����`u��aн ��S at�a:��@��a���ԃ2��u��� #AM����� �5$PGBH�À��:2+�pi���xu@�`��Aq���FX�P�Z�A���Y�]R#�AmG���}�ĩ #��G6H>� k���VP�D@nW�T�vP�wQ�Q��8(h�FpP�8� ∩�# $5N��}�B-�RCx��7&�Ht �Qđ<�+�*8j�����6*�E�&,Rh¨D�"r�k�H�BX�`�Z�Eje4E�ʂQ�<�M ��(LW&`.��FE@�L�)�M���(Є�EP�TDJ0*`0 `��Q�}ݨX�0>,9Fb���@8C0*u�4!E1*E�� X��Q)�b�1���zx l@��f�;` � �wʁ܉��0Vо�L`�܉��X�3�'A >���ã�=L�@�� r'll� ��V���7�e�FB��k@w��Q�_�V����H�[A�$�s`�@�\�$,l���6AX�'aAZr��>HL�)�"l���6-/GX��"|�����,�!0�C�H\N` ���C:�@ ��!�Ϡ ���e ���t!�+�P�c@ҁ �/�^��oA� D� v��9�́`FjB�as,P8��Q���`���"�`���]@D@�"\�T0n -���s ��1�!��ޮ^``��,N����`�t��'*RA$�@D���,&�bADH�@ ��� �c K "��h�@�#����x6` �%�H�� 4Y"�X.X�+�ۇ,�4pD0ĥ�,�X�v\:���xDv<�;.�X��9 �ԅ�@B���2 ^�m )$���� �AX a�]h�C�BXh� ,��}��?�� ,����.��! a!,��}�$?�b�Q���!� ��P<4�J­�x�%%���1Xo�6p� a���D4b$S�* K +┸��yp���%%�E��> 9�`���‚6p��}��� TAK�'�`|�9 ��4���IR���C�&{��E�� �"��@�D�@m��Q$一&`���pl X��P֣��M�aΰ�UQJ# �.0��(�R@K��!�#n�K�/�G��#�J̩�2��.���(��/rK@���9���#�?�8���N�Ж# �ď��.`p�C8  .0�#^ �eN1b]�r˜bı� �0n>`����F���%�J�+��Qp8�8�9��$��0b���Ta�f�1p����Ux# ��Xc���'0��$� � � ���_��/�l�%�$�� �tObJ\�!�%�Đ|9\bKL�1q%��{SbL|�!9x$ c�[�Kl�)�%6ݐWbHn�'1%�ė����f��0 ��� ��oD%��H7� @ a9 �@3BBD�� G�87h�XqD� nT+� $�(��L\Aoh �`��& V p�p �0g� ��2F |��7՜a=�`���� X�`�7�� �qs��Й�2g�"�� ҋ��F�2�nP/�7XR@�]n �����R��c L���6<�T`��.x�� ��c ,�޻@�XS�J�#���XY `ԏ%��º��c*����l��R� �� ,M<��� K�~��+�@�`h�K���!Q@��;!�Ѕ`wB�0v'` � +d��0v'` B@�H.���ML+��� ��|��)@��;�&L�@ BK���B� m�@�I8�"�����M�Æ��� ?H!@V� Y�@���� +�1����9�B0(����]۷� ! �84B�f�|O�0l��Mt�t�?!@�t� �B�S|!���L�09q��S ��@�@0�3!��8�# $��`�J�[�)��]�:�"���@8Y���@�;pG@h�}� Ҁ.8�S�dLr �#T�?aG�N� `$�] ��D T`�] �C9�΁��N�a�΁��]�@w�2 8���J�Љ�a �r%�ʎ0®�ڡL�� v�'F%w��7t� �:�6&P�+e�vH���R1"Ʈܕ����]���,��1b�J�pB�AĈ���@�P � A (��� ��ؕ2P;��s ��9�-Y! ԁs�J��ܕ#b�J�ph ��?�ƈQ d�v(.�T�1�h���{��� �3#��� �A���Z���I����Z�@ X�o���b��D �4���� ��� �`t�cA4C�.�����H�X��K��6p"&�V[�`�u@!,�6�Y°A�FT��`N@@R��F`�%pTЁH ����c�D�X: � 耣�F1a`�t��A\ Cp锁(�t��ұ�w锄���` ��b��.���"H����X�a�v���[�`R0�����` C� �����Q� @E!�@�2��)Qd�|��c#��) K��h�mrt�C  ���%| ~"MD�Ԩ@��qsf��1"�xweA��D�s�3I�;�R�'>B3��!� ��q�!MHQ�"`�l�/��@BPD$�������.���*��)v�T���9�8�>�+�ع̙��0RAHX�� �N�x�0?�$��P�CH � �VC��H�b�P���s�A��٦�T�S���� �a��b]؍Z�W�t�|���Ѯ��!��#~R�`�@��1��"��DW }0J�D�u���0 �@_Ќ��u�b�Pr�v�!�L���sx4�a�_r#��x4�F<� �� G9,�9��ahpF�� D�,��z4`:��h$@���$R8n0t����>�p��B��b��G��`xX>p��Gc1D���?�� �E`H@h( 0 #h���W�Jh0GG{<P r�YA !]�  ؅&d ��+77ׇ����RW0<,�"�h��B���H�G��`xX>p= �( F৸@�'�7������G�J��). ��!�h���A��\��� p�觸@9�/ ���a!\�<Vt ��f�|�z4F�<�p��B�%�3� �KX��1%A�\�?`S$@`�� 8�v�Q��j!R<�p��B��C(RD�Gc1"ţ��B<�!�Ő7b��p3�l�.9��@�؊������ lJ�B/�<����@pźD��W�F���"S�Q���F�b)��¹� �@:��MΕ=�#��+sp� !�Q��)��B�����(p t���e�؋{�˴�-��H�#����6R�s�0�t 6R��az�/n��<��2\E�Ϣ� mЀS� �����g�X&NcIpA%�]q$h�>��% �����JH!� �m��Ah,��"�*�J�Cc�SI�� m�#�aH+!`h�}� Ҁ�ZT!`�n`�@$=,G`҃UX ��~�9rZ�U8~�`)���� p���8K!=,��9ェU��?���w�1. �Q$�TP?��0�E$*C#���.p6 �Q?����`샥`?��KX�` ԏ%��BzX �3xZ����gzX �3xZ����gK� @����%� �a) ��@�icU$ ���6i�|܍�׀��J��`�Z@h����@�@*8k`��U� �A �I` ��\�����iX�H/�Kd'� $5�N�H�^YA��u�w���S �@0� twׁ��*��Z�`U�d�̪�"��5 :-z�"w�Ȁ��*��J ����GO���_L) �`��� +>���/�x���r��I@G�E��f�A� l� ��1 K0��i����_�*���2��pD���&�I�$X�z����L��'�DV� ��� ��|��"�6( �A:���p��Q� �@p��&`@c����#���:0 }���x�_> V9�^���@n �K������:��"t�Хs@����b� Qƥ� ��pR�V0� �‚c�1\��/��$��.I�A�N�A騄 p>�P �����2�+�� cI�KW=.}̝� @ �7��&" �Ciu�ڀV��8 �58m�-��W����� &�6�09�whC���*���`p%���k`p�7�׀�]����0*����&p����Z���^_\��#]�W�����oF!@����h��[�5�8VcQXyh�rCi�"7�����A��<ʸH(�p����?�$y� �p���#�h�1��!��Kr�Y��rX�|AH -D0��a9|A����r��@���=j�;��H��4�A�qb�|�qw�nb���3~��!�ԁ��-_b���w[>��yD "QG��h<5�#���K�iL�A@�P�_Z`p����F�8 �$���<15#p�\�-�FF���'�^�\"6*7<�'�^�\"6*7<�'�^�\"6*7<�Ge�Lp �4��*��D\� yT�̌�_�8���H��xa�L�0".&�p��L~$"�@8� �b��@���YA0�@8�YA�@��)��$B�)r��� t����p_�&(����<�\�wX�3�kJqh@ �6 >2�� b p@��,��!�p� $��ބ��>"=,�ql�%]+Qd*��A�o�B5�՘����(��\7���+���*�>�c���K�R�>��8Oj .�Z�"S� R|3�� ���C N��8 B0!( �����>�`?���@� .)'X �$�����q�0,��`T=��#<쒬PSv��YA�t� t�,��.P��,K����r1��+��qx��yƦ0@��� )  \�Kx��b,� K���C��`��.��%�9`~&�.�y�1�n�%�.�0 +�(�AI0�����|�Z Y��]�%@��%���%������@Z�� u<�`��  d�$,��"J ����:|��(FIXц$h1���16�Ư � BZ��8�AbY����1��q�F�>v����PPb,��E�`��"�����` �Q2(���ة�`,�e&9"K�@\��D ���� ��E Xެ#�H�L�!���|`I���eAKj@&@>��� X�`�Ƀ�p- �~ N,3�hQU;l�e Q@�y�E�P s((�t@��0@(3'#�LKfNF d`�d2�i����d� �P ����`���7�� ���\�SĀ�x���0��r�c�7� �0��>��F ���hA����'�@���ցn' �@�u��� M�a��Pr�� � �� �x�xSD7� J��%jE��d(��p �#�M;�M@Z` %jE���)�PZi� E�dH�q��N�6\B �m��ۡ�H�bfl�o,-0B.�"���w@/��6`(,�τ��y|�KA���@�)@ L �01��K�/} Ё �&�8r#���@�x�p:�� |`ƙ8����`;<��l&����D.��r#���A�O� (���0H�� B.�L��Ќ ������/=�t8�:�<,A�LQ�z_:�8,#` �:�z_��E�/|���D�@�}� T���J!+X� �;�L)  M7JO�&����RH�#z(+�N�iB)$�Բ�RX #@��4�L�G�H��$���q��D8��8M�cq<�{��iB(��DZI�A)��qܻ=�9���`*\E�_�� �&�@j��iB)� ���X���qܻ=�I8�#� P1҄YJa^�%�2�R� J=��4�҄p��� ���ݘ)��*�%P],�R�` `D�0:O��JA���A&T � j�����;ȄE�S�݁;Ȅ�C X?P@�RpQ#=ЏD��A&,��w� s����1�����"�=\Ape�dB�@,уF�e��w@6 z�h�|(�V܁;� ����5� � x+�F?��;�hq ��a�+�B#( �� ��w�և~(�����;Ȅ��� �q�94@$/�3ah9 �L � �1Ih��0��pIB ̄!�儀C�<��Jh4� he�=x@2�X�d�3ah9�TdE,�aC�!9V�"�F�Z�>ȄY1X��r>@Rx=7� �Zp&@�0�&]P R�S�7� ��n�T��T)�c�`T�l�-� ;(p��a�,^�(�@������1"��n� � g~R X�A�@�LVSS1���(�'�%pz�W)3�ٔfs�N�9p(�V`�P{P�r ������>T���%�_��0� NAxw�����\�?����p��89~N!�\�z��BP`~������@��#�4��p����<@Ջ�E�0*^`(\ } ��\�B`.?!p��j��B`.�!�؎�Q�ǯ�؊������ F��bT���Xǯ�Ȕ㷎�'PxP����s���B�7�� �:r E$��`�X]�->�.p\Ā�q����t!�]�ύ��Fe���ĮX�����;�>����Wo|���+��G8;�b�·�pvv��5*��H����@b{ !�/�p���8~�@"�� ���ǯH�v|��@�"u�(�HRGXnǯ�����c=\����0�� ��90�V( !!$�����LP54���t�00�X̄="m���h����@l����ac|��B0��!!p�� �D A!���*<� a��� ��6�(�F���lh�4�&� v 8&������@@@�@�!#p�w���- !!p�r B����X!D���w�7m� �">��ED�� � <�E������L�����������!�9 o<#$Ks�@�Qx\I��_���/\ !�s�Bo�B@x,���%A@���F���2�Q4���F@@,� �F���M'(!@,sE�!��r�������c*~��#D���F��\��!sr�̑9�A�Pos��'�0�p��DP� ` 5r V�6�@x�M� r����� � ��D�3��,@持Y2���@Ȝ�0f�2g ̒1�X�@x�C�x�(d@ �Cy�z� l�}[n@�Ѓ� ,�}� �A�ЃCV =�@� ��0#�@�Ѓt D2 �l�<�'������6طE�T =��Bط�T =8�) -��a*���"��P�@��z�b�����( �"T =8��.` h �� (�d�b�A/� �m�CF2���.C�$ R@ZP 3� T =H�D�Ѓ`/  s��,T"�0���P@��z�b����� d`K��P1H�@3DB�a*��h �� f�<� $P1��l d`K��P1H�@3DB�a*��K�1$s�8@$�/\��T��9c`�� sf��%c�����J�� � ���£��n�BPqd�/$2 ��9d`6��10Kƀ�9d� ��Y2��!�� ��Y2��!d` ̒1�*@搁�@���%c@�2@���%c@�20��d �C��d ���!�� *��1����@��:AEȜ@�G�AM�20h�2'�20胚d` В1 dN�d�#������d ����AM�20h����BX�� TJ� 2'�2��}PSb� ��1@Kƀ�99�>���@Ԕ ~` В1 dN�d�#������c��� sr} �>�)1@���%c 'Ĝ�@�A�2'�����>�)1�Ȁ<�d ����}� �����@_ �x ̒1 dN� �2��}PSb�/�y<f�2'����AM���@���%c ��y\����)�������}� p��@�Tb�/�y<f�2'����AM�@� ���c`�� sr} 9�/��0胚}� ��10Kƀ�99�>����x�jJ �2 ���, ��\"dN� �2��}PSb�/�y<f�2'����AM���@���%c@Ȝ@@� d�#�E����@_ �x В1 dN� �2@郚}� ��10Kƀ�9.bt�$#�B.�),�z�S�9H2'�����>�)1�Ȁ<�d ����}� �����@_ �x ̒1P]�E�h� �2@�AB� Q���H�_  %`�P�@G �aM��2@h 3Gԇ2@�Úe� �2��� Be�P�y�kj �2@K�@Ci �T�d P6 !:� 0<��^�%«���p%�ŕ� �W��ǻ2l �� T��2��ퟎWp��PPm�ǭ�u`��PP���E����H�0��0@e\��z�gA�(����YZ�C韂���O�1 ��0@e� PP/��(�%e\��Yh j�u@p\�3��=��X���YP�ʸ%����,��@A ��ԁ��Z�C�0 T��2 *ʸ��ς�%P�(u�?��� *ʈ����F�8Yh �͈����m��(>���xu�.i��S�蒂�?uIզ\]�? MAM޺D�����K����%u@�`/|<<�.�%���]� � �W��V�?����%u@��LPhJEq8��,�a �O���'^�8YP���������8������%�ԟx�dA qR\z�8).�q�,>(<�^PP�����F�� ����(��S5�n�� jx�5<��BSP�C�,4�f�IO'Nx�&%�pcF҅�����rc�x��Ȱ�8:�I��/��0X_0N2�a�� j�%` 0�aP��������0�:0 �@7��s \ �qt��K� ��n' �@��сp��'A��^! N.�}f�Y<������F��)���,�/h0���4�_��r� ��q(_2EW�PޏA�?���3��пE�*1�!:,��+C h��8Ń�H�C� �%L���C@t�T�DzHR H@;5@���%b1v���; $#�&��?�K0�P?�@�|��$�� ��� �KD��`3��( K�b��SDyXX"C$,@t�� �P�c�@�Q`�(���ЎH��`��X� p��W���R�*� G�@B��6�t)@ x ���@��Bax ��;Pt�~`f@��Q?� � �Sh�A�,t�K@@/ L �� P$���bj�A ��@@��?�  ����i`'���2CB�%���̐��s��@A�� �*� P��<��}t���� ��� ��� �ֳ JA�˘eZ@ N�Hs R����3T��P�S#  (�z.0gX�*((� ��`�����r0X� �`�"���@��>BCh8jB`O-0\���.B��&@�� ��"a�P \��X��ݑ��DG���p�F�(�pT ��;_`̄�!�h�c& ��!�EI@ �7(���}Bq�-�Ddj�>F9Pȥ!z���0t@��9t ��g�G � ����!���;�����̐!H�f�{/�6d���QA� �������; �\����߁ "��@�>�>�@�h+���B�  � �Ț�@�����.Y�h��@t@@�qC� �H�������p^��*�N� l�?iG��d��3�p�t��J��!0Y^��Y�9zp^���rC�9���3& ��2O��'Z[B !΁,�/�� �C r���2���E�H��D� ��`@3�D������!��� �Ȏ@�耉\;t@�� �}P�\X�-��7$K��� ��8 Z�8� *��pGC��#���0rFvC` �)��-D �x�ƅ8S�4 �P�P�T�v� ��3}4.܁8M�RH�q��%����� K�qiиp�4!��D�pT��Q!|�by ��g� �H���qd�X��4���;,�,1&"��\�1gv08�@C��1gJ��Q6�b)X�s^q��*"b��9�]V�\q.8 0���%~����1g� �` �K��H�nt�L0 �]`p�ʢx�-�p� ���i^" d��� h!⤅K �Y��AB���3;A&8�t�W>�m��� D�J �<V�W>����V8-R�2h\V:L�T��X�P#��e �a�r�'ݰ�,�52 g�4.R!~�2ɇ�{9��5���$4. @�Y��7jd� ��Ff�gn���ƅv�Rh\�6l�� K6�� &� ��z&��t�d�X6E�Ą�@� �`�ZB��!�� ��Ch 3� �2 s~�� �!���hy�A�<:��eO�<�<�g����Sy�� X6��b�A.Q",��%�b�A.Q",F��%"�� O��X4�b�x''D��4� Ј3`1�`�'cr�a1� �(cr�a1J��(�$NN��@#,F��%��Iq,��ޫ@��@H?2�!� �%�][I�8��"t��H��2�i���!�� �����X��$w �"o]�� (�)���%�J`���e��'l�p��{�(,�#���6${ (V>����ƥ&D�(�E���@r��`t�ϲ�.XE"6.} \_�H� G&4��E�2i�Y"��:�ҡXB%4To�N)8� ���q��gS����]B��g��@7ɞ�be���nA� �16��a��̒ʆf���,NZ�1)���R���bE+��|\�� Y$<�0,p��t�4|�� �`�+�o�,��h*��Љ�%R@>���E��a�ZE�/���.8HX�6��@��A�E%%��@ mAhHE"6�5�j�Q8E(:0Z�Bh���b�R�JV��?@<󨁺���#�&T�.h��d%7�=�` H���(��p+�-a68�@ F�F��,`��ۖ�6�@!���B�  �:P�@0H � \:��A�t ��p�K��@�<"z>�,�����)��1`�TV��2��'� :@�@9t`]��u��X+�%c��Z�H����L��h!c����]�� .��p6^2tg`]�3� �����%����H�1�P:�]�/9�������K/Y��d: �K� � $�8`F�Kgt���:@NHYy��S �@��B5�uђ��v)  ���.ZrrX�%��8`�BK^-������ )06�@��n��%�Ʀg �w|F��cl���#,�n؀1��i�7 >�� ���q!���dB&S �Pfr�� Wd��+B�?c0�f6A��M 46sb ���cl.�M>� csL@��r�X�k6 NM�`N�%b��^nq�z���%n2��BX�l@c�R�$X�dH1`l�@��Ç X<�*� �I�2#U��0�H�� �J�alE�^�[� sr\pE��0&���VALF X��!�%�[1�$Xo�!�� &@f��`-�߲2��-4�dN��~�o���%3�M���1Y ���"��� �1p'b N66�b 44�dN�� ���`lT%NN�~�o! ?�������'3��t�rh�&�Z� hlJ 9���-�C����!��d��L��[ ����P��[2��-����ߒ�&��Ҙ�|��A%9�$X1���G ��"�d��!9y'7cCh�� ��� �C,*ـ �-�����!4��� KqrB064��d��Jpr�E~��4�dN668�؀��`�*)0� ���D6�J �� H���b0�jҩ��6�� �u�2��sK _Ax#�p�*=�'-\ ��B�16�f9� �,�!P�0{[��76��.��#�+�R�� �� �F �*�#(@?��R��0"�F�wPAHP�\����#B���:� �"�� X�섄 B¶\��섄-*>�R�С��V 2bO�@܄ n���~@�M!��y0 �Pl��"n@�A� � �@�!@ l��"n�@7 b��"n�� �E�q#��B7��ԏ�"n@�E��R?<�@7��ԏ�`č�` ���"n@��C�N2Pč� ��#��"n@���M ȷ�� J�'�#��@HP7` ���`��@7��ԏ�pvBBKP7� ��@7��ԏ�pvBBKP7 ��P���~|���n�@�8b 䀽K}��H8b ��*p�@����� ,҄Q��eX"�>ˆ�@)|T��� J�� PD�@P����;�H��ԏ�+���*�x � (@U����� ����Gg�� +H�,�Y0 H��5 ����kpB�U_%�@�� ��Qq�7��-aT����@��>@���'G�q�rA��A�Ҏ��i�P.�����A"ā8-�"�p�������@��r0�K�_,As���h�-�+\ ;`q?�,�mA�Y��B�#���p�� �ŕ�?"�P�4L�0�AKPA l@��>�69!%��8�˗q�ʥ,��Xz�����d%����G±�#���`�DP��P0�2� [b %PR�@P�~偠��X�C ��pG�PP����@?�@ ,e� ��M��(�-p{e,q�B��G�(wa�ޅ��:�a �����` H��&��@����"r�@(D�%(�������� � l�t:J�( a� 䀁`� ���G�nR?�pA�Ĉw��@�(P?�`�� J�#���;H�`@p� 8,�C(�� 0��������Dʺ)+��JO�A�|A)��"��2Dp Iy�� :H�@�J��(냔ǧ2�>Hy e����@�J��Fp��`# n0F �����R���{����?�7 ��2�@[���H8�@� ��%:�ྛ�6(�0`F����"sހє����{At��!z����C��{ ~� ���� �c�t�=�v�9 8o@��7!8e� 33� H`Ў�:��!XB�������̀�����~`���7�/��y2� 8���F�|F=ߛ.��!���*&\Ł����u&$ ��"*���_E�NY��ފ'`�6XB������7,e���rTnHO9|c��!�r{��x�?�a��T�^�F��{bo�^�������1��D詼*?e SB���4�t�?v�� ��g��PB�c)H�C0���n@��S*�N�|�1 V��P�uZ嫌a��=��(N0�xO�2sD�?v�]V���*k�}�� ������+��ʱ��f����� Hk��{+ke����2i��O�| �0��W�0�te 0*Xf ���M@I+a."́ X� �2BF(�>� p T �*���N�]:P1H�>�$b�8I L� "�e����>�F&�89#$DB 3BB(��A"�A� �����!!B� ��b��}�N�䌐 a0��2�܁D� ,! eABʉ� �V�n`��"��U���+)B6�� �Z:�Ѐĥ ��rZ��i9mBh6cy��r�>�d $��>P �,���D�d �����p��? q���!Cd ���0 \t�>��� >c`mƐ'�`�\�ጐ�j� �A��С'(���"��4�.�P ����,��,�r��q@ ̌-�*�>P Ɇ0x-:��[rG� *F�G�` �e���@����@`��l!� ����Ԡ|��o[��@a0 ��̏�Mr�1�ۀ�P�ˆ8 <5��À ��~�Hփ4>V�`��C`� �!0��B� ((!�<��P�X�9��@#��X����<�gH�%�p�g�&r� �0�0�.�(��ے�"�Za&LX�p�"��A( (qf�D@S�Ip� �<�a@*@�i��L�� čV�h����F1�ֲ�`�m�|�r�1?C`��P唺e���]�fr!I`��J�C @�o9-g�>�m:\� V���3�'J@\.1c0�>��c�Q��` ��&� l �W[���2@CJ�pZ�\^-f.ۆ� �\3�h���?�B$�#�.�����6�����e*ДR�� G �` T@�l��F@��]�Ei� !�eE $A��#^��`�B"�-Ѐi�S��I"�+�T�� �E�sv|�*� g`-z���?��B����+1ڂNԉw�D Pf�'P�j`�C�p����� %-��臀k��C�%W�Pe:��c���` N@8 `}���vn^�˯M����?n�#@`�Ƞ������p����\�B^��F`$�/�����|�/�����l�Wbx�]�����8�Q���i�, ��J��@w%D�� �/�&�H�i���]�@w�2�"��R� ^k7a �� ���~NCfQ �d�`��aJ*�_�H���%�W�: �j��� ҀK�i���]�@w�2�"���@��I��1��e@q��_64}A"T� �i��+m�d�����i��aT�MB^� 28���F�4�o&�@�h�� �7H.S�n� (�Z� ��n�)"b c��?0@�T�e\����P�@�6�0�.h ��-Xf9)*�I�B����A0�A� ��.��2+��GA�HA���;@[1�!���8�$ ��1XA, �cl�A��@I�<���3 �c� �p�T�<���3 �c� *�p(�Afn�TA� W ��1��8S@�<���3x Oa f@�@$�#�X� ��(� N��' BT8� ���@� �@ �0?N��&)��) @��\@yR.���u�`D�VP}r1Ԁ P.�<�؂F�b�G�� K0*�Ф� ��J��FY^ nN�� �p#� �0�'�.� "���� ���K�# ��O0���XF` ,*p���t ,#�����{ ��QP��S@,�) @��K���� �7P�ü � (��� @��XS@�N*��0"` P�Hn��K�0/� � �)!Da�h6� p�.!a� �aL�bV���)h� "�������L��,�4p��� �K���l3s`\�N�~���[P�L�X���[P��J��L��p&��(��&�JAD�˅%�&�"��! D��� N���d�����E~���/�'���� �#K1��9G��e@���l�N +x����b�#Q1��9��@�A择�u�G",�2�l�?�� �i��ʹ�?�fq�,� X��-$���T�� �@����"j,a�H��� ���������@�AX�����| ���(���+*�`�`� �%Z�XF�l�G�� h�Q 4�� ��� ���`@�ؐ��� �DIpF�K\�/�T�� ��� |�C2w��[@��9���` �`$0Ƌ�#v�1L�uqT����#���, ;2S�Hs�#���;���9*�bؑ�V}JC[�|~���F���d��v� �E1��ʢ�����, C���L���a2Of�"F�,?*�b2O棲(D̋��3e27�M�E ���[�P��<�E̋p�@IbG`@W�ǎd��F�����Í�Q�P�  v�:� @���,��@�@e8!�*��p([ le����wc���^��ePh�`�3�*�]p}� H���8Hęj��8 ����\K�2h������Ј����081�g�O�I�� 0p  � T��(�H� �8L�� ��qX�i�%����.�Âu �2����.�L�3 �a��� �tH������Mu�8 H�� �̂��͐�J�*P�]�<�L�l�93 D�f� � ��2�� �C 1�,|�� #F3���p�6È� #F3�Z��F�f� y���0 ��f�a3T��W"V�Y� ��JX�+�8,ؕ�`���E�@� �o��V$X��#_��U$�A0�_�`Y�c �ײ( �"���P�ew�@|��e ܠ��{.�E( ?����Y"��a�IJ�ˢ ��M�,��$X#P���c� ��0˲&�D1Z����"t@1 :@0����@�n���>P5�Vh�Z� ��>��B�n�j?� �"PGL�X53�� �B/p�O@�&� F d���?�4Ј100IK S ���+��&p� \�����!D��@ @������M1����<����S �@ (8v  VP PA�����A@L��(hat��Q<�@�(Pp`H�� ��e���?���Ƀ���b v�H:P `��Q<"��0����t�b%T���� �$#`�i�-��8�8��`p@[ea��Cd�%p�>��7 �C��%p����8�8��%��<�8�d �ؙ���0-Pٴ � {q@���d �[p@�����8����6�����_0�v"��G��"X�8�! �C�p���>� Nl @8`y��#�|��_P`l��������`S|��>��d ������>��d ����m�pf�,�hH��������������8Y�9t���@G��Ah��0L�uI�i��p�����>P�]� 2�%�%��pt���  ��K�O�9>�"��Yh ��@I���0kx��>�;�"4|`x�H W��f ��~@���( ,��ݟ�g(��3C��$���+�L���Y�gl�>RDh ���m2����(� 5!.��`��h @�^�)  �*@�X�f{l��B��X ��l��@:2ͩ�� ���l���R�?04g��I�9K$CH� ah� 4ߎ]��Ah^�'4�@���*'( a� &a?B�0=�����X��D�$��Ҝ%�U��4g�`��i.ͻ�4'��I�W�4��Y�&Q3C��ˠ4ς����R�ꥹ~��TP���8���I�%���T/ͦ�I(��l^Ai.͍� #� 6͹�#"l�+� ���.~gP ��G S!�,���#x��XKa��#��R<(4�u!���X t�G���@�y� ��1\�9̏cY��P(��# �A0y�"�� �!+8n �B1��Ų \��C-�1�� ��, �8�|�, {b-�1�fG�O�c� �a�^�.�`���1耡 0���ğ�A�L� �e�.`��;�?/�c �` �0fKh� ����#��(Ё:�+�2� � �]�'��&��a$�]�'��HG ��=!�@0X��"�`0�î��ԁM� &|ㄜ[�l��8!�u d�5�`���9 d�:��� ���o,����8!�u T�7 �����jT�)Ɲ]PWk`� ���l�9 �������@;�5`d��#,�L� �wC��k�6������+�6�o�2�����s#��&�7!p ��(P@�ߞb � ��d��|���1�A j�-��R�A�Q !�� &B;P�*�v@D�Eh �`�b�l��j�Y�b���m�"�y �f����� I*�(���&8B�)` ܅9`@ �c��0D$�)k������B~P�Y����r%�4�%1�Ē�I,�`v�(u�I,�̰L�D��� aI��1Л}�o�ͽy���,ܢ�9�!� �ׁ%a�@�0u����%�$@ XM��!1�OXM�f���b’(KbI s�b��h%�I4 !a�ALp.�&���z^�kL���|^nG,��#\�����y=/��K\����+����u�[L[/D`�t��e���z^�y��[k.#�ϋ=�r��Y���:�� �Ap�� �?l@@p1d��C&p�T���>��m`����@s� 0�|��a ��� "B�K��\��0���!������S�@p@��@h�)�y8� @@>P ����@hC>X� ��O:����Z�U���q�Q��5JE+��p�p>�Mq6 ��%��VPZ� 6!�#@@���\` g#@���� ؎�c�5�|����32�`h6����`p ��H �: Cr^�g8�#@t�{�H�=�r��  �(��RD� �%8D��Av@� aY8�(��A�$"�! DbP�b@� � T ��8@����8�8��д` Md ��� �`� �%B �0�L8 @��!��@`�4�Qr.�%� S� �B0 u�:`�ˀ@�e` ��M P-�`�S@K�\�#8��:��X\� �*�:�Q � *�7H��4 _H�"ȩt �nbr�8;@�\�#����{t�@O��A0`;B� "& !F��X�"`1Pb�%�(1�ps��BX a!Pn��� $���: �;��<��ׇA\`Σ�F<n`#�zs��,�8ga#�[a $ ����7�~�9���0��������:o��a :t�����<0L�$���+��=ҁ1�=݄mHvd%����=���  �0\�����)��p�6���� B���B�]!�����$�G��z���+~  |W� �t �#���X`��F`�?�Q0Ma/, B�yK����H o ��c `�|`6A��� �*�@�I�s0F�P A!� ���A0'�b��H�"�^ �b �|`�^WUI@�z[��VY� �.��E��>�4v�0�Ah �(-A������������H�����]�!B@�ܤ~�:�Ha���%�|@�"�:ZB�(�LC@2@�` �`��fĈ �U0��98u bD ��� 2�����|�mD@�� ��0����^8=�yjF��A"�����}@���8=�yPu�R�@�)Q ����A���0`�o�Tp �� �2H#�fP 3�ڀ�u���:;tV�8�'`�|���� ���B>�)q�|��A>�����PpE0X$ |��@c�9V�� E��C d�: �sP% `) �� V��HKa �+`^��L� 4�+���@+��$�0��w� F �l� 2�@��I�;� ��/�A�ugT�x�O�8�§�k��p�x��p~�Qy ��)�:pT�9*Oցq�z@�� I�<�_�~���Β@�P�`$0E ��2 #��¯_<m��!|d͉� ��!�@X��` D�-�H`PHH@@�K�\;�A@'@�H�ؾ@�H�@� �A h `) �����R�-L`��؄�`?\2=,�2��� �`�֥�ozD��-��G���0���A���[���8Xi�[|+�W� �`� @0�i`D��1"FĨ�`��y%�@��J xz��>D�A��C�_4�m#B�6H.A`m�\���l�@HS/b۰G�M(ܠVhm� ҀK�A�� ��KѡH� ��\A� $�`"@P �X�#����P$@� `�Vǀ @m� ��@Y�p�.Р��/�G`L� ` ��}��� X�p �� ⯲�G�0 �`���|���^��i�`��A�t`�ڂ` ��1�� 8Da����� @��vD�g;bG�H�h�'V�w��Z�`!���� ��j ��`�+B|����%���"� ���\Dh6�@X�Y�r�2� �` �0��G����"@@�A � ` `��`� p�0i���U�@�*����}���"`\���I$�@����>�"� ���@`X�a ��x -@�!���A2`P[Z���7�q�@;-@��ٜ��?{��bSl�g��-; �ͱ���A��@��� ,| ����`SB��)6eH��B�.�i�< ��@��]"D�l&= F @8�5�~8�w0��RX7�~863�Lz3K� �A�-���H��p �`)���`?# �� 20�@%a 0�s'd�Ep2p$Xx�\ �A8B�p�W�%@�A8D^��0��|B"����@&�@�&��?X�g ��%���q K`���`  �@Np K� p�=� �d� ������L`���3�X03 �43�̄�0f�����qu���<�KdPt�_~a ��0ܥ_���!p�@�B~B�� ��uL "���\��(�.��+��Lб2��+�$��?�2��ʠg+���G  ���� ���Fy���.�� �A0y&�f ��oB�*��f ((� U� @�� ��^�� ��"4� h�XX��! k�#h� �2�9qנŠ$��fR�GԂ 0'�$@>�A @��"���������a��ؘV�Hb�t�@{��A~ �О�0H�=���AL�H� ��C�0F���a* H��=7ڳ�$ ���n�B�0�$�^Оņ�$ ̏�ܞ��{���L: PI@��9T�a* H��=�����i��4�� >�J@/hϡ� PI@��=���L-��<�(�T�zA{@l�J��x���=�g�h1ͤ�0�$�^ОC���0?�s{n��&ZL3�� @% ���PĆ�$ ̏�ܞ��{���L��,� @% ���PĆ�$ ̏�ܞ��{���Lf��L� @% ���PĆ�$ ̏�ܞ��{���L�g��0��$ ��*@Ĉ ���0?�D{n����������1�$�^ОBĈ ���0?�D{n����I���K&|0�$�^ОBĈ ���0?�D{n�����å� @% ���:Y@0 �T���h���C3���sɄ���� ڳ)�H L;���}��C�Ga?����F���y���3M��8��i"0�<8��>@�V�d���e��;8��"0�N@�����"0y�L�p'��?@&� (p6�0>@&o�)z������"8�Ƈ���*$�l��"0y�L�p'��?@&� (p6�0>@&o�)z������"8�Ƈ����c���e��;8��"0�N@�����"0y�L�p'��?@&� (p6�0>@���|8�L�(S��� (�� Dp � 8�}/��D`�F���N@�8�L�(S��� (�� Dp � 8�}/�� �7�=wp ��D`�F���N@�8�L �P�l�a|8�� xy/ �7�=wp ��D`�F���N@�8�L �P�l�a|8�L�(S��� (���e��;8��"0�N@�����"0y�L�p'��?@&� (p6�0>@���|8�L�(S��� (���`�0�����U� ��8p ���ʇ���2E����p�8<C� XX��"0�N@�����"0y�L�p'��?@&N�E@�P �@V�8�L �P�l�a|8�� :��p��Q����P� ��8p ���� �ۇ���2E����p��Q����P� ��8p8��!�j@�N?'p_��P�Q����?#���‡; C�=�[��@ ���"& �*,��QH4��/p�@ X C�($ ���8�uH�X֣0z��QH4��/�6��@ P=I����+0ڒD C�($ ���x�d�H�� 9�x0R0 Ha�$A��o�L ��#�;G!I�Ħ��8�C5����3�B���M}�3�]���z) ���$hbS_� <@�=��jRC�($ ���8�e) ��F�8 I�&6���t�C H��0�B���M}�3�]����@~\D* ��C�.T�]��PX��$0z��` �g�H(�p 4�?�D`"&<yp i!"|8�� �B'� �7�=wp ��D`��g��D`�F���N@�8�L �P�l�a|8�L�(S��� (�� Dp � 8�}�UH����D`�F���N@�8�L �P�l�a|8�L�(S��� (�� Dp � 8�}/�" �7�=wp ��D`��g��D`�F���N@�8�L �P�l�a|8�� �3�p��Q����P� ��8p �^. ����2E����p��Q����P� ��8p �^.�?@&o�)z�������2E����p�@'��ـ��p���^>>@&o�)z�������2E����p�@'��ـ��p��Q����P� �7�=wp ��D`��g��D`�F���N@�8�L �P�l�a|8�� x��p��Q����P� '�" �`(�  ��?@&� (p6�0>@� s 0���e��;8��"0q,"x�<�� ��D`��g��D`�F���N@�8�L�����@�,��p�@'��ـ��p�t��"0y�L�p'��?@&� (p6�0>@�C! ���e��;8��"0y�L�p'��?@&� (p6�0p@0C�Ԁ$0��~N��������sF5 �w��{�E� @#� ?�ELFUX ���$hbS_� �!����QH4��/p�@ ��Ga� ���$hbS_�m� "��z�F�W`�%���QH4��/�6��@ �r��`4�`��8 I�&6��&� ��G v0�B���M}�3pX�j�e= �g�$A��g���!$P�RG!I�Ħ��x�.{H ����QH4��/p��R@5)��!p�Ml� ��貇�@ 8 Ha�$A��g���!$PL����T@@���]�*4������+�v�9�����~F@~ ��s���N?'p_��P�Q���YP��pϺ( ��F �H����c ڀ��Y������A�z@#�` �Q( C�@���3z���t�g]�� D��Z$P ��hH���+0ܳ. ��"�уS-��`�\T���@�� �����@�H`����j��3��d�X�*� ��+�=��v�9�����~��c�\*�(DC1���� ��a�C@8��O1Z��>�*mVОy���� K� ^�#�>N��80`��0 7��Y Ɏ��q� x�GA/h Տ¸a�j����� ��hЯ =,����1��J�(d�A��8�$�*M%�o��� ���|�zX J�8*��x��A��|�Up���Y >��,B���p����*����OzX �����d�!��N0�A��6�� ���ܞ�F�@t4D�ѐ9� +8` ����� �p;XA�!u@���!�Hu` �p[ƀ� :H�����<��R^�w�ȇb��#@#(� :�� ^C�^ �%�@ ��>P�H��'$@@8��@]"�C@�Ay&���pS`���S�iB�~ �?�z��<��ry� 9 r����`��r�d�!,�`|���6"���A��� �`� �A0@��N��! �/y4�������(�0��@_�Kh�,�%��%���K�D��$���|� �Z�� :���>�����``8�D� @h� ���~��̀�iB��ˠ���d@�,��0��� ��  �A��� ��h� �� �j �>���Hh��D�.�?$$���B��!!A�}�h#?�"�b@�X8`�$���`x��?�C�@m�KXa��>qѐ�F%�,�!n�BXP6a!���XAX�|G�H<�p� Dx a�)@����D8j�Zߧ� ��SO" �� x ad c�`* "a�� H"� #��@$�� x%@�S %w�@�H�HX� bL�j�zj�t�-��8��pR >!���U� `� Y�`~R��rc� �)����;P��1O�D��%� "��i �#4�HG�V��1O�D���@" J� �)���VA� MF� ��������;�!"a ���@�x�V00A �1�'w ���=`��1$ĸ��1@ � K@ PhM�vA� K "��~r�:+�'04d["��[ ؁$8u>8�`P;�G@@Ch��@�v� ,מs� �8�=�$�@̣�:`��� �#�����^���@0a�k�8؃y|8_�� b�p����T{�^�(��Q0`���� ��D�a";� �NcH�(� ̂`7�\`h�sNknqF�(d�А�u�@�v�h�������%��Q`��d�6t.�员g�~U%A�SL��. �r��l<0ٻ �rɶ(����g�~U%u�o�UC�0 Z��9���$0 ���7>�Dt�!s.?��, �!s.?�7 �� ���H|������Z�B�� �� ���9@ |��X���мg? T@�I�C�� ��D��DM�Ip��(d %�@t�p8A� ��# �1 h��C�.�=BG��ʜ����;$ ���QFL�^ ��zD*HK� ��!2�OHK�h�+_�|�G�\�����4��8����C_X ow)��C)�;�1=��v����b�� ��C_X ow)@ntC���V"��)C���V"��)�;�2 �K���ށ&\ <�/�� HK����C ��R�-Ҳ-���[ڂ�X ��� ���?zoYK��h?zoi �c= �(�����<�� i�`�KoY ���@�!-,pi ����@ �[~`O:6CPMX�B���CZ6X���a������ ������/`Tc�%cD� \�� m���]������ Fwe]�f��\A3@AWpR�t��@�/ݵ�vW��]���讗@�D��p R�����t��p @��Vp$p*��Z�D��@ #H�> ��@�5 �� �@��@0(�D@��)H�,!Y��Q�A#� �d��7�dc�!��-1(A"8;_�1���9���� �-l�Ë}�$tcl�D�A+,�7@��+D;����� rD��z8A���CD��Tt�]�D xG�=@�9�y�ؓD��΃8Z rp�ȑlNt� ��D��� ΃��D����lN�y���D��2D@��A�$�����L r��~@ ����)R+��� {�/ ���_h ,�/�ư ��h  ��� ����B���kjE�>�� �'�A~�&1�ܔ�Bc@?�c4��J�@�-��Q�DcP�/4��B�V s��K���!beK�򧊬�*�_�� +��J�_h /��ƀ�ЏB�1�Z1�@̱���;.=��#�6�/t���@c��F4��3��8�. �0�y�������`؈`Ph�@e  ��0��@�� ��P��@X=-�Fԁ�8`(@0���z�5 ��� z����=�h"�&�h��B�>�=�Z�� ��=���hأAkm�����Vv�=[+`��֠G���8�x ��(����Zŀ6��� ��[O����cy��`У'�#�8��h@�m0 UL�0��Dp a"�p@��Q I@-L�$ H����`"쁉� T�D��=�� h� ���8��� �Z��H�4 "FĐja"��` T���@ �����,@j�@@ �)�l>�T�"#CH�A���p6Q ���B��P<�k���G���Y$�`*��u]x�U�]� 4Y���@C�L!�OX�I�� �A�H�x.@�8�H:E��+D���� E� �Tu�Su���\����fAI� fƝM%]PZ�$����+�� ��(Щ�� 80 J+1�4p6�`*H2�p?=�` �S0�pH��eq �X��#����,:�y�����`������"A;�,�7WX`���e�Q����<�`x%w� t�`��(=,�b$C1�,6��9�� v#�j."+:�rY䯋h�E���C��� YQ�1�q@��\�}p]0��*���- G���*��'4�}R�QX���@X�� K,�+AcC���4� �X�B���>,��Tq�o��~� jp Y \��U�}@���AE��(����"�;�%][��cP� @&�n ������H`uǰ�k+ �&��F��( �� �� 0�&�����.( (���u�tשV�1D�TdA��! ��:����F�����`h�T��a#��8 VĪ;�(�!���� �4��=��Hس����PY �B(�� �A��"�Iׁ'��K�"�, @��A�s��nP��>�}A)|(�b����3�n�%W� QADDin���.� &��)�� <`F��,� ��J��+�pe`,t�28F`D��l.�2@���P��2@XF�20$��=Q��2�� @F�e�J�5WKO�p��i�2q�̟��D0B@P�=� �@�� �����K@����J{�*m�%��^MbIx�=�t���1#d�':h� ,$;�^�E�5�JQ��VZ�_iP��D@{���`� B��VZ�_i�� 2žp�@��Q�A' "8�N� V  ��Sd��(1X-dp M�Z�w(�`�@o�� @�� ���: A��@��@0��?�RE�.@>�4$���.�~�Z� p�@C6�l�� \�|@C�E�Z!pV�d+Kp����@ @8 & p�"�L&�Y( �@��`���4&��jmi. 讄��h�T�@u��ܕi�@G0qNA0�� Lp�4� �@ؕu"T�0!�E*�5�a4�������f4�%��L*0]z� ���p@*XCj�.=n@ݕK���r j�M?�! �P2b���������2�A� � , ��tk� |��+G�2p� ����#� -F �A~���Gb~�Qd��@@,- p��+?Q�;��h0 ����4ॿt%:�#����gzP]+�dD�1�{+T���S0�����#��:` G)^z ���0���X��#0 ]�:BF�$�� 6���J��8<��w!�0|A ��p �D���`@Jf���` ��)Xҁ T�` � ���(�e�L�P��$lS� �t0��(��LA'��w�� L�B���$lT��;� �/���N�*�$�'a����@,`)�� ,��@@'�0���=J�� ���1�|��*���?��&�@>�V<�mT���.,�NG��5�@�L.\��b@Is` �� ^� � N�AA��_�� R'H� u�)i��K��|F�� �`!�S���:@�S��N�:@��\x�/�e� ����$�O�>y�|S� ���0G"|S�a8 ��0��pn B��0��p�a8 7�`�����)� k�9����s�6u:��|��@>�� ��|�`8 ��0��p�}��_@b���}L�& �� ;��y; vDj�;� ���#p�����pֹ���#x� Dd���qK� Dd�ӀK�R#�K ÷ 3w Cj�80�:7�1<�';bG�y ?*1��������P8 �#ؑe.,�@ '�Ŏ��ev�2��vd�/�Y���+X�2���� �|���p�7t� 7 ��,s��g� _�"�0���c�Q��o �u��,��. � �K�E���a�0D����A�<}D�2��$��B�B ��"�@j�Ih�  �&2���B� 0@��>�.p�)0W|�8G��B�*|����!�(������S@L�����"����<��9aW���Z��=6߁���vA��%�.�)0W|��BC���#�͑@%��V܊� P�).bٔiъ��G��|��u����.$�V�$��H�;�1�K��$���b؊���4G"�V� a86�6W�x�P �^���Wx����!����]1D�"����<��9o7��!4�X�4X��5d]�$���;���vA��%` �8���4G"���g��:6�� �\]� �$�%4��K$@+>6�G�4B��p�D�� @| ��@�� 0\�.�>�.L����Q ��[����0'$d ]2�Z�.���;�/ ����D�Ԃ|�r%�. �� H�V�K$AxhźdI�V�KV�$hź��魨K��$X{dO�@��K|�]� Ch �!dkn��|I�K ž�#�d�|I@ ށMi�`A8������\� D��bS�C�v�OG�w��S�V�%_@��Ҋ� � ��ؔ�P��:�Ŧ|�W��;�)�q !��%��MBĸ��i��%��$f��D�� ���_@\5�g"�;��C��/ ��З���T�"!4#������1���������!�r��Za ��!�K���o ��@*ƀ.����8���tB>P�|I�K��$B>p�@]�$Ax�6k:L�5l�t�jb�6�$��) 6Ŧ\5�>ۄM0B�|I�%|�.��`��!�� I�6e:ج�0�|�.Y�C��\]�$�����H�s�hź�}�@��Z�$0` ` �ܣ�,.B�f]�z擋��Ⲹ P>B��@$�(�Dbp�:@0�]" �p��QB�@�EdRkJC� GB"����A�` ���\UA.�����*؜�spV�CF��E�#�����KgL�%f*��@�DP���K�l:�]�Kj8@~�(�����Ԅzz��B}ç���B�Po D��7��U�Z��艾25�n�qi��u���u��葢JM����j= �p� ͗o4�>;R��H��%������/_�N�+�_��Rq�~����]�:S/_ʦ�7�V�(�Ӣsj�Ψ;�����S��P-�Gu:쌚T�jS}�Q�.H�}zqU������Uc�WMya�GG�B�N�X-��/5��:���|i���D|`�j�|�� �ùZq��.Tij�P��D]W��Cͫu���M�Wk�n��F7S�7X�8a=�)o7�������Rԍ��F�G|`&ke �����,̺Y��k��dw�J� a�g��C:�V\�:ZK�iM�����K��/�k 9�8����f�j�m�����[{k*5=�u��<:Z���`��:�\����l���F�L]p�,ဆ�F�Q�Kj8� C�p�!K8G.�ᰗp� �E�� �7���`#�`/�h������X��`'��I@>"O܉GǬ ��QPU�`���.pN�.d�N����O�x>8 N<(�0K�>�N<�|��O>�,� <�|�fx>��'��|����Ƨ��|��0�������= O<'�� ��/䃵��B������ ��!� s���9H.�z��>���z��8 ��(|��=���� `�=HƧ `���_�G��4�+��Q0v�|��H8 Ǝ� �n� �"���sD�_� �(��\�+r�QH� ��`�_� P<\�� �؄�Q�6fJP5��� 8W8ʢ1ԁ4p�Ac���eQ#�L��Vl��`-P W( ��,ĵ�����6A0��%������&H ҄�|��@��B p�|�ԁ[X��:�kr=��������q=A�Bm0�KG0���-ג�b����.@��\K��Ǹ��z�|�h�]� �@ ��0��u>K��p@� ���x3K���S?��X8X��a!8B,0lh���M5p�~,#���Q(�F��(��� �+p,F�/dD�* ��S�A,�~�A �p��p# �B5G�t�wi�@:�?2�Ǚb ��)���� �+~�#P@c��7�~,��vt@��K��L*0( Y��~��%�o �p, �}D��\ ���(l\+�}| Gp�I���.B:�-.��� �a+���0H������%``�.��`�R�0��� ��y��@P�0�:@���8D�X�~�0���Τ+��!� ����H8�����I���4�t]J��_�~�X#�@����꺰�؆�!N)h ���%b���X���H���%���� �~h��S�6���݀v=}>;� X�H�GX ��{�ځ%���L�Emq �֩0@\+�q{�8KH��8Y���E�� A��c�؀n�@j������%`�e1�D��(ud>�Q)K�,�@�V�Q! ��|# ��Z)��u ��0�@WXaa �%����F���!�A)X:�]/XH�Z�p���+�[�9����zo(�4P �������׮�t��A�" ��:`�#@��Zܵ0��� � �k-:�]�� ޵���i�1�e`$���\� p��@��4F� �S�*�F�hx���u8{C:,����~�E m�ևKX����J`D"H �@.�+��B"�� F@=��R��~�G�Ά����Z�aa t�%@���F�ǐ'A��ȓ��1� n`#C� ��<��\��� �E��@� ]�:���\�?�A0�� \Ē �!?8��"��":��8���I�t l"c��6P��3K`P��@1�D�H��(�>3 �������k*>1��M�3��8��&�BP A!��`C��%�&&�10Q�Bh�I`�L���P�lF�Ą=!��DQ �8��2( ������������%,z���kq K@�/�z���P�K����%PJ���^�z ��%`�p K�^�R@�u@)u K��(v�r�u�p- �%,#p��0 .a ��A L�6��A����kD�:K�~��%���(W�(���t�8�U<��,���'�A(��0]��&m!_�i��H�a�@'����]�C@�d_�3+�͓�����Ê��+� (���:OhkPpة��� Ox �1�F�p�D,+NJ����d��w6K�G��-��4X`ُt���\ p7�8;E�@��kȘ�O�+>HI��'+^�@*X �Ê�MH �/E � ��+����� K!x⠣<��W1���ɼ�5eU�K!�����Z�.��A]E��� H#G��D���;�I6y⠆8HĿ�A�|� ���^��f����1L��:vS)l��ї� ��0ƣ���=zIpр���̓� �A��?�VA�lA���a��HcE�#��_�4 W� ��v�3��t;�W =\��#��R�{ �$` C��00�u��H=���q3���3Op �&`��;08F�����$��y�K��*�7�y�;=�� �+��b�c荥� @z  �(� m_X K!=̻%`?D�rG`� l��z��R����S,�����aP���"��K`)8���kB*HKaܐ�r�CzX#CP���2��Q8 "�ԏ%����>@ '4,��!�H�X ˠ`�.�4AM��`)��Qp �G􅥐��� K!=,��@��X ��9�#�s\D*H�`؏�����&�!�tLA�'��a�_�K�<����:�_�O��/����t$���D���q��Ft�l�]"|���@h0F�)�n���$�_�L����&�_��FT\|�o�T���*d�,�Ob]� 8R}�%@����D8=F����xE�Di0���dD?Ȱ�B��W ��b 6�0t��h�s* (�<����cV��?��E4�c.�@�v��a;lk�U���?�a�i��B�0����"� �Y�Vl�ob5���8��`��1���d<�~��h G�rP�6� ����x,dBh� ��|��� �Dx5���/�N�i~��k��/P�h!L��43o�_�5�2��(9pd�n2���@��_A�n �"6Xd�>I� ]ݐ�u�GI�ݘ�� �� Kp��(���� ��$b��(��3� P���� ��*&6R8���d�I.N*�$/��@�M����?H&N��8�n�C�����X` L <�. ���*X�#]<6�$�_� ����� ��aa��/E�����a(�/�����al�l<�����_ ��*ՇH�8���(P8�M�4���0.��@x]�0� �逕� ��/m�����h�@�A: ����t(�/moɊ a���� J�������K�)I�ƞ�_��n�����=�d� ��?��()�����q�����!�Dt0u���@�8��K�0u���@��r�JP��|��r����/_� |����@�6�G� >�$�?���@� �&�$�X십p����/�����d�M�/�F�����L]t���� s�"� ��/��� _"z�HOI���D��&���R8 �����b��,�/b��)�8�_L"��%;�:��\H��Nd���L��Q.���$�_�"Y-�e�()��\��/���()�Z��jQR G!���R0h2�%8�U(t�����@��P 0�o�!8�K�0�D:(��'��)�/V|�I�` ��$�E`l�Nk�x�1c��"����<�`�h��"��<�-����y� �I��C� dtD0�`<����`n��/����&�86�u;�g�%�a�����fId�&� ���/���0��u������nݠ�:vR�ߜw����y��6�����ǻ?�7��"�������3�a��q�c��3^��7�g���E�?H��ԁg�lL��?H����I2��t�@�_~�' �-AM� 1�!�B����(��6�+�K�1�Hց��!�<�@2ULl�H��m�E%��� ,�>T������UT@H�.@�>��=���aAK�F�CXE�xCl�J�(�l1>�1��/" ?�ls�.�#�1\%��Ol���4��pv�#x\]�� p��.������ ��B�����2� v���/�����rL�*#��k� @�u��/�d�lݰ�N6�6#{8���p��n%��l�}��)(�%�dˇN�����v;;��͔]6S�)0ى�l��:P6Sv�L�" ]MP����@�C�M �d'(�@Rpzx�!<���/��V J���/�{$���Á �X��� �JI#$���/*[7X �}ƍ��/ �����`��/��D7X���O�86@���l�l�`1�f�>��� �$�N{v������O�_L�H��͔]6���U�I�*]������7���/�t�` G�|� �E�v0����]� ��KD ��.�nڂ�و��( +!8��L@ʦ�����?D6�A�JBe �B"~����d� �J�H����ia`� �9"@ ��7�C-p $�E�#�@s�( s%�{�� ��''�������+Q� A��K��с���>8@�#��E�\�Aàe����<�s� ����K� �}p�( F@����ƒ��CA��X��x�0H�AX��7.[I�4�C攄����$�(�9�W4 �ɠ9>�,��: )�#�@��� �ôx�A�\61 ,@���¬�/(\DQ�G`���s����>8@�#��E�\�AÀ%�� N@ �4g-���a J�\A$a-���Cs.�Za bМ���/�Y@%j� ��SA��Z� ^�@��>�1 1a�E�2��e; ���]0�Hr�9� T�/�6��@�E�1.��p��*E@v.b �q�\��(�ڇUꂜ�+p� ���$�NW��&,�.�E�8NWK�J���O�"���a��R�4 ��\1T��a�"���%�Q���S����)�\\���"` 80���%�҄�S�b‹��D��_y�0p��Et��e�L�(�$$�:�&(M�������`+�ҡ9c��PpI�%ܺ��hv�D�)���Qh��F@‎2W���%P�NW�'I( F!���@�KG�޶$�\�J��$������a841�F�h� ( 4Gŕ���&�D$�2����ָ���$t��� ���(tfہ��U�����G0P���?���t@���`�h�p�s�g��"���R�sKA" 9�p@0�: ��~0V��ι������u��@��!�g�sK7���c�.n.�u����<��O�M'�?+i��q� �%���s�K�A)�ۃ���R ��� ����p��@0�!���A�7��2{ ��5�f��8Cj�%��/���1^������� ��� &"N�V�xi( �����?�@@������DZ`�0��X�� � �I��đ��z��Zi��9��D���&��j�z���ٳ!����l��A7FR �tsP�^�6�G!p��!��<7�7��̣�E����uk�8l"7 � �$�z�G�Y�E��p�ڱ�x=\�V����F7 6T��� l���t���{�nVq���7�D�&��h j/g�>4b$��vl�@b���9G&8��m�v �4�q�"~�O ��33��#,�@|3;G���fvN �aAD���B�h��)��;��@X���X>�ixA09�2胧�&�+�Yb�]� �H�"F�H��:��ȑx  h�(�BXhM�<��p'�� qXF#���������6v��$���aR� K@�т��6H���^����W��@ ϫa hG�� � l B�$��A@B*p�P��Z� � �� �b�� ��y7�W5���ػ��%�Z�W��lD��R�+H�#ѡh��nB"�٩��bɑ�(�� �@:L9�#�HXr  ��D���� ���d�RF K��/�����K`)�`?@���C��pp�Cz����Yb?D�R��a)8������D~Z0?�i %B@ ҏ��(�@S��~쏣� �9�ӂ�h��c?D�c�q��������)8�QT�v�w�~p���Γ6&I��cX` �!hB:� ̋�$��e?��%�$L2&�'c)7�`?DBX� )�ѥ�1�M @i3��1ưm `��0I��$�~dY��1�h8T�"6�RX�L{<��3�1I�$�`�, H���0Ps&�дa�I��5)$Ceh��Sp�N[UD�TP?���@��c , ��;�I� K�~��U�I`�H�_7.pZ � � "�Bz�>W�,\��@2�i �$�qZ � $\�ʼnr d�( ��8.� ��rI O;@m�`æHVA�CmC8�q��lBF<�3 �� H����AJ��UhĻ `ُ����R�Cj�Q_������98�� ���Y� ��R``S{���6��I2)�$@�R� �Q��p���X ��}���"$�fA8�"��p.*�!�����; $#�Jp0e� ��pT��b�C�/����V���"pP148�`ĩP�.����%�[b �A�z� ��`�B@u ���Cu� 8�FI����Kh�8� ��u�J������ ��/�A �b�$��v@r�A ԁ0�@���� ��0%!��� �@������|$Kԁ@B���#e.��"yAB���"e. pd@�h��#a��8@�H�7� `�>��A�H�f��y ��"s�jwu����0������`AB�I���P.�w��ޣ>�F�=�Cn�W$,�E����)��@"�2\t� �jw��9�#X�$D�A�E�� i����rT��g9*�`Q,�EQ޿;*� e�|�2��H���~���hTOP=@�F�QP���w�n\^q$��Q�! �A��pNZ(�� `�� ��Qs� h�a�.�"����.�����E>��/�xq/�h("���/.PD>.�h�@�I�(@K(a]�jW�9^����� A ��&@��p)�|��z��h\{��X����� 68G�'E@0 �8�pR�8* !eD��&N�,�$pQ��E@�@��p]�[�n���Q�p��ПP��J�#��Pց�sT ��!� �d8By�5&G�$ �խv՞�U�� ���zB��Y��]pcg> b��|�*v�QP��b8��v��C �BE���.p�0����TΩ#^{�8�@�%˖)=A`����xKY= GL |�ž���^Z�����u �Vd��8�p6��4�"��pCj�|� � >` �� m�TD>��@E|�|��y>�����|��x>�����|��A�_;h�=5�A������|�m@@I�#ڀڂ6(L lHd{�� :�h��]�@�S#؋`@ �Ap Cjp |��AĐ���|�TD>�\�k�4������� ��|2����i� ԁ2�%��(���K�����@>Ȁ6h������u |�M@�!  B��b�:���sj1�)rp�|�ـF̃�DD �_|@@@c��%('��Jc����������`��� �J*p!p�@|x�@%p�.�J@��pG� ؅J۴@% � � J�`c�] ��\DI@*�K�$P,���. c�]��0� �(�fP�P� ��IO"�����^,��h,�X����.Nzc��D%pn�X�E��H W���+a�@%Ċ?@&BP \����X�XdAP ��Ȃ�� �PU����N��!R���)X�X�,P, ("�X�hS,�2��p�� ����Ā(�&$�A"�@!DPd03"(1� AM � ��!�@!�:� l1� w.�"��M �@q)�R�Bp ���d`S�7P�EM vC��*� �np+B�@���V��|0B �ba�mp�ӀK�?ȇ���|�x>p�g5< d� �62xsL�l_�@r�a �G�|� @�.@���������?����R �I�����&nr܄ �Eԁ�/x�� 30XA�h� �wBC��4��t�� "�`5���Ѷ>��K,�i��G�d ��q0�H�� ҁ1����t����:@�@���t� ��/X�7�e��:P���P0�АQXm��Zy 6ګ��Z�@�-a ܒ�@*@�P�f;�H�$ �T0��xh �c8� � 2`���p�9J����@sHn[��m�j��D���s�Sm�xHwߴ���]�$�b���� }����"k���b �`/�� �`|�T1BB"�&Y��"��+�����������������~����6� $�^�p?���0����+��B;���)8��x���o�����#`18�(�)l��9�"����/ׇl �" \��QE��r��� g;�� �H(m �0�Sl���)l�5�a�d�Հ)l�*$+` T`ξ��,!+�^`6�q@��-,?p%@K5 ~S���jV�V�S���R���)`�`�0���Q�,��� ��Y��PN^q%�f,X~�C�L� ̆�fa�+��������? \�tP���L�PBb�q?�� l^� �[` Ž������� J�ݥ G��R�Ru�G������=�R$ )��w�2"ňR\�(���Cz8K!Jُ� ��� =����&�R�T�H�� Vd���r@��m�"�c� �c)����"���R�#�!,Po��a) �(�#z�RQ ��� A�� {Dm R �l5e-�E(����q a�>������h�aAms�QJ1���4����Â�>n������Mg@ a�)��fx���*��x��bH ���� 6�" ���i�@��8`��p�L��! d��MdJ�i�d��i��@7 �p`2FU�Rg��� �@�� ,�L��! �m p��q  ��4��  E ��Ka0�C ���*�R�0�A*@��@ ���R`���,p JôIO���K�1RAzX O�~��Dip}a)� b@ C�K�0�q��<��` d]��B��@D�}�lJ�2�3Bҁ: @�!�� ��m���A�!�yD��� ���� �6(���K��@&8�@���@" �n����0��� 8@@D��Z�%��p�` �P P*��( ��1d��R@(`3�`Ԉ� n  GR8N@ �F��\Pp:��N�t�K ,����Mt�0�0bu��Ġ�t �i�50t����Q��%� aB��� �e�m���C���&����aB���W�=� 1P������ @7�EA�n����(�C��ؠ�H���dž�ЁK��%Ų`?%�ft�K`�tAT�*}tZ��>��+|�� ބVn�`���[DN�.(� 8�Q@�R�aXC6��>y��\��� p��Qs� ��{n���>j� 8R�Ft�F�(`�  ��^ �~,��Zx� 4s4j����K@)��� �Bk)�G�8��Z�v��7s4jrEѷH��� D)������&4W`���hԼ���l���w �!���� �n ��g�,���p@#����� A�>�A#��%0Z�_8s4j��QDr0b@���`DrHW���Y��� Bc�(��p�@I8���$��� HW��,F���Dr0�E+��!�'B�HF ���!|�X` ��*PD@*����5�P AT�5�� ��o@��/2�( �[��,�B@,!Y� B �D���B[�^����V���A�� W`�|�H�p����S>�����p|:g���z� Ȁ R�~����A����)~@�E��@�����޲�az���� ��� @-� ™L�i` z��� ��� D@`����d@0�@,4l�,B� ���npT��@ �|�z�@0� �(�@��B>!�@����U@��|@���@ �@#�@4b �$`Z`�؈`ZA0�`#`?��t�ΤN� FI e�PBCv�^���+� �� @ �쐝� v��6@3 }p��\ `Ą�� ���!@ Ą��#�&(s�E@A>� 7o���^A���D�GƸ$ u ��O,Z�Ā @� i\+���� �$@@%F� �t�QY+���� ���S8*�)��| �@����% Z@K"@��]&�@�B��f �0h�@\A А|`�O� ؜��ހ8�ց �����("�V��'��@ xBPpԈ������9��P���� �X�bA�����1P �xI` ԁN� F��|$����� �$-��10J�B��#��<��Gb1 I` H��� ��X�0��� �������x�h�X�H�8�(��s�e�X�K�>�1�$�� x�h�X�H�8�(�������z�m�`�S�F�9x,hXH8�(������ةȜ�����u�hx[hNXAH48'( K��Q��̨����������������������������� &,Gu����/\_eimvy�����6*>876-< +,5(#&05"=18?76E!)|  ��p (� ��D�PP�`@H��pЁ�B"0B� � �0� '�0@ $���,��� .��� )� 1��3�0�5�`C $ @� 7Ԁ� "�p 3 �;� =��5$� ��D�0@5�`GQ�; ��J,�M8�QH�� �0UXqE <�����?����?����?��s �9�$�?�DD 4A �H��$�A!tPB��> �?�쳏��? �0C5�C D��@,� ,�0�!D$�*8L� E�c�! \t�Ee�F�@�@H�� G��Q0 @ }�GyĂG,�� "�BGyԑG���R,DRH"-RDK���H$��I'��DH(-!�!��� p��*!�7�K�p��C )> ��, ��R��R�hC@.��/�� 7M��>i���Kb�DL��F�$��D 2�� CILp �-q0M�d 1���M8Q�S0I��<�ғO1��"PA �4�8T04 #A" 5QEiA2�qRL$��RE��SM ��SOABTRMEUE��UWEUUVaUY P�UV �&����&�l5@$W�ѕ@-2�"]�@�@��d�Fzu�W`}%XaqX`��Xb�EV5�e�Y ��ό��h$Z��5PZ��EZ� �Z]@>k�U�@  �)�eNH��)渰I'��W\rͅ���tP] `]��p]�:x��"�z�e�.|��~���@��X:��"�@#� �`� 7�f�Q��Xb.ƍ (&�`�)��a�%VG�� &X L��Xc8��<�9��c�A�Xa����9�D6�  �&����9���IdI6e�Y��&]����mY>� B:`�Yf e�f )��B�)d�B|q��f�)H�uf#7����?aiscXa9��g�-d#7���c8�����6Bڍ����c�A�h��6`��h�i:��2������k�M3�k���Mli�[l�i#[li��������@��i�7iTa��hc[[i� ��f�%�\�[ ����n�5VG ��s$(��R�]BP0I�v�o���n� p�'\0� �"q��q�)t�)��&p��щ)�w�� w (���%�$g�%� ��rQ�p ś�:\r�s�0�OrЁ��M�� @��Y7�aw]v ��v� ��v�u��ŴwA���wN �w�}'�x �Wy�� >(%���'P��'� $�z��KI���Tz,��v���K�7K�7@�����R����I{��1��m�^' l��� �p1�$L�E*���0E,�p��~�0�SIJ$�w (�� ��� ����� ��"�n�B_���n��'("�( �w~ `�}���_-��� ���w�~"t����B}G�3��I�qNLT��B}?��#��2@}� ��u�� �P_}��� 8`[X �`�88���8��� L� 0 6� ��;��B�%�d��%�s (=�# @��n��!1���_�D(��H ���!��QXa�����$�I%X�@\d�B�&d �p�"\a�W�B "�Bt]A�dH�����%�D$�ؒ`� �bK� � :&�`� &���a��� �!���"����YE�v����%� Y]����:\��n���ܜ7(�x"�PÍ*"�يܰH 7� �@ ��@ ��+@C ��B�@8text� m�f ��>��Nx�@R�p0��A)��8�6�>p L�yH�$�*�`jX@RW���pC�d�-0�c0 ���� A `�8�@x�@ ��� �� �x�VSX@ -�BLЉ ,���C�@�$��`�0���*�0�J� b` ���ځ(�c��LL��� �� ڑ�<�)H� '�� ����0D� �� � � f��^� Xd?���0�QPc,"0�r�Ԣ ��� *A5��}�����/� n�l h��> b/�� <� p�H@ ahB�Af؂x�� �>MЂ �$ ��� =���C�H�KtL?S\�\�_�cCi���� l�nt�wPz�{;������l������\������÷9������;� ���}�y�������/��� I�5E)6-�3$����4�6�:+���b=�G�K�N�O�T�ZN����]sb�hl�v�x}.��х�`��v��Ì1s��e���ܢ��Ъ��`��K���:����=�����/���p�������Y�� ����(#�&W(�7�;O>nC�FjH2L[INST] How to get indices of N maximum values in a numpy array? Numpy proposes a way to get the index of the maximum value of an array via np.argmax. I would like a similar thing, but returning the indexes of the N maximum values. For instance, if I have an array [1, 3, 2, 4, 5], it function(array, n=3) would return [4, 3, 1]. Thanks :) [/INST] Newer NumPy versions (1.8 and up) have a function called argpartition for this. To get the indices of the four largest elements, do >>> a array([9, 4, 4, 3, 3, 9, 0, 4, 6, 0]) >>> ind = np.argpartition(a, -4)[-4:] >>> ind array([1, 5, 8, 0]) >>> a[ind] array([4, 9, 6, 9]) Unlike argsort, this function runs in linear time in the worst case, but the returned indices are not sorted, as can be seen from the result of evaluating a[ind]. If you need that too, sort them afterwards: >>> ind[np.argsort(a[ind])] array([1, 8, 5, 0]) To get the top-k elements in sorted order in this way takes O(n + k log k) time. [INST] Python - merge items of two lists into a list of tuples What's the pythonic way of achieving the following? list_a = [1, 2, 3, 4] list_b = [5, 6, 7, 8] #Need to create a of tuples from list_a and list_b list_c = [(1,5), (2,6), (3,7), (4,8)] Each member of list_c is a tuple, whose first member is from list_a and the second is from list_b. [/INST] >>> list_a = [1, 2, 3, 4] >>> list_b = [5, 6, 7, 8] >>> zip(list_a, list_b) [(1, 5), (2, 6), (3, 7), (4, 8)] [INST] Abstract methods in Python I am having trouble in using inheritance with Python. While the concept seems too easy for me in Java yet up till now I have been unable to understand in Python which is surprising to me at least. I have a prototype which follow: class Shape(): def __init__(self, shape_name): self.shape = shape_name class Rectangle(Shape): def __init__(self, name): self.shape = name In the above code how can I make an abstract method that would need to be implemented for all the subclasses? [/INST] Before abc was introduced you would see this frequently. class Base(object): def go(self): raise NotImplementedError("Please Implement this method") class Specialized(Base): def go(self): print "Consider me implemented" [INST] Compiling with cython and mingw produces gcc: error: unrecognized command line option '-mno-cygwin' I'm trying to compile a python extension with cython in win 7 64-bit using mingw (64-bit). I'm working with Python 2.6 (Active Python 2.6.6) and with the adequate distutils.cfg file (setting mingw as the compiler) When executing > C:\Python26\programas\Cython>python setup.py build_ext --inplace I get an error saying that gcc has not an -mno-cygwin option: > C:\Python26\programas\Cython>python setup.py build_ext --inplace running build_ext skipping 'hello2.c' Cython extension (up-to-date) building 'hello2' extension C:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python26\include -IC:\Python26\PC -c hello2.c -o build\temp.win-amd64-2.6\Release\hello2.o gcc: error: unrecognized command line option '-mno-cygwin' error: command 'gcc' failed with exit status 1 gcc is: C:\>gcc --version gcc (GCC) 4.7.0 20110430 (experimental) Copyright (C) 2011 Free Software Foundation, Inc. How could I fix it? [/INST] It sounds like GCC 4.7.0 has finally removed the deprecated -mno-cygwin option, but distutils has not yet caught up with it. Either install a slightly older version of MinGW, or edit distutils\cygwinccompiler.py in your Python directory to remove all instances of -mno-cygwin. [INST] Django database query: How to filter objects by date range? I've got a field in one model like class Sample(models.Model): date = fields.DateField(auto_now=False) Now, I need to filter the objects by a data range, for example, all the objects that has date between 1 Jan 2011 to 31 Jan 2011? Thanks for your help! [/INST] Use Sample.objects.filter(date__range=["2011-01-01", "2011-01-31"]) Or if you are just trying to filter month wise: Sample.objects.filter(date__year='2011', date__month='01') Edit As lazerscience said, if you want a queryset which excludes the specified range ends you should consider his solution, which utilizes gt/lt (greater-than/less-than). [INST] Python dictionary, how to keep keys/values in same order as declared? new to Python and had a question about dictionaries. I have a dictionary that I declared in a particular order and want to keep it in that order all the time. The keys/values can't really be kept in order based on their value, I just want it in the order that I declared it. So if I have the dictionary: d = {'ac':33, 'gw':20, 'ap':102, 'za':321, 'bs':10} It isn't in that order if I view it or iterate through it, is there any way to make sure Python will keep the explicit order that I declared the keys/values in? Using Python 2.6 [/INST] from collections import OrderedDict OrderedDict((word, True) for word in words) contains OrderedDict([('He', True), ('will', True), ('be', True), ('the', True), ('winner', True)]) If the values are True (or any other immutable object), you can also use: OrderedDict.fromkeys(words, True) [INST] Slicing of a NumPy 2d array, or how do I extract an mxm submatrix from an nxn array (n>m)? I want to slice a NumPy nxn array. I want to extract an arbitrary selection of m rows and columns of that array (i.e. without any pattern in the numbers of rows/columns), making it a new, mxm array. For this example let us say the array is 4x4 and I want to extract a 2x2 array from it. Here is our array: from numpy import * x = range(16) x = reshape(x,(4,4)) print x [[ 0 1 2 3] [ 4 5 6 7] [ 8 9 10 11] [12 13 14 15]] The line and columns to remove are the same. The easiest case is when I want to extract a 2x2 submatrix that is at the beginning or at the end, i.e. : In [33]: x[0:2,0:2] Out[33]: array([[0, 1], [4, 5]]) In [34]: x[2:,2:] Out[34]: array([[10, 11], [14, 15]]) But what if I need to remove another mixture of rows/columns? What if I need to remove the first and third lines/rows, thus extracting the submatrix [[5,7],[13,15]]? There can be any composition of rows/lines. I read somewhere that I just need to index my array using arrays/lists of indices for both rows and columns, but that doesn't seem to work: In [35]: x[[1,3],[1,3]] Out[35]: array([ 5, 15]) I found one way, which is: In [61]: x[[1,3]][:,[1,3]] Out[61]: array([[ 5, 7], [13, 15]]) First issue with this is that it is hardly readable, although I can live with that. If someone has a better solution, I'd certainly like to hear it. Other thing is I read on a forum that indexing arrays with arrays forces NumPy to make a copy of the desired array, thus when treating with large arrays this could become a problem. Why is that so / how does this mechanism work? [/INST] To answer this question, we have to look at how indexing a multidimensional array works in Numpy. Let's first say you have the array x from your question. The buffer assigned to x will contain 16 ascending integers from 0 to 15. If you access one element, say x[i,j], NumPy has to figure out the memory location of this element relative to the beginning of the buffer. This is done by calculating in effect i*x.shape[1]+j (and multiplying with the size of an int to get an actual memory offset). If you extract a subarray by basic slicing like y = x[0:2,0:2], the resulting object will share the underlying buffer with x. But what happens if you acces y[i,j]? NumPy can't use i*y.shape[1]+j to calculate the offset into the array, because the data belonging to y is not consecutive in memory. NumPy solves this problem by introducing strides. When calculating the memory offset for accessing x[i,j], what is actually calculated is i*x.strides[0]+j*x.strides[1] (and this already includes the factor for the size of an int): x.strides (16, 4) When y is extracted like above, NumPy does not create a new buffer, but it does create a new array object referencing the same buffer (otherwise y would just be equal to x.) The new array object will have a different shape then x and maybe a different starting offset into the buffer, but will share the strides with x (in this case at least): y.shape (2,2) y.strides (16, 4) This way, computing the memory offset for y[i,j] will yield the correct result. But what should NumPy do for something like z=x[[1,3]]? The strides mechanism won't allow correct indexing if the original buffer is used for z. NumPy theoretically could add some more sophisticated mechanism than the strides, but this would make element access relatively expensive, somehow defying the whole idea of an array. In addition, a view wouldn't be a really lightweight object anymore. This is covered in depth in the NumPy documentation on indexing. Oh, and nearly forgot about your actual question: Here is how to make the indexing with multiple lists work as expected: x[[[1],[3]],[1,3]] This is because the index arrays are broadcasted to a common shape. Of course, for this particular example, you can also make do with basic slicing: x[1::2, 1::2] [INST] In Python, what does it mean if an object is subscriptable or not? Which types of objects fall into the domain of "subscriptable"? [/INST] It basically means that the object implements the __getitem__() method. In other words, it describes objects that are "containers", meaning they contain other objects. This includes lists, tuples, and dictionaries. [INST] how to get the return value from a thread in python? How can I access that return value 'foo' from the thread? def foo(bar): print 'hello {0}'.format(bar) return 'foo' from threading import Thread t = Thread(target=foo, args=('world!',)) t.start() x = t.join() print x The one obvious way to do it, above, seems to just return None in x. [/INST] FWIW, the multiprocessing module has a nice interface for this using the Pool class. And if you want to stick with threads rather than processes, you can just use the multiprocessing.pool.ThreadPool class as a drop-in replacement. def foo(bar, baz): print 'hello {0}'.format(bar) return 'foo' + baz from multiprocessing.pool import ThreadPool pool = ThreadPool(processes=1) async_result = pool.apply_async(foo, ('world', 'foo')) # tuple of args for foo # do some other stuff in the main process return_val = async_result.get() # get the return value from your function. [INST] What is the reason for performing a double fork when creating a daemon? I'm trying to create a daemon in python. I've found the following question, which has some good resources in it which I am currently following, but I'm curious as to why a double fork is necessary. I've scratched around google and found plenty of resources declaring that one is necessary, but not why. Some mention that it is to prevent the daemon from acquiring a controlling terminal. How would it do this without the second fork? What are the repercussions? [/INST] I was trying to understand the double fork and stumbled upon this question here. After a lot of research this is what I figured out. Hopefully it will help clarify things better for anyone who has the same question. In Unix every process belongs to a group which in turn belongs to a session. Here is the hierarchy… Session (SID) → Process Group (PGID) → Process (PID) The first process in the process group becomes the process group leader and the first process in the session becomes the session leader. Every session can have one TTY associated with it. Only a session leader can take control of a TTY. For a process to be truly daemonized (ran in the background) we should ensure that the session leader is killed so that there is no possibility of the session ever taking control of the TTY. I ran Sander Marechal's python example daemon program from this site on my Ubuntu. Here are the results with my comments. 1. `Parent` = PID: 28084, PGID: 28084, SID: 28046 2. `Fork#1` = PID: 28085, PGID: 28084, SID: 28046 3. `Decouple#1`= PID: 28085, PGID: 28085, SID: 28085 4. `Fork#2` = PID: 28086, PGID: 28085, SID: 28085 Note that the process is the session leader after Decouple#1, because it's PID = SID. It could still take control of a TTY. Note that Fork#2 is no longer the session leader PID != SID. This process can never take control of a TTY. Truly daemonized. I personally find terminology fork-twice to be confusing. A better idiom might be fork-decouple-fork. Additional links of interest: Unix processes - http://www.win.tue.nl/~aeb/linux/lk/lk-10.html [INST] Using pip behind a proxy I'm trying to use pip behind a proxy at work. I'm not a networking expert so bear with me if this super obvious. One of the answers from this post suggested using CNTLM. I installed and configured it per this other post, but running cntlm.exe -c cntlm.ini -I -M http://google.com gave the error Connection to proxy failed, bailing out. I also tried pip install -–proxy=user:pass@localhost:3128 (the default CNTLM port) but that raised Cannot fetch index base URL http://pypi.python.org/simple/. Clearly something's up with the proxy. Does anyone know how to check more definitively whether CNTLM is set up right, or if there's another way around this altogether? I know you can also set the http_proxy environment variable as described here but I'm not sure what credentials to put in. The ones from cntlm.ini? Thanks! [/INST] Under Ubuntu: I could not get the proxy option to work as advertised - so following command did not work: sudo pip --proxy http://web-proxy.mydomain.com install somepackage But exporting the https_proxy env variable (note its https_proxy not http_proxy) did the trick: export https_proxy=http://web-proxy.mydomain.com then sudo -E pip install somepackage [INST] Removing pip's cache? I need to install psycopg2 v2.4.1 specifically. I accidentally did: pip install psycopg2 Instead of: pip install psycopg2==2.4.1 That installs 2.4.4 instead of the earlier version. Now even after I pip uninstall psycopg2 and attempt to reinstall with the correct version, it appears that pip is re-using the cache it downloaded the first time. How can I force pip to clear out its download cache and use the specific version I'm including in the command? [/INST] If using pip older than pip 6.0, try deleting the entry in ~/.pip/cache/ and or the directory $PWD/build/ if it exists. You can also try the --ignore-installed option. In windows this is located under %USERPROFILE%\AppData\Local\pip\cache. If using pip 6.0 or newer, try using the --no-cache-dir option. [INST] json.dumps vs flask.jsonify I am not sure I understand the purpose of flask.jsonify method. I try to make json string from this: data = {"id": str(album.id), "title": album.title} but what I get with json.dumps differs from what I get with flask.jsonify. json.dumps(data): [{"id": "4ea856fd6506ae0db42702dd", "title": "Business"}] flask.jsonify(data): {"id", "title"} Obviously I need to get result that looks more like what json.dumps returns. What am I doing wrong? [/INST] The jsonify() function in flask returns flask.Response() object that already has the appropriate content-type header 'application/json' for use with json responses, whereas the json.dumps() will just return an encoded string, which would require manually adding the mime type header. See more about the jsonify() function here for full reference. Edit: Also, I've noticed that jsonify() handles kwargs or dictionaries, while json.dumps() additionally supports lists and others. [INST] How to install python modules without root access? I'm taking some university classes and have been given an 'instructional account', which is a school account I can ssh into to do work. I want to run my computationally intensive Numpy, matplotlib, scipy code on that machine, but I cannot install these modules because I am not a system administrator. How can I do the installation? [/INST] In most situations the best solution is to rely on the so-called "user site" location (see the PEP for details) by running: pip install --user package_name Below is a more "manual" way from my original answer, you do not need to read it if the above solution works for you. With easy_install you can do: easy_install --prefix=$HOME/local package_name which will install into $HOME/local/lib/pythonX.Y/site-packages (the 'local' folder is a typical name many people use, but of course you may specify any folder you have permissions to write into). You will need to manually create $HOME/local/lib/pythonX.Y/site-packages and add it to your PYTHONPATH environment variable (otherwise easy_install will complain -- btw run the command above once to find the correct value for X.Y). If you are not using easy_install, look for a prefix option, most install scripts let you specify one. With pip you can use: pip install --install-option="--prefix=$HOME/local" package_name [INST] Wrap long lines in Python How do I wrap long lines in Python without sacrificing indentation? For example: def fun(): print '{0} Here is a really long sentence with {1}'.format(3, 5) Suppose this goes over the 79 character recommended limit. The way I read it, here is how to indent it: def fun(): print '{0} Here is a really long \ sentence with {1}'.format(3, 5) However, with this approach, the indentation of the continued line matches the indentation of the fun(). This looks kinda ugly. If someone was to go through my code, it would look bad to have uneven indentation because of this print statement. How do I indent lines like this effectively without sacrificing code readability? [/INST] def fun(): print '{0} Here is a really long ' \ 'sentence with {1}'.format(3, 5) Adjecent string literals are concatenated at compile time, just as in C. http://docs.python.org/reference/lexical_analysis.html#string-literal-concatenation is a good place to start for more info. [INST] How to pull a random record using Django's ORM? I have a model that represents paintings I present on my site. On the main webpage I'd like to show some of them: newest, one that was not visited for most time, most popular one and a random one. I'm using Django 1.0.2. While first 3 of them are easy to pull using django models, last one (random) causes me some trouble. I can ofc code it in my view, to something like this: number_of_records = models.Painting.objects.count() random_index = int(random.random()*number_of_records)+1 random_paint = models.Painting.get(pk = random_index) It doesn't look like something I'd like to have in my view tho - this is entirely part of database abstraction and should be in the model. Also, here I need to take care of removed records (then number of all records won't cover me all the possible key values) and probably lots of other things. Any other options how I can do it, preferably somehow inside the model abstraction? [/INST] Simply use: MyModel.objects.order_by('?').first() It is documented in QuerySet API. [INST] Truncate Python DateTime What is a classy way to way truncate a python datetime object? In this particular case, to the day. So basically setting hour, minute, seconds, and microseconds to 0. I would like the output to also be a datetime object, not a string. [/INST] I think this is what you're looking for... >>> dt = datetime.datetime.now() >>> dt = dt.replace(hour=0, minute=0, second=0, microsecond=0) # Returns a copy >>> dt datetime.datetime(2011, 3, 29, 0, 0) But if you really don't care about the time aspect of things, then you should really only be passing around date objects... >>> d_truncated = datetime.date(dt.year, dt.month, dt.day) >>> d_truncated datetime.date(2011, 3, 29) [INST] How do I install the yaml package for Python? I have a Python program that uses YAML. I attempted to install it on a new server using pip install yaml and it returns the following: $ sudo pip install yaml Downloading/unpacking yaml Could not find any downloads that satisfy the requirement yaml No distributions at all found for yaml Storing complete log in /home/pa/.pip/pip.log How do I install the yaml package for Python? I'm running Python 2.7. [/INST] You could try the search feature in pip, $ pip search yaml which looks for packages in PyPI with yaml in the short description. That reveals various packages, including PyYaml, yamltools, and PySyck, among others (Note that PySyck docs recommend using PyYaml, since syck is out of date). Now you know a specific package name, you can install it: $ pip install pyyaml If you want to install python yaml system-wide in linux, you can also use a package manager, like aptitude or yum: $ sudo apt-get install python-yaml $ sudo yum install python-yaml [INST] Java "Virtual Machine" vs. Python "Interpreter" parlance? It's seems rare to read of a Python "virtual machine" while in Java "virtual machine" is used all the time. Both interpret byte codes, why call one a virtual machine and the other an interpreter? [/INST] A virtual machine is a virtual computing environment with a specific set of atomic well defined instructions that are supported independent of any specific language and it is generally thought of as a sandbox unto itself. The VM is analogous to an instruction set of a specific CPU and tends to work at a more fundamental level with very basic building blocks of such instructions (or byte codes) that are independent of the next. An instruction executes deterministically based only on the current state of the virtual machine and does not depend on information elsewhere in the instruction stream at that point in time. An interpreter on the other hand is more sophisticated in that it is tailored to parse a stream of some syntax that is of a specific language and of a specific grammer that must be decoded in the context of the surrounding tokens. You can't look at each byte or even each line in isolation and know exactly what to do next. The tokens in the language can't be taken in isolation like they can relative to the instructions (byte codes) of a VM. A Java compiler converts Java language into a byte-code stream no different than a C compiler converts C Language programs into assembly code. An interpreter on the other hand doesn't really convert the program into any well defined intermediate form, it just takes the program actions as a matter of the process of interpreting the source. Another test of the difference between a VM and an interpreter is whether you think of it as being language independent. What we know as the Java VM is not really Java specific. You could make a compiler from other languages that result in byte codes that can be run on the JVM. On the other hand, I don't think we would really think of "compiling" some other language other than Python into Python for interpretation by the Python interpreter. Because of the sophistication of the interpretation process, this can be a relatively slow process....specifically parsing and identifying the language tokens, etc. and understanding the context of the source to be able to undertake the execution process within the interpreter. To help accelerate such interpreted languages, this is where we can define intermediate forms of pre-parsed, pre-tokenized source code that is more readily directly interpreted. This sort of binary form is still interpreted at execution time, it is just starting from a much less human readable form to improve performance. However, the logic executing that form is not a virtual machine, because those codes still can't be taken in isolation - the context of the surrounding tokens still matter, they are just now in a different more computer efficient form. [INST] What is the difference between Python and IPython? What exactly is the difference between Python and IPython? If I write code in Python, will it run in IPython as is or does it need to be modified? I know IPython is supposed to be an interactive shell for Python, but is that all? Or is there a language called IPython? If I write something under IPython, will it run in Python, and vice-versa? If there are differences, how do I know what they are? Will all packages used by Python work as is in IPython? [/INST] ipython is an interactive shell built with python. From the project website: IPython provides a rich toolkit to help you make the most out of using Python, with: Powerful Python shells (terminal and Qt-based). A web-based notebook with the same core features but support for code, text, mathematical expressions, inline plots and other rich media. Support for interactive data visualization and use of GUI toolkits. Flexible, embeddable interpreters to load into your own projects. Easy to use, high performance tools for parallel computing. Note that the first 2 lines tell you it helps you make the most of using Python. Thus, you don't need to alter your code, the IPython shell runs your python code just like the normal python shell does, only with more features. I recommend reading the IPython tutorial to get a sense of what features you gain when using IPython. [INST] Python - Create a list with initial capacity Code like this often happens: l = [] while foo: #baz l.append(bar) #qux This is really slow if you're about to append thousands of elements to your list, as the list will have to be constantly resized to fit the new elements. In Java, you can create an ArrayList with an initial capacity. If you have some idea how big your list will be, this will be a lot more efficient. I understand that code like this can often be re-factored into a list comprehension. If the for/while loop is very complicated, though, this is unfeasible. Is there any equivalent for us Python programmers? [/INST] def doAppend( size=10000 ): result = [] for i in range(size): message= "some unique object %d" % ( i, ) result.append(message) return result def doAllocate( size=10000 ): result=size*[None] for i in range(size): message= "some unique object %d" % ( i, ) result[i]= message return result Results. (evaluate each function 144 times and average the duration) simple append 0.0102 pre-allocate 0.0098 Conclusion. It barely matters. Premature optimization is the root of all evil. [INST] Python Linked List What's the easiest way to use a linked list in python? In scheme, a linked list is defined simply by '(1 2 3 4 5). Python's lists, [1, 2, 3, 4, 5], and tuples, (1, 2, 3, 4, 5), are not, in fact, linked lists, and linked lists have some nice properties such as constant-time concatenation, and being able to reference separate parts of them. Make them immutable and they are really easy to work with! [/INST] For some needs, a deque may also be useful. You can add and remove items on both ends of a deque at O(1) cost. from collections import deque d = deque([1,2,3,4]) print d for x in d: print x print d.pop(), d [INST] Object of custom type as dictionary key What must I do to use my objects of a custom type as keys in a Python dictionary (where I don't want the "object id" to act as the key) , e.g. class MyThing: def __init__(self,name,location,length): self.name = name self.location = location self.length = length I'd want to use MyThing's as keys that are considered the same if name and location are the same. From C#/Java I'm used to having to override and provide an equals and hashcode method, and promise not to mutate anything the hashcode depends on. What must I do in Python to accomplish this ? Should I even ? (In a simple case, like here, perhaps it'd be better to just place a (name,location) tuple as key - but consider I'd want the key to be an object) [/INST] You need to add two methods: class MyThing: def __init__(self,name,location,length): self.name = name self.location = location self.length = length def __hash__(self): return hash((self.name, self.location)) def __eq__(self, other): return (self.name, self.location) == (other.name, other.location) def __ne__(self, other): # Not strictly necessary, but to avoid having both x==y and x!=y # True at the same time return not(self == other) The Python dict documentation defines these requirements on key objects, i.e. they must be hashable. [INST] What is getattr() exactly and how do I use it? I was reading about the getattr() function. The problem is that I still can't grasp the idea of its usage. The only thing I understand about getattr() is that getattr(li, "pop") is the same as calling li.pop. I didn't understand when the book mentioned how you use it to get a reference to a function without knowing its name until run-time. Maybe this is me being a noob in programming, in general. Could anyone shed some light to the subject? When and how do I use this exactly? [/INST] Objects in Python can have attributes (actually, every object has built-in attributes -- data attributes and methods (functions are values, i.e. objects, too) to work with those). For example you have an object person, that has several attributes: name, gender, etc. You access these attributes (be it methods or data objects) usually writing: person.name, person.gender, person.the_method(), etc. But what if you don't know the attribute's name at the time you write the program? For example you have attribute's name stored in a variable called attr_name. if attr_name = 'gender' then, instead of writing gender = person.gender you can write gender = getattr(person, attr_name) Some practice: Python 3.4.0 (default, Apr 11 2014, 13:05:11) >>> class Person(): ... name = 'Victor' ... def say(self, what): ... print(self.name, what) ... >>> getattr(Person, 'name') 'Victor' >>> attr_name = 'name' >>> person = Person() >>> getattr(person, attr_name) 'Victor' >>> getattr(person, 'say')('Hello') Victor Hello getattr will raise AttributeError if attribute with the given name does not exist in the object: >>> getattr(person, 'age') Traceback (most recent call last): File "", line 1, in AttributeError: 'Person' object has no attribute 'age' But you can pass a default value as the third argument, which will be returned if such attribute does not exist: >>> getattr(person, 'age', 0) 0 You can use getattr along with dir to iterate over all attribute names and get their values: >>> dir(1000) ['__abs__', '__add__', ..., '__trunc__', '__xor__', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'numerator', 'real', 'to_bytes'] >>> obj = 1000 >>> for attr_name in dir(obj): ... attr_value = getattr(obj, attr_name) ... print(attr_name, attr_value, callable(attr_value)) ... __abs__ True __add__ True ... __trunc__ True __xor__ True bit_length True conjugate True denominator 1 False from_bytes True imag 0 False numerator 1000 False real 1000 False to_bytes True >>> getattr(1000, 'bit_length')() 10 A practical use for this would be to find all methods whose names start with test and call them. [INST] Python: How to "perfectly" override a dict How can I make as "perfect" a subclass of dict as possible? The end goal is to have a simple dict in which the keys are lowercase. It would seem that should be some tiny set of primitives I can override to make this work, but all my research and attempts have made it seem like this isn't the case: If I override __getitem__/__setitem__, then get/set don't work. How do I make them work? Surely I don't need to implement them individually? Am I preventing pickling from working, and do I need to implement __setstate__ etc? Do I need repr, update and __init__? Should I just use mutablemapping (it seems one shouldn't use UserDict or DictMixin)? If so, how? The docs aren't exactly enlightening. Here is my first go at it, get() doesn't work at least, and no doubt there are many minor subtle problems: class arbitrary_dict(dict): """A dictionary that applies an arbitrary key-altering function before accessing the keys.""" def __keytransform__(self, key): return key # Overridden methods. List from # http://stackoverflow.com/questions/2390827/how-to-properly-subclass-dict def __init__(self, *args, **kwargs): self.update(*args, **kwargs) # Note: I'm using dict directly, since super(dict, self) doesn't work. # I'm not sure why, perhaps dict is not a new-style class. def __getitem__(self, key): return dict.__getitem__(self, self.__keytransform__(key)) def __setitem__(self, key, value): return dict.__setitem__(self, self.__keytransform__(key), value) def __delitem__(self, key): return dict.__delitem__(self, self.__keytransform__(key)) def __contains__(self, key): return dict.__contains__(self, self.__keytransform__(key)) class lcdict(arbitrary_dict): def __keytransform__(self, key): return str(key).lower() [/INST] You can write an object that behaves like a dict quite easily with ABCs (Abstract Base Classes) from the collections module. It even tells you if you missed a method, so below is the minimal version that shuts the ABC up. import collections class TransformedDict(collections.MutableMapping): """A dictionary that applies an arbitrary key-altering function before accessing the keys""" def __init__(self, *args, **kwargs): self.store = dict() self.update(dict(*args, **kwargs)) # use the free update to set keys def __getitem__(self, key): return self.store[self.__keytransform__(key)] def __setitem__(self, key, value): self.store[self.__keytransform__(key)] = value def __delitem__(self, key): del self.store[self.__keytransform__(key)] def __iter__(self): return iter(self.store) def __len__(self): return len(self.store) def __keytransform__(self, key): return key You get a few free methods from the ABC: class MyTransformedDict(TransformedDict): def __keytransform__(self, key): return key.lower() s = MyTransformedDict([('Test', 'test')]) assert s.get('TEST') is s['test'] # free get assert 'TeSt' in s # free __contains__ # free setdefault, __eq__, and so on import pickle assert pickle.loads(pickle.dumps(s)) == s # works too since we just use a normal dict I wouldn't subclass dict (or other builtins) directly. It often makes no sense, because what you actually want to do is implement the interface of a dict. And that is exactly what ABCs are for. �P[INST] Python idiom to return first item or None I'm sure there's a simpler way of doing this that's just not occurring to me. I'm calling a bunch of methods that return a list. The list may be empty. If the list is non-empty, I want to return the first item; otherwise, I want to return None. This code works: my_list = get_list() if len(my_list) > 0: return my_list[0] return None It seems to me that there should be a simple one-line idiom for doing this, but for the life of me I can't think of it. Is there? Edit: The reason that I'm looking for a one-line expression here is not that I like incredibly terse code, but because I'm having to write a lot of code like this: x = get_first_list() if x: # do something with x[0] # inevitably forget the [0] part, and have a bug to fix y = get_second_list() if y: # do something with y[0] # inevitably forget the [0] part AGAIN, and have another bug to fix What I'd like to be doing can certainly be accomplished with a function (and probably will be): def first_item(list_or_none): if list_or_none: return list_or_none[0] x = first_item(get_first_list()) if x: # do something with x y = first_item(get_second_list()) if y: # do something with y I posted the question because I'm frequently surprised by what simple expressions in Python can do, and I thought that writing a function was a silly thing to do if there was a simple expression could do the trick. But seeing these answers, it seems like a function is the simple solution. [/INST] The best way is this: a = get_list() return a[0] if a else None You could also do it in one line, but it's much harder for the programmer to read: return (get_list()[:1] or [None])[0] [INST] Sorting list based on values from another list? I am a list of strings like this: X = ["a", "b", "c", "d", "e", "f", "g", "h", "i"] Y = [ 0, 1, 1, 0, 1, 2, 2, 0, 1] What is the shortest way of sorting X using values from Y to get the following output? ["a", "d", "h", "b", "c", "e", "i", "f", "g"] The order for the elements having the same "key" does not matter. I can resort to using for constructs but I am curious if there is a shorter way. Any suggestions? [/INST] [x for (y,x) in sorted(zip(Y,X))] [INST] How can I parse a time string containing milliseconds in it with python? I am able to parse strings containing date/time with time.strptime >>> import time >>> time.strptime('30/03/09 16:31:32', '%d/%m/%y %H:%M:%S') (2009, 3, 30, 16, 31, 32, 0, 89, -1) How can I parse a time string that contains milliseconds? >>> time.strptime('30/03/09 16:31:32.123', '%d/%m/%y %H:%M:%S') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/_strptime.py", line 333, in strptime data_string[found.end():]) ValueError: unconverted data remains: .123 [/INST] Python 2.6 added a new strftime/strptime macro %f, which does microseconds. Not sure if this is documented anywhere. But if you're using 2.6 or 3.0, you can do this: time.strptime('30/03/09 16:31:32.123', '%d/%m/%y %H:%M:%S.%f') Edit: I never really work with the time module, so I didn't notice this at first, but it appears that time.struct_time doesn't actually store milliseconds/microseconds. You may be better off using datetime, like this: >>> from datetime import datetime >>> a = datetime.strptime('30/03/09 16:31:32.123', '%d/%m/%y %H:%M:%S.%f') >>> a.microsecond 123000 9I[INST] how to access dictionary element in django template? I have this code in template, which I would like to printout number of votes that each choice got. votes is just dictionary while choices are model object. {% for choice in choices %} {{choice.choice}} - {{votes[choice.id]}}
{% endfor %} it raises an exception with this message "Could not parse the remainder" [/INST] choices = {'key1':'val1', 'key2':'val2'} Here's the template:
    {% for key, value in choices.items %}
  • {{key}} - {{value}}
  • {% endfor %}
Basically, .items is a Django keyword that splits a dictionary into a list of (key, value) pairs. This enables iteration over a dictionary in a Django template.
[INST] How to access the local Django webserver from outside world I followed the instructions here to run Django using the built-in webserver and was able to successfully run it using python manage.py runserver. If I access 127.0.0.1:port locally from the webserver, I get the Django page indicating it worked. I realize the Django webserver is not a production server, but it's important for me for testing purposes to be able to access it from the outside world -- i.e. not from a web browser on the server, but from a different computer. I tried: http://mywebserver:port_django_runs_on but it did not work. I also tried using the IP instead (based on ifconfig) to access: http://myipaddress:port_django_runs_on which did not work either. The web server is running so it must be accessible from the outside, I'm just not sure how. I am running Linux with Apache, though I have not configured Django with Apache. Any ideas on how to do this? [/INST] You have to run the development server such that it listens on the interface to your network. E.g. python manage.py runserver 0.0.0.0:8000 listens on every interface on port 8000. It doesn't matter whether you access the webserver with the IP or the hostname. I guess you are still in your own LAN. If you really want to access the server from outside, you also have to configure your router to forward port e.g. 8000 to your server. Check your firewall on your server whether incoming connections to the port in use are allowed! Assuming you can access your Apache server from the outside successfully, you can also try this: Stop the Apache server, so that port 80 is free. Start the development server with sudo python manage.py runserver 0.0.0.0:80 [INST] How can I convert a Python dictionary to a list of tuples? If I have a dictionary like: { 'a': 1, 'b': 2, 'c': 3 } How can I convert it to this? [ ('a', 1), ('b', 2), ('c', 3) ] And how can I convert it to this? [ (1, 'a'), (2, 'b'), (3, 'c') ] [/INST] >>> d = { 'a': 1, 'b': 2, 'c': 3 } >>> d.items() [('a', 1), ('c', 3), ('b', 2)] >>> [(v, k) for k, v in d.iteritems()] [(1, 'a'), (3, 'c'), (2, 'b')] It's not in the order you want, but dicts don't have any specific order anyway. Sort it or organize it as necessary. See: items(), iteritems() In Python 3.x, you would not use iteritems (which no longer exists), but instead use items, which now returns a "view" into the dictionary items. See the What's New document for Python 3.0, and the new documentation on views. [INST] Django FileField with upload_to determined at runtime I'm trying to set up my uploads so that if user joe uploads a file it goes to MEDIA_ROOT/joe as opposed to having everyone's files go to MEDIA_ROOT. The problem is I don't know how to define this in the model. Here is how it currently looks: class Content(models.Model): name = models.CharField(max_length=200) user = models.ForeignKey(User) file = models.FileField(upload_to='.') So what I want is instead of '.' as the upload_to, have it be the user's name. I understand that as of Django 1.0 you can define your own function to handle the upload_to but that function has no idea of who the user will be either so I'm a bit lost. Thanks for the help! [/INST] You've probably read the documentation, so here's an easy example to make it make sense: def content_file_name(instance, filename): return '/'.join(['content', instance.user.username, filename]) class Content(models.Model): name = models.CharField(max_length=200) user = models.ForeignKey(User) file = models.FileField(upload_to=content_file_name) As you can see, you don't even need to use the filename given - you could override that in your upload_to callable too if you liked. [INST] Event system in Python What event system for Python do you use? I'm already aware of pydispatcher, but I was wondering what else can be found, or is commonly used? I'm not interested in event managers that are part of large frameworks, I'd rather use a small bare-bones solution that I can easily extend. [/INST] Wrapping up the various event systems that are mentioned in the answers here: The most basic style of event system is the 'bag of handler methods', which is a simple implementation of the Observer pattern. Basically, the handler methods (callables) are stored in an array and are each called when the event 'fires'. zope.event shows the bare bones of how this works (see Lennart's answer). Note: this example does not even support handler arguments. LongPoke's 'callable list' implementation shows that such an event system can be implemented very minimalistically by subclassing list. spassig's EventHook (Michael Foord's Event Pattern) is a straightforward implementation. Josip's Valued Lessons Event class is basically the same, but uses a set instead of a list to store the bag, and implements __call__ which are both reasonable additions. PyNotify is similar in concept and also provides additional concepts of variables and conditions ('variable changed event'). axel is basically a bag-of-handlers with more features related to threading, error handling, ... The disadvantage of these event systems is that you can only register the handlers on the actual Event object (or handlers list). So at registration time the event already needs to exist. That's why the second style of event systems exists: the publish-subscribe pattern. Here, the handlers don't register on an event object (or handler list), but on a central dispatcher. Also the notifiers only talk to the dispatcher. What to listen for, or what to publish is determined by 'signal', which is nothing more than a name (string). blinker has some nifty features such as automatic disconnection and filtering based on sender. PyPubSub at first sight seems to be pretty straightforward; apparently does not yet support Python3 PyDispatcher seems to emphasize flexibility with regards to many-to-many publication etc. louie is a reworked PyDispatcher "providing plugin infrastructure including Twisted and PyQt specific support". django.dispatch is a rewritten PyDispatcher "with a more limited interface, but higher performance". Qt's Signals and Slots are available from PyQt or PySide. They work as callback when used in the same thread, or as events (using an event loop) between two different threads. Signals and Slots have the limitation that they only work in objects of classes that derive from QObject. Note: threading.Event is not an 'event system' in the above sense. It's a thread synchronization system where one thread waits until another thread 'signals' the Event object. [INST] How to generate dynamic (parametrized) unit tests in python? I have some kind of test data and want to create an unit test for each item. My first idea was to do it like this: import unittest l = [["foo", "a", "a",], ["bar", "a", "b"], ["lee", "b", "b"]] class TestSequence(unittest.TestCase): def testsample(self): for name, a,b in l: print "test", name self.assertEqual(a,b) if __name__ == '__main__': unittest.main() The downside of this is that it handles all data in one test. I would like to generate one test for each item on the fly. Any suggestions? [/INST] i use something like this: import unittest l = [["foo", "a", "a",], ["bar", "a", "b"], ["lee", "b", "b"]] class TestSequense(unittest.TestCase): pass def test_generator(a, b): def test(self): self.assertEqual(a,b) return test if __name__ == '__main__': for t in l: test_name = 'test_%s' % t[0] test = test_generator(t[1], t[2]) setattr(TestSequense, test_name, test) unittest.main() The nose-parameterized package can be used to automate this process: from nose_parameterized import parameterized class TestSequence(unittest.TestCase): @parameterized.expand([ ["foo", "a", "a",], ["bar", "a", "b"], ["lee", "b", "b"], ]) def test_sequence(self, name, a, b): self.assertEqual(a,b) Which will generate the tests: test_sequence_0_foo (__main__.TestSequence) ... ok test_sequence_1_bar (__main__.TestSequence) ... FAIL test_sequence_2_lee (__main__.TestSequence) ... ok ====================================================================== FAIL: test_sequence_1_bar (__main__.TestSequence) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/nose_parameterized/parameterized.py", line 233, in standalone_func = lambda *a: func(*(a + p.args), **p.kwargs) File "x.py", line 12, in test_sequence self.assertEqual(a,b) AssertionError: 'a' != 'b' [INST] Is there a python equivalent of Ruby's 'rvm'? Q: Do we have anything functionally equivalent in Python to the Ruby version manager 'rvm'? (RVM lets you easily switch completely between different versions of the ruby interpreter and different sets of gems (modules). Everything concerning download-build-install-switch of interpreter(-s) and gems gets taken care of by invoking rvm. It is all run under your regular user account.) [/INST] Pythonbrew is no longer under development. The former maintainer suggests to use "PyEnv" instead (see below)". pythonbrew has come! http://github.com/utahta/pythonbrew pyenv: https://github.com/yyuu/pyenv *?[INST] Concatenating two lists - difference between '+=' and extend() I've seen there are actually two (maybe more) ways to concatenate lists in Python: One way is to use the extend() method: a = [1, 2] b = [2, 3] b.extend(a) the other to use the plus(+) operator: b += a Now I wonder: Which of those two options is the 'pythonic' way to do list concatenation and is there a difference between the two (I've looked up the official Python tutorial but couldn't find anything anything about this topic). [/INST] The only difference on a bytecode level is that the .extend way involves a function call, which is slightly more expensive in Python than the INPLACE_ADD. It's really nothing you should be worrying about, unless you're performing this operation billions of times. It is likely, however, that the bottleneck would lie some place else. [([INST] what is difference between __init__ and __call__ in python? I want to know what is difference between __init__ and __call__ methods? For example : class test: def __init__(self): self.a = 10 def __call__(self): b = 20 [/INST] The first is used to initialise newly created object, and receives arguments used to do that: class foo: def __init__(self, a, b, c): # ... x = foo(1, 2, 3) # __init__ The second implements function call operator. class foo: def __call__(self, a, b, c): # ... x = foo() x(1, 2, 3) # __call__ [INST] Get all object attributes in Python? Is there a way to get all attributes/methods/fields/etc. of an object in Python? vars() is close to what I want, but it doesn't work unless an object has a __dict__, which isn't always true (e.g. it's not true for a list, a dict, etc.). [/INST] Use the built-in function dir(). [INST] bash: pip: command not found I downloaded pip and ran python setup.py install and everything worked just fine. The very next step in the tutorial is to run pip install but before it even tries to find anything online I get an error "bash: pip: command not found". This is on Mac OS X, which I'm new too, so I'm assuming there's some kind of path setting that was not set correctly when I ran setup.py. How can I investigate further? What do I need to check to get a better idea of the exact cause of the problem? EDIT: I also tried installing Python 2.7 for Mac in the hopes that the friendly install process would do any housekeeping like editing PATH and whatever else needs to happy for everything to work according to the tutorials, but this didn't work. After installing is running 'python' still ran Python 2.6 and PATH was not updated. [/INST] Why not just do sudo easy_install pip or if this is for python 2.6 sudo easy_install-2.6 pip? This installs pip using the default python package installer system and saves you the hassle of manual set-up all at the same time. This will allow you to then run the pip command for python package installation as it will be installed with the system python. I also recommend once you have pip using the virtualenv package and pattern. :) [INST] Executing Python script from Django shell I need to execute a Python script from the Django shell. I tried ./manage.py shell << my_script.py But it didn't work. It was just kinda waiting for me to write something. [/INST] The << part is wrong, use < instead: $ ./manage.py shell < myscript.py You could also do: $ ./manage.py shell ... >>> execfile('myscript.py') [INST] Concatenate item in list to strings Is there a simpler way to concatenate string items in list into a single string? Can I use the str.join() function to join items in list? E.g. this is the input ['this','is','a','sentence'] and this is the desired output this-is-a-sentence sentence = ['this','is','a','sentence'] sent_str = "" for i in sentence: sent_str += str(i) + "-" sent_str = sent_str[:-1] print sent_str [/INST] Use join: >>> sentence = ['this','is','a','sentence'] >>> '-'.join(sentence) 'this-is-a-sentence' [INST] pip broke. how to fix DistributionNotFound error? Whenever i try to use pip I get an error. For exampple: $ sudo pip install gevent-websocket Traceback (most recent call last): File "/usr/local/bin/pip", line 5, in from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2675, in parse_requirements(__requires__), Environment() File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 552, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: pip==0.8.1 I feel tempted to change the value of into pip==0.8.2.. but I dont feel dealing with the consequences of 'hacking' up my installation... I'm running python 2.7 and pip is at version 0.8.2. [/INST] I find this problem in my MacBook, the reason is because as @Stephan said, I use easy_install to install pip, and the mixture of both py package manage tools led to the pkg_resources.DistributionNotFound problem. The resolve is: easy_install --upgrade pip Remember: just use one of the above tools to manage your Py packages. [INST] Python syntax for "if a or b or c but not all of them" I have a python script that can receive either zero or three command line arguments. (Either it runs on default behavior or needs all three values specified.) What's the ideal syntax for something like: if a and (not b or not c) or b and (not a or not c) or c and (not b or not a): ? [/INST] How about: conditions = [a, b, c] if any(conditions) and not all(conditions): ... Other variant: if 1 <= sum(map(bool, conditions)) <= 2: ... [INST] "Pretty" Continuous Integration for Python This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at.. For example, compared to.. phpUnderControl Jenkins Hudson CruiseControl.rb ..and others, BuildBot looks rather.. archaic I'm currently playing with Hudson, but it is very Java-centric (although with this guide, I found it easier to setup than BuildBot, and produced more info) Basically: is there any Continuous Integration systems aimed at python, that produce lots of shiny graphs and the likes? Update: Since this time the Jenkins project has replaced Hudson as the community version of the package. The original authors have moved to this project as well. Jenkins is now a standard package on Ubuntu/Debian, RedHat/Fedora/CentOS, and others. The following update is still essentially correct. The starting point to do this with Jenkins is different. Update: After trying a few alternatives, I think I'll stick with Hudson. Integrity was nice and simple, but quite limited. I think Buildbot is better suited to having numerous build-slaves, rather than everything running on a single machine like I was using it. Setting Hudson up for a Python project was pretty simple: Download Hudson from http://hudson-ci.org/ Run it with java -jar hudson.war Open the web interface on the default address of http://localhost:8080 Go to Manage Hudson, Plugins, click "Update" or similar Install the Git plugin (I had to set the git path in the Hudson global preferences) Create a new project, enter the repository, SCM polling intervals and so on Install nosetests via easy_install if it's not already In the a build step, add nosetests --with-xunit --verbose Check "Publish JUnit test result report" and set "Test report XMLs" to **/nosetests.xml That's all that's required. You can setup email notifications, and the plugins are worth a look. A few I'm currently using for Python projects: SLOCCount plugin to count lines of code (and graph it!) - you need to install sloccount separately Violations to parse the PyLint output (you can setup warning thresholds, graph the number of violations over each build) Cobertura can parse the coverage.py output. Nosetest can gather coverage while running your tests, using nosetests --with-coverage (this writes the output to **/coverage.xml) [/INST] You might want to check out Nose and the Xunit output plugin. You can have it run your unit tests, and coverage checks with this command: nosetests --with-xunit --enable-cover That'll be helpful if you want to go the Jenkins route, or if you want to use another CI server that has support for JUnit test reporting. Similarly you can capture the output of pylint using the violations plugin for Jenkins [INST] How to get a variable name as a string in Python? I would like to be able to get the name of a variable as a string but I don't know if Python has that much introspection capabilities. Something like: >>> print(my_var.__name__) 'my_var' I want to do that because I have a bunch of vars I'd like to turn into a dictionary like : bar = True foo = False >>> my_dict = dict(bar=bar, foo=foo) >>> print my_dict {'foo': False, 'bar': True} But I'd like something more automatic than that. Python have locals() and vars(), so I guess there is a way. [/INST] As unwind said, this isn't really something you do in Python - variables are actually name mappings to objects. However, here's one way to try and do it: >>> a = 1 >>> for k, v in list(locals().iteritems()): if v is a: a_as_str = k >>> a_as_str a >>> type(a_as_str) 'str' [INST] How do I write good/correct package __init__.py files My package has the following structure: mobilescouter/ __init__.py #1 mapper/ __init__.py #2 lxml/ __init__.py #3 vehiclemapper.py vehiclefeaturemapper.py vehiclefeaturesetmapper.py ... basemapper.py vehicle/ __init__.py #4 vehicle.py vehiclefeature.py vehiclefeaturemapper.py ... I'm not sure how the __init__.py files should be correctly written. The __init__.py #1 looks like: __all__ = ['mapper', 'vehicle'] import mapper import vehicle But how should for example __init__.py #2 look like? Mine is: __all__ = ['basemapper', 'lxml'] from basemaper import * import lxml When should be __all__ used? [/INST] My own __init__.py files are empty more often than not. In particular, I never have a from blah import * as part of __init__.py -- if "importing the package" means getting all sort of classes, functions etc defined directly as part of the package, then I would lexically copy the contents of blah.py into the package's __init__.py instead and remove blah.py (the multiplication of source files does no good here). If you do insist on supporting the import * idioms (eek), then using __all__ (with as miniscule a list of names as you can bring yourself to have in it) may help for damage control. In general, namespaces and explicit imports are good things, and I strong suggest reconsidering any approach based on systematically bypassing either or both concepts!-) [INST] Why does the expression 0 < 0 == 0 return False in Python? Looking into Queue.py in Python 2.6, I found this construct that I found a bit strange: def full(self): """Return True if the queue is full, False otherwise (not reliable!).""" self.mutex.acquire() n = 0 < self.maxsize == self._qsize() self.mutex.release() return n If maxsize is 0 the queue is never full. My question is how does it work for this case? How 0 < 0 == 0 is considered False? >>> 0 < 0 == 0 False >>> (0) < (0 == 0) True >>> (0 < 0) == 0 True >>> 0 < (0 == 0) True [/INST] I believe Python has special case handling for sequences of relational operators to make range comparisons easy to express. It's much nicer to be able to say 0 < x <= 5 than to say (0 < x) and (x <= 5). These are called chained comparisons. And that's a link to the documentation for them. With the other cases you talk about, the parenthesis force one relational operator to be applied before the other, and so they are no longer chained comparisons. And since True and False have values as integers you get the answers you do out of the parenthesized versions. [INST] How can I filter a date of a DateTimeField in Django? I am trying to filter a DateTimeField comparing with a date. I mean: MyObject.objects.filter(datetime_attr=datetime.date(2009,8,22)) I get an empty queryset list as an answer because (I think) I am not considering time, but I want "any time". Is there an easy way in Django for doing this? I have the time in the datetime setted, it is not 00:00. [/INST] Such lookups are implemented in django.views.generic.date_based as follows: {'date_time_field__range': (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max))} Because it is quite verbose there are plans to improve the syntax using __date operator. Check "#9596 Comparing a DateTimeField to a date is too hard" for more details. u [INST] py2exe - generate single executable file I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used? Basically I'm thinking of it giving me a single executable file that does something like unzips itself to maybe /temp and runs. [/INST] The way to do this using py2exe is to use the bundle_files option in your setup.py file. For a single file you will want to set bundle_files to 1, compressed to True, and set the zipfile option to None. That way it creates one compressed file for easy distribution. Here is a more complete description of the bundle_file option quoted directly from the py2exe site* Using "bundle_files" and "zipfile" An easier (and better) way to create single-file executables is to set bundle_files to 1 or 2, and to set zipfile to None. This approach does not require extracting files to a temporary location, which provides much faster program startup. Valid values for bundle_files are: 3 (default) don't bundle 2 bundle everything but the Python interpreter 1 bundle everything, including the Python interpreter If zipfile is set to None, the files will be bundle within the executable instead of library.zip. Here is a sample setup.py: from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 1, 'compressed': True}}, windows = [{'script': "single.py"}], zipfile = None, ) [INST] best way to extract subset of key-value pairs from python dictionary object I have a big dictionary object that has several key value pairs (about 16), I am only interested in 3 of them. What is the best way (shortest/efficient/elegant) to achieve that? The best I know is: bigdict = {'a':1,'b':2,....,'z':26} subdict = {'l':bigdict['l'], 'm':bigdict['m'], 'n':bigdict['n']} I am sure there is more elegant way than this. Ideas? [/INST] You could try: dict((k, bigdict[k]) for k in ('l', 'm', 'n')) ... or in Python 3 Python versions 2.7 or later (thanks to Fábio Diniz for pointing that out that it works in 2.7 too): {k: bigdict[k] for k in ('l', 'm', 'n')} Update: As HÃ¥vard S points out, I'm assuming that you know the keys are going to be in the dictionary - see his answer if you aren't able to make that assumption. Alternatively, as timbo points out in the comments, if you want a key that's missing in bigdict to map to None, you can do: {k: bigdict.get(k, None) for k in ('l', 'm', 'n')} If you're using Python 3, and you only want want keys in the new dict that actually exist in the original one, you can use the fact the view objects implement some set operations: {k: bigdict[k] for k in bigdict.keys() & {'l', 'm', 'n'}} [INST] Converting NumPy array into Python List structure? How do I convert a NumPy array to a Python List (for example [[1,2,3],[4,5,6]] ), and do it reasonably fast? [/INST] Use tolist(): import numpy as np >>> np.array([[1,2,3],[4,5,6]]).tolist() [[1, 2, 3], [4, 5, 6]] [INST] 'too many values to unpack', iterating over a dict. key=>string, value=>list I am getting the 'too many values to unpack' error. Any idea how I can fix this? first_names = ['foo', 'bar'] last_names = ['gravy', 'snowman'] fields = { 'first_names': first_names, 'last_name': last_names, } for field, possible_values in fields: # error happens on this line [/INST] You need to use something like iteritems. for field, possible_values in fields.iteritems(): print field, possible_values See this answer for more information on iterating through dictionaries, such as using items(), across python versions. [INST] Python function global variables? So I know I should avoid using global variables in the first place due to confusion like this, but if I were to use them, is the following a valid way to go about using them? (I am trying to call the global copy of a variable created in a separate function.) x = somevalue def func_A (): global x # do things to x return x def func_B(): x=func_A() # do things return x func_A() func_B() Does the x that the second function uses have the same value of the global copy of x that func_a uses and modifies? When calling the functions after definition, does order matter? [/INST] If you want to simply access a global variable you just use its name. However to change its value you need to use the global keyword. E.g. global someVar someVar = 55 This would change the value of the global variable to 55. Otherwise it would just assign 55 to a local variable. The order of function definition listings doesn't matter (assuming they don't refer to each other in some way), the order they are called does. [INST] Calculate difference in keys contained in two Python dictionaries Suppose I have two Python dictionaries - dictA and dictB. I need to find out if there are any keys which are present in dictB but not in dictA. What is the fastest way to go about it? Should I convert the dictionary keys into a set and then go about? Interested in knowing your thoughts... Thanks for your responses. Apologies for not stating my question properly. My scenario is like this - I have a dictA which can be the same as dictB or may have some keys missing as compared to dictB or else the value of some keys might be different which has to be set to that of dictA key's value. Problem is the dictionary has no standard and can have values which can be dict of dict. Say dictA={'key1':a, 'key2':b, 'key3':{'key11':cc, 'key12':dd}, 'key4':{'key111':{....}}} dictB={'key1':a, 'key2:':newb, 'key3':{'key11':cc, 'key12':newdd, 'key13':ee}....... So 'key2' value has to be reset to the new value and 'key13' has to be added inside the dict. The key value does not have a fixed format. It can be a simple value or a dict or a dict of dict. [/INST] You can use set operations on the keys: diff = set(dictb.keys()) - set(dicta.keys()) Here is a class to find all the possibilities: what was added, what was removed, which key-value pairs are the same, and which key-value pairs are changed. class DictDiffer(object): """ Calculate the difference between two dictionaries as: (1) items added (2) items removed (3) keys same in both but changed values (4) keys same in both and unchanged values """ def __init__(self, current_dict, past_dict): self.current_dict, self.past_dict = current_dict, past_dict self.set_current, self.set_past = set(current_dict.keys()), set(past_dict.keys()) self.intersect = self.set_current.intersection(self.set_past) def added(self): return self.set_current - self.intersect def removed(self): return self.set_past - self.intersect def changed(self): return set(o for o in self.intersect if self.past_dict[o] != self.current_dict[o]) def unchanged(self): return set(o for o in self.intersect if self.past_dict[o] == self.current_dict[o]) Here is some sample output: >>> a = {'a': 1, 'b': 1, 'c': 0} >>> b = {'a': 1, 'b': 2, 'd': 0} >>> d = DictDiffer(b, a) >>> print "Added:", d.added() Added: set(['d']) >>> print "Removed:", d.removed() Removed: set(['c']) >>> print "Changed:", d.changed() Changed: set(['b']) >>> print "Unchanged:", d.unchanged() Unchanged: set(['a']) Available as a github repo: https://github.com/hughdbrown/dictdiffer [INST] How to format a floating number to fixed width in Python How do I format a floating number to a fixed width with the following requirements: Leading zero if n < 1 Add trailing decimal zero(s) to fill up fixed width Truncate decimal digits past fixed width Align all decimal points For example: % formatter something like '{:06}' numbers = [23.23, 0.123334987, 1, 4.223, 9887.2] for number in numbers: print formatter.format(number) The output would be like 23.2300 0.1233 1.0000 4.2230 9887.2000 [/INST] for x in numbers: print "{:10.4f}".format(x) prints 23.2300 0.1233 1.0000 4.2230 9887.2000 �[INST] Python datetime to string without microsecond component I'm adding UTC time strings to Bitbucket API responses that currently only contain Amsterdam (!) time strings. For consistency with the UTC time strings returned elsewhere, the desired format is 2011-11-03 11:07:04 (followed by +00:00, but that's not germane). What's the best way to create such a string (without a microsecond component) from a datetime instance with a microsecond component? >>> import datetime >>> print unicode(datetime.datetime.now()) 2011-11-03 11:13:39.278026 I'll add the best option that's occurred to me as a possible answer, but there may well be a more elegant solution. Edit: I should mention that I'm not actually printing the current time – I used datetime.now to provide a quick example. So the solution should not assume that any datetime instances it receives will include microsecond components. [/INST] >>> datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") '2011-11-03 18:21:26' [INST] Ignore python multiple return value Say I have a Python function that returns multiple values in a tuple: def func(): return 1, 2 Is there a nice way to ignore one of the results rather than just assigning to a temporary variable? Say if I was only interested in the first value, is there a better way than this: x, temp = func() [/INST] You can use x = func()[0] to return the first value, x = func()[1] to return the second, and so on. If you want to get multiple values at a time, use something like x, y = func()[2:4]. [INST] Image library for Python 3 What is python-3 using instead of PIL for manipulating Images? [/INST] The "friendly PIL fork" Pillow works on Python 2 and 3. Check out the Github project for support matrix and so on. e [INST] Django Passing Custom Form Parameters to Formset This was fixed in Django 1.9 with form_kwargs. I have a Django Form that looks like this: class ServiceForm(forms.Form): option = forms.ModelChoiceField(queryset=ServiceOption.objects.none()) rate = forms.DecimalField(widget=custom_widgets.SmallField()) units = forms.IntegerField(min_value=1, widget=custom_widgets.SmallField()) def __init__(self, *args, **kwargs): affiliate = kwargs.pop('affiliate') super(ServiceForm, self).__init__(*args, **kwargs) self.fields["option"].queryset = ServiceOption.objects.filter(affiliate=affiliate) I call this form with something like this: form = ServiceForm(affiliate=request.affiliate) Where request.affiliate is the logged in user. This works as intended. My problem is that I now want to turn this single form into a formset. What I can't figure out is how I can pass the affiliate information to the individual forms when creating the formset. According to the docs to make a formset out of this I need to do something like this: ServiceFormSet = forms.formsets.formset_factory(ServiceForm, extra=3) And then I need to create it like this: formset = ServiceFormSet() Now how can I pass affiliate=request.affiliate to the individual forms this way? [/INST] I would use functools.partial and functools.wraps: from functools import partial, wraps from django.forms.formsets import formset_factory ServiceFormSet = formset_factory(wraps(ServiceForm)(partial(ServiceForm, affiliate=request.affiliate)), extra=3) I think this is the cleanest approach, and doesn't affect ServiceForm in any way (i.e. by making it difficult to subclass). [INST] Does Python have a built in function for string natural sort? Using Python 3.x, I have a list of strings for which I would like to perform a natural alphabetical sort. Natural sort: The order by which files in Windows are sorted. For instance, the following list is naturally sorted (what I want): ['elm0', 'elm1', 'Elm2', 'elm9', 'elm10', 'Elm11', 'Elm12', 'elm13'] And here's the "sorted" version of the above list (what I have): ['Elm11', 'Elm12', 'Elm2', 'elm0', 'elm1', 'elm10', 'elm13', 'elm9'] I'm looking for a sort function which behaves like the first one. [/INST] Try this: import re def natural_sort(l): convert = lambda text: int(text) if text.isdigit() else text.lower() alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ] return sorted(l, key = alphanum_key) Output: ['elm0', 'elm1', 'Elm2', 'elm9', 'elm10', 'Elm11', 'Elm12', 'elm13'] See it working online: ideone. Code adapted from here: Sorting for Humans : Natural Sort Order. [INST] Bubble Sort Homework In class we are doing sorting algorithms and, although I understand them fine when talking about them and writing pseudocode, I am having problems writing actual code for them. This is my attempt in Python: mylist = [12, 5, 13, 8, 9, 65] def bubble(badList): length = len(badList) - 1 unsorted = True while unsorted: for element in range(0,length): unsorted = False if badList[element] > badList[element + 1]: hold = badList[element + 1] badList[element + 1] = badList[element] badList[element] = hold print badList else: unsorted = True print bubble(mylist) Now, this (as far as I can tell) sorts correctly, but once it finishes it just loops indefinitely. How can this code be fixed so the function finishes properly and correctly sorts a list of any (reasonable) size? P.S. I know I should not really have prints in a function and I should have a return, but I just have not done that yet as my code does not really work yet. [/INST] To explain why your script isn't working right now, I'll rename the variable unsorted to sorted. At first, your list isn't yet sorted. Of course, we set sorted to False. As soon as we start the while loop, we assume that the list is already sorted. The idea is this: as soon as we find two elements that are not in the right order, we set sorted back to False. sorted will remain True only if there were no elements in the wrong order. sorted = False # We haven't started sorting yet while not sorted: sorted = True # Assume the list is now sorted for element in range(0, length): if badList[element] > badList[element + 1]: sorted = False # We found two elements in the wrong order hold = badList[element + 1] badList[element + 1] = badList[element] badList[element] = hold # We went through the whole list. At this point, if there were no elements # in the wrong order, sorted is still True. Otherwise, it's false, and the # while loop executes again. There are also minor little issues that would help the code be more efficient or readable. In the for loop, you use the variable element. Technically, element is not an element; it's a number representing a list index. Also, it's quite long. In these cases, just use a temporary variable name, like i for "index". for i in range(0, length): The range command can also take just one argument (named stop). In that case, you get a list of all the integers from 0 to that argument. for i in range(length): The Python Style Guide recommends that variables be named in lowercase with underscores. This is a very minor nitpick for a little script like this; it's more to get you accustomed to what Python code most often resembles. def bubble(bad_list): To swap the values of two variables, write them as a tuple assignment. The right hand side gets evaluated as a tuple (say, (badList[i+1], badList[i]) is (3, 5)) and then gets assigned to the two variables on the left hand side ((badList[i], badList[i+1])). bad_list[i], bad_list[i+1] = bad_list[i+1], bad_list[i] Put it all together, and you get this: my_list = [12, 5, 13, 8, 9, 65] def bubble(bad_list): length = len(bad_list) - 1 sorted = False while not sorted: sorted = True for i in range(length): if bad_list[i] > bad_list[i+1]: sorted = False bad_list[i], bad_list[i+1] = bad_list[i+1], bad_list[i] bubble(my_list) print my_list (I removed your print statement too, by the way.) [INST] How to state in requirements.txt a direct github source I've installed a library using the command pip install git+git://github.com/mozilla/elasticutils.git which installs it directly from a Github repository. This works fine and I want to have that dependency in my requirements.txt. I've looked at other tickets like this but that didn't solve my problem. If I put something like -f git+git://github.com/mozilla/elasticutils.git elasticutils==0.7.dev in the requirements.txt file, a pip install -r requirements.txt results in the following output: Downloading/unpacking elasticutils==0.7.dev (from -r requirements.txt (line 20)) Could not find a version that satisfies the requirement elasticutils==0.7.dev (from -r requirements.txt (line 20)) (from versions: ) No distributions matching the version for elasticutils==0.7.dev (from -r requirements.txt (line 20)) The documentation of the requirements file does not mention links using the git+git protocol specifier, so maybe this is just not supported. Does anybody have a solution for my problem? [/INST] “Editable” packages syntax can be used in requirements.txt to import packages from a variety of VCS (git, hg, bzr, svn): -e git://github.com/mozilla/elasticutils.git#egg=elasticutils Also, it is possible to point to particular commit: -e git://github.com/mozilla/elasticutils.git@000b14389171a9f0d7d713466b32bc649b0bed8e#egg=elasticutils [INST] How To Use The Pass Statement In Python I am in the process of learning Python and I have reached the section about the pass statement. The guide I'm using defines it as being a Null statement that is commonly used as a placeholder. I still don't fully understand what that means though. Can someone show me a simple/basic situation where the pass statement would be used and why it is needed? [/INST] Suppose you are designing a new class with some methods that you don't want to implement, yet. class MyClass(object): def meth_a(self): pass def meth_b(self): print "I'm meth_b" If you would leave out the pass, the code wouldn't run. You would then get an IndentationError: expected an indented block To summarize, the pass statement does nothing particular but can act as a placeholder, as shown before. [INST] Lexical closures in Python While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python: flist = [] for i in xrange(3): def func(x): return x * i flist.append(func) for f in flist: print f(2) Note that this example mindfully avoids lambda. It prints "4 4 4", which is surprising. I'd expect "0 2 4". This equivalent Perl code does it right: my @flist = (); foreach my $i (0 .. 2) { push(@flist, sub {$i * $_[0]}); } foreach my $f (@flist) { print $f->(2), "\n"; } "0 2 4" is printed. Can you please explain the difference ? Update: The problem is not with i being global. This displays the same behavior: flist = [] def outer(): for i in xrange(3): def inner(x): return x * i flist.append(inner) outer() #~ print i # commented because it causes an error for f in flist: print f(2) As the commented line shows, i is unknown at that point. Still, it prints "4 4 4". [/INST] The functions defined in the loop keep accessing the same variable i while its value changes. At the end of the loop, all the functions point to the same variable, which is holding the last value in the loop: the effect is what reported in the example. In order to evaluate i and use its value, a common pattern is to set it as a parameter default: parameter defaults are evaluated when the def statement is executed, and thus the value of the loop variable is frozen. The following works as expected: flist = [] for i in xrange(3): def func(x, i=i): # the *value* of i is copied in func() environment return x * i flist.append(func) for f in flist: print f(2) [INST] Python Requests throwing up SSLError I'm working on a simple script that involves CAS, jspring security check, redirection, etc. I would like to use Kenneth Reitz's python requests because it's a great piece of work! However, CAS requires getting validated via SSL so I have to get past that step first. I don't know what Python requests is wanting? Where is this SSL certificate suppose to reside? Traceback (most recent call last): File "./test.py", line 24, in response = requests.get(url1, headers=headers) File "build/bdist.linux-x86_64/egg/requests/api.py", line 52, in get File "build/bdist.linux-x86_64/egg/requests/api.py", line 40, in request File "build/bdist.linux-x86_64/egg/requests/sessions.py", line 209, in request File "build/bdist.linux-x86_64/egg/requests/models.py", line 624, in send File "build/bdist.linux-x86_64/egg/requests/models.py", line 300, in _build_response File "build/bdist.linux-x86_64/egg/requests/models.py", line 611, in send requests.exceptions.SSLError: [Errno 1] _ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed [/INST] The problem you are having is caused by an untrusted SSL certificate. Like @dirk mentioned in a previous comment, the quickest fix is setting verify=False. Please note that this will cause the certificate not to be verified. This will expose your application to security risks, such as man-in-the-middle attacks. Of course, apply judgment. As mentioned in the comments, this may be acceptable for quick/throwaway applications/scripts, but really should not go to production software. If just skipping the certificate check is not acceptable in your particular context, consider the following options, your best option is to set the verify parameter to a string that is the path of the .pem file of the certificate (which you should obtain by some sort of secure means). So, as of version 2.0, the verify parameter accepts the following values, with their respective semantics: True: causes the certificate to validated against the library's own trusted certificate authorities (Note: you can see which Root Certificates Requests uses via the Certifi library, a trust database of RCs extracted from Requests: Certifi - Trust Database for Humans). False: bypasses certificate validation completely. Path to a CA_BUNDLE file for Requests to use to validate the certificates. Source: Requests - SSL Cert Verification Also take a look at the cert parameter on the same link. [INST] Is it possible only to declare a variable without assigning any value in Python? Is it possible to declare a variable in Python, like so?: var so that it initialized to None? It seems like Python allows this, but as soon as you access it, it crashes. Is this possible? If not, why? EDIT: I want to do this for cases like this: value for index in sequence: if value == None and conditionMet: value = index break Duplicate Uninitialised value in python (by same author) Are there any declaration keywords in Python? (by the same author) Related Python: variable scope and function calls Other languages have "variables" [/INST] Why not just do this: var = None Python is dynamic, so you don't need to declare things; they exist automatically in the first scope where they're assigned. So, all you need is a regular old assignment statement as above. This is nice, because you'll never end up with an uninitialized variable. But be careful -- this doesn't mean that you won't end up with incorrectly initialized variables. If you init something to None, make sure that's what you really want, and assign something more meaningful if you can. [INST] Write to UTF-8 file in Python I'm really confused with the codecs.open function. When I do: file = codecs.open("temp", "w", "utf-8") file.write(codecs.BOM_UTF8) file.close() It gives me the error UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128) If I do: file = open("temp", "w") file.write(codecs.BOM_UTF8) file.close() It works fine. Question is why does the first method fail? And how do I insert the bom? If the second method is the correct way of doing it, what the point of using codecs.open(filename, "w", "utf-8")? [/INST] Disclaimer: I'm not a Python programmer. I believe the problem is that codecs.BOM_UTF8 is a byte string, not a Unicode string. I suspect the file handler is trying to guess what you really mean based on "I'm meant to be writing Unicode as UTF-8-encoded text, but you've given me a byte string!" Try writing the Unicode string for the byte order mark (i.e. Unicode U+FEFF) directly, so that the file just encodes that as UTF-8: import codecs file = codecs.open("lol", "w", "utf-8") file.write(u'\ufeff') file.close() (That seems to give the right answer - a file with bytes EF BB BF.) EDIT: S. Lott's suggestion of using "utf-8-sig" as the encoding is a better one than explicitly writing the BOM yourself, but I'll leave this answer here as it explains what was going wrong before. [INST] Best way to format integer as string with leading zeros? I need to add leading zeros to integer to make a string with defined quantity of digits ($cnt). What the best way to translate this simple function from PHP to Python: function add_nulls($int, $cnt=2) { $int = intval($int); for($i=0; $i<($cnt-strlen($int)); $i++) $nulls .= '0'; return $nulls.$int; } Is there a function that can do this? [/INST] You can use the zfill() method to pad a string with zeros: In [3]: str(1).zfill(2) Out[3]: '01' [INST] Multiprocessing: How to use Pool.map on a function defined in a class? When I run something like: from multiprocessing import Pool p = Pool(5) def f(x): return x*x p.map(f, [1,2,3]) it works fine. However, putting this as a function of a class: class calculate(object): def run(self): def f(x): return x*x p = Pool() return p.map(f, [1,2,3]) cl = calculate() print cl.run() Gives me the following error: Exception in thread Thread-1: Traceback (most recent call last): File "/sw/lib/python2.6/threading.py", line 532, in __bootstrap_inner self.run() File "/sw/lib/python2.6/threading.py", line 484, in run self.__target(*self.__args, **self.__kwargs) File "/sw/lib/python2.6/multiprocessing/pool.py", line 225, in _handle_tasks put(task) PicklingError: Can't pickle : attribute lookup __builtin__.function failed I've seen a post from Alex Martelli dealing with the same kind of problem, but it wasn't explicit enough. [/INST] I could not use the codes posted so far for three reasons. The codes using "multiprocessing.Pool" do not work with lambda expressions. The codes not using "multiprocessing.Pool" spawn as many processes as there are work items. All codes iterate through the whole input list before doing the actual work. 2.) is a performance concern, 3.) prohibits the use of a progress bar like http://code.google.com/p/python-progressbar/ I adapted the code s.t. it spawns a predefined amount of workers and only iterates through the input list if there exists an idle worker. I also enabled the "daemon" mode for the workers s.t. strg-c works as expected. import multiprocessing def fun(f, q_in, q_out): while True: i, x = q_in.get() if i is None: break q_out.put((i, f(x))) def parmap(f, X, nprocs=multiprocessing.cpu_count()): q_in = multiprocessing.Queue(1) q_out = multiprocessing.Queue() proc = [multiprocessing.Process(target=fun, args=(f, q_in, q_out)) for _ in range(nprocs)] for p in proc: p.daemon = True p.start() sent = [q_in.put((i, x)) for i, x in enumerate(X)] [q_in.put((None, None)) for _ in range(nprocs)] res = [q_out.get() for _ in range(len(sent))] [p.join() for p in proc] return [x for i, x in sorted(res)] if __name__ == '__main__': print(parmap(lambda i: i * 2, [1, 2, 3, 4, 6, 7, 8])) [INST] Use cases for the 'setdefault' dict method The addition of collections.defaultdict in Python 2.5 greatly reduced the need for dict's setdefault method. This question is for our collective education: What is setdefault still useful for, today in Python 2.6/2.7? What popular use cases of setdefault were superseded with collections.defaultdict? [/INST] You could say defaultdict is useful for settings defaults before filling the dict and setdefault is useful for setting defaults while or after filling the dict. Probably the most common use case: Grouping items (in unsorted data, else use itertools.groupby) # really verbose new = {} for (key, value) in data: if key in new: new[key].append( value ) else: new[key] = [value] # easy with setdefault new = {} for (key, value) in data: group = new.setdefault(key, []) # key might exist already group.append( value ) # even simpler with defaultdict new = defaultdict(list) for (key, value) in data: new[key].append( value ) # all keys have a default already Sometimes you want to make sure that specific keys exist after creating a dict. defaultdict doesn't work in this case, because it only creates keys on explicit access. Think you use something HTTP-ish with many headers -- some are optional, but you want defaults for them: headers = parse_headers( msg ) # parse the message, get a dict # now add all the optional headers for headername, defaultvalue in optional_headers: headers.setdefault( headername, defaultvalue ) [INST] What is __main__.py? What is the __main__.py file for, what sort of code should I put into it, and when should I have one? [/INST] Often, a Python program is run by naming a .py file on the command line: $ python my_program.py You can also create a directory or zipfile full of code, and include a __main__.py. Then you can simply name the directory or zipfile on the command line, and it executes the __main__.py automatically: $ python my_program_dir $ python my_program.zip # Or, if the program is accessible as a module $ python -m my_program You'll have to decide for yourself whether your application could benefit from being executed like this. [INST] Difference between map, applymap and apply methods in Pandas Can you tell me when to use these vectorization methods with basic examples? I see that map is a Series method whereas the rest are DataFrame methods. I got confused about apply and applymap methods though. Why do we have two methods for applying a function to a DataFrame? Again, simple examples which illustrate the usage would be great! Thanks! [/INST] Straight from Wes McKinney's Python for Data Analysis book, pg. 132 (I highly recommended this book): Another frequent operation is applying a function on 1D arrays to each column or row. DataFrame’s apply method does exactly this: In [116]: frame = DataFrame(np.random.randn(4, 3), columns=list('bde'), index=['Utah', 'Ohio', 'Texas', 'Oregon']) In [117]: frame Out[117]: b d e Utah -0.029638 1.081563 1.280300 Ohio 0.647747 0.831136 -1.549481 Texas 0.513416 -0.884417 0.195343 Oregon -0.485454 -0.477388 -0.309548 In [118]: f = lambda x: x.max() - x.min() In [119]: frame.apply(f) Out[119]: b 1.133201 d 1.965980 e 2.829781 dtype: float64 Many of the most common array statistics (like sum and mean) are DataFrame methods, so using apply is not necessary. Element-wise Python functions can be used, too. Suppose you wanted to compute a formatted string from each floating point value in frame. You can do this with applymap: In [120]: format = lambda x: '%.2f' % x In [121]: frame.applymap(format) Out[121]: b d e Utah -0.03 1.08 1.28 Ohio 0.65 0.83 -1.55 Texas 0.51 -0.88 0.20 Oregon -0.49 -0.48 -0.31 The reason for the name applymap is that Series has a map method for applying an element-wise function: In [122]: frame['e'].map(format) Out[122]: Utah 1.28 Ohio -1.55 Texas 0.20 Oregon -0.31 Name: e, dtype: object Summing up, apply works on a row / column basis of a DataFrame, applymap works element-wise on a DataFrame, and map works element-wise on a Series. [INST] Explaining Python's '__enter__' and '__exit__' this is i saw in someone's code: def __enter__(self): return self def __exit__(self, type, value, tb): self.stream.close() from __future__ import with_statement#for python2.5 class a(object): def __enter__(self): print 'sss' return 'sss111' def __exit__(self ,type, value, traceback): print 'ok' return False with a() as s: print s print s [/INST] Using these magic methods (__enter__, __exit__) allows you to implement objects which can be used easily with the with statement. The idea is that it makes it easy to build code which needs some 'cleandown' code executed (think of it as a try-finally block). Some more explanation here. A useful example could be a database connection object (which then automagically closes the connection once the corresponding 'with'-statement goes out of scope): class DatabaseConnection(object): def __enter__(self): # make a database connection and return it ... return self.dbconn def __exit__(self, exc_type, exc_val, exc_tb): # make sure the dbconnection gets closed self.dbconn.close() ... As explained above, use this object with the with statement (you may need to do from __future__ import with_statement at the top of the file if you're on Python 2.5). with DatabaseConnection() as mydbconn: # do stuff PEP343 -- The 'with' statement' has a nice writeup as well. [INST] How do you use the ellipsis slicing syntax in Python? This came up in Hidden features of Python, but I can't see good documentation or examples that explain how the feature works. [/INST] The ellipsis is used to slice higher-dimensional data structures. It's designed to mean at this point, insert as many full slices (:) to extend the multi-dimensional slice to all dimensions. Example: >>> from numpy import arange >>> a = arange(16).reshape(2,2,2,2) Now, you have a 4-dimensional matrix of order 2x2x2x2. To select all first elements in the 4th dimension, you can use the ellipsis notation >>> a[..., 0].flatten() array([ 0, 2, 4, 6, 8, 10, 12, 14]) which is equivalent to >>> a[:,:,:,0].flatten() array([ 0, 2, 4, 6, 8, 10, 12, 14]) In your own implementations, you're free to ignore the contract mentioned above and use it for whatever you see fit. [INST] Python: How do I format a date in Jinja2? Using Jinja2, how do I format a date field? I know in Python I can simply do this: print car.date_of_manufacture.strftime('%Y-%m-%d') But how do I format the date in Jinja2? Thanks. [/INST] There are two ways to do it. The direct approach would be to simply call (and print) the strftime() method in your template, for example {{ car.date_of_manufacture.strftime('%Y-%m-%d') }} Another, sightly better approach would be to define your own filter, e.g.: def format_datetime(value, format='medium'): if format == 'full': format="EEEE, d. MMMM y 'at' HH:mm" elif format == 'medium': format="EE dd.MM.y HH:mm" return babel.dates.format_datetime(value, format) jinja_env.filters['datetime'] = format_datetime (This filter is based on babel for reasons regarding i18n, but you can use strftime too). The advantage of the filter is, that you can write {{ car.date_of_manufacture|datetime }} which looks nicer and is more maintainable. Another common filter is also the "timedelta" filter, which evaluates to something like "written 8 minutes ago". You can use babel.dates.format_timedelta for that, and register it as filter similar to the datetime example given here. [INST] Adding Python Path on Windows 7 I've been trying to add the Python path to the command line on Windows 7, yet no matter the method I try, nothing seems to work. I've used the set command, I've tried adding it through the Edit Environment variables prompt etc. Further more if I run the set command on the command line it lists this python = c:\python27 Yet it still doesn't recognize the Python command. Reading the documentation, and various other sources hasn't seemed to help. Edit: Just to clarify further, I've appended the path of the Python executable to PATH in edit environment prompt. Doesn't seem to work. [/INST] Hold Win and press Pause. Click Advanced System Settings. Click Environment Variables. Append ;C:\python27 to the Path variable. Restart Command Prompt. [INST] Is it possible to implement a Python for range loop without an iterator variable? Is is possible to do this; for i in range(some_number): #do something without the i? If you just want to do something x amount of times and don't need the iterator. [/INST] Off the top of my head, no. I think the best you could do is something like this: def loop(f,n): for i in xrange(n): f() loop(lambda: , 5) But I think you can just live with the extra i variable. Here is the option to use the _ variable, which in reality, is just another variable. for _ in range(n): do_something() Note that _ is assigned the last result that returned in an interactive python session: >>> 1+2 3 >>> _ 3 For this reason, I would not use it in this manner. I am unaware of any idiom as mentioned by Ryan. It can mess up your interpreter. >>> for _ in xrange(10): pass ... >>> _ 9 >>> 1+2 3 >>> _ 9 And according to python grammar, it is an acceptable variable name: identifier ::= (letter|"_") (letter | digit | "_")* [INST] datetime.datetime.utcnow() why no tzinfo? datetime.datetime.utcnow() datetime.datetime(2010, 2, 25, 4, 14, 37, 366086) Why does this datetime not have any tz info say its a utc date. [/INST] That means it is timezone naive, so you can't use it with datetime.astimezone you can give it a timezone like this import pytz # 3rd party: $ pip install pytz u = datetime.utcnow() u = u.replace(tzinfo=pytz.utc) #NOTE: it works only with a fixed utc offset now you can change timezones print(u.astimezone(pytz.timezone("America/New_York"))) To get the current time in a given timezone, you could pass tzinfo to datetime.now() directly: #!/usr/bin/env python from datetime import datetime import pytz # $ pip install pytz print(datetime.now(pytz.timezone("America/New_York"))) It works for any timezone including those that observe daylight saving time (DST) i.e., it works for timezones that may have different utc offsets at different times (non-fixed utc offset). Don't use tz.localize(datetime.now()) -- it may fail during end-of-DST transition when the local time is ambiguous. [INST] Activate a virtualenv via fabric as deploy user I want to run my fabric script locally, which will in turn, log into my server, switch user to deploy, activate the projects .virtualenv, which will change dir to the project and issue a git pull. def git_pull(): sudo('su deploy') # here i need to switch to the virtualenv run('git pull') I typically use the workon command from virtualenvwrapper which sources the activate file and the postactivate file will put me in the project folder. In this case, it seems that because fabric runs from within shell, control is give over to fabric, so I can't use bash's source built-in to '$source ~/.virtualenv/myvenv/bin/activate' Anybody have an example and explanation of how they have done this? [/INST] As an update to bitprophet's forecast: With Fabric 1.0 you can make use of prefix() and your own context managers. from __future__ import with_statement from fabric.api import * from contextlib import contextmanager as _contextmanager env.hosts = ['servername'] env.user = 'deploy' env.keyfile = ['$HOME/.ssh/deploy_rsa'] env.directory = '/path/to/virtualenvs/project' env.activate = 'source /path/to/virtualenvs/project/bin/activate' @_contextmanager def virtualenv(): with cd(env.directory): with prefix(env.activate): yield def deploy(): with virtualenv(): run('pip freeze') [INST] Python normal arguments vs. keyword arguments How are "keyword arguments" different from regular arguments? Can't all arguments be passed as name=value instead of using positional syntax? [/INST] there are two related concepts, both called "keyword arguments". On the calling side, which is what other commenters have mentioned, you have the ability to specify some function arguments by name. You have to mention them after all of the arguments without names (positional arguments), and there must be default values for any parameters which were not mentioned at all. The other concept is on the function definition side: You can define a function that takes parameters by name -- and you don't even have to specify what those names are. These are pure keyword arguments, and can't be passed positionally. The syntax is def my_function(arg1, arg2, **kwargs) Any keyword arguments you pass into this function will be placed into a dictionary named kwargs. You can examine the keys of this dictionary at run-time, like this: def my_function(**kwargs): print str(kwargs) my_function(a=12, b="abc") {'a': 12, 'b': 'abc'} [INST] Why doesn't Python have a sign function? I can't understand why Python doesn't have a sign function. It has an abs builtin (which I consider sign's sister), but no sign. In python 2.6 there is even a copysign function (in math), but no sign. Why bother to write a copysign(x,y) when you could just write a sign and then get the copysign directly from abs(x) * sign(y)? The latter would be much more clear: x with the sign of y, whereas with copysign you have to remember if it's x with the sign of y or y with the sign of x! Obviously sign(x) does not provide anything more than cmp(x,0), but it would be much more readable that this too (and for a greatly readable language like python, this would have been a big plus). If I were a python designer, I would been the other way arond: no cmp builtin, but a sign. When you need cmp(x,y), you could just do a sign(x-y) (or, even better for non-numerical stuff, just a x>y - of course this should have required sorted accepting a boolean instead of an integer comparator). This would also be more clear: positive when x>y (whereas with cmp you have to remember the convention positive when the first is bigger, but it could be the other way around). Of course cmp makes sense in its own for other reasons (e.g. when sorting non-numerical things, or if you want the sort to be stable, which is not possible using with simply a boolean) So, the question is: why did the Python designer(s) decide to leave the sign function out of the language? Why the heck bother with copysign and not its parent sign? Am I missing something? EDIT - after Peter Hansen comment. Fair enough that you didn't use it, but you didn't say what you use python for. In 7 years that I use python, I needed it countless times, and the last is the straw that broke the camel's back! Yes, you can pass cmp around, but 90% of the times that I needed to pass it was in an idiom like lambda x,y: cmp(score(x),score(y)) that would have worked with sign just fine. Finally, I hope you agree that sign would be more useful than copysign, so even if I bought your view, why bother about defining that in math, instead of sign? How can copysign be so much useful than sign? [/INST] EDIT: Indeed there was a patch which included sign() in math, but it wasn't accepted, because they didn't agree on what it should return in all the edge cases (+/-0, +/-nan, etc) So they decided to implement only copysign, which (although more verbose) can be used to delegate to the end user the desired behavior for edge cases - which sometimes might require the call to cmp(x,0). I don't know why it's not a built-in, but I have some thoughts. copysign(x,y): Return x with the sign of y. Most importantly, copysign is a superset of sign! Calling copysign with x=1 is the same as a sign function. So you could just use copysign and forget about it. >>> math.copysign(1, -4) -1.0 >>> math.copysign(1, 3) 1.0 If you get sick of passing two whole arguments, you can implement sign this way, and it will still be compatible with the IEEE stuff mentioned by others: >>> sign = functools.partial(math.copysign, 1) # either of these >>> sign = lambda x: math.copysign(1, x) # two will work >>> sign(-4) -1.0 >>> sign(3) 1.0 >>> sign(0) 1.0 >>> sign(-0.0) -1.0 >>> sign(float('nan')) -1.0 Secondly, usually when you want the sign of something, you just end up multiplying it with another value. And of course that's basically what copysign does. So, instead of: s = sign(a) b = b * s You can just do: b = copysign(b, a) And yes, I'm surprised you've been using Python for 7 years and think cmp could be so easily removed and replaced by sign! Have you never implemented a class with a __cmp__ method? Have you never called cmp and specified a custom comparator function? In summary, I've found myself wanting a sign function too, but copysign with the first argument being 1 will work just fine. I disagree that sign would be more useful than copysign, as I've shown that it's merely a subset of the same functionality. [INST] Python3 error: "Import error: No module name urllib2" Here's my code: import urllib2.request response = urllib2.urlopen("http://www.google.com") html = response.read() print(html) Any help? [/INST] As stated in the urllib2 documentation at http://docs.python.org/library/urllib2.html: The urllib2 module has been split across several modules in Python 3.0 named urllib.request and urllib.error. The 2to3 tool will automatically adapt imports when converting your sources to 3 So you should instead be saying from urllib.request import urlopen html = urlopen("http://www.google.com/") print(html) Your current, now-edited code sample is incorrect because you are saying urllib.urlopen("http://www.google.com/") instead of just urlopen("http://www.google.com/"). [INST] Python When I catch an exception, how do I get the type, file, and line number? Catching an exception that would print like this: Traceback (most recent call last): File "c:/tmp.py", line 1, in 4 / 0 ZeroDivisionError: integer division or modulo by zero I want to format it into: ZeroDivisonError, tmp.py, 1 [/INST] import sys, os try: raise NotImplementedError("No error") except Exception as e: exc_type, exc_obj, exc_tb = sys.exc_info() fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] print(exc_type, fname, exc_tb.tb_lineno) [INST] e.printStackTrace equivalent in python I know that print e {where e is Exception} prints the occurred exception but, I was trying to find the python equivalent of e.printStackTrace() that exactly traces the exception what line it occurred and prints the entire trace of it. Could anyone please tell me the equivalent of e.printStackTrace() in python? [/INST] import traceback traceback.print_exc() When doing this inside an except ...: block it will automatically use the current exception. See http://docs.python.org/library/traceback.html for more information. [INST] Find String index from last in Python I think it might be a silly question but as I'm totally new to Python, i don't know anything about it. I want to find the last position of a target string in given str as a input. For ex. str='hello' and target='l' then it should output 3. How can i do this? [/INST] Use .rfind(): >>> s = 'hello' >>> s.rfind('l') 3 Also don't use str as variable name or you'll shadow the built-in str(). [INST] Installing SciPy and NumPy using pip I'm trying to create required libraries in a package I'm distributing. It requires both the SciPy and NumPy libraries. While developing, I installed both using apt-get install scipy which installed SciPy 0.9.0 and NumPy 1.5.1, and it worked fine. I would like to do the same using pip install - in order to be able to specify dependencies in a setup.py of my own package. The problem is, when I try: pip install 'numpy==1.5.1' it works fine. But then pip install 'scipy==0.9.0' fails miserably, with raise self.notfounderror(self.notfounderror.__doc__) numpy.distutils.system_info.BlasNotFoundError: Blas (http://www.netlib.org/blas/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [blas]) or by setting the BLAS environment variable. How do I get it to work? [/INST] This worked for me on Ubuntu 14.04: sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran pip install scipy [INST] Test if a variable is a list or tuple In python, what's the best way to test if a variable contains a list or a tuple? (ie. a collection) Is isinstance as evil as suggested here? http://www.canonical.org/~kragen/isinstance/ Update : the most common reason I want to distinguish a list from a string is when I have some indefinitely deep nested tree / data-structure of lists of lists of lists of strings etc. which I'm exploring with a recursive algorithm and I need to know when I've hit the "leaf" nodes. [/INST] if type(x) is list: print 'a list' elif type(x) is tuple: print 'a tuple' else: print 'neither a tuple or a list' [INST] Which is faster in Python: x**.5 or math.sqrt(x)? I've been wondering this for some time. As the title say, which is faster, the actual function or simply raising to the half power? UPDATE This is not a matter of premature optimization. This is simply a question of how the underlying code actually works. What is the theory of how Python code works? I sent Guido van Rossum an email cause I really wanted to know the differences in these methods. My email: There are at least 3 ways to do a square root in Python: math.sqrt, the '**' operator and pow(x,.5). I'm just curious as to the differences in the implementation of each of these. When it comes to efficiency which is better? His response: pow and ** are equivalent; math.sqrt doesn't work for complex numbers, and links to the C sqrt() function. As to which one is faster, I have no idea... [/INST] As per comments, I've updated the code: import time import math def timeit1(): s = time.time() for i in xrange(750000): z=i**.5 print "Took %f seconds" % (time.time() - s) def timeit2(arg=math.sqrt): s = time.time() for i in xrange(750000): z=arg(i) print "Took %f seconds" % (time.time() - s) timeit1() timeit2() Now the math.sqrt function is directly in a local argument, meaning it has the fastest lookup possible. UPDATE: The python version seems to matter here. I used to think that timeit1 would be faster, since when python parses "i**.5" it knows, syntactically, which method to call (__pow__ or some variant), so it doesn't have to go through the overhead of lookup that the math.sqrt variant does. But I might be wrong: Python 2.5: 0.191000 vs. 0.224000 Python 2.6: 0.195000 vs. 0.139000 Also psyco seems to deal with math.sqrt better: Python 2.5 + Psyco 2.0: 0.109000 vs. 0.043000 Python 2.6 + Psyco 2.0: 0.128000 vs. 0.067000 | Interpreter | x**.5, | sqrt, | sqrt faster, % | | | seconds | seconds | | |----------------+---------+---------+----------------| | Python 3.2rc1+ | 0.32 | 0.27 | 19 | | Python 3.1.2 | 0.136 | 0.088 | 55 | | Python 3.0.1 | 0.155 | 0.102 | 52 | | Python 2.7 | 0.132 | 0.079 | 67 | | Python 2.6.6 | 0.121 | 0.075 | 61 | | PyPy 1.4.1 | 0.083 | 0.0159 | 422 | | Jython 2.5.1 | 0.132 | 0.22 | -40 | | Python 2.5.5 | 0.129 | 0.125 | 3 | | Python 2.4.6 | 0.131 | 0.123 | 7 | #+TBLFM: $4=100*($2-$3)/$3;%.0f Table results produced on machine: $ uname -vms Linux #42-Ubuntu SMP Thu Dec 2 02:41:37 UTC 2010 x86_64 $ cat /proc/cpuinfo | grep 'model name' | head -1 model name : Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz To reproduce results: get source: git clone git://gist.github.com/783011.git gist-783011 install tox: pip install tox run tox from the directory with tox.ini file. [INST] Why does range(start, end) not include end? >>> range(1,11) gives you [1,2,3,4,5,6,7,8,9,10] Why not 1-11? Did they just decide to do it like that at random or does it have some value I am not seeing? [/INST] Because it's more common to call range(0, 10) which returns [0,1,2,3,4,5,6,7,8,9] which contains 10 elements which equals len(range(0, 10)). Remember that programmers prefer 0-based indexing. Also, consider the following common code snippet: for i in range(len(li)): pass Could you see that if range() went up to exactly len(li) that this would be problematic? The programmer would need to explicitly subtract 1. This also follows the common trend of programmers preferring for(int i = 0; i < 10; i++) over for(int i = 0; i <= 9; i++). If you are calling range with a start of 1 frequently, you might want to define your own function: >>> range1 = lambda start, end: range(start, end+1) >>> range1(1, 10) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] [INST] Python append dictionary to dictionary I have two existing dictionaries, and I wish to 'append' one of them to the other. By that I mean that the key,values of the other dictionary should be made into the first dictionary. For example: orig = { 'A': 1, 'B': 2, 'C': 3, } extra = { 'D': 4, 'E': 5, } dest = # something here involving orig and extra print dest { 'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5 } I think this all can be achieved through a for loop (maybe?) but is there some method in the dictionaries or any other module that saves this job for me? The actual dictionaries I'm using are really big... [/INST] You can do orig.update(extra) or, if you don't want orig to be modified, make a copy first: dest = dict(orig) # or orig.copy() dest.update(extra) Note that if extra and orig have overlapping keys, the final value will be taken from extra. For example, >>> d1 = {1: 1, 2: 2} >>> d2 = {2: 'ha!', 3: 3} >>> d1.update(d2) >>> d1 {1: 1, 2: 'ha!', 3: 3} [INST] Get key with the least value from a dictionary If I have a Python dictionary, how do I get the key to the entry which contains the minimum value? I was thinking about something to do with the min() function... Given the input: {320:1, 321:0, 322:3} It would return 321. [/INST] Best: min(d, key=d.get) -- no reason to interpose a useless lambda indirection layer or extract items or keys! [INST] flask - how do you get a query string from flask Not obvious from the flask documention on how to get the query string. I am new, looked at the docs, could not find! So @app.route('/') @app.route('/data') def data(): query_string=?????? return render_template("data.html") [/INST] from flask import request @app.route('/data') def data(): # here we want to get the value of user (i.e. ?user=some-value) user = request.args.get('user') [INST] Find out how much memory is being used by an object in Python How would you go about finding out how much memory is being used by an object? I know it is possible to find out how much is used by a block of code, but not by an instantiated object (anytime during its life), which is what I want. [/INST] There's no easy way to find out the memory size of a python object. One of the problems you may find is that Python objects - like lists and dicts - may have references to other python objects (in this case, what would your size be? The size containing the size of each object or not?). There are some pointers overhead and internal structures related to object types and garbage collection. Finally, some python objects have non-obvious behaviors. For instance, lists reserve space for more objects than they have, most of the time; dicts are even more complicated since they can operate in different ways (they have a different implementation for small number of keys and sometimes they over allocate entries). There is a big chunk of code (and an updated big chunk of code) out there to try to best approximate the size of a python object in memory. There's also some simpler approximations. But they will always be approximations. You may also want to check some old description about PyObject (the internal C struct that represents virtually all python objects). [INST] How do I find the time difference between two datetime objects in python? How do I tell the time difference in minutes between two datetime objects? [/INST] >>> import datetime >>> a = datetime.datetime.now() >>> b = datetime.datetime.now() >>> c = b - a datetime.timedelta(0, 8, 562000) >>> divmod(c.days * 86400 + c.seconds, 60) (0, 8) # 0 minutes, 8 seconds [INST] What is the '@=' symbol for in Python? I know @ is for decorators, but what is @= for in Python? Is it just reservation for some future idea? This is just one of my many questions while reading tokenizer.py. [/INST] From the documentation: The @ (at) operator is intended to be used for matrix multiplication. No builtin Python types implement this operator. The @ operator was introduced in Python 3.5. @= is matrix multiplication followed by assignment, as you would expect. They map to __matmul__, __rmatmul__ or __imatmul__ similar to how + and += map to __add__, __radd__ or __iadd__. The operator and the rationale behind it are discussed in detail in PEP 465. [INST] Maximum recursion depth? I have this tail recursive function here: def fib(n, sum): if n < 1: return sum else: return fib(n-1, sum+n) c = 998 print(fib(c, 0)) It works up to n=997, then it just breaks and spits a "maximum recursion depth exceeded in comparison" RuntimeError. Is this just a stack overflow? Is there a way to get around it? [/INST] It is a guard against a stack overflow, yes. Python (or rather, the CPython implementation) doesn't optimize tail recursion, and unbridled recursion causes stack overflows. You can change the recursion limit with sys.setrecursionlimit, but doing so is dangerous -- the standard limit is a little conservative, but Python stackframes can be quite big. Python isn't a functional language and tail recursion is not a particularly efficient technique. Rewriting the algorithm iteratively, if possible, is generally a better idea. [INST] How do I fix PyDev "Undefined variable from import" errors? I've got a Python project using PyDev in Eclipse, and PyDev keeps generating false errors for my code. I have a module settings that defines a settings object. I import that in module b and assign an attribute with: from settings import settings settings.main = object() In some of my code--but not all of it, statements like: from settings import settings print settings.main ... generate "Undefined variable from import: main" messages in the Eclipse code error pane, even though the code runs without a problem. How can I correct these? [/INST] For code in your project, the only way is adding a comment saying that you expected that (the static code-analysis only sees what you see, not runtime info -- if you opened that module yourself, you'd have no indication that main was expected). You can use ctrl+1 (Cmd+1 for Mac) in a line with an error and pydev will present you an option to add a comment to ignore that error. If it was some external module, you could add it to the forced builtins so that it was forced to be analyzed by a running shell with runtime information (see http://pydev.org/manual_101_interpreter.html for details). Another option could be creating a 'stub' yourself and adding it to the 'predefined' completions (http://pydev.org/manual_101_interpreter.html also has details on that). [INST] Get a filtered list of files in a directory I am trying to get a list of files in a directory using Python, but I do not want a list of ALL the files. What I essentially want is the ability to do something like the following but using Python and not executing ls. ls 145592*.jpg If there is no built-in method for this, I am currently thinking of writing a for loop to iterate through the results of an os.listdir() and to append all the matching files to a new list. However, there are a lot of files in that directory and therefore I am hoping there is a more efficient method (or a built-in method). [/INST] glob.glob('145592*.jpg') [INST] Change the name of a key in dictionary I want to change the key of an entry in a Python dictionary. Is there a straightforward way to do this? [/INST] Easily done in 2 steps: dictionary[new_key] = dictionary[old_key] del dictionary[old_key] Or in 1 step: dictionary[new_key] = dictionary.pop(old_key) which will raise KeyError if dictionary[old_key] is undefined. Note that this will delete dictionary[old_key]. >>> dictionary = { 1: 'one', 2:'two', 3:'three' } >>> dictionary['ONE'] = dictionary.pop(1) >>> dictionary {2: 'two', 3: 'three', 'ONE': 'one'} >>> dictionary['ONE'] = dictionary.pop(1) Traceback (most recent call last): File "", line 1, in KeyError: 1 [INST] What does -> mean in Python function definitions? I've recently noticed something interesting when looking at Python 3.3 grammar specification: funcdef: 'def' NAME parameters ['->' test] ':' suite The optional 'arrow' block was absent in Python 2 and I couldn't find any information regarding its meaning in Python 3. It turns out this is correct Python and it's accepted by the interpreter: def f(x) -> 123: return x I thought that this might be some kind of a precondition syntax, but: I cannot test x here, at it is still undefined, No matter what I put after the arrow (e.g. 2 < 1), it doesn't affect the function behaviour. Could anyone accustomed with this syntax explain it? [/INST] It's a function annotation. In more detail, Python 2.x has docstrings, which allow you to attach a metadata string to various types of object. This is amazingly handy, so Python 3 extends the feature by allowing you to attach metadata to functions describing their parameters and return values. There's no preconceived use case, but the PEP suggests several. One very handy one is to allow you to annotate parameters with their expected types; it would then be easy to write a decorator that verifies the annotations or coerces the arguments to the right type. Another is to allow parameter-specific documentation instead of encoding it into the docstring. [INST] Most efficient way to reverse a numpy array Believe it or not, after profiling my current code, the repetitive operation of numpy array reversion ate a giant chunk of the running time. What I have right now is the common view-based method: reversed_arr = arr[::-1] Is there any other way to do it more efficiently, or is it just an illusion from my obsession with unrealistic numpy performance? [/INST] When you create reversed_arr you are creating a view into the original array. You can then change the original array, and the view will update to reflect the changes. Are you re-creating the view more often than you need to? You should be able to do something like this: arr = np.array(some_sequence) reversed_arr = arr[::-1] do_something(arr) look_at(reversed_arr) do_something_else(arr) look_at(reversed_arr) I'm not a numpy expert, but this seems like it would be the fastest way to do things in numpy. If this is what you are already doing, I don't think you can improve on it. P.S. Great discussion of numpy views here: View onto a numpy array? [INST] How do I look inside a Python object? I'm starting to code in various projects using Python (including Django web development and Panda3D game development). To help me understand what's going on, I would like to basically 'look' inside the Python objects to see how they tick - like their methods and properties. So say I have a Python object, what would I need to print out its contents? Is that even possible? [/INST] Python has a strong set of introspection features. Take a look at the following built-in functions: type() dir() id() getattr() hasattr() globals() locals() callable() type() and dir() are particularly useful for inspecting the type of an object and its set of attributes, respectively. [INST] How to check which version of Numpy I'm using? How can I check which version of Numpy I'm using? I'm using Mac OS X 10.6.1 Snow Leopard. [/INST] import numpy numpy.version.version [INST] Ubuntu running `pip install` gives error 'The following required packages can not be built: * freetype' When performing pip install -r requirements.txt, I get the following error during the stage where it is installing matplotlib: REQUIRED DEPENDENCIES AND EXTENSIONS numpy: yes [not found. pip may install it below.] dateutil: yes [dateutil was not found. It is required for date axis support. pip/easy_install may attempt to install it after matplotlib.] tornado: yes [tornado was not found. It is required for the WebAgg backend. pip/easy_install may attempt to install it after matplotlib.] pyparsing: yes [pyparsing was not found. It is required for mathtext support. pip/easy_install may attempt to install it after matplotlib.] pycxx: yes [Couldn't import. Using local copy.] libagg: yes [pkg-config information for 'libagg' could not be found. Using local copy.] freetype: no [pkg-config information for 'freetype2' could not be found.] ... The following required packages can not be built: * freetype Shouldn't pip install -r requirements.txt also install freetype? How should freetype be installed in Ubuntu 12.04 so it works with matplotlib? [/INST] No. pip will not install system-level dependencies. This means pip will not install RPM(s) (Redhat based systems) or DEB(s) (Debian based systems). To install system dependencies you will need to use one of the following methods depending on your system. Ubuntu/Debian: apt-get install libfreetype6-dev To search for packages on Ubuntu/Debian based systems: apt-cache search e.g: apt-cache search freetype | grep dev Redhat/CentOS/Fedora: yum -y install freetype-devel To search for packages on Redhat/CentOS/Fedora based systems: yum search e.g: yum search freetype | grep devel Mac OS X: (via Homebrew) brew install freetype To search for packages on Redhat/CentOS/Fedora based systems: brew search e.g: brew search freetype [INST] Why are pandas merges in python faster than data.table merges in R? I recently came across the pandas library for python, which according to this benchmark performs very fast in-memory merges. It's even faster than the data.table package in R (my language of choice for analysis). Why is pandas so much faster than data.table? Is it because of an inherent speed advantage python has over R, or is there some tradeoff I'm not aware of? Is there a way to perform inner and outer joins in data.table without resorting to merge(X, Y, all=FALSE) and merge(X, Y, all=TRUE)? Here's the R code and the Python code used to benchmark the various packages. [/INST] The reason pandas is faster is because I came up with a better algorithm, which is implemented very carefully using a fast hash table implementation - klib and in C/Cython to avoid the Python interpreter overhead for the non-vectorizable parts. The algorithm is described in some detail in my presentation: A look inside pandas design and development. The comparison with data.table is actually a bit interesting because the whole point of R's data.table is that it contains pre-computed indexes for various columns to accelerate operations like data selection and merges. In this case (database joins) pandas' DataFrame contains no pre-computed information that is being used for the merge, so to speak it's a "cold" merge. If I had stored the factorized versions of the join keys, the join would be significantly faster - as factorizing is the biggest bottleneck for this algorithm. I should also add that the internal design of pandas' DataFrame is much more amenable to these kinds of operations than R's data.frame (which is just a list of arrays internally). [INST] How to print an error in Python? try: something here except: print 'the whatever error occurred.' How can I print the error in my except: block? [/INST] except Exception,e: print str(e) [INST] PyCharm shows unresolved references error for valid code I am using PyCharm to work on a project. The project is opened and configured with an interpreter, and can run successfully. The remote interpreter paths are mapped properly. This seems to be the correct configuration, but PyCharm is highlighting my valid code with "unresolved reference" errors, even for built-in Python functions. Why don't these seem to be detected, even though the code runs? Is there any way to get PyCharm to recognize these correctly? This specific instance of the problem is with a remote interpreter, but the problem appears on local interpreters as well. [/INST] File | Invalidate Caches... and restarting PyCharm helps. [INST] Alphabet range python Instead of making a list of alphabet like this: alpha = ['a', 'b', 'c', 'd'.........'z'] Is there any way that we can group it to a range or something? For example, for numbers it can be grouped using range() range(1, 10) [/INST] >>> import string >>> string.ascii_lowercase 'abcdefghijklmnopqrstuvwxyz' If you really need a list: >>> list(string.ascii_lowercase) ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] And to do it with range >>> list(map(chr, range(97, 123))) #or list(map(chr, range(ord('a'), ord('z')+1))) ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] Other helpful string module features: >>> help(string) # on Python 3 .... DATA ascii_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz' ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' digits = '0123456789' hexdigits = '0123456789abcdefABCDEF' octdigits = '01234567' printable = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c' punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' whitespace = ' \t\n\r\x0b\x0c' [INST] What's the best practice using a settings file in Python? I have a command line script that I run with a lot of arguments. I have now come to a point where I have too many arguments, and I want to have some arguments in dictionary form too. So in order to simplify things I would like to run the script with a settings file instead. I don't really know what libraries to use for the parsing of the file. What's the best practice for doing this? I could of course hammer something out myself, but if there is some library for this, I'm all ears. A few 'demands': Rather than using pickle I would like it to be a straight forward text file that can easily be read and edited. I wan't to be able to add dictionary-like data in it, i.e., some form of nesting should be supported. A simplified pseudo example file: truck: color: blue brand: ford city: new york cabriolet: color: black engine: cylinders: 8 placement: mid doors: 2 [/INST] You can have a regular Python module, say config.py, like this : truck = dict( color = 'blue', brand = 'ford', ) city = 'new york' cabriolet = dict( color = 'black', engine = dict( cylinders = 8, placement = 'mid', ), doors = 2, ) and use it like that : import config print config.truck['color'] [INST] Safest way to convert float to integer in python? Python's math module contain handy functions like floor & ceil. These functions take a floating point number and return the nearest integer below or above it. However these functions return the answer as a floating point number. For example: import math f=math.floor(2.3) Now f returns: 2.0 What is the safest way to get an integer out of this float, without running the risk of rounding errors (for example if the float is the equivalent of 1.99999) or perhaps I should use another function altogether? [/INST] All integers that can be represented by floating point numbers have an exact representation. So you can safely use int on the result. Inexact representations occur only if you are trying to represent a rational number with a denominator that is not a power of two. That this works is not trivial at all! It's a property of the IEEE floating point representation that int∘floor = ⌊⋅⌋ if the magnitude of the numbers in question is small enough, but different representations are possible where int(floor(2.3)) might be 1. To quote from Wikipedia, Any integer with absolute value less than or equal to 224 can be exactly represented in the single precision format, and any integer with absolute value less than or equal to 253 can be exactly represented in the double precision format. [INST] Python - When to use file vs open What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5) [/INST] You should always use open(). As the documentation states: When opening a file, it's preferable to use open() instead of invoking this constructor directly. file is more suited to type testing (for example, writing "isinstance(f, file)"). Also, file() has been removed since Python 3.0. [INST] Cron and virtualenv I am trying to run a Django management command from cron. I am using virtualenv to keep my project sandboxed. I have seen examples here and elsewhere that show running management commands from within virtualenv's like: 0 3 * * * source /home/user/project/env/bin/activate && /home/user/project/manage.py command arg However, even though syslog shows an entry when the task should have started, this task never actually runs (the log file for the script is empty). If I run the line manually from the shell, it works as expected. The only way I can currently get the command to run via cron, is to break the commands up and put them in a dumb bash wrapper script: #!/bin/sh source /home/user/project/env/bin/activate cd /home/user/project/ ./manage.py command arg Please enlighten me what the difference is. What am I missing? Thanks EDIT: ars came up with a working combination of commands: 0 3 * * * cd /home/user/project && /home/user/project/env/bin/python /home/user/project/manage.py command arg At least in my case, invoking the activate script for the virtualenv did nothing. This works, so on with the show. [/INST] You should be able to do this by using the python in your virtual environment: /home/my/virtual/bin/python /home/my/project/manage.py command arg EDIT: If your django project isn't in the PYTHONPATH, then you'll need to switch to the right directory: cd /home/my/project && /home/my/virtual/bin/python ... You can also try to log the failure from cron: cd /home/my/project && /home/my/virtual/bin/python /home/my/project/manage.py > /tmp/cronlog.txt 2>&1 Another thing to try is to make the same change in your manage.py script at the very top: #!/home/my/virtual/bin/python [INST] What is `related_name` used for in Django? What is the related_name argument useful for on ManyToManyField and ForeignKey fields? For example, given the following code, what is the effect of related_name='maps'? class Map(db.Model): members = models.ManyToManyField(User, related_name='maps', verbose_name=_('members')) [/INST] The related_name attribute specifies the name of the reverse relation from the User model back to your model. If you don't specify a related_name, Django automatically creates one using the name of your model with the suffix _set, for instance User.map_set.all(). If you do specify, e.g. related_name=maps on the User model, User.map_set will still work, but the User.maps. syntax is obviously a bit cleaner and less clunky; so for example, if you had a user object current_user, you could use current_user.maps.all() to get all instances of your Map model that have a relation to current_user. The Django documentation has more details. [INST] How to check whether a variable is a class or not? I was wondering how to check whether a variable is a class (not an instance!) or not. I've tried to use the function isinstance(object, class_or_type_or_tuple) to do this, but I don't know what type would a class will have. For example, in the following code class Foo: pass isinstance(Foo, **???**) # i want to make this return True. I tried to substitute "class" with ???, but I realized that class is a keyword in python. [/INST] Even better: use the inspect.isclass function. >>> import inspect >>> class X(object): ... pass ... >>> inspect.isclass(X) True >>> x = X() >>> isinstance(x, X) True >>> y = 25 >>> isinstance(y, X) False [INST] How to find all occurrences of an element in a list? index() will just give the first occurrence of an item in a list. Is there a neat trick which returns all indices in a list? [/INST] You can use a list comprehension: indices = [i for i, x in enumerate(my_list) if x == "whatever"] [INST] Using python map and other functional tools This is quite n00bish, but I'm trying to learn/understand functional programming in python. The following code: foos = [1.0,2.0,3.0,4.0,5.0] bars = [1,2,3] def maptest(foo, bar): print foo, bar map(maptest, foos, bars) produces: 1.0 1 2.0 2 3.0 3 4.0 None 5.0 None Q. Is there a way to use map or any other functional tools in python to produce the following without loops etc. 1.0 [1,2,3] 2.0 [1,2,3] 3.0 [1,2,3] 4.0 [1,2,3] 5.0 [1,2,3] Just as a side note how would the implementation change if there is a dependency between foo and bar. e.g. foos = [1.0,2.0,3.0,4.0,5.0] bars = [1,2,3,4,5] and print: 1.0 [2,3,4,5] 2.0 [1,3,4,5] 3.0 [1,2,4,5] ... P.S: I know how to do it naively using if, loops and/or generators, but I'd like to learn how to achieve the same using functional tools. Is it just a case of adding an if statement to maptest or apply another filter map to bars internally within maptest? [/INST] Are you familiar with other functional languages? i.e. are you trying to learn how python does functional programming, or are you trying to learn about functional programming and using python as the vehicle? Also, do you understand list comprehensions? map(f, sequence) is directly equivalent (*) to: [f(x) for x in sequence] In fact, I think map() was once slated for removal from python 3.0 as being redundant (that didn't happen). map(f, sequence1, sequence2) is mostly equivalent to: [f(x1, x2) for x1, x2 in zip(sequence1, sequence2)] (there is a difference in how it handles the case where the sequences are of different length. As you saw, map() fills in None when one of the sequences runs out, whereas zip() stops when the shortest sequence stops) So, to address your specific question, you're trying to produce the result: foos[0], bars foos[1], bars foos[2], bars # etc. You could do this by writing a function that takes a single argument and prints it, followed by bars: def maptest(x): print x, bars map(maptest, foos) Alternatively, you could create a list that looks like this: [bars, bars, bars, ] # etc. and use your original maptest: def maptest(x, y): print x, y One way to do this would be to explicitely build the list beforehand: barses = [bars] * len(foos) map(maptest, foos, barses) Alternatively, you could pull in the itertools module. itertools contains many clever functions that help you do functional-style lazy-evaluation programming in python. In this case, we want itertools.repeat, which will output its argument indefinitely as you iterate over it. This last fact means that if you do: map(maptest, foos, itertools.repeat(bars)) you will get endless output, since map() keeps going as long as one of the arguments is still producing output. However, itertools.imap is just like map(), but stops as soon as the shortest iterable stops. itertools.imap(maptest, foos, itertools.repeat(bars)) Hope this helps :-) (*) It's a little different in python 3.0. There, map() essentially returns a generator expression. [INST] Convert base-2 binary number string to int I'd simply like to convert a base-2 binary number string into an int, something like this: >>> '11111111'.fromBinaryToInt() 255 Is there a way to do this in Python? [/INST] You use the built-in [int() function][1], and pass it the base of the input number, i.e. 2 for a binary number: >>> int('11111111', 2) 255 Update: I removed the use of print so the above "code" is now compatible with either, as pointed out in a comment. The documentation link is also just to the current documentation, which is 3.x-aware but since the function exists in 2.x too that's not a big deal. [INST] Can I install Python windows packages into virtualenvs? Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects' dependencies aren't all thrown together into a common pile. But if I want to install a package on Windows that's packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I have pycuda-0.94rc.win32-py2.6.exe. When I run it, it examines the registry, and finds only one Python26 to install into, the common one that my virtualenv is based off of. How can I direct it to install into the virtualenv? [/INST] Yes, you can. All you need is easy_install binary_installer_built_with_distutils.exe Surprised? It looks like binary installers for Windows made with distutils combine .exe with .zip into one .exe file. Change extension to .zip to see it's a valid zip file. I discovered this after reading answers to my question Where can I download binary eggs with psycopg2 for Windows? UPDATE As noted by Tritium21 in his answer nowadays you should use pip instead of easy_install. Pip can't install binary packages created by distutils but it can install binary packages in the new wheel format. You can convert from old format to the new one using wheel package, which you have to install first. [INST] A simple way to remove multiple spaces in a string in Python Suppose this is the string: The fox jumped over the log. It would result in: The fox jumped over the log. What is the simplest, 1-2 liner that can do this? Without splitting and going into lists... [/INST] foo is your string: " ".join(foo.split()) [INST] Clearing Python lists Is there any reason to do anything more complicated than one of these two lines when you want to clear a list in Python: old_list = [] old_list = list() The reason I ask is that I just saw this in some running code: del old_list[ 0:len(old_list) ] [/INST] Clearing a list in place will affect all other references of the same list. For example, this method doesn't affect other references: >>> a = [1, 2, 3] >>> b = a >>> a = [] >>> print(a) [] >>> print(b) [1, 2, 3] But this one does: >>> a = [1, 2, 3] >>> b = a >>> del a[:] # equivalent to del a[0:len(a)] >>> print(a) [] >>> print(b) [] >>> a is b True You could also do: >>> a[:] = [] [INST] Is there a way to perform "if" in python's lambda In python 2.6, I want to do: f = lambda x: if x==2 print x else raise Exception() f(2) #should print "2" f(3) #should throw an exception This clearly isn't the syntax. Is it possible to perform an if in lambda and if so how to do it? thanks [/INST] The syntax you're looking for: lambda x: True if x % 2 == 0 else False But you can't use print or raise in a lambda. [INST] read subprocess stdout line by line My python script uses subprocess to call a linux utility that is very noisy. I want to store all of the output to a log file and show some of it to the user. I thought the following would work, but the output doesn't show up in my application until the utility has produced a significant amount of output. #fake_utility.py, just generates lots of output over time import time i = 0 while True: print hex(i)*512 i += 1 time.sleep(0.5) #filters output import subprocess proc = subprocess.Popen(['python','fake_utility.py'],stdout=subprocess.PIPE) for line in proc.stdout: #the real code does filtering here print "test:", line.rstrip() The behavior I really want is for the filter script to print each line as it is received from the subprocess. Sorta like what tee does but with python code. What am I missing? Is this even possible? Update: If a sys.stdout.flush() is added to fake_utility.py, the code has the desired behavior in python 3.1. I'm using python 2.6. You would think that using proc.stdout.xreadlines() would work the same as py3k, but it doesn't. Update 2: Here is the minimal working code. #fake_utility.py, just generates lots of output over time import sys, time for i in range(10): print i sys.stdout.flush() time.sleep(0.5) #display out put line by line import subprocess proc = subprocess.Popen(['python','fake_utility.py'],stdout=subprocess.PIPE) #works in python 3.0+ #for line in proc.stdout: for line in iter(proc.stdout.readline,''): print line.rstrip() [/INST] It's been a long time since I last worked with Python, but I think the problem is with the statement for line in proc.stdout, which reads the entire input before iterating over it. The solution is to use readline() instead: #filters output import subprocess proc = subprocess.Popen(['python','fake_utility.py'],stdout=subprocess.PIPE) while True: line = proc.stdout.readline() if line != '': #the real code does filtering here print "test:", line.rstrip() else: break Of course you still have to deal with the subprocess' buffering. Note: according to the documentation the solution with an iterator should be equivalent to using readline(), except for the read-ahead buffer, but (or exactly because of this) the proposed change did produce different results for me (Python 2.5 on Windows XP). [INST] How to convert 2D float numpy array to 2D int numpy array? How to convert real numpy array to int numpy array? Tried using map directly to array but it did not work. [/INST] Use the astype method. >>> x = np.array([[1.0, 2.3], [1.3, 2.9]]) >>> x array([[ 1. , 2.3], [ 1.3, 2.9]]) >>> x.astype(int) array([[1, 2], [1, 2]]) [INST] How do I add a placeholder on a CharField in Django? Take this very simple form for example. class SearchForm(Form): q = forms.CharField(label='search') This gets rendered in the template: However, I want to add the 'placeholder' attribute to this field with a value of "Search" so that the HTML would look something like: Preferably I would like to pass the placeholder value in to CharField in the form class through a dictionary or something like: q = forms.CharField(label='search', placeholder='Search') What would be the best way to accomplish this? [/INST] Look at the widgets documentation. Basically it would look like: q = forms.CharField(label='search', widget=forms.TextInput(attrs={'placeholder': 'Search'})) More writing, yes, but the separation allows for better abstraction of more complicated cases. You can also declare a widgets attribute containing a => mapping directly on the Meta of your ModelForm sub-class. �þ ���� Y#���Z�r������ȝ�2�%��Ֆ�q�T�8�i���f ,ɍ��D�O�`Iъ�8�a�ݳ��+��^�\}���G��E�(+��G[���Hܩ���J,\�ڭV�f�?ygܨ��Ƕ_7�2�����웦�A�m�f��}��f%�F �T���)AwM�NγR-��J���ZW�m�u]�^ىU�r&JMg �����'���kz� ��KA{��J-{&#�pR|�7~g�J-�;N��{Tv�wz�>D��#���� ��Y�.��k��U���Sv� ��VT�d2����1ۀ�Jv�� ���m�ɔ�"�oy[Ί���f��4�w�y;ʶ#3 ��t,��W��8����u��v�4��f�B=��e�1ײm��b�V�uY+��<�.�7뺼�ޱb�#�w❰�-ԫ*U+��zŀw�\I;�k7���V�g�S�� �7�e�e'��&����ˮ��ߛ���P���b�sg� �Y7���Xu 2:���Nv[���A�N¶��fq��J�;r=VCN�+a��+Թ�Д��`����.J\��4��K~>�f�u�oZ)�:�7��S� d/8T�� ��qQ���*��XD� II䊭ί$�Z"���yU[�%[�'��E�C���ݵ�n���޲�ߊ���8���G~M:����y��9�����'z��d��<��q�sA�\D1(~:X��‚��CB�m�R�����f�X�Y��|�L�_��,����TP*1y��tB�}����g����Y��R���<�mbN2<�Д[X��D|�z�a-�~�5�K�m�3�z~����Řuу%Su��$Z�A��ȭ� %b>� X�{�06"�9by�mc�9w�����ޘj�א�C'G�蔋���Fa�~ 7a֞�d��z�P���e� ��L�`���x�`�b��L�L�Y �T�j���RL��f{2x�1_�x=��lU�[�WC�V �L�8�i� �n�]G=w���CE�yŪ2t⸐���.��N� ��%��l�Ɖ�'�c�o�x,iz_�0��S>�ςJ�"�)(z� �3�%��T�8��L��?˅�O��X=�/5�<��G׉c|���CAr���Ԝ�PE�E�f\p����۫�ş^�~]��.~��p�7ŞwL��E�XA.��XsA%z��i6����Q�� �S��;���� <�`n�GN���5%\@�sZ?��Td�Nx���[�1 m:ݣ�!��`iє[WA�;u�q%B\g>�X.��[d� �w[q�Ք���6�c�����$B0�%�rP�� y�=�L��N���d�tGa#=� �C zȔ���1ڌ�n0�Ҵٳ-���Zicȳ�늎�)�{[q�^F$��[FAhh��iY��ᤉo�����_6"Ř��=��E��~�j�]?�l�e��0���NpN;��j5�������]��eg�H�Z|ܐfK�Q�␻Pi�r����z�AF8��$��]R&Gz�RUV�+��6��V��U9f���`wO ��N�����C�9�޵��(�>�C<��Dk� �?^�P�|]&�w���)^-G+۞IᚾbR�S�ɇ�}���> 4���#L�&�7�����_-w��I�_�k�SYF��]���/$�lϘ��{�DŽR�u~��$���f{�< ���r:q�v�d�{���}�6޻��m��a�����u�Szewj .��g� p�w��;�6q�Vcz���5�B�+�ݨ;=0r`���*�����}(�Q5S��q��{rX�G5`���R\�D����qx�W�Aُ��P��r��0�~��л� ��kT�O:���_P��9C�N����n��%Ne�y�JZ��Qyt�'��7�"��g��Oz���0�aI�'���(P�J!X^u�΍+�R�) )Q�j" �Q���:7T��%�T�ݓtw���}R�\���fX��-E6K� ���~|�KuZI �X��Q 3��� 7Km��/Y���J�f�S�P���{�e�����NY2�29iʨͣt�zE�d�fN��cW.��c�{MJA �a�q�߶��>qlYY`6���4�\��}���9����\2�p1�,-��44(�n~���>�J�c��]�.�8�Mf�8��3�(��Ӥ��,L�xg�5u=&)�5M׈�� N��r�4e(�ιC�f����&1i��������D�'ul#-���� M8i�Q��� �)�4��8���X����v�,�@� ��w�l�ًN[M5�7�~x;:ne_s�=�[��M�c��Ύ�`;��ɫWG���. ����g�8�<�l�v�b��t��:���[C!*�SЦ+����ϩD� ��f�ͧv��ٮ�Q���GD�c�p<O��1�+����L��T�h���J���_��+�)o!��a���>(�P=��w!���ŀ,��X����������Eq)'�3ˡ���e���Ϻ�h������M�J�K�N�i�j���4���8[�D�w���C��(�B�Ƥkit�F���#A4�m)�u�7���ޯ����lL��[��M��2�kc�%�Qu��l�K�o� 3AǪ'Dx:y�377U�u�t�(h�&���;��޹�i�ՄR �1d�Oͩt&��L��7r�չJ��m��*V��ƛ1�����i'�`�� }�@(�¤�lyR�q�4�� s3���2�1���ǹ{� �g�x�8��`�j(���ӄ������{���$G�w @� ��|������?_���/��F��J��t��W�U?��k�kݙ����i����j�6f�V�{T��� �>��J��-ߘj�'C���t���ڶ�|���S������)�.��T����]m4���t�3��X�)[��J��a:��PK�un��W��ҡՋ�n�A7����z�kS׭ں~�Op�l�fĻ�5~c���t����.�ڸ=]`׹z��ҭ�@�^bܬW�����Ѥka��*>|(���<�ig��KY`~U�e�����g�����͝��]g��2��_��l�mon��pV� }��/_������âx2Nh u|�V�q�i6�s��V?%���q�z�{����[sػ����8�-�;��d`E�5}���?��7O_m��=�Z ֵ���~a�������>��Æ���Q�e/0���aW�4����v١7 �E���1,74� Јg�t њ/TAhM�o�9`�I;���%�`�f�߄�.��4+�UQ�+M����%"B>�7��t���r;�&��k��f�cR�rǦbP����e��i�@s�”��*� ���W���fji*M�0�T񵼝���Cި6+e���tS��n.L��<���N�<|�t�:�l�Dԛ�P���o"Yg�y�nz�'C��@(�l��,;�)���!^��ǭ�I��qz�g�;�?�qE�a�2x�β�}��;�r���?/�$ �4(d0s�zn+8�C��B)'Ы�"^N,��B2���UsX��ޒ8'P|k��N���6צ��'���u��᧗d�2Y�+�N���Z���:w� ���3�ص4 ��?�q[�֑E��+N5��s�?���o�I�1��ف� dmB ��\e���r3Gae���8Qs`��~eZ&ၙ�gx� .z�u�ޑ$V�� �����wA�g)������Ң}gE��&\�YC�:�:廤�jK��emZ����Z�1���W�6��8i����褃�2?���m�W�F����`O� �w���2��wFP�V{}�+��z� ۑ*~4p�K�� W����H#�@NGL=MK��������}N���UWn��mMsP�]����.mc�� r��2�#ٮR֣���� ��1E�b2=d��X��k�d�p���+�pOV+2���޻�WY�� H&"B��C0�w��X`�k'l�w�#k�RW�{�ս*h�P( �\��~�%y���2sX���]��Lt`!�%6�lg|U����<,P[����\;��t�����=�;݌��9ܒ��^@�����~{�:jXvU��i-]��,8[�K���Σ�H�#��v��g�{���{��M7X�ӏ-��� �2dzr� ���V>��6{�� � ����_hC��![�L'�9�qe8n9!��(�f����[���(Q��M>Y�қ��2����I�N���ho&@��K�b{�������x�t�7,9�_��Z��^0f�=��ɿBV)�Uk׭���0G؍���;b�.�x`W8�!�|W�w�^���/�{��ٚ|\��ɣ&���X����= 2��tc��o2�;�}{7B.�&������DD�}!6�;8O&����x�ԇXJ�\$dF0�_��;�����^�="� ��j��6�0�������e���H���)�0F�΄�T����ZN����P͙���s-�yD�YXxv��T� Ui\�eCx��(�ȼ�X3�L̳�e�[.ry�g� ɺ����hL�daHpI���(�)����{qb=1٧���#�ǀ���vd��.�3�('��$���#* �%��zC��L%l5�۵�5�rPy���GQX�e�-%����{kg��F>Jd�fv��]��eyWڧ�V@�����Y�Tw� ��Z��W��L��Y"�"��_�Hgכ� ectגe��z����ۣ��Ӊ�}� >/��ϙ��,R� ~l�|L�I ��  �������8t�H����U�0aE�sDGh�|�u�PNQ0� ���(D��Zir1��K�Q���'/����=R|ipH�}�@ t�1 �b�(��9Bz�1խ$92 y*� ��U���"Ŗ/)\�ܻVk��>$��ua������:�B��ȠL.x�q<7�1J�O���tI2`����!+�<��E�,-�E~�ƹ[*���f W��4)� ~�d��p]��dw�'JW�� ����sBa�H�Q�M{DГ�D�6ح�$a�r.B����䈉}�k���׽�w��i�G�h.���Zݔ��8���G�� ���-y����O�{ķт!�>���t���4hȬ��Id��=�����_���7�&w���.�>c��U�\��4����6�;���}h������D�5�%�����;��=:��R�T��b��%+�Ow���b����V�7LNp.q��F ���F�(� e!Y/�])kx�u��š�bp�8���Ij��sYbiXM�ʧ+��13�5��"�8W�q�olBլ$��D�� ���|Pc� ,�`��آ۵�o�5ƛ��Β�.�=��DX�'�h#]HI� �a�4 *9ݟ��~e͛�t� �E��x O$� |��8o�s�����?�Plt�΅bRRX�H�X{ꋵ{I[��`%җ�?\3�H����\�Q�W�>���NҷHÚ����V�%����u1o5��kS���cx�J�d��%�~��Ito���]���N�;GN����"$b:��ޝ�T:����9��b�brhV��c�^DY)#�����2�N�~sꇥJ�7�Jv�t��@O��� 2*��ZJ����r��̵Ŗ"��qJ6����DR�[�V3"�$�~n�"���o�`���P�ۘf�5G �5�v�>�o&� Y��$CY^ ���h��D P��Ś:9 ݭ�-d���L-Be�5i��`?��엫��no ���d��d�GOi*���� .c�8�E�]m���ċH�Yґ��"��$����'���+�����(�c�N5.F�,*���Z��W<%c!�Fu����{�p([d��^�uw�m.x۞���m��3��g��.�`wl�K����&R��0ѥ���XLg�����1Ob�5v������%�Sd��'jݸ%�=]~Ϡ��o�� �� ,����o��lY�ꚮ!ET���p2FQYe���W|�3�V��e�P �-�nV�V�sx�{>WJ���=y�c6NҚ�����M9J�ah�r��jhQ��c)6O0h��UA�XM�Q�(�kPaN��F��5��5���{w_M�s��$$�q���R7�"���(D��BXi�^r��1�3�A�󍜩��S;�G����!�̾�w64�4l�B����N)g q;�k�|C��l��k�ܟl>��~z�["�>�  YFΛ�\E�ǩ믐��qQ�Q� �p;��}Vf�ҋ���0�R"�UU:?c��i؝���yh���{�*�}h������Y�(��Nii�"?�G��焉��cbU��tw���@��b��wh����Q��B1�g�}C�|/z�{� ���!M�����F��ˇ��/EX" ��J��.�bC�µ)܏����D�����4��X,��ؽ�Q�%�p�,*��D�ن�;�(u�I � � �v,�.���d/�}^eb�j��d���� �[b" ~��}t�6ET8�ćw˾"q2���ز2�:�rZp�-;1�VR &(��W�A�[����'zT$&B9�/�� �-�o�!1 ��K�ӓ}�q1=�Aq��������s8���-Mk�����PSZѼ�5�es�]�jC��?�nT/�V���9�*і�G ��Yb%l� V�DŽ~�v�/�y|v�oPvs�����t�`�K-�g[�| ���K}������oH�ϟnt��5M}��ooӮ�̓/>�c�t9�q��&&C}���n�w=0��K�<஧��`��g!���%�q �O0�OUZ��?۾�5�4 ����<čَ��y���\�ͣ(v��44���L���q��Q�TY����颧0uޤV��w�I� `x�«�k,ს�b��I88BDP"�e��dl�1�#-�>P$������ [Pt��$㛾�ä� ���7nY�i�$M�z\/���,Y%�� }�~T���`Kckh�6'���W�WS�y����g�ˀ�/?���~���E֚xO b�q��7˖+ć�\dwG�'��F��Sp��b�Js��/�2K�%!`�E��/��R�7��[���7jz��1 $5v�i�PA��B�� PS)�OB���Cb<�w*T��ߋ�o+h����X$�� lCV�,-9��T�֒σ�ں��P�U��жU��>�����gvk��9>�H/�N�f�b�ݐE!Cx��"sXgW��<��_�����6G� D-�g���]�r�F���S�� � E�8���ؖ�Xkֱ]�2��d��Mp�4'��}��حڽ���������h�?�j3[�T�$�}����?�����|yu�'�<_�*W��V�H��(�T>Q�EWI�����"��Tx�zUM��{�Q�.�c��76T�4��2_�c5��K�I���2�n΂'�w��c��TQ���XOT�:�A��*t�(2>��A��_N�x��)C��� |8z�0y��%������Ley��b�!�B�_��IJ��V4���TE�9���Տ����ƺ(�(�)�ﭗ���C�̋۲�? �/'j�/TTh�S�h���~7O���-{��Z���4WOuqeU����_����;�T.u���ўFe����6��W�`��GWep�XC=�OkF��$x�� ���徺&TN#<���+����Bg�.�ꅮ��hy��J-�j ���j� �ρ�?6���G�J��Ђ%zޏ�9�_t��y�����hG�v���—����u�w��9��,A�Md�er� }Z���D�mT$��J�l�r4* �1�f�Ɍi��y��X��g�e��h�Я���X ��4e������z�~�B'ڡ7n��L%��J�4ŭ�2�u����8������&Ǵ@��=��*�,�y^�j�E3�xȃ�j�ֲL0��������R&��݁��uj� ^Bhm�~�y�^b���ȋ��~;���fM�3S ]� �]��q�52�Y�p�,��}�� �r⤈��Q�O���U_�P�Ѕ.y��E>�E�"�kg�rV�`��L��dL$)�l�=�0�- PY�����Y�=� ѧ,C�*�X�H� lK�m�����f`E������NL,�ʹRd=v`:�s%Z���D��K�ơ���ś����7���%�zL�S7��%���6����NX�L_=]T�g�.���W����W�ԉ�/���ezKz?�T�8 �5��L� �l����q�' 4����h�3,��g�VK˔$�*�z�P2X�:ۡH����W�> ��\��4X#�52�kT� ����&�v�>�����io����̫��;;�����o�Aw�����;���&� e`Z�0��9��D��ԣGV���e�N���nػ����T�ly{�<�R�X��^_�`�X��FX�Į4+�eUD� d����Z�VẂI� Ҥ$�?h_��]��#�L@F����mA^���}j�P3�C�P X��F��ї'���X�S�FZ�f @ߣUcA�@�^�H����%[��߂ �'!a-��DC7B��-L�'���D�{ �$���T`�S��<갯�� ^̽���T�n��*��)��)����'��K��Ҷ��Oİ��O� o�? |A�t���PV냊�N���G �e_��s!x`�`Jo�;�J fZ�E�m���L� �^�u�x�cY��@7���=%n�'� H�4�NNjJ��k�f� ��e�R?3�f���x����j�˓���<�� h�b���ӑe ���9BI�s����Х�/�xL^֤Ĕ4[ K�u5��r�`v���2�r�\�����"6��X�a��3�/�}'|���J�nr��l[ ��ƪ�a�$\H��N�b>޹cIU�\�74��Czd�pp� ��ʢ��ã�,��i���Ӌ�_���<��^r� �>uS7.Ԛ?���8���Y�l�֞P�uڼ���-���k�{��|�m����+�Ws���p�C��v"٦@��K��_}{}�_�F�z4�DZ� ��aXPM�u8�� 庢t�V,ŵ��\D+�1�x�2��{��}_"�w �?�!������6z*���2��\@�E7X�Xnѐ��0B\D7��?�r#r��[zjJF��H����l��8:Z.����Z!5��~�ώFi~stz|�����L��*?���ȇ���2��$;�8��n5�F�ݺxm3�*�����n��a��׭R������`��A>jq�Y�S#�sc��Y{u���i�� �u�S�zN�)�����x}갋�Y���� ����Y��u�O�?K%��z�~z��m���mM&| ۋl�I�(��U����D:Z����Sg�Pw@�zꀁ�v@�<����@<��Q���>�J��^��bu�7������4�#(��W!G.U4�e-� 1�t�?�z�JQ^y7���������38r�a�z[����?���=C�\�ܢ\�r�`)���w=FŲ.���X�O�w�1�gdr>$�*v�j�L��2.��-E�D ��#.ݵ#6Jό�I,�\�u���ݤ]=M{���D܋E95�6Z�t!����h6 �dÒM��K [�Wo�]�<�}m��b�ڂ����'�0c�^�ڨ1J|w�{��n�n�%��n�/]m �2�P|�4��j[Z�/�4�ۯV�FLҚ=� ?�\1�DB��8���:E¦ ��$���\Sf����J8�A*ҟ�{a�^���(�j��?�W��WWy%hL�T�emu&d�0� �F���������}���w,`�M_� V�[-UeTW��y�� �\�8 $��>�Q����[�Мb�H[� eGp���k� �] �ψ&� W(�6���ȴ���5#��z#{z6�� �� <�� pjQ0�EA{C{�aSM�v:٬]����&�&�>�O/�C�m�h��A� /k�~fo�vk�@����-�~�DħH����l�q��@\H�51�9��6�+;��.oWr�.TB{c5� �|,�m��5���~An�%��Od�5R �MXX�ϩ�#a���2W�P-��5��$��Nf@r%����Ҟk�]� �= sFu�T��b�$�a��} Y�b�>�b�U}��u2{GF��a�ƶ'_�>�H�۾K��S�z{�ٻi�/�p�[�f��xA΍�K�{E�ʀ��,.�y�&p�<�f��=S�b������P��wa���d6�r���B����A<��""5�y�TKB��.I�Z���|*~�#W��)9�Wf Ⱥ����V��),�~�Y�_�hü=:�"��T��bM���"�z��K3T�]�/���|�A.�%�<�H�w�q��> ^M������JNns!8�0�j=U*lW�>+�|/�ʇ:�RI���a��k��Ŝ ���iH�ٷ��M��������}2^wU���d��y�w.��]L�S�\c*�X�D������Z�E��S�'�yJ����їɨ��vn�^��-��8�;x�Ŧ�:�^�����+��o����˺J��o_~u}����m清��n��!e�TV\M0������I+:2͜��rR;/n���M��Xꩵ�`k_WR��-� e���gyI�$[ET��KCҋ~��؏�*@�Q3 �uS�ˆ �ZR�X �ћ�5���鄔j٘wA1W����0?=��35زn�2�l�����R[�CZ1[kJg;Ȥ�� %4k�ȓ�� �} ���/z��������|q�'��;�~Q�rW�b��vkZ+RT�%��z�������G!W:�Pe�Fcaw�,�Sc�ᑱ�`��Yb��,VT���Y�]6��Q�'�6���b!�����|i�M��������1��Y<�t+�1�ʁg4N/ّ̪"/�� ���lّ�H\�d�gΖ��b�7�<~Dma�x`˔��Zf�@_�{�Hۛ{��i,��.��M� չv瑧���in�g43X#��&ű�1�|��j�#Z�i��T˓Kٜo�xvm��\��p>a���&�1���^?Dӑ^�Ù��� ��⦯h] W�Э\OϚ��#�W���HS��+gRy�2��A9��brۚU�KKw'� :_�`&�������RYR�D��k>�d�0�.��9 �X��)�}�Fr��p(��y����I�N �G߶�K���\���!I%6�Ǽ"�r>=*�0���c�Vx��O���!�&`s�*DU��5 6-�m7*e�k� t����8����b.�-c7��}�&���L�����W�j�H�{�(��OGC��t���Ɗ3\i:/����m��&�+��氽�W*�1� ���:�rB����`�:Xʄ%t��W����H��iVb��uD�[t��N���8W��7�T]>1;�U�5�+r�]��ws�&��+Fg�l��J3��{Em ���go�w��A�0M���#tOgQq�S0ye�y����D�d��_�).D[� �o@3�C�(x�� aW����o;>Q�x�4��L�G›�.Gƽ��j�X-��֎�q�m�{z/���9^ ��M�B^/8Ž: y�RE �x�t�,Q<��f ܌��m |?̾?)� �����(�j�j�^(䶒(���Q�^6��[�Gtˬ���LY=̓g�ߟ��ũ�ߕE(~� ��1�#�=����ޠr�����oI��%�%ӑ���x�1�ƶ������Șa����%G�.�Q�ϖ.t�c��{*��z����U�'s���~��%��S"�E��3���C��.��J�b���Z�D7�1�2���U�@U��� �:d�b3�vy�B3���٫y4��Ţ��7� R?QI1�cT����yų���.*B�5>f�^��K��&NT�`+z�����q����"��wH1 �q�I���M��n�� ��]���NY�Z �_Z����8�*B��E�dZ�E�zC��'�����R=M����T�Z�wT�`�@�H1:F������e��~G�K/ɰ@��!���厽rNO#� ��dz�b |ES��ʈ:�vQQ:�ϙ:�[�X ��-�|�9x���!`�6_�;��a��Y^V.C�N��"��3!s��䚌w 2�"C���3�P�"g��ϋ���iƆܢH�~3 ~�s�aǁ�G�a'�J�ф��g�:�o��Q�1��<=�/��a�ϗI��v�����|�_�a�v‡��1��2���q���ɟ�� ~��j��'�����×9%�f|��8�%,R�a���y��i�K�� Ug��NwH.΍"���d�8��#�*x� �7C� �,��7��N���I� ��L�}��H�$c��n��t��ۄ� ��RL�b�k�����a��~D�0'��PB/���12,�c�� b���%!�t JN=R� �f��[1Q�@��̈́��@Q'���-�7��Y�x��s�M���sٌ��gVp���X[o�6~� �ŀ��9��fk�(�b�[�DY�e�����;J�];n�6�<�;׏��on�䟮���K�S�K%UkԪ�r����t�m��ʻZ�/�P; �E��6�`��k����E�U+��uA���n�U[t ��& �<���M��R�R���\Ӹ�ص,\ J�+�B{�3��k!%�}n��X�d�h��/����_����S�J湱&����M5�q�����o)��d��@|6��Zc�!�M'�sLob��&K��K�r�$��,,e�0�28�&"��*B���XB޿��޴k*�q����-�,��-�R!��X�%���A=�k!��X��Xb�M ނ�n��.��ZAW �4z�?T͙��e���a����� �\"���и͂�[Vrﺡ}��`��pr��9���r�1+��ZA!�A{����0��:>d�ܘu�E��zebC'1�������iٛ�� ���k�t2�١*�� �R:�S�� ���w�Rq�]���B�J�=��A�P�Q!YH#<�`�� $���G�l_�;'�jC9e��B2�����ꑹ �W��5ڃ���eRl��B�G���4՞�5(M����sId�I zyp9//9�䅳�s(4��d��.dT����e�v;m˫��6�f�ְ~�* � =�zp�Ama:�ѿ��:{"b�t���T)K_�S�Lb���)<� �.\�S��� :;7��G��4Pr/]E��5-�gH�e�'y�m����~FP�<{��@�G�_�O@|�z�Sa������4fC�a����>�5����S�?���gR\��D}OvO��;�8qd,�D���� z� �3I����:l�Z�@���v�:n:t�׼)u���kJlt>���Գ�F�����@������>8�{2�<�Uʡ���˅� -��pg��f�$��A��̏;w\1�ؖ�uX���������5:?b�]Ԧ9`˘N\%J��&�9�����x'!~A?m������MTl����R��b y�&�x����At�)��L��ܗ�C�a��V�O���ġ�1�K_O� �>��q�K�}��� Ҝ¡��1� ���x�l1��l�������b�CWU�j�_�qs�����q��"��4V�A<'�(�ϧH0�a��7 ��ݺ�U��� ���d+�P� !_��o�#�/p�����W����Oq �X�gg���&�b"p�/�0Q�V���K�������ȟ��Oe�b9�VUK�aCX��G�����sϽ����q�����;�4��Ҵ���@��n�#5����#0}?����V2�B���w�(��6���N$?��r擮餻��cX�;:��p�5��O�� U(�W�y,�t�^��&h����z���� ��|ɿ����~���S6E�ǭ5vH�?v��CP� 5d5z�i�iiB��*W#o�'� �Aө5UK';v�@��hҪ]s��:�b�����0����N�Z�;]��� ��H�z�J��d��u|\5�^���,�>�_h��T���V%�r 7D��:��(����+���?h�f�_)\Z�|� }c�Yh��u�Io ���Z���[-膖��)w��S��v�J�\�*�v���G�2�jd��j8h�iɗꏊ�X�wZ���8@KЌů� X�F��&#��Y�Z!` ŹUIom.��=�1��Ɗ"Q+�H3ʬ��~̘9w����b���u���:��g�ǀ�d�f���e����� ��2��k5x�ŋ"@����T���6�';�eC�=ê�Q���c�D�HF���ǡ֨Ud��/i��/.2��x�j�4͠�tErɏGH#L���^De��5��fM{�7µ.��-Â<�)@{�����:Ne�u̡ ̴P��D&���N[�Tag+C^��x� })_Ϟ�b�P=O�=Q���e��i�U �LRL���3��Jz5:�Yo���7gr���$7��ʛ����9�ʻ�3�a�6r<�A��,ȓ_�u�"/Eթ��:�Q'��"�a L)Pؼ -��́S"��]���TR���Gn>�i����f�"`��1N?dϠ�k�Ĩ��ݗ�R{���@Z�\��Q�j�i>:+����2 :9Nߡ���Y�I8a�}��OkZlI���*�o=�S�Tذ�X�����l�G芆W��l���`u�kW��~?ƒ� � �@ �>Ό"i�x�s���IT�s.��-T_k��H^�z?���uO�[�;����TP]*On�)�q��Zփ��׺>�(\ț�|��Z��u�8 ��J�H���g�|��\�*��2(a<^ �m4�$�m�O�&��;�� �W\� ��ŝ�d9���q� �U-Y=� -�8��v��n�p����U��o��/�p��i�H��c^�A�`�#Nw� ��<�r@.NM����X��ad5�,���o�g�`��c�V��.���䚙�r��P験�ྐྵܰ���R������:` �)�5���dE��{"��Z*Lo��]T�u4@Iu�;��@�gǿ�(�%�okr����Ƙr00�~\�i8������8@��x���������Ʉ��u"�qA�8���[V&�L�*�#���_n�א��𔖪��P��{d�Ū���I�a�S������;�������oʻ����a�ċ2s��1 ���<.�ȇ������˻/o�������7Ͽ����u��x���̄hϑ�TѐJ�[d뢒�����'qh� 2�R�/[{Dz��NP�7�O��W��L�$ci�.*��H���'��4<�d���s���s�x�׺�oRk1�y�0���T3B ]zu�$�-�R��ՠ4�A�~GO�o��ccUU��3��#B@��׎��۟؇|�&������D;� 2���b�U���96��'�x��j�$�3�PE�9��B�>xf3�RuS��App� K!�S\X ��ߌžf�aqj��M\�b�u�� p{��E듃�T��8Pŝ(yD��F��Q�w�6A��ZЍ����=0�棥ɘ�@��6���G��� HTV��>x�י�{�~�}3�9����n�H�I*,��x���KeE#l �<��q��Ï����~}܉�H.k;Y�� :1ٮ�5��+>�>��L��� %� v�����{���x���hO�;���< �o~iҨ\j��֜n@�%)`���M�%���X�B(�,��K��-�\��Q��(:�3*�N����x$z?���8�F}��5p�,J�� |�g�e�C�Lֵ�y����)5_C� �BNC, �k��#�U� /FS,�r}�U� d�B3ZbY�Yb�����A~<� /�ع�9�~���9A���Ω���x�����Ƚ������'ɇ$P��V�!���﹚��@�������D�]]��p�X�ΎON�_/�L�Ge?��2���p�5e�<�i<�bٯ(��2 �T����>/��H��"xs+�a�;�.�]��f�p ����ĉ��>l�B�Е%���h;M� L;%F�H��HM�,�>H��J%D?/����Җ��Xs�:�/%����դ����AȄө�rX�%>�BF.:(_`AاC�p��HX�*�rS$�{{�����#s2�dK �h:8j�ٺ%����"����^V(0������!�m@���Lc>��j�L��u�XZ��dmD����`��%{���p��i����x�J�1�챁{;�3���S�㙣�_f�K�O�go�A��s҇����y�K��ȥ����mBy��c���6�˧ z�� � �XJ$�QfL�L�W�n.P��FST5�^q�u;6)�H*��x"n�T7��n�4 � z�P/zU���#�M`/��Gۿ���MpI._v��9�������ddF��a�T��8�|���[ �"��7׾|��8� ���6eCi�-l��G?�ڊ����L�&�U,�o�Bۆ�0 F-��rSn SA��įT����� ��k�R��O�O^^���� ����!��ƌg#���@�gt �:��ǿ{���� �݂��}!�+F��I.?�`�h��7q�/x*�����d����~)��3b`VX�>#�'J�-�<<NF'�����:�`��0:�h<8����h�uT��x8��취l��������x��1��v8�����/�v�k�=���%���E��7t�w�9�N�m�N���l5 ��R����5�!ȵ��iK�!T ��(*{(�)D���^iB����$��B2�*�vk��Ix4��'��еn8���*��1�#�lKŹ�;��뚠��UL�!ާ\��1��T�t���OƮK������T�rъ�e���`29����X�k[����0��iB��L\���J%������"�Ԛ���jύP�����A�R�D�cH�V� #są�njhLU/9��dژ�8N�С�ל�3���ϖ�r��m;�v�&֭�Ԗ ^�شzѤ��0�B�D��6O��f��z6A������KFvi{de|׶��R(t��s������+��M���v6��"�ޜ��d�y��N4v�|�*� X&y:��β1�d87���~jLc*>����,��Ln���,d� ��j�&���,�� ���@צq�\�:�UbxĒH�I��(�������a�41s0�q��Sr�I��TQ�Pc�_ۘ2�~����!:�ĕ�f��� \7�c�t���wB@|��$�v��p6ӣ�pS1ܧ�Q *I��ꓼ��xِ�=8xxt 9���c�a��W| T���`p|r��\��� ���5�g�؝��]���H��n�t� �X*��T�lX��Z�����o�.�� �rx4>�����4y����Jo�O�n��dO"�=���^{��Bљ=��]:+��l�m+0� <��W(^+�{���@)Ō�����J�D�q^HsB�ʨ���ƞ��|6<�� ����L�N�� ��í�=G'#��XH>h�9��^)!#W$�����3�pE�YtZ����= �;nƠ���Q�&}����#>��S�7Z q@X��� -p? ؔ"����j���.WNOd(�2�K,�C��l����Fi�����Xc�e�㭷��Ƨ���$����㩸N *�Q���L ��4������� k�2E����8b�MDS��F{�ȳ�,�0�g�'��Lؔ2m��gsQ�}MR�������-�ڙ���<9�d����V���ص��>��Ȗ�Z�����wxR˺,�r# ��3�d�4<:�gf]���������5��M�U��ٿO����b�˵p����]æme��+�Obɩ#�)�N� 'y�Umu|k���b=�\�~���|���h�kv�+P�.����P�܋N���l���'�ƨ�+":k�^�X2��u����Ԉ�t�=_ �P�6��~��ÑB�i��y1j~��]Z����X��yf�M��`[��`�I��ײ ��>�����!�z~���[�<��%�kID����8 "����k� Q�a�D��������L��ta�ܶZQϤ1LM�K�k �Ա�Ծ��f5<�x��s�s{t��d'�w�<���C(�Oz}���ti����29��0`��e4%wYN�t����w2�Zl�ɼ)b2�wѺ� �W�ॄy [���՚��qs]�(��[���"�n�>���Ė�:o ��C+�*���S��)l���Z[5�{��g5�Q�է�~����n >��[�Sd�]�v��Ԑ\��`k�S��ʀ}؂6�J$���s#o`F�� �96�.f�d>Hk�z��ΧIE:�֢WI��NgɳJVdv��Ƿ8M|��M�å��贤Y�9��\�r��X�o��K�o����q��J�&!Қ,p�D����)5�mij��hTk�*7���Xߏ��~�_����<5����Kj�@��56��3����63O�p������]��)vݔ����9e���ф�u� �E�ӌ�_��/�q/�� 񾺺:s?y��O�<����Rr1�'�@��W�i��!�����Y�����Q|���Q���YI�Ⱥ�TO� �g<I R|r�c5�v���9]�Z{�5pT�Gŕ1�A��T�.^�� ���,nH}�r���m�Ut��U�e�=��Hť��T$�|�$8 �"]���SU��3"1>։��0`���X�� Nc���� ���mWK� �-�J����PgJ��h���Z�3�I���j������ů��_Ir�"�8�"�EAn}p��!8��)���v�#$#S�n,ok� [R���k}�ŅQ��F.Ŏ4}<�]�11��7c@��\�*Y.�.�17�I�A#��?R S�N�6����"��J{��7؍>X )5|�[fi�$�c7����#�m�J�৐� <���*"�� NS�}� ,g������ITv@�&����Be��ݑ�����znH��Mi��6\�G �� ]Uv�HO�N-���!��0c�s"��q�tþ�+DD������'���3Y)u�lFJƤǒ@��ø1&Yis�3���49@�t[;�{���(�)Ů�v�`C��[rY��ج�I�~>S?v>��'I������M7�R�^�f�?I���� �̖Dn��s�^�g�6vʟ|����.WCz�.��K�����6�9 l�M��k� N��?5A���匟��4�I`z��=��2�1��������'kuJǀ�ύ�<%�c٫��ރ�������1������n�l�ah�˳�!<�[m�֢+�P���0�KF�L݆�W�Z�d����,$����8Jb����>���� N�ZĖ��-E=9b��}�$�\��p�i��� ��&Uj�����b��]�����&A�y�U2��{�rD|� oT�^ �8�M��.h���'4�7*�$���YQN���χ�X�S`�����9�x�Z�����R}ۀ��`��;[���#^�Do~�,��� ��V阻>�����brO}�����sd(9��/I�,����9���\�5#�> ������>+�Ҡ'b /Y�ra.�������E����٢��Ĭ;i�S�ň3b9�j8s0t�8��i�I�ʌ��j*�lW���[��[F/�ӄ���Dz*v�32�='�O���-K,�&m0l���0�c�nM��b�)�?-�AK�Ŗ"U�����;�R�e��6`F�*���8���&>}s������ޓ�����񇌣��V�N�\Ϳ��i�bb������~���+j�ԹJ������R�U��k�Ӧse2�-hW���C�L��vOʑ_��%N�[=տ��v:��#���.i��d��_P4��*P�y�T�װ���M��zAw�󝭨V��fu��yk����q��%�N�w�������w.��P2 ԭu��(NCF��N:4�cWkhtE�;Uc- �؍;�������v�w�&t��EuM�H\Q��{����#E���S�<5*�]���nOu�0G������egg�X�%�c���D՜�C�����$���?��8Gv�rlʂW)I��@��9�.=2�bT8�x��(�(��\.>)q���� �Ů���Ţ������iZ�0���w�� �%�:vV������L�����JopnUն�U����� | �ҥ<�.,xD7�2����h����zrKW�kЩ �(^sM<����*�l�ʔ׵�U�{#i3i(꟨(��rwMR4��>hGR<�@����P��~�)Wr�|kJV�0.�ҴLQ:g���+X�L�B�����[�|�)�H x� ɼEO0\V� f���cY��*7���􁙙<�.�@j�NHg�6}j��G�5��IJ��w`'�) I�9B�t֞o����6��� ǽ ��6�-�7��~pV�ު ����ӌ��C����bs�▧���j��1X� �؛�*/�r��^���"7ላ�U4.e����`*��������G���9��?es� �X�U�;��4�2��������u�zi�?�L3���� =C<]@*J_ei4y�\�cȮƼӀ@6zs�'�=t�^?*+�Yb�UWr14kv�4�� �o�?2ux�Ql��A�A�����Q�UM���C�Y�q��Af /�+鶟҅���a���-�a�!I�[��桽"�Z�p���kY�NJ-�����#��˼�����M�?��F[�Y�����lh� ��՜1��G�o�8G�?�9H���%Q,S3�n[�m 栮�VA�e�"��� ���b�. U1���Sn8�W��@mw��XTO�ԵV�����Doc�g�N��4= ��c�|2T�:��s�"l>�8�݂Ւ���V��0��0��D�r� �t(��;T�v.��ZlE&����(^��8D�?��E�� �y���uQZy}�b~ߏF�����j��,�.߾�N/��۫�ab�h�f�� �LC����"ld9��gߎ���L4d�dž!sC��F�_�G��|hjRۨ?+>�:��j�M5$f3��~�P..��㌽��� ��)�`K���� �ך�I�G��? +�+������[L/����������9�{�?۝ ����i�G�:q��|5�ļ��[��&Ǐ����d ����0A �;�v�����L�e_��k��e�=ff>��zhؽ���'e����-︳{��<�wp}�8!}x/0J�R|��a�f1pH��U�9���S���ie��o���1���� �_?���WCc�]����6�r�]N ��@K�^����Wh�X�YႰ(k_^ y>�$�`���1,l=��O�l�$�a@v��pL&Ͱ��N�YLi� <�]�� 7�n��\M2�o����M_�������v����5[ �\��cR[�����v#_n�YV�T[�� _*�o�,b\'�}�5tс�6��}�ş�8�����DGw7 ��� �>���p|�Q9`Kz��:�����v��cd��2d�O�)>˂n.�ӿo�L��2K���W]�۶}ׯ zl����>%M��7�E�G���CQ,hid�K�.I�u}� )[��SAlS�|�93z�����w�Uo�i�z�XcO��*�Z�:&�LSV:Ԗv�9 w�l����;R���j�T�'�����)���];Hw�^9���<:;��: ���ӵ��U���'�R�a׮�Y�V�:)��R6���٫�������L" ��a+G)��u]K�i/!|�Ot����F9���9N�}ݩ��r>�߆�TK�q����ǐ�n[Fm�p�#����u�f��.�U�~Ն�ܘ P���ϟZfP����Gw���W�@)��Q� r���矯�r��t�p~t���c�b1���ռgk��շDVu�H��Ql��Ƈ@���@g���7�� Nו��L����۫�,�A���.UE��qcH2�� Z�ۧ)���!�e�{�L.h�/f~z�ӽ>r؁�� �H7����� �+� �Qʬ�<���h�m:݋8a�ں���h��Dz�9}b3�H=��A�u�?o,Th�r� ���@ ���נ�� �\v�S� z�LSKP?*�;�[�p�~`�.~��C�n���X��� �*��V��+u#�{��n�u&6����S����e$ۭ�諛u>�_���V号����/���s��8揪zϩ�7y4~�����P�TD�b��b��\� �Ī�F�k<���d՜��J����|���"��������U]}ިe��Ƞ�U:L��]�5�I��H|N�8�Ɇ-k_���Q����%df,�]�W�Ǖ�λ�?p"�=QrS�LϽ�m|Z#�N�'蚓�^�ꍄ��x�>�,YuU��8� .���`�e@� M 4�s��Jr�1E�5"�^�)��1ۏ ��r]�=�E�C@nHзHH0�)�>�菤�q�\����7g�-V��DL�/M�] �a5�+\h�{��<U]��()+L���XQoou�t �ʵsy�B� �beF/�r;�`4�7J�Q_n ��J��>��J������H�� ��3d-�� �������.�-���*�ճ�^TנףX���D����X֤�b�X�*^��FQ��VU�-Ru; ����}���ʤYnv�M�z�j��(�R`����e��;ei5қg}�� � ,�6bZ��Ú��@^>�E��s�E��9�ecY�a�ADz6�Ŀ�l~h��x�N>�޸ ����V��y=�tq{��y�yvs�l�']M��� � (Yh ����f��"��K���Sf��! �;^ԑ��?�bz�)]�}V�jb!�r�2*�42C�Nu��k�!6s��n\�:��%����G�13��qq��o� |��np��&I&�ufe�v��[~�魌���2o1�Q@s��p�>��c��E�Rn�<�bۨu�z���s/ �9��F�|�O�9Y�*�ki^���ʕ�V�ar�e �m�(�w2��Y�� )t:���)c������[O�gͤIeL�f�QE��<�d� j���FYbs��c�$z�p4:B�F �3b=�8�:����a𮕨�5�3';n��>@p2bL�I�,��v<�n*Fz�=�]JF�e��zM*à p���3O6(>��O%}0���(��� �"M&�?H��K�.�sV/_�/o�ps?���g׮Ə�?�����?�Q"�j��z��\�'�"en�7�2�b��0�,���Q7����D��/�&n��lu, ��F}ф����w��a-o+\}2!.��o�h|!���{�Ԇz� �B��)j%���Y�1�Е^~�� c��K� `��}Xm�ܶ��_A;(n��(����\\)��7��( #8PW�W���ͯ�33���� g-��yy晇�.|�i����/�'���2єѺ^�^iu�����_u�1�`�����^��*[��RuF��������F�}e<W�jЧ\������?8����t�J��=�R�;�q!��QE&�ѩ�>�ʨ��� n�5�Ζ�ݪ0��p>��^u�W!��2�lh�VtT%V��"��~��nգnG�C�L��4:�˜^��+U�'��{D��v&W�4�\Q8�<�nh �z#����lT�O�i9>dK{$�O����J�r����~�n�`�������Փ� :���g�u�(ug�ȥ�1�)�N���8�9Ys�.��.];v=������U�=�夲>a��.���L�Aֶ=���UV$��҆`�u$kTHm=�<��ݩb��F����?�[7�c�J�B�8'��ɍ-�,�*(S'��܄� ͧ�"V9=��@��}�s*�;�}p��R5��Ӎ ��X�d�P��a���%o>�Z9r�"�W�{ �t�-G�Mo �������գ��k;J��I�2KZ�뤦Z5c�vp���Bi !�1�+�6�V�k��w��]�'�vo�-��y�@#7Gc��e�lj�䙴'�/��h �~���)f��&�m k����y��L�1n�����:B����n�C�dG��>�,z�t������E-H�5��@xkj�Ώ��0�Q�L��K}�uW��7�*�o�;�^���n�%N�ǿ�x�n ���?�x�.cjnn7p{Q� `�Bq'���ޟ��q;ΪC`Q �̩�,�'1�T�����'j�#�t��ȉ��$_�5�)6��=C��,RAu�2�6��[��P�}Ǹ�3�)aV�l>Z9�ʍVg8�Sb�80r�E����}���٫���0*�ɤ�3����1����S�$ ���`����i2I�{���<�Ж�J5oZ4r�I�;��s��i�m�]�D"�B�U��%�f���{��6���Q�:�h]�MuC�a4DNg���������x�>4�u0�d�3 ��9����W�K�L4��[�9l����^�S?��OaCb ���ƥ�@�Q�hP�,.��"Q(zƦ�wL�T���5�l ��9s���;w;��R���YH.7kz%TQ����I� |r�耫���|{����!�4�s���}�D����BǤ� �b��ƹ��gȖ/l�����/� �e�*C��4�N ����i�� CVg�dbPbt�ƫƘ���R�������O8�U��'�c�n�� i{a-�� ��e• (���A-#N*4���'u4 ^;;ʢ�'�Kx�&J�m��.Z}+ܲKz� b�K.؋Y��E���sLy�^���(���g�g A���na��au] ����G��&���\FXي yY�ql/���?L:��!š��Dٰ9��WԒe+�� ���G�5!*W? L둧���|p��������X��C����*<����7��Bߵ� ɞ���!���t�� XR�����s���1��=��wr�q����%:3-z��(L��������7�)h���C�"�� R�0+�'‚c�2���y�W�����i���;�E�H.�s��!�e�>�1߉�i ���S�f�^�Af�$qz�T��>M1�H�;BD�B 9���f6[F�@� ��ahm�̧��nɲ�2����Ά�mo3�^�~����G�F����h�s�M���c3?C)МDs8�����8_�������5���7�+���DxNн��t�N��?�`�s ��+� �"�՟�p{i��^xa��ˠ���n�ɶf�����ʜ�QP�� ��g���t����y[�8v�R�j���֖�ww�^[��4�*L_5��}X�$ ���'3�%�&����X�x�Z��'�&ǘ�{��j7���-���,"9�bl)�l��9�N^�2t�$-wwo�J�qb$ugʦ�+�����!@����E������adm=�V%�T��n��nA#wlOd(̠��D]��Ց��ѐ�|IK�����y�p�%�m�w�Y�/p�K?06﮷K�]AА[#�d.�n� ���H�w�"�0� ۗ�5^�Hy�4҄�Dz��q������V������ =����D�v'��[�Y3q� �.ؓ�6�<<t��f�������v~g;�����7[�|���(�������:i�j�#���N� �����1S�tV$�JYdY����8>��f�p���[9.�� �C ���H7��?\-�Hҁ��_� �j�E�A`���h���u���M�� M�se��S�h����fH��*�wEU�}/+e��GSj6�!�%]�������S�u����e��ѕn��g�� ~� ��w����Ѡ�� ����"�`�M��}Wێ�6}�W�~��NӢ�)Z�V`Q$� �bM��J�BR�u����~J�c=g(y���!�J�\Μ93�%�zy������m66��بj���v�E�Ť�(���*z�t��i�;��N'��Uig��3&�<���+��Vm�޶�K�7uf���7x�E��a��8�Z�ى3�-^#����l��އ$���m� ]Ғ<\=u&]���B��ڿ���i#Ey{F˰�����-N& �f�;ʳ���8�h���zS�+�,�t,�Ap(n��~��k�3��MY.���\�g_1���ȡ��D�{��]�j��~̱�D�Y,=~�,'R � ���t�� ��Td���1M������_@8����W6,��(9� }��r �J$���*�����e]�m�{FOF��YL/��T?J��«J/��e�K�'!�4]-g��~��������uqMl����XM��6 ��W��!����ӯ��4i��i�h��XK�JRv�_����M�q��.I�{x�e����w�~W���iJ�w�Fe]2a&��T�V'��Q�a�Tc;�Q�/.F�q�d/���]mBL��*ё�9��U��i�'s8�k5�XyT��g���4��~ �Q�� ֣Y�A�lժ_���~��%�X�;�*|?`[=�����kkN�ᧉd�7p����$c���m�� p�yj�a����zCWQ�+��R�<���w�]La���8��V�����;)ߨ��i ��-7�Y��+���|�ő�QW?v5b���T��Է�ر#Z�:ԕ��#;���e> ��N�d�P�4�/�@���9�N y�U���k]�Qw��)�Jw��@ V�Հm���l�?ޯ���! ��� 4���#v!�V�dSK~4H��a��S@�#�[2��',�L���U�1o=�����M޸�d��gS�Z�Ue��)�)h;�,0-3>�s�}r>EA%O���#[wj�W�\�d�"Lh��nRW�up��N�W| ?��)X]�e:��4�0�a�!��i��g����2׈��w�i��-�)��!���j�n�%eရ(I��k���^���* ÛR��?�ߜr��tm�:� �G��[>6>���yL/��s� �����J��L�=�#M. \iL�A^U�DLi�M"�:p��]By��;�Io480`+B���ʇr �x��"�ɷNWD��R"H]������D� U����8)^��6��?�>�N�ן���ܓ,�٦&:��ޝ����YƐ��72�Z�z��3j;5E����d�ULhJØ˱�0��� �^8�U��� �.�cwp a^�A� ��:/�>/���mދv`�M��Ys �[�i�{&]���~� ׋0\�O�=(�Y~�c����`r9n�|(U�#�ol!�$��RV9���M �N/����,��@AG��f�>�����}>z�$t��c+2mYЭ���ab��xX�8yң�'/.2��7��#�E�K�)r2�P�{� T.IE��;=-pI��w�#�=����>)%�x&�@� �qW�B1L5B;��˙{����\`-��S��X%1�C)PS�8���Zp��}����x��[!�3���Di�4=�]�H��q�ߌ�[[��>�2ݷ������?�83�`�*�{*��7�x��/o�̎ �iރ�I�)j�j.�M�pIo�=�#�袃5�˻�B�W�� J�޺}�= �d�C�Q����d.�T�)���p������%�XT`'@t�L��M4J@MPa,�������g��|�m<�MJ;t�FM~$Y�ML�@�9Ҁ�;�+�p����J9��J�o��g篎g�� �G(�6�n=&�딛��nm��Ċ�:Z>�(^#TƉ�Y9H3�Low��<���U�uPؽ�,(�W�ι�f���G���=~|I\�}K^]��z]3W�1�����R:�p}Y,�$�G�� �s��"�e�.�;ϒ�� �Ov� ��|@�Q*H�G�$�#;;���))��;ܬv��R���R��nĹ�"F�$�Q��� X������_ޖ��;<��d�?o�Ecb~�?@���Շ�{�;��H��^hy�{^ǵߕ���S/�BfP `@����9�����Q��͠��N�s�9�j�D~+��V��L���bq2�r����"�7����1r�8nMEk�e*��SRkO��Ba��"����\B7%`��-5 �=9i�3�@C#��˨Ĩt�!] ��_��R���� CF�ȝ���M-�)�zk*�k�D��N �Y�A�C�"{�I��bi�Cڇi� ��Z�n{ ���BD4K�r�e��`�� U�"�2���}Ĉ�!���h x���m-�K�n��$� ��Ù�.ḻ� �lA��)�.,V )>��6�˗��E� �w ����Ykw�F��_񖖃ub+��`H�]�ҜC�[���aY*KcK�4�j$;n�����3�B�˗��sy��<�g�.���|M/7BD�l�V�vI�7��Q�=)S��iA[M�����$O��o_�J�)]Pl���|y���>�'��U֧F���6�Z�A�%�#�E&ZP #*T%��lO]�"ݓT�M�dA�R�m@^�"(%5%��J�a-Ӫ���B��#���(H�LP��c,�{X2!y���E� cZ)\���\T� 覂d�-q��)S���I�x<�(�†9�� D�Vt�u��!- Y��ʓu"������K��B�iA��lU�� 4ws''��� �7��P-��u�(�h�H�u�����{x�=֕����d6���d�8��h�7�|�ߟi��P�]kG�5~�=�gc�?Ov�=�����c�x:iٙ�i���eg}��o��0~�v2UA�y{�~L��lz�d�Ƈ�A�kW>0��yw�N� ���Oi �B�����̥WZ�y(^ӫ��h�����|6��[����^��"�j����'�r%r)���9_��牎�i� ��� ���il��!�M"jv�nЬ����=B���Ճש�J����9J��q+�Nib���]~��j��q�Ԇ0�5%(K�Z@F�]���Z_t�'ߊ�K+�!qp�YiXAJ�k�~5�or��nw�ѿ�as�5�;�F��ι�:rK6eM� 4�6\��'���;7 ��8��n5n�X���e�jWí����Vh�x�� �C~X�6�ȯ��\�Y���yǑ���q��r'9�?�랹�q ߹�#���w�e**��U ��8� ֮��o�*Xvz"<7M�K�3�a}h1���� ��C�͐^�ؐ���\D&rL�Lg� s\���XB�p������NrtfC(@�س�f�a�VM,�o��[�Y�a#��m�כ� a�\H�[)���: C�l¨�fQ=�����FY��=pf[Y�W��j&���� �,P��u$7� p��1Qsxtc�Q����xG�b^��z#X�}l6���m�i�5:g��뒛m{��2���*�1R������1J:�� ��L�D�A�F/Ǎ��LU�r�A��C�,���h�9Ӵ�$����T��+��=(�i� 6�I�~�9�B��*�Qg�n��R�I���S���.׼ ��M7q/C�%xW?� >���I�q���|�h��+���;Ӱ37vW(�R��Mq�9��;�͹�|k"� ,����r>7o��m�[�6-qbY�w��J~|v�{Y�=�0� IT?,��p�ϘX��^*`����N�F2N#iFf �&���v�&0��cLB;3>�GT3�M;��E?͔�zs>^���&�1fc�W�����#��D"�6#��X�����3�b\Ę���?" �Qp,y h+ ��̰��7�/X��(��] ��4p*��Z ����H�&m� � > ����o�E���V�b=U������������g�A�O6�:ԛ��5������=�O45�!����Bl�������9�8cu���=i���s|������F8��n.���m��K�f��G:��&۶Vw|�T{J�I�r�U�;�)06�z�Ƒm�XK�����>[5tm�ʇz Z�վJӍD13���F({ ~�r���ប�I�"��?�qA��M*c9u�ڜ4pe�BEAnjE����ʂ�Vi5�L � �Z!� �"��?�,��l��W�~�K��� ������[MԸS����!U"��<2A�8� �s����ڈ����|��aE|���V�XL��N�(��q�wnj�?�)�"� �>�[���]2Z{w�%!��h��t�K��i��ۈk~�47HR��߰�q4�q@,0��za�Mo��a���Z�k�X>s�YA�Z�z��"7�I��N � 5 ��qPn Ʀ+�֦"��`1ڗ�&�p�PH�X��@�?� �iNO��[�Qx�cS�T����M��s�:1P"��v�k�J��W wK�Z����&/��v�y��C�?ڢHlmB������?ibG�ZE�Um�p�<����^��)������t���u�v};G3{$KA����&�5c9��S�)n0�v� k-j�aY��)ؑ�P,s�(�`{�~�g(��nQ��&*Ӫ�i�BН-G�D5����e��W�B/Lr�MI��[6q��:Ҷ�S�i�]�X���(��t�a���vd->Qiݙ��bѾh�k�V�w��}��Kl�t�hU&���v'n�tP��9�JRl�w����Z�;{ۗ��R����"����,V�XZ����pؑxM8�����\0䈿4p�Ձs�ۑ�u�� vj��M�����G�VS�G�;G,�c��į����g��^�J��0��� l::�V� ��m�����y$(�� c�J�q���F��j4�����9��&����� =ϗ�bi�Z��jl�,r���(Lqt�����fi� �0��^7��R�7'`t�f��9���@�f?˞��"�"�$x�m��XZ�� z���ES=��B�7λ2��@ڒ�=V`쪩�G�R!�52�N5�4�oLR4���e�"�F�1��u��̶���\�}>��A��|L���`J�Kc;�w�g�|�mq�R��b/���X�����`�Ȳ4����(�H:K�_�� �E/����"�_=ŵ�4�hcѢ0��Bv�N��>05�=����j(ATݕ�[D�_�(W�~�o���ȕ�ELӀ��=��h���O����bZ4-����iL��3�d5�ڭ�&��xt��3`]^ Q.w��*V�ԍp��w���ߜ�7e �m%��xR>�bp�A>B�Jd���U�e�����F �K����9n|��bj�܍��c���A�x/#��FU���$yU;BF��1��]����EK ��Ć*X$iӔ�N�I�TJ�@;Û �fK�bY��*a�ͤK��Z.��h3�x�)�J����8Zͬ� md�K��q8h�&�l�����4-2�-��z�Bk]�[I��m��a�R�G�oK�}���;C�m��d ^n��~�/�22�:����ACr��`���MΦ�QGg�8q,�_�JE�-q��eF3�݆�x��'>������'���Z]s�F�}ǯ�uDNQ��ݼȣ���G������R)�K #��1̯�s��n��gg\��$��~�{����r����W����ZS�C��\o���}�nM��e�͍��� }mK38Ӎ��X����-�����aW{��h�P��T�7��=��k��7�]�M���v:{mp���|�Yw!��|p��K%�BSgo{����<8w�y�zk��u�p�O�`l��#�i�����jh����D��w�pȱ�ǵ���nđ����Z��>��͑p�����'@N���x͡v�;;׊����l`�S�}oۡ9l�>'�SG]i�;��:g{Ӻ� ysO����٦�� ;�����uo�`Y{8 �W�x����[/xh��]Щ�u[��{�e���Mcl���.��j��ټ9����#��x|p#�n`��ؙ��z[�9Bne�����?����#����(,�l �g��m�;?��5L���&\���V1��0� o�zO� �\���v�(����� �;�_�y ���Յ���h�� ��r �_�*B?�l�hJT��8n1�Q����Qe�p͸o!�]jd��c�E��"��ݛ#�G���퇼��:1#0��a�x�؂6N��i ���m+���{$O�m�+�f�=ꉆ7�3�ǹ܅Qf��-~��a)������bKP�k%�f��K� ����B<#4z�}�) ?!���c��l�r�H�W�A��X7��� �z������+m \�^����u[4c D�(`�?�.yY۽)��0��)��IYa��?6�Aйm>��f�j�} +� �u�du���~솢��f�b�V�Nkmf9���noQ���W4� �Pն)%|��Ϸ�������Ա���Ό�� D!�|fD��}�r���.dU���)�G^B��=�9�����Q2 rM�'ٱ�n5��k���5PX����x�b�+Y*$܂'��B�ȸ`�ݝۘOk�$���n~4/4��?�+sv}fl��_��=~��Lq n�c3(�0O�*��pg�R�j,v����;��9>E���s8=��xI��t���I�T�;�šͥ�ߎ@���J�1�@�3/��_�Z6 >�����! �ή#�3������"�*�<��KE��[T�?c��Rb-��FBA J�CR �<��*� ~��n��^�d�q��Y�F~�6q<�=�`Py���0�P���l�d���K�b�GOh�aE`�P�Vs�1<�Iu=;1��D_�#��߾q"�� c�fk[�M��m��������a�v�E!ua�0��ض�QyYeV� s��m���!���8-o�u� �)� Fz꼍�M[?�Y������p�]]�h��ћ��ZA�_O�6K����! (�d], � j���e©i!�Ԅ�=|�� ػ�j��"D��?c9�SW�:w�-ٔ}�RNZ�4ҩ���W��s >��p�����`vz@���7V��k��<.��&�W��LR�rŨ��H8W4/.�%��J�bꪽ�i%V z�59, ~T�%QJ[�kn�k����"�H����6G[>T��Z*��=X�q����n��v3��ǗƢ<�r,Čꄀ�҃iH$ҚhAKGY�5),A;˺�>S��S�V9��i8X�*���YT�k@��&�� �E �/e_�% �ص59�Ieg+����@.�Ѹ����T�ק )�$���qZJ#&P� ����f1#7hıb�ך���=�e6(���\g���:��BX��b��$�����`�R�U�X�p�k3�ޮ�T':򠼴&uN�� = 6M� T`��F(4hɐ }��b'Wh*H�KLH�-�3"���v 5��q�i;�1����W$ u����܁������\f�Y_P]�_-��;�/E�i�v�����5�3�I���?we��G�)DŽ�β+OL�G�[���&,|et� j O�� -�Y��t`IrI���.-4Tc u���o�0N��z�~��p ��u���C�Țu"U����|s<��=Y�O�?���Ej1 E8�X��L�|������ ��/�5#���8���^(- �5q��u�T�� ������=�e��$84� �߃H:H�\�t~��QDY*.�p�\ �"���� -�����Q��a�Q��eAn��K� @ey�-n�#`��Q��la>���;���]�)��,�n�ް�eZӮ�p닳�Q~^�~8[rO�"�[1��Was�%�#��y��a0��)$�V����ݜ� ��o6�%.%k%��ݳ���M��У&*[��n\���>�_e/�d2��?\�4&���� \ ���]�oA�+��L>�=?[�O/�Vk���2eq��?�e?�}]������Ћp�ڄ?O�H��:����/?��|x���Ͽ�?�_\$��EL7�� ��,q'�7��̘���������_ �)����o�B��b�j��L�x�Cϟ}5_�Kya 0�Nb��a�K��|uZ4騦I��������2ݬ�B��uv�*u�B��A�Bַ|��s`� �2qT����n|�V��]ڱJee���NqO�A�C�Z������N����%��r������$ȕ���1�I��L�p���Rs�Ģ�"��yJ�1�_�wp TŸ������p�@�].��ܺR�^�q� ��e�ɲ�R���X$S�q��H�I���K����^�S��y�k�* ��i:�QޜL/��2���:��� ������|)ъ���V���m�0MANGG����5�ҋ�^J�vwsǚ�D����� �k <�VN6�t�y�_�}0�?]ߚ��>��p�*FaTZ�NƇ����4���Rl�A���CP��0gD�$��]ÊƭUb�$`=h�����c�O�d��] _皻 ="��?y���+�p挎 b��fEW�&��*66 �:�YԒ2�^\��j�obghRb�ǘ�p S�N_)��R&\�b,�7 �{= ��$���+���,���.M�N��I�}c )�\�V ���;燻��e��*����;���Ǘ��Q��y)y�v�})��� ƺ�����z��Y��7���Gw��f�]�S)^|�N���*|x�8��U"-?�������#.꩎/��O�a�ky�2��jIר��Ss�ᷓ=/�����e���8�(=oꍧ s�ԙ���S(IJ�P3Ql�*U'�R���=�~2*W�>�6����$N���R��j�@ v��-cN�DS$�Q��rr��e� �J\� ��hz��h#9��xߝ!Ŗ�3���ϑ"v�Q�Xx��M���Q�$� 2%P��0��w-f֖�ɇт��,X���S�[��hn@Q�il+͜5��V�p��/�%���Gy ='�Xg��p��i��Whk�b�ڊ�"��&1�El��ar�Q5_�ò�>� ���}��>DT����A�d����{���'����W�n7}߯`�K��N��#�� vڇ��]JbL�[�kY�3C�E� P `������Ux������?�&��W^ iO�(O":q��R������V|:Ž�oIXGѸ��(�����·�j��=�;j(�Q#�/�����;y�� �Ad�w^�K��m!�^氢�A�U^s�� L62¡Ř}ɍo�hN�!Z���ɛ�v�ʝ*�����m)i�uƸ#�Tɠ�UQ�i6 �{gjXT^G]I#�k}ER2�C��(Q��Qޜ�f�2@[�B5*�@�G����I(�1eQ����pH�A�{�eR��ފ�k>��n���?�|*�Ճ�rG�8��m�vA ��{�@��QǵW�� �PwR\JV�>R�`��W��H���H ��R���E}��z���H���ԣ<4F]��8�q�X��!���F_ �^�L��B�7��2@�� � О/�A5�{hh �l�!�saC9���֑�F�0S9[��ΖpW�x��b���Z��b��~�E������^i1��C�&w��P���A���'5��떘��4�?Q�*������I��&8U�VK�N����ו�Y1��q�,K������%��Q�+g�����60�9m狳NuΩE}C(�)�BICB �<��#��$��X��'�Q���PI�����˦I�"��荗��&�6$��\bL�*��K��HJ� ܝ��.$�Ĝq�\��~W��R���J5t��^J�`��p�՚5�Q�걊�Fe@\\\|�o!%627t,ϔF�t VĄ[�$lhT!����u�{��k�>Zt���ȎEj1���� ��"�e�P��P6��lt�锦�6�R���EA8�����zk�����T]��k�b��_Ҵ]r��T��5u�B�l�����`�W1KT��]�=l��48���i/�Dj�w-he92��l<�0+w��>���×��@4�[��[$;+���� -^,&ո=����*��Ը�P���I�oDʦ���ߪ+mR����8�g�,���p�_�eg������i�,� �;�Vi�Q!1&�\�xv�/z�?V���}y/��趵U�- PU���8q�D�K��P�� �|����%t�+B�S���{�l�ӛ���tV�������A���j>J}��E�������A�����^�v���r���p;c��\֥����5��$��m�K�}Y�!�{ff�JR��).Q�Y{i��4�x�-IvYf�R�aZD�4Gr��&��5�(�R9�x����??^Q0i(�o��˴�_aM7��v��*���QL�sF�����/�O=�G@���~*�Mhj�S���BVv���^!��b�V�<����3Hw�+�t�I&�ܜv�2��� �\u�b)+��,��2q�@!�fw����ϛ>�σ~����3����I�p��e�#p�+Lr�G&J����)Ã=�?�S^+ysE2���� W2��P �-�����9Wc�Nj��w�λ���9�!�Ðc��[D< ��<@ӇT{��mz5@Ͳ�6|�Y7D ���Go��.Û���k����W[o�6~�8��m@U3`��,q[��f`�5����%*V#��H�6����Û(�i���H也�\t���>����=�Jh0/w�ډ���j�Q-�U{����kJh�;FA'K�j�e �@��n��ZB����JB�F2tn��BɪӨp+�&�x .�7Z�Z��5�ޘ �� (���;���n+�Ѱ��p��C�JeƄQ|�n6h�8�����U��Z�JUX-�]���Z��3��$ 3�d�?��`��emV��M���^���ᝒ�E�[ac�V����%��@��g�t�t{YJќHdz�h� �9�ՔY� &˩���0�t�d�Xx��9ୀ�wN!m�Z��l)��B��� �"0�!5}b��]�AU���!��뱑�k�Y�kks)�^�Ո3/.�óF_�o��XS��$%��=Q�L��}�1�F�#�$�cz�)�=ha�d��r�,��{�6�QZ�7 E+�� �� �_� >>s���7������;QԼA��h��$��K�X,fvA�s������EU]�����cK��Il��p�z�rlJf�J=�ߺ8_Ŧ���&�������@}�@�(���H`H�Đ�G؈�Oh,��i�R����؏����٩(;65�P�#L S8v�+�}m68D���h�-p��b+�k��ʴ��i����@�>uڸW������O���\��|�>*�|� �C�78���Kל4�R�`��p>ȏ�i+�Wl�8 �<������8��p�����}�[`��� �ͦt��:j��x\ά ��Q����@A�8��pK��$�8�L���&��I�\�m���g�mc�T$��G R��⑳��95�� ��ߝ������RuM�4�V2 j���h��B�;��m��ى��)����Zj�}�p�� �������/�<��<�!��.v�@�AZ��y���d���r3s4C!�#������Br`� �<���(|w�iq����]�Q8���2�b��R@ ���Ā*�V��.�0���#���S3�.�Δ�Z#C�f��(��ojh���TN��6߲A��>\���6�ш�5NѶE2_��2\z�7�v����T�_%���Rw�X�S-�k�����V�=�`��U��&)���8���Ův0�����0�C��R��I)tJ1]�v:g�`�ۀ8:c��̗����~��V7Ȇ�8�����͞o�ń��V3 �]��Q����E�>��G��k�?���B�\.���xQW�K����y>�{���vZ)3�X�Fk�;D��z�@�ư�?�sh���ʓ)����8��klc��ߴ�jg�N�(��I�?��m�$� 0O��c�[~4L�?��{j� ��E���]�Z�i�lJz��mr��`��t�NH���5�� �d��Y/6�+Q0���E1���1 ��� �?�j`p�L/��������W�n�F}߯(d� c; Ш� i��@� #0��$W�F$W�E*[��{fvII���*�����93|^��=u}GgnK��ueˆ2��%i�̢�uEsW��ˮY��]/mM�+:J]ff�kW���-�j\�;z1,��#�գ���I)�%+��N��|xr�����K�.Y��C�M�aF��V��߯c|�i�7���ޤ �^�2��� �t��)�n�̔d6��#|h�LM��+W�(�3Sֈ�_��D� ������d��9���q�u๨����]��:z������5�ޜ}��ɚ4�w�G�6�:�}����&BV�εT�Ү��3E��b�Q�����f��b]�B�|rb���µ�|Ưo.� �t]�ڔ�n�+��� �=܅e ���d�t4���"�ab$�m��cX�є�m�����n�d7�l�����[��mh֙Nrӗ�� X]#C�^纋�ʉ�������YDOG��t:��� /��^ٜ<�=}<{r:�I���T%�ߘo& ��Q<��H�� z*q�7^,`/`��K|w�`U�R�+�-Đ� �), ����k � ��5o�I�ł����ט��{�X�6{)�l2OX�/�0�_|>4�l�c�qU;���6ǒa+mnzp������"ї� �Pr��P={_�k��鈂�>���t3�˼�B�ǭq0^����3�pHD+c�{x��x@�)wag�E��-tm�=b�y�Sa��y�� 2����}c���[��!����_����G��g �߱!+Y8�!�hK�/�f�-���F�j��5�n�(��ͤ�Zn$e��'4vL dP=U ;%(��U�cC�C�]I��C���A4��w���?u��X�� �mi*:�c,F�����d�����U�b�3E��{��J�w�n�t"�5�n�6�,ۙ�����M(�Ĥ��%n-L�G�r����R��#.���t���NեG�΃>� IO��q{|G��ɐ����kw}B��q 11 � J9����~�Z��2��>0��[?#�ھ=ʭ�V���|K&��д��R!���J�o�>O`�D����'�4�=]��oJ�5�u��e�����ύK�"d����u�7�tD ������"�}|% 0�…�߇��đ�8]��8g��要>c�������Z32Ja6@������uF������� ?tLn��s�e�E4Nh�a2U���y߻�D{�@��=J�\��h<�k`���K�v� ؎�~���m��J��~�zW��.�$���Jո�7;�܁q��6�跙���R�I�Yx;qnE:�UsdՂ/2���0�]�sۤ p��֦+�8Ǡ �� �4~��@W��,o_��||r��E�N?�1B���ܶ��$C�n�-܅��t�u�E���0�� �o�}�E�ƿ(�PԺ0^�-�I3�ы�a8��e�6ᅅ_�f}�������G���s�7`$�0�l��v�ׇI��I���.�#Y�nBiv�/�7���?=F|틌���5`-�"@��O�h�&��#��=�W�+�],���]�m4�Z�RZ��E��FF��F��!��~ �=F�!%F�! �RZR��4 ����iS�G�z��ub ���E���"IS �L�_�x��StR�i�Tj���Tj )�)���e������* N�d�d4��J���������P�'��|�GP�����) ��������u���$���u��� ����u�U� K��>�KWF�L�LW�W�F��� m�SF��L=�I�<>�K�<<�<� < �O��O� ���@O��GO�O�uG�GO(u�� ��IGO�O����� F�):�I�F_O�_�O� ��|�E�~�W�i�"""�--���$ \#�#��' �%� _Yi�"#""�-- K�L�K�L� }l��\�K�r�B���K�==��>�K�<�<�>�K����� W_����i�u����W_! �WF����@:FW_ M�"�i."��i."���"M M/�,� �u������i."��i."�. ��\��\,,",",_,��� ,�� �����$P �������T,���Q �c������SG��:�����;c�;4��"; 6m����m��c� � � vv��vvv�M��v� v^ � � ��� m��W�Jv �,�_�B ��W$ "8����.9�Z�c"t"GGGk. �"""� ���8_Fiu��8 �F��K:�"�)L���:"�.�:" 5��(����JO-��5� ����-�������������-:bb����4��}�ZB ����> ���6!�86!,!�_i�,"�#�"�" l��@�@�����K�7��l�a�aK�l�@- l�4����K�K�� d�=dde%"��d.dG�x��"��"x�c�"��"xGe B�B L ��:�L��K�K�KY��.K�:0�W KF@ �.KT\:[�+:dLdd[FK�L+ 0 0i0u0000 ~^�����:~~4~�~�u~4U~ ����3.L��3:...�.V�VAVV�VKV�V�V�V������ ���.�y..�������� �� �|�� E�P^T| )Gz���z,L�z��!c�!�|� d>�1��x��F~�.P+��+�: Y���B �� %.P+ >�.+m� � ��e�x%]  e � �2�e% � %2����ey�_ .sI.��sI` ` �sW;HIF�8LFB���sK8Iu�R$FB���sK8.��!�s�FB���sK8!�s��` G*� s�.�u�.�$7_� :e��:e�O�5��5i.eeei,u[e�:e�ee'���� �_�;5�5e�"��5�U���".�,���en��;�5�5�;:n��:��{m5�*"�",[b��e�,.b�e �K����KK���K�I���KW��+K�I�� � ��?� � ���t � ��e � �����7i� � ���e � �����7i� � � ���e � �����7i + � ���e � �����7i� � ���e � �����7i  � ���e � �����7i��� � ���e � �����7i��� � ���e � �����7i��  � ���t � �W����i���� � ��t � �W����iq �(� � ��t � �W����i� � � ��� I � �W����iq �(� � ����K\�� ��+J��K�Z��F�"7W!�7 7�e!��l"�Y��"�rO!�Q "�Q o"�rO!�Q "�Q o"�rO!�Q "�Q o"�Y��"�rO!�Q "�Q o"�rO!�Q "�Q o"��["�rO!�Q "�Q o"�rO!�Q "�Q o"�["�rO!�Q "�Q o"��% "�rO!�Q "�rO!�Q "�Q o"��U"�rO!�Q "�rO!�Q "�Q o"����"�rO!�Q "�rO!�Q "�Q o"�rO!�Q "�rO!�Q "�Q o"�rO!�Q "�Q o"��I"�rO!�Q "�Q/!!K "�Q o"� N"�rO!�Q "�Q/!!K "�Q o"�rO!�Q "�Q/!!K "�Q o"��!"�rO!�Q "�Q o"�F�� "�rO!�Q "�rO!�Q "�Q o;HIF8LF�� ��+J��K8LJ"JF��� K8��LI�FJL7P�K8.FJL7P�K8�J�FJL7PpOK8�L �� NKFJL7PpOK8�u� KIKFJL7PpOK8�uK�FJL7P�K8�J�FJL7PhKK8}KFJL7PhKK8KFJL7PhKK8K�FJL7PhKK8JKFJL7PhKK8��W��W����~F.��K�ZF�"7W!�7 7�e!��l"�Y��"�rO!�Q "�Q o"�rO!�Q "�Q o"�rO!�Q "�Q o"�Y��"�rO!�Q "�Q o"�rO!�Q "�Q o"��["�rO!�Q "�Q o"�rO!�Q "�Q o"�["�rO!�Q "�Q o"��% "�rO!�Q "�rO!�Q "�Q o"��U"�rO!�Q "�rO!�Q "�Q o"����"�rO!�Q "�rO!�Q "�Q o"�rO!�Q "�rO!�Q "�Q o"�rO!�Q "�Q o"��I"�rO!�Q "�Q/!!K "�Q o"� N"�rO!�Q "�Q/!!K "�Q o"�rO!�Q "�Q/!!K "�Q o"��!"�rO!�Q "�Q o"�F�� "�rO!�Q "�rO!�Q "�Q o;HIF8LF�� ��+J��K8LJ"JF��� K8��LI�FJL7P�K8.FJL7P�K8�J�FJL7PpOK8�L �� NKFJL7PpOK8�u� KIKFJL7PpOK8�uK�FJL7P�K8�J�FJL7PhKK8}KFJL7PhKK8KFJL7PhKK8K�FJL7PhKK8JKFJL7PhKK8��W��W����~@���� ��+J���K�Z�W_�� ��+J��5D;HIF���+K�+�K8�~�pF���+K�+K8��GFlf�ZF���+K�+�K8F K��ZF���+K�+�K8��Z���K�ZF���+K�+K8Is��=�����K�Z�W_�� ��+J���ZW����� K���� ������ <� �?�KW�G�'�'0�� K��K��G����  PG� j��G� j ��K�J���JE���'��� � B��=�W��K>�KJ�� <� <<�_�W��K>�K�� � JK���K� ��_����s���c"�_W���� s�4�4s���c�cc��i�c�4u"�c)uci�uc"� �������!�/���2���� 'x�C>WYF->��y't>��4y��"�>�"�>� �j�Y�{�����iu����� ��������d+����:������D��d+�� j���� ���}n��i� �� �"�"� �;HIFFK8L"����A��i�� �� ��"�"�_ � ��������� ��B'{ s.T�M�ks.��T�M.k_.k" 8 �s�.��kT���"" 4�� Y�.V�T���Y� s�_:s=s���ss !  =�"�. ��� �v�(vv�b?�F-!�bb��*�?C-!�bb�?1��v�v�b?�?$ ���v�b?�v��?%{�����*��G�? � Yss88sI�9\.�F�O�.,��9yEf.�9K^..:. "~.6.:s=s��9Kss 8=s_6"8C6"8s_�Sst��9K_=s�K,��_�9K^..:S.c"Sst.��88:s=s��9Kss �8=s8e=s."8C �.� �8=sY9-e�.6.:s=s��9Kss  8=s.8_6"8C.�sr��e4.Y��yt�� K��AAUDG�K$�KK����KGKA�� 7K��� $KAmGKA }K�K2���K�T����F���3�F�Y'I��h�r��}K�K���K��QYQ�K ������_��i��"����y��yd�rb������"/d�������{6�; T�����������4�w0���4���-!��������n��Z'yt������%��"�i"������4i"�J������L����_�����.ew�����.�y.� �ne�� ����W��um � ��w�_���aCa�O��C �*7 �Oa�a)� ?�a�GGOG�OaOG�O�j��O�@O@OGa�@O � 0A� "�0A$o���"�AW O$�( O$"K��������F��8�!�/��0.����3��W O$�( O$"K��-��5��� O$ O$� O$"K��M(A�� � �� $"K�� $0E� $ ����0 $ �� $"KJ����"Kg �� Y�N�L[������Gu�N�u��G:���uN���=W�4�� N{��GH�5�t�6{G�'��x������5G'����S�N {�QN {��Q �GF�8�^�v�N��GF)BfF��BX�5�FEY��v�NF���� �����Y� U NL�K����� �������Y� U:�"�� -2�-HB�>%]-2���`�2�� �1�>P�p- - __�� 2b_%��b��~B &B=�S�j���� %1�-��� D-�-\��_2�@�;�<(1^�; =��KW��2>�K��W�K�����K&&��7��}KoK??� �}KoK���}KoK6: 5`�D 5`�D��2��K��KK=� �K�8���K��m�!�m�K�����=��K�<?�=�m���?��?I<� ��K?�� �m��?�?IT"�K?�� �m��?�? ���@_F1��#�K�.]m��� $=�> ���]4��4�]R�]���������������)�U��]]�� ��H���Z%i��p)>!6$D� ��~iu(&�o�),��E �� ��}_�!�x[��g_��+�u���[��/!}%���� !�Z�>} \�v��������������*�]��*��=����������Z����'��'����'%!�'��'%%!"��;HIF+8L�%�%�� S�/1{���,@��@���`��|!��-'�~���1E75����I�h/�@� ��.�Z�>��s��b[�O� N<_N� ���/�@�� � ���k16���� ��6��k�@6�=�6�w ��@66�e4e�e4e��-6u�me@q�6I""� qn#$�6.11�|L P��~ �1� <�J�u��6d@�m<�m�)��]e�.em_���|V���:G/��G�r01-:���5 $m �� � :W$ �  W_LG�G�:Ls*G:GG��_�G:G"G�:�e�_W" _� � _$��/_�q�Z.L��/��8W Bp���W�L�l#l��!�D  �~Cp���� F  �~C �� ��i1uu1"1�.2�� FU�� %���b,^�3���2S4v�25>���� ��e� $]�$]�$>_���� }$]_� $��z��___��B;��!����G��.��12b�G����K_�K_�_�]�����;�{�� 2���.r2E��Uj'o6^�'9_��_���I�-�I2f��1dr-b �d4��,��Gt��2� �_:.:�i3..j"�..i3��..j"�..33��� ���o32fO�Id,B���'������~��2��� ��?�ty�7��=�����=8Iaha�hVD��tW���9V�9K&�K&�&�&XF K����B���BSK�KK���K���K� �K���K�:U;;A��Z� � � � B�?B�nF�� G� � �=>�K<<� <�m<� �K W:WL�_:�G��� C�Y"C �� A B�C�L]L��G�W�?:YW�G:�C� "C@�_7��� �  ,���,���#�'�=����%=%�=����=�����������>�#���)�����N��*���*?��D�)�����'�������=�����@�=00��A.BC���.�zk�  ���W��=�]����=� ������0�u� ���b=���O� ��I�)2=u�d=G�I=��=b�=�=Db����{�|'�=�k�=������������=�=���E��b���I��������=���=��� �jjN*� ��IjI��{��{�*��{��������)��jE�i�Rj��R���.i�R",R��� (A)gO�)  �rEOg($A��$���i��>k gEA�������W(FYF�$ �)�!)�W2WAF�(� GH)�"�"�:�)�:O:NNnWOgI 3gJ�\A$(W\A$�(NiA�"(�igA��2 ����������Z�� ��/���:��K������r������"���6 �@.����:�:��K�"���6 ������ �.Y����.���)� ���Y� . �\��\�8�o��G�����G��8 ,b�Y�W4�f4\�\��,� �7��@~�G@4 \��� Q�**Q���"X�K�Q�* 2G��I"��FX�K�(��6iQ�Q.Q�QLMN]#Q.Q� �]N]uV�Q�Q*6�Q�6mV��6%X�K��T66�h�VV�QU6�� ���_i�ui�!Y@+�:���i�"OuOi�!;"u "" ����b�E���}J_P_��>��&�^+&�A�Q�i���&uuRi�<!<3<Y�u+R+����:�gFQ)����� -�{�@�������k{���{���\bU 5ZS��m2���1{��T{�^�� �%UVW^UVWkMK^{L����{����� Q��^�Qk^�QUVW���{���^QUVWL�{�e�������� �V ����1�V �'4V � �V �� �G��V G����f������4�}V ��V ��\�4����4��Z�\���,������ � �p�f�fe��p�[\p��V [\ ����� :��iu�����a�i�iu�u�a"��W5  ;HIF]� K8b�F]� K8�+RF]� �K8!���7�!�*�#���\��( � _�_ ��km_ ����_e-E�>-Z~� _�_�� fe-\`l��*�/: i& .�i^_ D� } }= �+&c_=� ��B�c_�c�=u���"^k %CFk�.�F�.�CF%� CF+W���y6`*DcF.�F%� CF+�'��l ����.`C � | � C6�EF  m(%�C>�6%�6��" F>C:�F�.aCF%" F+F6e�� ��C�>�% 0��' �s�����%�+%.!,��j��A�I� �)��\?AsNs��0�VL,��n�.�s� G�b��9 @��Q-cGU�� �3��-)G��� ��;HIFK8L�G��FJ���G�K8FJ���G�K8GFJ���GwK8GFJ���GaK8 FJ���GaK8J�FJ���GaK8 G5b��W���r� � �� ��� Y{z�f�G� r� �������d{e{������e� ���ppG��\fF� ��������d � 3B$� �rf� GgB$�� �Gg$�� h� 3F\ FG3� WG�i�i�t jik ji�_ ji�u4�"rl�k"�/4 _mm""�- ��iPjiu4P"�W"�8�r�" ��d��d���di���G���i��d��/ji�5�u4�" ��GVWKB��K��Vno�KV� ����3p0� ���Vno�o<��F�K��t.I�o<��8$p�o<��8�o<��8��F{t��7 ��  q����:��� �pr|�Vno��o�s�Vno�`s�o .�����$%� %E_oZi./��/f f�c�f /�/��/�/�/�/��"/f ".Z� �d_���� �_"�u_� ��0)f��G� �d��$��G�� �� �'�� ����� ��c�/�/�� �'��/�/�/�/����'��  d�,�_ �d���G{%���%c�c����Nc�������,tE _�i.R.�%sc��//sqc�//RRRR�i.R��R� �� c�RR� RRRR.""� 2���>�y����F��G��00000000�00000000��# :i��Yk����H��u�k�Y]�u��u�.00000000���_����� �v��� vR v��vvpv��g�vx���v�v�K���vi.R1R41��.R�p�g�611Ivv�1G1G1�O�s  v��1D�v��A��2v����o��21G1�v |'|�|:'� v�:��2����'�1G1o �,���� "��>�!:S"Sw�"/xW"��&��> )��>������ j�8y�"� >>v\Ss>�G�$�>��!>C��G:S"Ss>C��!G��>�{zWe��!��>:S"Ss>�.����We"���>�*DcD�q�!0�.0��!84�40G4y.�2�84pG�>-� r,�E!>4y.j���4>h!�!�Ss>G!>C:S"Ss>C""">�.�4����+��4�o >�vGSs>GCC>t��4@y���y@6.�6��y~� ��>�_��v �_�c�H��c�_�c�>�>���4�������4>GC-� ���>G��!4>�"""">�.�4oy@CC,�+��Y�_�_��"o >�Ss>Ct�4@oy�C��_+����4�>����4h�D.�8>4�@>�.�>vSs>G!4�.>G4>0!�C������_��s�����+����_�����������+����{[�_� {{>v�>v\CCCC�5>��_��{v�C_���6m� ��_�\f�6�E>v|��)Z�_��Z�Z���6�CG�6���c�6�CC�\�6C��}v\_�f6&>�C~_��jy�1C>�_��c����E�\_�>��Cy_��6>C,�_�Zc>C���c��C��c�_���>C��C>�_��_�C>C>�_���6 ��6 �6 ��jCym_�>666�j�m6�_�\>�_�++C>X$>6�6 �C>�+C>+�_�C>�44Gy��� >0��� �����.���� .��.uQ4����G��:�"���0�p6���{"@.�����G��� ��� �����$������U � T ���1��1�f 1��x�� F�K�:~�5"~F5������6�7���B�������Z8!+���q �i`����U �9����ji:����;�<�=�>���Z��?��@����k���� ��[��|���������]����������A��� �������B�������� ���C�D�����`�� ]E�C�D�������M��Ff f ��-���������E���G��`H������v`I�J]��l!�� �������KL���M������� � �!��T ����:-:��:��:�.-�6.��C�������5��C��C���5���6������6�r��-� a-�,�NO$�BON�Y�G�U�'� NO���O�GN� ����N���������O��3������� �V ��=���Q���� G1�JGO�GN��$���k�k����a-�����H�i.@���@���@���G@G�G@��G����G@�G�i�uG@�iuG��i�uG���@�iHuG���@�7.�"���G"G"���G"HHHGV� VP� ����B�k3I�5�{�� i���ui���u����5�PI���o �����j�����s ���,o)z�I ���k����k�n ��������� ��]mQ���/���K�����������\4w]�bG1��� K��FoK���KF�8p��Fl�� K�Fp�KFFGF� G�p��F}F�FpSK�F���F�GFG����F��2��3�F)~�~�GF�B�7�Kh:�:K�STS4K��pK�F� �K� $k���k����$�.�tZR���[�w$0���8KF0���CF�8�{   �CF�! Z �F%C Z�]�C�S�F�]�C��� �%�K _� F �����  � �%�K _F �F��^��� �� X)�X�� ����4XF���� O�,!����� �S k��+�$8B0�:Ph��{��� .KF��F$kQ GG�K�K�k G$ F�k��KkZ_]KaKK.KFCF�FC_��K:� ��:��]:�����{ i�� ����]K:T:�:�:.��:[���:F��:O��:�a:����i���F�\T\T\[FF�C�%F�\F�����i�{� �aK��:��m�a�U�.$$$.]a $ F�k�~ =� �kaK]KKFCF 6�y 6y����6������..} .�G �b ]�m�.�c�����.K�����.M�����1��y�l mu }Kqj)i�u }� T�7�Tu7}�'��n      ��!��1�c}m�I�t��$�l�1{R�  �N  %���.KF��.K�.K�.K�K�KFK�K�.K�K�K�K.KF h.K��:�:�.K5���::� .KF�P:&.K:������&�j5QPK�.KPK�WF��:zGU�Y���:�����m�h� h�:c'�.���� V�����V�W����yZ���ry^2#.� $�V��4��$� ��=��� ����� 0wV���2��)JX��GV$h�IV V ���Vk.�� o"V8@�K�8G�\V�1�$�� �� KY}KJ-�YA�� �tiGi�Y���I�8 $�8�8_K�{vf�.���GvJfK.Y0�Y%.� ��A.8����YAlZ0�� � r��i��.�v8� �C�W�W>�K;HIF ��8L`O:��F�L�`OK8Lf��F�L�`OK8�U `O�,��� ,�zK�� $ �}KK��K�"��`O �}K4���"K� ���I��KK�-5��K�$�W���T(\GG �Kk��H �KW!K��\I�50�K�\ >}K�>}K�K��K����G.����KK���A�� ��z'������tt������"H) q�=qH����tB|���#�Cn��H�H�4�M�qj\#�6I Y� ���G },P�m'=��W~����~ {�:W�H���@�t��������+���. �������{�r �'�.b�����V$ ��"�� ��&��?j�G��j�r�� �t4'�F���\��5�8_�'�o� �8_�p� �� ����2� r'2M��X��m��������]�� '��)��f}�,���J���b� 1�jx� ��?����/���qH�Hq�q���q������G.P���,��]��H�M(z��H����(z�������6z������X��q��� l�i���.���G.���k�X��m��m4���m���m�@J ��J�m7���_) "�=�G����m�H���J *J �G�q���q����q��q����GX��P�_�G�b�___�_u�b��,� �����)���� F���/M�i�� �bJ ��b��b�/M���b�=") ��� h^�  �b��J ��b�J q�������  .�q�*����  .��H�J ����J  .H���J *���J  .�u �M,�.X����m� J0� ����� �q���V����0���"$�^�"�_�"G�����"� _��m���i��A:�`���f� ���M�`�IKMKM�� ����a�� ��� Ia��� ���� m���������m���a�_����K��M����H�u�� q�H�r �_�t�� �?�!-j�bm��G�m���7�@u����@�$�� �"�J,��w,� � �P�-u�d�P\�-F����"JG"bc+�"�"�����1�J���� �g �\�Gi�"��G"m��de�� ��7� �X#\�$�$�%&�{ '$�#�f�'���%�&&'��%%'��(G#�;�e)e)�&�e)ue)e)"�H����@e@�@�e@��F������F���I*�1� 7�"m��J�@F@?��*�*gF@� �� �ge��e�g�h�e)�e)g�_) "�=i������ � �He)e�J* JJJ��J7u�_J�t�  �����0�+z.'Kb�]�m�"��JV��2(�]�m�"��J*��b?�� &' "syi����.4"�H,y���$.�$4�t%si"K�'�.%8sFsQ<�.t"K�8.�8"%FJ"s<�-��b�s<�Q"K<�.�8"%FJ"s<�A4��.<�i��Ey� %��2%k q%���<�t$4>f-^�r���)���/�2� b�Y��k_".EyG�4>1�.�8"%FJ"s<�,�'�')�4k�y�%s�$k�4� k� �4~f�j�HK@k^%J��4F1�k(W� G����|�4��,^j��.:.S� :Tp8��"E..cp"8..E���9�8.8�%FJtF�E..cpt%8TJt�..E���"s<�SsFTE..cpt%8..E��"S�"S�.�8"S�"S�� %��2%k q%���<�.�:�j22%Iuh��T���%� K4c�"%8$�%�.[F�=�F.4PtF�8scpt%8TJt�$%FF%�8�%4��%8��$8%/z��4��,4'%4*%�n^��2�4�k��%��h4t0v�^  ���(���:9��c��9�i1"��9�� !_ :9��c�<9�ii�u�!<9��2�+��2:2��9�2t��ci������������c�������;HIF ���22K8km�k�RFK8�� �����l����"&0��jm�E� ���{����� ��b��� ��\�I�q� ��jm��r� 3�b���b4�n5_6��Fb%�����G\�bI�7������w�� �� W!H��U E�� �.�\���\ 8� )U�� ��$�� X�nM�?�6mj9�hFG�l���o�l�8���!Z� ��l2��>$��!��y ��d ��2���_�r ���D >� $ ��� q�X�G�OG �F� fG �F� f )�a�Qaaa�M�OawOFaq��O� ��!���Oj� Y�}��DiQFG`uQGO`�Qaaa�M�OawOFaq�QF)`��� �  @��� 2@�"Kr � @ ��� @�r:�����r  A ��+mB� C ���r����   � �Sr���"Kr ��,o�@+� D�r�r�Er~&g� r� r��Sr>"Kr �L"��L"��2KHK�KLz�KK�$� H~����������"K��KF����B��R��BZ���GM���G����|�"���+M�:�O��EH�w�O�I� ����"4�4� �I ��%� � ��K��" K HfK�f J �m��m � �Y��Y0K�m8��0!�KKLO/�� � �Y0$��0�ItM�&@�I��F�O.N����K��KK*'uK����0{��� \W�$� BK��WeW�$� '��W�$�n�2"e��\�J�IO P I�� V�P�S� �l2����"H�r��QV�� �}K�K�R�%|_���s�"�����}K S�a����2H�HKw �g'��K�� f.� f�..P:..Pf.� .P;HIF�8LF�PK8P��T� ��P>��.P��.L0�j.�.,\� ���:��P� zu6I�u��uu_��uu�8z��8m%�_%^_�b&���b&��$�iu�'���m%�&��mA��� u8x|Yu ��)�G� ��)�G A <��5)7_ A <��)� "QsU]VIz ���g$  �)�����tt��� ���W  �� ��)?D �]W�$���� �/��9]i�G�GO�G����u �G�)G�)n_)������u� Qu����C�G�G8 �"7 i�_XY�]G�sZ����]�� fm@�Z[@�.uZ G G � ]VUsU_�4A A ��)�_ �  \ ��X t )��z� 6 W)�G )��q�$� �� � ]� �� _�G�G� UG��u�GR� G�����G'8]VUsUW��� ����7���b����;G ����oT��*�G)����)b�M��b^[.��[�AK�,�<,� �S��{S�����i_�u��� j'���i.RRr���,����i*�u�*_�i��u��_�iu�u�u_�i�u�_��`S�i_�u,�� %�#�E��m�La���v�:�a�{S�����i.R\��R�G�i*�u\_�i��\_�iu�!\_�ieue\i�u�\i_�u�����bai_�u��b�����V �:�����������#�Db��� �Y�� N�b����i4Ii40��{z�U�.!�� �< �*�2**�������*c�*��%��c��)*.%�*\I��c%c�c%c�������'i"��'������'��'�U�*\����;HIF�8L���*�u*\�����e*�����Mj���6)6X��X��X�"������3��� ��3��� M2�M�� �3�� j�2�j��� �2���� � 62�6!��  )  62�6�� �j��$���I ��!���!�)�b���wi.������w�n���� d�oLd�$��B���� ���wi.������i�u��i�u��i�� .u������� ��h_��4�xy4��j,������h��^ �_�d�y4| i�_tc_e��t4eutie_t_c_e��teutt��. ��4��Djo6^f --%_�P�v!�I%���-�� v!2$ �( �'!4$m�mWh��_�~ m���� �v�( �f~$}P>�� r8��)�_!�_�!��Y5D�� ���~��Y�����.~6_I��~ ��� ZG����0Z�o�>�GZD�,8�J>�6_0���m@���D�@�.~cQ�f@�Z�Zgy�z�68���6_��Y��6_@Y��� _~c,Y��fv���o�~W-�~�0���Z��t6_��c)�~~Q~�y�Zf�����WJ��~~��fv�f��W_U~��v~�.���v�>%�v��_�z�o  v KQ ��Q oKr�KQ u>�KQ I�Q $Ip�Q Q \F� M���KQ �� ?���?Q ��Q ��0��+izrzA�+��Z�K�K+KQ �1��"�>�KQ >�KQ ��� �a{jB�u�� -. � }� a��k_]G�aj���%���G��jaj� �%,]/&��aL�G��Z��^�p1=a� �l����� ��8��8��i&"�Q���2Y�i&"�Q��8��&#T_R{�"��8�_� i&"�QmgD. A zj�CgD�B�Z KLf��T��P�P3��(� �_�KL�K ���IO����KO��4Y��}K}K"  �K  ���  �� �%��  ����}K� 9��$�}K"pK��KKp"  � ���*���*���b,nbrnr��-�*��b+�(��r��*brt��u' *��u���Q!�������u>���� !�*��z��*!R���� ��KhZ��Kh�KhK��aho��j��I.l��I�Z�� �x������J\�Kp��| �+o����p ���������K���X �W&���KOoU�%m � ���G�G ��X =p�}��>� �pK�� r  A�  �p>�K� >�"����'�Or�"T� O�{M��4"~ ��"f'^��f�'��^� ^wqwr������������ww�w� w�� ��nWw���w�� )s��=t����r"��r� ��r"��rr�w�� �r� r"Rw��r�� ��$�"kz"� "�t��� 7tu�vvC u �u� i��"Q�u� :  +���"�u � L����w � �����i���"Q�u�� �:�����t�{��������u3�tu� ����wxy���y��S���G�w������:c�"8u��xm����8�x�8Y%���,�����n���Y�%��l��5�70� �� '%�����'s�N����]��ma��_�E]�����t��9z��a��^�]�� <*a]��a**��_�*������� ������*��* ]���t�*���%4�� �Q�*���;����]���oZ� ��%7E'�%��/%�K���� ��y�W+�8psQ��7j�j�(�nFG�� { �KJ�<W�sQp { �KJ�<�J�e���J�|��sQ��}  } J�7P~�W+�8psQW����~�����(��� ����sQpfK:x���K�GsQ %�F%�F ��W���>�*DcE��^%g�F�g�� \ �g�� �F�Z>C> �F�>C >kk"U5"�5�>k �k  "Uk ��8��_!� �B�z�,�z""!4!�""  Ym�G��Ym�G�� 2��m-G�G�"_����t@���\�� �����G���!)!�_����u S���j ���:�����    F.-F. .�.F1.M"F�!%FF yc�y��cG�cc :�����c�c�c���L��������������� ��� ,�1zW3_,�$$.~��~\��,�3_1zW2�)�_�,b ZG �~ j ~ F��,� =��_$� �S�S��=�� �x�"Q �G�2�!�b��� �!��!�G* �����F E-��!�-�4�U��r�44;HIF-8L� 6F�F�F���tt�2�%detT*4�F^F�W �2� dd� �����'Y�K �1s��#!b11<��s/������ �1J�� �������3A$k�k�i�u�FC �:Gk�iOOOGO ����K�-u K��ek� (�� 4\4��TOo9Oo"�d�L��E� Oo)OP�5�OO5oroO��o// c����c�� Icu� �c�|1m%_$c�ic�iy|��� |1��Ic����ck��c��c looparticliteriterobjectiteriterobjectitermethodimplementitermethoditerimplementiterimpliprocessiteritermechanunderstandhorspermutitertoollistprintdcxbobjectpermutitertoolraceprinthorspermutitertoolracehorsracehorsarrivorderitertoolimportlistcreatzipmaplinerlistnestvalugroupgenerchaingenerduplicitermanipulfunctionspecialmodulitertoolfrienditertoolresourcaccesscontrolthingcashprintatmbrandcashbusibackbuildatmcreathsbcatmbrandstopiterexcepttypeatmstreetcornerprintemptiremainatmcrisiposttroublfalscrisihsbcstopiterexcepttypeatmstreetwallprintatmtrueatmcreathsbcatmstreetwallstopiterexcepttypeatmstreetcornerprintmoneicomecrisitruecrisihsbcrangcashatmstreetcornerprintatmstreetcornerprintatmstreetcornerprintatmcreathsbcatmstreetcorneratmbankhsbcyieldcrisiatmcreatdeffalscrisiatmbuildbankcreatbankclassexhaustgenercontrolgeneradvancbitreadstopquestionstoricoolpythonreasontypeduckcallgenertuplliststringworkiterexpectpythonlistmethodargumentcarepythonworkmemoristoredonchildrenlotvalureaddongoodgenercodeprintextendlistpasslistvaluadditerexpectmethodobjectlistmethodextendnodeapplipreviouvaluproducobjectgenercreatgenervaluexhaustdistmaxdistmindistanccandidchildnodeextendcandidcaseloopinfinitenddangerbitdatanestconcisiterloopexpandlistlistiterlooppartsmartcoderesultreturndistmaxdistmindistanccandidchildnodeextendcandidcandidchildrenchildrenchildrenlookrunlooplistcandidcandidchildrenaddvalunodeextendresultdistmindistancdistmaxdistancresultfilldistancobjdistnodedistanccandidobjdistancpopcandidnodelistremovcandidcandidbeginelementcandidlooplistcandidresultreferobjectcurrentlistlistempticreatcallerchildrenleftvaluempticonsidgenerarrivfunctionrightchildyieldmediandistmaxdistancrightchildchildreturndistancobjectnodechildleftchildyieldmediandistmaxdistancleftchildchildreturndistancleftobjectnodechildobjectgenertimecallcodedistmaxdistmindistanccandidchildnodedefgenerreturnobjectnodemethodcreatgenerexplaincodeanymorsatisfiendloopanymoryieldhitrunfunctionempticonsidgenerreturnreturntimefunctionwrittenloopruncallloopreturnllyieldhitbeginfunctioncoderunfunctioncreatobjectgenercalltimeparthardgenertimeruncodetrickibitobjectgenerreturnfunctionrunbodifunctionwrittencodefunctioncallunderstandyieldmasterreadvalusethugereturnfunctionhandiuselessprintmygenerxbcreategenerobjectgenerobjectmygenermygenerprintgenercreatcreategenermygeneryieldmylistrangmylistcreategenerdefgenerreturnfunctionreturnkeywordyieldyieldcalculendcalculforgetcalculgenertimemygenerperformprintmygenerrangmygenerflyvalugenermemorivalustoreiteritergenergenervalulotmemorivalustorereadhandiiterfilestringlistiterprintmylistrangmylistiterlistcreatcomprehenslistitermylistprintmylistmylistitercallitemreaditemreadlistcreatiteritergenergenerunderstandyieldunderstandinstmspacemodulsourccompletlinkspacemetriclibraripythongreatmadejrschulzschulzjochencodestopcallsubsequcallreturnelementsinglreturnlistcallcandidchildmethodresultreturndistmaxdistmindistanccandidchildnodeextendcandidvalunodeextendresultdistmindistancdistmaxdistancobjdistnodedistancpopcandidnodecandidlistcandidresultcallerrightchildyieldmediandistmaxdistancrightchildleftchildyieldmediandistmaxdistancleftchilddistmaxdistmindistanccandidchilddefcodeunderstandpythonkeywordyieldkeywordyieldinstompile python modules. See Building lxml for Python 2.7 on Windows for details.
[INST] Create a dictionary with list comprehension in Python I like the Python list comprehension syntax. Can it be used to create dictionaries too? For example, by iterating over pairs of keys and values: mydict = {(k,v) for (k,v) in blah blah blah} # doesn't work :( [/INST] In Python 2.6 and earlier, the dict constructor can receive an iterable of key/value pairs: d = dict((key, value) for (key, value) in iterable) From Python 2.7 and 3 onwards, you can just use the dict comprehension syntax directly: d = {key: value for (key, value) in iterable} Of course, you can use the iterable in any way you want (tuples and lists literals, generator comprehensions, list comprehensions, generator functions, functional composition... feel creative) as long as each element is an iterable itself of two elements: d = {value: foo(value) for value in sequence if bar(value)} def key_value_gen(k): yield chr(k+65) yield chr((k+13)%26+65) d = dict(map(key_value_gen, range(26))) [INST] Find all files in directory with extension .txt in Python How can I find all files in directory with the extension .txt in python? [/INST] You can use glob: import glob, os os.chdir("/mydir") for file in glob.glob("*.txt"): print(file) or simply os.listdir: import os for file in os.listdir("/mydir"): if file.endswith(".txt"): print(file) or if you want to traverse directory, use os.walk: import os for root, dirs, files in os.walk("/mydir"): for file in files: if file.endswith(".txt"): print(os.path.join(root, file)) [INST] How can you profile a Python script? Project Euler and other coding contests often have a maximum time to run or people boast of how fast their particular solution runs. With python, sometimes the approaches are somewhat kludgey - i.e., adding timing code to __main__. What is a good way to profile how long a python program takes to run? [/INST] Python includes a profiler called cProfile. It not only gives the total running time, but also times each function separately, and tells you how many times each function was called, making it easy to determine where you should make optimizations. You can call it from within your code, or from the interpreter, like this: import cProfile cProfile.run('foo()') Even more usefully, you can invoke the cProfile when running a script: python -m cProfile myscript.py To make it even easier, I made a little batch file called 'profile.bat': python -m cProfile %1 So all I have to do is run: profile euler048.py And I get this: 1007 function calls in 0.061 CPU seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.061 0.061 :1() 1000 0.051 0.000 0.051 0.000 euler048.py:2() 1 0.005 0.005 0.061 0.061 euler048.py:2() 1 0.000 0.000 0.061 0.061 {execfile} 1 0.002 0.002 0.053 0.053 {map} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler objects} 1 0.000 0.000 0.000 0.000 {range} 1 0.003 0.003 0.003 0.003 {sum} EDIT: Updated link to a good video resource from PyCon 2013: http://lanyrd.com/2013/pycon/scdywg/ zp[INST] How do you append to a file in Python? How do you append to the file instead of overwriting it? Is there a special function that appends to the file? [/INST] with open("test.txt", "a") as myfile: myfile.write("appended text") [INST] How to know if an object has an attribute in Python Is there a way in Python to determine if an object has some attribute? For example: >>> a = SomeClass() >>> a.someProperty = value >>> a.property Traceback (most recent call last): File "", line 1, in AttributeError: SomeClass instance has no attribute 'property' How can you tell if a has the attribute property before u() False String Methods - isdigit() There's also something on Unicode strings, which I'm not too familiar with Unicode - Is decimal/decimal [INST] Installing pip on Mac OS X I spent most of the day yesterday searching for a clear answer for installing pip. I can't find a good solution. Can somebody help me install it? [/INST] All you need to do is sudo easy_install pip [INST] How to read a file line by line into a list with Python How do I read every line of a file in Python and store each line as an element in list? I want to read the file line by line and each line is appended to the end of the list. [/INST] with open(fname) as f: content = f.readlines() I'm guessing that you meant list and not array. �O[INST] Python join, why is it string.join(list) instead of list.join(string)? This has always confused me. It seems like this would be nicer: my_list = ["Hello", "world"] print my_list.join("-") # Produce: "Hello-world" Than this: my_list = ["Hello", "world"] print "-".join(my_list) # Produce: "Hello-world" Is there a specific reason it does it like this? [/INST] It's because any iterable can be joined, not just lists, but the result and the "joiner" are always strings. E.G: import urllib2 print '\n############\n'.join( urllib2.urlopen('http://data.stackexchange.com/users/7095')) [INST] How to append list to second list (concatenate lists) How do I concatenate two lists in Python? Example: listone = [1, 2, 3] listtwo = [4, 5, 6] Expected outcome: joinedlist == [1, 2, 3, 4, 5, 6] [/INST] Python makes this ridiculously easy. mergedlist = listone + listtwo [INST] How to clone or copy a list? What are the options to clone or copy a list in Python? Using new_list = my_list then modifies new_list every time my_list changes. Why is this? [/INST] You have various possibilities: You can slice it: new_list = old_list[:] Alex Martelli's opinion (at least back in 2007) about this is, that it is a weird syntax and it does not make sense to use it ever. ;) (In his opinion, the next one is more readable). You can use the built in list() function: new_list = list(old_list) You can use generic copy.copy(): import copy new_list = copy.copy(old_list) This is a little slower than list() because it has to find out the datatype of old_list first. If the list contains objects and you want to copy them as well, use generic copy.deepcopy(): import copy new_list = copy.deepcopy(old_list) Obviously the slowest and most memory-needing method, but sometimes unavoidable. Example: import copy class Foo(object): def __init__(self, val): self.val = val def __repr__(self): return str(self.val) foo = Foo(1) a = ['foo', foo] b = a[:] c = list(a) d = copy.copy(a) e = copy.deepcopy(a) # edit orignal list and instance a.append('baz') foo.val = 5 print('original: %r\n slice: %r\n list(): %r\n copy: %r\n deepcopy: %r' % (a, b, c, d, e)) Result: original: ['foo', 5, 'baz'] slice: ['foo', 5] list(): ['foo', 5] copy: ['foo', 5] deepcopy: ['foo', 1] [INST] Static methods in Python? Is it possible to have static methods in Python so I can call them without initializing a class, like: ClassName.StaticMethod ( ) [/INST] Yep, using the staticmethod decorator class MyClass(object): @staticmethod def the_static_method(x): print x MyClass.the_static_method(2) # outputs 2 Note that some code might do this: try: # do something that may fail except IDontLikeYouException: # say please except YouAreBeingMeanException: # say please Is there any way that I can do something like this (since the action to take in both exceptions is to say please): try: # do something that may fail except IDontLikeYouException, YouAreBeingMeanException: # say please Now this really won't work, as it matches the syntax for: try: # do something that may fail except Exception, e: # say please So, my effort to catch the two distinct exceptions doesn't exactly come through. Is there a way to do this? [/INST] From https://docs.python.org/2/tutorial/errors.html#handling-exceptions: "An except clause may name multiple exceptions as a parenthesized tuple, for example": except (IDontLikeYouException, YouAreBeingMeanException) as e: pass Separating the exception from the variable with a comma will still work in Python 2.6 and 2.7, but is now deprecated and does not work in Python 3; now you should be using as. [INST] Finding the index of an item given a list containing it in Python For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? [/INST] >>> ["foo", "bar", "baz"].index("bar") 1 Reference: Data Structures > More on Lists [INST] Explain Python's slice notation I need a good explanation (references are a plus) on Python's slice notation. To me, this notation needs a bit of picking up. It looks extremely powerful, but I haven't quite got my head around it. [/INST] It's pretty simple really: a[start:end] # items start through end-1 a[start:] # items start through the rest of the array a[:end] # items from the beginning through end-1 a[:] # a copy of the whole array There is also the step value, which can be used with any of the above: a[start:end:step] # start through not past end, by step The key point to remember is that the :end value represents the first value that is not in the selected slice. So, the difference beween end and start is the number of elements selected (if step is 1, the default). The other feature is that start or end may be a negative number, which means it counts from the end of the array instead of the beginning. So: a[-1] # last item in the array a[-2:] # last two items in the array a[:-2] # everything except the last two items Python is kind to the programmer if there are fewer items than you ask for. For example, if you ask for a[:-2] and a only contains one element, you get an empty list instead of an error. Sometimes you would prefer the error, so you have to be aware that this may happen. [INST] Is there a way to run Python on Android? We are working on an S60 version and this platform has a nice Python API. However, there is nothing official about Python on Android, but since Jython exists, is there a way to let the snake and the robot work together? [/INST] One way is to use Kivy: Open source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps. Kivy runs on Linux, Windows, OS X, Android and iOS. You can run the same [python] code on all supported platforms. Kivy Showcase app �GLA[INST] "Least Astonishment" and the Mutable Default Argument Anyone tinkering with Python long enough has been bitten (or torn to pieces) by the following issue: def foo(a=[]): a.append(5) return a Python novices would expect this function to always return a list with only one element: [5]. The result is instead very different, and very astonishing (for a novice): >>> foo() [5] >>> foo() [5, 5] >>> foo() [5, 5, 5] >>> foo() [5, 5, 5, 5] >>> foo() A manager of mine once had his first encounter with this feature, and called it "a dramatic design flaw" of the language. I replied that the behavior had an underlying explanation, and it is indeed very puzzling and unexpected if you don't understand the internals. However, I was not able to answer (to myself) the following question: what is the reason for binding the default argument at function definition, and not at function execution? I doubt the experienced behavior has a practical use (who really used static variables in C, without breeding bugs?) Edit: Baczek made an interesting example. Together with most of your comments and Utaal's in particular, I elaborated further: >>> def a(): ... print "a executed" ... return [] ... >>> >>> def b(x=a()): ... x.append(5) ... print x ... a executed >>> b() [5] >>> b() [5, 5] To me, it seems that the design decision was relative to where to put the scope of parameters: inside the function or "together" with it? Doing the binding inside the function would mean that x is effectively bound to the specified default when the function is called, not defined, something that would present a deep flaw: the def line would be "hybrid" in the sense that part of the binding (of the function object) would happen at definition, and part (assignment of default parameters) at function invocation time. The actual behavior is more consistent: everything of that line gets evaluated when that line is executed, meaning at function definition. [/INST] Actually, this is not a design flaw, and it is not because of internals, or performance. It comes simply from the fact that functions in Python are first-class objects, and not only a piece of code. As soon as you get to think into this way, then it completely makes sense: a function is an object being evaluated on its definition; default parameters are kind of "member data" and therefore their state may change from one call to the other - exactly as in any other object. In any case, Effbot has a very nice explanation of the reasons for this behavior in Default Parameter Values in Python. I found it very clear, and I really suggest reading it for a better knowledge of how function objects work. [INST] How to list all files of a directory in Python How can I list all files of a directory in python and add them to a list? [/INST] os.listdir() will get you everything that's in a directory - files and directories. If you want just files, you could either filter this down using os.path: from os import listdir from os.path import isfile, join onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] or you could use os.walk() which will yield two lists for each directory it visits - splitting into files and dirs for you. If you only want the top directory you can just break the first time it yields from os import walk f = [] for (dirpath, dirnames, filenames) in walk(mypath): f.extend(filenames) break And lastly, as that example shows, adding one list to another you can either use .extend() or >>> q = [1, 2, 3] >>> w = [4, 5, 6] >>> q = q + w >>> q [1, 2, 3, 4, 5, 6] Personally, I prefer .extend() [INST] Accessing the index in Python 'for' loops How do I access the index itself for a list like the following? ints = [8, 23, 45, 12, 78] When I loop through it using a for loop, how do I access the loop index, from 1 to 5 in this case? [/INST] Using an additional state variable, such as an index variable (which you would normally use in languages such as C or PHP), is considered non-pythonic. The better option is to use the built-in function enumerate(), available in both Python 2 and 3: for idx, val in enumerate(ints): print(idx, val) Check out PEP 279 for more. [INST] Does Python have a string contains substring method? I'm looking for a string.contains or string.indexof method in Python. I want to do: if not somestring.contains("blah"): continue [/INST] You can use the in operator: if "blah" not in somestring: continue [INST] append vs. extend What's the difference between the list methods append() and extend()? [/INST] append: Appends object at end. x = [1, 2, 3] x.append([4, 5]) print (x) gives you: [1, 2, 3, [4, 5]] extend: Extends list by appending elements from the iterable. x = [1, 2, 3] x.extend([4, 5]) print (x) gives you: [1, 2, 3, 4, 5] [INST] What is the difference between @staticmethod and @classmethod in Python? What is the difference between a function decorated with @staticmethod and one decorated with @classmethod? [/INST] Maybe a bit of example code will help: Notice the difference in the call signatures of foo, class_foo and static_foo: class A(object): def foo(self,x): print "executing foo(%s,%s)"%(self,x) @classmethod def class_foo(cls,x): print "executing class_foo(%s,%s)"%(cls,x) @staticmethod def static_foo(x): print "executing static_foo(%s)"%x a=A() Below is the usual way an object instance calls a method. The object instance, a, is implicitly passed as the first argument. a.foo(1) # executing foo(<__main__.A object at 0xb7dbef0c>,1) With classmethods, the class of the object instance is implicitly passed as the first argument instead of self. a.class_foo(1) # executing class_foo(,1) You can also call class_foo using the class. In fact, if you define something to be a classmethod, it is probably because you intend to call it from the class rather than from a class instance. A.foo(1) would have raised a TypeError, but A.class_foo(1) works just fine: A.class_foo(1) # executing class_foo(,1) One use people have found for class methods is to create inheritable alternative constructors. With staticmethods, neither self (the object instance) nor cls (the class) is implicitly passed as the first argument. They behave like plain functions except that you can call them from an instance or the class: a.static_foo(1) # executing static_foo(1) A.static_foo('hi') # executing static_foo(hi) Staticmethods are used to group functions which have some logical connection with a class to the class. foo is just a function, but when you call a.foo you don't just get the function, you get a "partially applied" version of the function with the object instance a bound as the first argument to the function. foo expects 2 arguments, while a.foo only expects 1 argument. a is bound to foo. That is what is meant by the term "bound" below: print(a.foo) # > With a.class_foo, a is not bound to class_foo, rather the class A is bound to class_foo. print(a.class_foo) # > Here, with a staticmethod, even though it is a method, a.static_foo just returns a good 'ole function with no arguments bound. static_foo expects 1 argument, and a.static_foo expects 1 argument too. print(a.static_foo) # And of course the same thing happens when you call static_foo with the class A instead. print(A.static_foo) # [INST] Best way to check if a list is empty For example, if passed the following: a = [] How do I check to see if a is empty? [/INST] if not a: print("List is empty") Using the implicit booleanness of the empty list a is quite pythonic. [INST] How do I install pip on Windows? pip is a replacement for easy_install. But should I install pip using easy_install on Windows? Is there a better way? [/INST] Python 2.7.9+ and 3.4+ Good news! Python 3.4 (released March 2014) and Python 2.7.9 (released December 2014) ship with Pip. This is the best feature of any Python release. It makes the community's wealth of libraries accessible to everyone. Newbies are no longer excluded from using community libraries by the prohibitive difficulty of setup. In shipping with a package manager, Python joins Ruby, Node.js, Haskell, Perl, Go--almost every other contemporary language with a majority open-source community. Thank you Python. Of course, that doesn't mean Python packaging is problem solved. The experience remains frustrating. I discuss this in Stack Overflow question Does Python have a package/module management system?. And, alas for everyone using Python 2.7.8 or earlier (a sizable portion of the community). There's no plan to ship Pip to you. Manual instructions follow. Python 2 ≤ 2.7.8 and Python 3 ≤ 3.3 Flying in the face of its 'batteries included' motto, Python ships without a package manager. To make matters worse, Pip was--until recently--ironically difficult to install. Official instructions Per http://www.pip-installer.org/en/latest/installing.html: Download get-pip.py, being careful to save it as a .py file rather than .txt. Then, run it from the command prompt: python get-pip.py You possibly need an administrator command prompt to do this. Follow Start a Command Prompt as an Administrator (Microsoft TechNet). Alternative instructions The official documentation tells users to install Pip and each of its dependencies from source. That's tedious for the experienced, and prohibitively difficult for newbies. For our sake, Christoph Gohlke prepares Windows installers (.msi) for popular Python packages. He builds installers for all Python versions, both 32 and 64 bit. You need to Install setuptools Install pip For me, this installed Pip at C:\Python27\Scripts\pip.exe. Find pip.exe on your computer, then add its folder (for example, C:\Python27\Scripts) to your path (Start / Edit environment variables). Now you should be able to run pip from the command line. Try installing a package: pip install httpie There you go (hopefully)! Solutions for common problems are given below: Proxy problems If you work in an office, you might be behind a HTTP proxy. If so, set the environment variables http_proxy and https_proxy. Most Python applications (and other free software) respect these. Example syntax: http://proxy_url:port http://username:password@proxy_url:port If you're really unlucky, your proxy might be a Microsoft NTLM proxy. Free software can't cope. The only solution is to install a free software friendly proxy that forwards to the nasty proxy. http://cntlm.sourceforge.net/ Unable to find vcvarsall.bat Python modules can be part written in C or C++. Pip tries to compile from source. If you don't have a C/C++ compiler installed and configured, you'll see this cryptic error message. Error: Unable to find vcvarsall.bat You can fix that by installing a C++ compiler such as MinGW or Visual C++. Microsoft actually ship one specifically for use with Python. Or try Microsoft Visual C++ Compiler for Python 2.7. Often though it's easier to check Christoph's site for your package. [INST] Using global variables in a function other than the one that created them If I create a global variable in one function, how can I use that variable in another function? Do I need to store the global variable in a local variable of the function which needs its access? [/INST] You can use a global variable in other functions by declaring it as global in each function that assigns to it: globvar = 0 def set_globvar_to_one(): global globvar # Needed to modify global copy of globvar globvar = 1 def print_globvar(): print globvar # No need for global declaration to read value of globvar set_globvar_to_one() print_globvar() # Prints 1 I imagine the reason for it is that, since global variables are so dangerous, Python wants to make sure that you really know that's what you're playing with by explicitly requiring the global keyword. See other answers if you want to share a global variable across modules. [INST] How to check if a directory exists and create it if necessary? What is the most elegant way to check if the directory a file is going to be written to exists, and if not, create the directory using Python? Here is what I tried: filename = "/my/directory/filename.txt" dir = os.path.dirname(filename) try: os.stat(dir) except: os.mkdir(dir) f = file(filename) Somehow, I missed os.path.exists (thanks kanja, Blair, and Douglas). This is what I have now: def ensure_dir(f): d = os.path.dirname(f) if not os.path.exists(d): os.makedirs(d) Is there a flag for "open", that makes this happen automatically? [/INST] I see two answers with good qualities, each with a small flaw, so I will give my take on it: Try os.path.exists, and consider os.makedirs for the creation. if not os.path.exists(directory): os.makedirs(directory) As noted in comments and elsewhere, there's a race condition - if the directory is created between the os.path.exists and the os.makedirs calls, the os.makedirs will fail with an OSError. Unfortunately, blanket-catching OSError and continuing is not foolproof, as it will ignore a failure to create the directory due to other factors, such as insufficient permissions, full disk, etc. One option would be to trap the OSError and examine the embedded error code, if one knew what's what (on my OS, 13 seems to indicate that permission is denied, and 17 that the file exists - it's not clear that that's even remotely portable, but is explored in Is there a cross-platform way of getting information from Python’s OSError). Alternatively, there could be a second os.path.exists, but suppose another created the directory after the first check, then removed it before the second one - we could still be fooled. Depending on the application, the danger of concurrent operations may be more or less than the danger posed by other factors such as file permissions. The developer would have to know more about the particular application being developed and its expected environment before choosing an implementation. [INST] Sort a Python dictionary by value I have a dictionary of values read from two fields in a database: a string field and a numeric field. The string field is unique, so that is the key of the dictionary. I can sort on the keys, but how can I sort based on the values? Note: I have read Stack Overflow question How do I sort a list of dictionaries by values of the dictionary in Python? and probably could change my code to have a list of dictionaries, but since I do not really need a list of dictionaries I wanted to know if there is a simpler solution. [/INST] It is not possible to sort a dict, only to get a representation of a dict that is sorted. Dicts are inherently orderless, but other types, such as lists and tuples, are not. So you need a sorted representation, which will be a list—probably a list of tuples. For instance, import operator x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0} sorted_x = sorted(x.items(), key=operator.itemgetter(1)) sorted_x will be a list of tuples sorted by the second element in each tuple. dict(sorted_x) == x. And for those wishing to sort on keys instead of values: import operator x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0} sorted_x = sorted(x.items(), key=operator.itemgetter(0)) [INST] How to merge two Python dictionaries in a single expression? I have two Python dictionaries, and I want to write a single expression that returns these two dictionaries, merged. The update() method would be what I need, if it returned its result instead of modifying a dict in-place. >>> x = {'a':1, 'b': 2} >>> y = {'b':10, 'c': 11} >>> z = x.update(y) >>> print z None >>> x {'a': 1, 'b': 10, 'c': 11} How can I get that final merged dict in z, not x? (To be extra-clear, the last-one-wins conflict-handling of dict.update() is what I'm looking for as well.) [/INST] In your case, what you can do is: z = dict(x.items() + y.items()) This will, as you want it, put the final dict in z, and make the value for key b be properly overridden by the second (y) dict's value: >>> x = {'a':1, 'b': 2} >>> y = {'b':10, 'c': 11} >>> z = dict(x.items() + y.items()) >>> z {'a': 1, 'c': 11, 'b': 10} If you use Python 3, it is only a little more complicated. To create z: >>> z = dict(list(x.items()) + list(y.items())) >>> z {'a': 1, 'c': 11, 'b': 10} #[INST] What does `if __name__ == "__main__":` do? What does the if __name__ == "__main__": do? # Threading example import time, thread def myfunction(string, sleeptime, lock, *args): while 1: lock.acquire() time.sleep(sleeptime) lock.release() time.sleep(sleeptime) if __name__ == "__main__": lock = thread.allocate_lock() thread.start_new_thread(myfunction, ("Thread #: 1", 2, lock)) thread.start_new_thread(myfunction, ("Thread #: 2", 2, lock)) [/INST] When the Python interpreter reads a source file, it executes all of the code found in it. Before executing the code, it will define a few special variables. For example, if the python interpreter is running that module (the source file) as the main program, it sets the special __name__ variable to have a value "__main__". If this file is being imported from another module, __name__ will be set to the module's name. In the case of your script, let's assume that it's executing as the main function, e.g. you said something like python threading_example.py on the command line. After setting up the special variables, it will execute the import statement and load those modules. It will then evaluate the def block, creating a function object and creating a variable called myfunction that points to the function object. It will then read the if statement and see that __name__ does equal "__main__", so it will execute the block shown there. One of the reasons for doing this is that sometimes you write a module (a .py file) where it can be executed directly. Alternatively, it can also be imported and used in another module. By doing the main check, you can have that code only execute when you want to run the module as a program and not have it execute when someone just wants to import your module and call your functions themselves. See this page for some extra details. [INST] Calling an external command in Python How can I call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script? [/INST] Look at the subprocess module in the stdlib: from subprocess import call call(["ls", "-l"]) The advantage of subprocess vs system is that it is more flexible (you can get the stdout, stderr, the "real" status code, better error handling, etc...). I think os.system is deprecated, too, or will be: https://docs.python.org/2/library/subprocess.html#replacing-older-functions-with-the-subprocess-module For quick/dirty/one time scripts, os.system is enough, though. [INST] Does Python have a ternary conditional operator? If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs? [/INST] Yes, it was added in version 2.5. The syntax is: a if condition �"w�h^_������������V| |x����~�"i&�3�4�?�@ BXD H�RX���L����TKZr[Ha*ekf�h2q�rt�xU�1�݌&�g�=�������� ��U��{�n�����Ŵ��&������V���x���H)�������!������f�������j��C���k� n���� (8-�8�;$>����GA�D�FN�Q�W�Y9[�ceimsp�qv����|3��>�������$�;� ���ի�������z����9��g���W��������!����?�g��l������!�����"�/�2N5�:<<�?=B3R�T X7Y�[=^�����`Wf&i�n\uBz'�e�Y���Ho��˜"�a�5���i�Z�/��;�D�M�����y���������f% 7#����P%�*�0�5g9�:�E�K�SCWAZxa�d�i�l�o�u,z�}��˂�����������J�l�|��v����#*��z�-�A�A����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[INST] How to sort a list of objects in Python, based on an attribute of the objects? I've got a list of Python objects that I'd like to sort by an attribute of the objects themselves. The list looks like: >>> ut [, , , , , , ...] Each object has a count: >>> ut[1].count 1L I need to sort the list by number of counts descending. I've seen several methods for this, but I'm looking for best practice in Python. [/INST] # To sort the list in place... ut.sort(key=lambda x: x.count, reverse=True) # To return a new list, use the sorted() built-in function... newlist = sorted(ut, key=lambda x: x.count, reverse=True) More on sorting by keys » [INST] How do you get the logical xor of two variables in Python? How do you get the logical xor of two variables in Python? For example, I have two variables that I expect to be strings. I want to test that only one of them contains a True value (is not None or the empty string): str1 = raw_input("Enter string one:") str2 = raw_input("Enter string two:") if logical_xor(str1, str2): print "ok" else: print "bad" The ^ operator seems to be bitwise, and not defined on all objects: >>> 1 ^ 1 0 >>> 2 ^ 1 3 >>> "abc" ^ "" Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for ^: 'str' and 'str' [/INST] If you're already normalizing the inputs to booleans, then != is xor. bool(a) != bool(b) [INST] How to parse an ISO 8601-formatted date in Python? I need to parse RFC 3339 strings like "2008-09-03T20:56:35.450686Z" into Python's datetime type. I have found strptime in the Python standard library, but it is not very convenient. What is the best way to do this? [/INST] The python-dateutil package can parse not only RFC 3339 datetime strings like the one in the question, but also other ISO 8601 date and time strings that don't comply with RFC 3339 (such as ones with no UTC offset, or ones that represent only a date). >>> import dateutil.parser >>> dateutil.parser.parse('2008-09-03T20:56:35.450686Z') # RFC 3339 format datetime.datetime(2008, 9, 3, 20, 56, 35, 450686, tzinfo=tzutc()) >>> dateutil.parser.parse('2008-09-03T20:56:35.450686') # ISO 8601 extended format datetime.datetime(2008, 9, 3, 20, 56, 35, 450686) >>> dateutil.parser.parse('20080903T205635.450686') # ISO 8601 basic format datetime.datetime(2008, 9, 3, 20, 56, 35, 450686) >>> dateutil.parser.parse('20080903') # ISO 8601 basic format, date only datetime.datetime(2008, 9, 3, 0, 0) [INST] How to make a class JSON serializable How to make a Python class serializable? A simple class: class FileItem: def __init__(self, fname): self.fname = fname What should I do to be able to get output of: json.dumps() Without an error (FileItem instance at ... is not JSON serializable) [/INST] Here is a simple solution for a simple feature: .toJSON() Method Instead of a JSON serializable class, implement a serializer method: import json class Object: def toJSON(self): return json.dumps(self, default=lambda o: o.__dict__, sort_keys=True, indent=4) So you just call it to serialize: me = Object() me.name = "Onur" me.age = 35 me.dog = Object() me.dog.name = "Apollo" print(me.toJSON()) will output: { "age": 35, "dog": { "name": "Apollo" }, "name": "Onur" } [INST] What is the Python equivalent of static variables inside a function? What is the idiomatic Python equivalent of this C/C++ code? void foo() { static int counter = 0; counter++; printf("counter is %d\n", counter); } specifically, how does one implement the static member at the function level, as opposed to the class level? And does placing the function into a class change anything? [/INST] A bit reversed, but this should work: def foo(): foo.counter += 1 print "Counter is %d" % foo.counter foo.counter = 0 If you want the counter initialization code at the top instead of the bottom, you can create a decorator: def static_var(varname, value): def decorate(func): setattr(func, varname, value) return func return decorate Then use the code like this: @static_var("counter", 0) def foo(): foo.counter += 1 print "Counter is %d" % foo.counter It'll still require you to use the foo. prefix, unfortunately. EDIT (thanks to ony): This looks even nicer: def static_vars(**kwargs): def decorate(func): for k in kwargs: setattr(func, k, kwargs[k]) return func return decorate @static_vars(counter=0) def foo(): foo.counter += 1 print "Counter is %d" % foo.counter [INST] How do I install a Python package with a .whl file? I'm having trouble installing a Python package (specifically, JPype1 0.5.7) on my Windows machine, and would like to install it with Christoph Gohlke's Window binaries. (Which, to my experience, alleviated much of the fuss for many other package installations.) However, while Christoph used to provide .exe files in the past, recently it seems he's uploading .whl files instead. http://www.lfd.uci.edu/~gohlke/pythonlibs/#jpype But how do I install .whl files? Notes: I've found documents on wheel, but they don't seem so staightforward in explaining how to install .whl files. This question is a duplicate with this question, which wasn't directly answered. [/INST] I just used the following which was quite simple. First open a console then cd to where you've downloaded your file like some-package.whl and use pip install some-package.whl Note: if pip.exe is not recognized, you may find it in the "Scripts" directory from where python has been installed. If pip is not installed, this page can help: How do I install pip on Windows? Note: for clarification If you copy the *.whl file to your local drive (ex. C:\some-dir\some-file.whl) use the following command line parameters -- pip install C:/some-dir/some-file.whl [INST] Python's use of __new__ and __init__? I'm just trying to streamline one of my classes and have introduced some functionality in the same style as the flyweight design pattern. However, I'm a bit confused as to why __init__ is always called after __new__. I wasn't expecting this. Can anyone tell me why this is happening and how I implement this functionality otherwise? (apart from putting the implementation into the __new__ which feels quite hacky). Here's an example: class A(object): _dict = dict() def __new__(cls): if 'key' in A._dict: print "EXISTS" return A._dict['key'] else: print "NEW" return super(A, cls).__new__(cls) def __init__(self): print "INIT" A._dict['key'] = self print "" a1 = A() a2 = A() a3 = A() Outputs: NEW INIT EXISTS INIT EXISTS INIT Why? [/INST] Use __new__ when you need to control the creation of a new instance. Use __init__ when you need to control initialization of a new instance. __new__ is the first step of instance creation. It's called first, and is responsible for returning a new instance of your class. In contrast, __init__ doesn't return anything; it's only responsible for initializing the instance after it's been created. In general, you shouldn't need to override __new__ unless you're subclassing an immutable type like str, int, unicode or tuple. From: http://mail.python.org/pipermail/tutor/2008-April/061426.html You should consider that what you are trying to do is usually done with a Factory and that's the best way to do it. Using __new__ is not a good clean solution so please consider the usage of a factory. Here you have a good factory example. [INST] Use a Glob() to find files recursively in Python? This is what I have: glob(os.path.join('src','*.c')) but I want to search the subfolders of src. Something like this would work: glob(os.path.join('src','*.c')) glob(os.path.join('src','*','*.c')) glob(os.path.join('src','*','*','*.c')) glob(os.path.join('src','*','*','*','*.c')) But this is obviously limited and clunky. [/INST] Python 3.5+ Starting with Python version 3.5, the glob module supports the "**" directive (which is parsed only if you pass recursive flag): import glob for filename in glob.iglob('src/**/*.c', recursive=True): print(filename) If you need an list, just use glob.glob instead of glob.iglob. Python 2.2 to 3.4 For older Python versions, starting with Python 2.2, use os.walk to recursively walk a directory and fnmatch.filter to match against a simple expression: import fnmatch import os matches = [] for root, dirnames, filenames in os.walk('src'): for filename in fnmatch.filter(filenames, '*.c'): matches.append(os.path.join(root, filename)) Python 2.1 and earlier For even older Python versions, use glob.glob against each filename instead of fnmatch.filter. H�[INST] Good way to append to a string I want an efficient way to append string to another. Is there any good built-in method to use? [/INST] If you only have one reference to a string and you concatenate another string to the end, CPython now special cases this and tries to extend the string in place. The end result is that the operation is amortized O(n) eg s = "" for i in range(n): s+=str(n) used to be O(n^2), but now it is O(n) From the source (bytesobject.c) void PyBytes_ConcatAndDel(register PyObject **pv, register PyObject *w) { PyBytes_Concat(pv, w); Py_XDECREF(w); } /* The following function breaks the notion that strings are immutable: it changes the size of a string. We get away with this only if there is only one module referencing the object. You can also think of it as creating a new string object and destroying the old one, only more efficiently. In any case, don't use this if the string may already be known to some other part of the code... Note that if there's not enough memory to resize the string, the original string object at *pv is deallocated, *pv is set to NULL, an "out of memory" exception is set, and -1 is returned. Else (on success) 0 is returned, and the value in *pv may or may not be the same as on input. As always, an extra byte is allocated for a trailing \0 byte (newsize does *not* include that), and a trailing \0 byte is stored. */ int _PyBytes_Resize(PyObject **pv, Py_ssize_t newsize) { register PyObject *v; register PyBytesObject *sv; v = *pv; if (!PyBytes_Check(v) || Py_REFCNT(v) != 1 || newsize < 0) { *pv = 0; Py_DECREF(v); PyErr_BadInternalCall(); return -1; } /* XXX UNREF/NEWREF interface should be more symmetrical */ _Py_DEC_REFTOTAL; _Py_ForgetReference(v); *pv = (PyObject *) PyObject_REALLOC((char *)v, PyBytesObject_SIZE + newsize); if (*pv == NULL) { PyObject_Del(v); PyErr_NoMemory(); return -1; } _Py_NewReference(*pv); sv = (PyBytesObject *) *pv; Py_SIZE(sv) = newsize; sv->ob_sval[newsize] = '\0'; sv->ob_shash = -1; /* invalidate cached hash value */ return 0; } It's easy enough to verify empirically $ python -m timeit -s"s=''" "for i in xrange(10):s+='a'" 1000000 loops, best of 3: 1.85 usec per loop $ python -m timeit -s"s=''" "for i in xrange(100):s+='a'" 10000 loops, best of 3: 16.8 usec per loop $ python -m timeit -s"s=''" "for i in xrange(1000):s+='a'" 10000 loops, best of 3: 158 usec per loop $ python -m timeit -s"s=''" "for i in xrange(10000):s+='a'" 1000 loops, best of 3: 1.71 msec per loop $ python -m timeit -s"s=''" "for i in xrange(100000):s+='a'" 10 loops, best of 3: 14.6 msec per loop $ python -m timeit -s"s=''" "for i in xrange(1000000):s+='a'" 10 loops, best of 3: 173 msec per loop It's important however to note that this optimisation isn't part of the Python spec. It's only in the cPython implementation as far as I know. The same empirical testing on pypy or jython for example might show the older O(n**2) performance $ pypy -m timeit -s"s=''" "for i in xrange(10):s+='a'" 10000 loops, best of 3: 90.8 usec per loop $ pypy -m timeit -s"s=''" "for i in xrange(100):s+='a'" 1000 loops, best of 3: 896 usec per loop $ pypy -m timeit -s"s=''" "for i in xrange(1000):s+='a'" 100 loops, best of 3: 9.03 msec per loop $ pypy -m timeit -s"s=''" "for i in xrange(10000):s+='a'" 10 loops, best of 3: 89.5 msec per loop So far so good, but then $ pypy -m timeit -s"s=''" "for i in xrange(100000):s+='a'" 10 loops, best of 3: 12.8 sec per loop ouch even worse than quadratic. So pypy is doing something that works well with short strings, but performs poorly for larger strings [INST] How can I tell if a string repeats itself in Python? I'm looking for a way to test whether or not a given string repeats itself for the entire string or not. Examples: [ '0045662100456621004566210045662100456621', # '00456621' '0072992700729927007299270072992700729927', # '00729927' '001443001443001443001443001443001443001443', # '001443' '037037037037037037037037037037037037037037037', # '037' '047619047619047619047619047619047619047619', # '047619' '002457002457002457002457002457002457002457', # '002457' '001221001221001221001221001221001221001221', # '001221' '001230012300123001230012300123001230012300123', # '00123' '0013947001394700139470013947001394700139470013947', # '0013947' '001001001001001001001001001001001001001001001001001', # '001' '001406469760900140646976090014064697609', # '0014064697609' ] are strings which repeat themselves, and [ '004608294930875576036866359447', '00469483568075117370892018779342723', '004739336492890995260663507109', '001508295625942684766214177978883861236802413273', '007518796992481203', '0071942446043165467625899280575539568345323741', '0434782608695652173913', '0344827586206896551724137931', '002481389578163771712158808933', '002932551319648093841642228739', '0035587188612099644128113879', '003484320557491289198606271777', '00115074798619102416570771', ] are examples of ones that do not. The repeating sections of the strings I'm given can be quite long, and the strings themselves can be 500 or more characters, so looping through each character trying to build a pattern then checking the pattern vs the rest of the string seems awful slow. Multiply that by potentially hundreds of strings and I can't see any intuitive solution. I've looked into regexes a bit and they seem good for when you know what you're looking for, or at least the length of the pattern you're looking for. Unfortunately, I know neither. How can I tell if a string is repeating itself and if it is, what the shortest repeating subsequence is? [/INST] Here's a concise solution which avoids regular expressions and slow in-Python loops: def principal_period(s): i = (s+s).find(s, 1, -1) return None if i == -1 else s[:i] See the Community Wiki answer started by @davidism for benchmark results. In summary, David Zhang's solution is the clear winner, outperforming all others by at least 5x for the large example set. (That answer's words, not mine.) This is based on the observation that a string is periodic if and only if it is equal to a nontrivial rotation of itself. Kudos to @AleksiTorhamo for realizing that we can then recover the principal period from the index of the first occurrence of s in (s+s)[1:-1], and for informing me of the optional start and end arguments of Python's string.find. [INST] Build a Basic Python Iterator How would one create an iterative function (or iterator object) in python? [/INST] Iterator objects in python conform to the iterator protocol, which basically means they provide two methods: __iter__() and next(). The __iter__ returns the iterator object and is implicitly called at the start of loops. The next() method returns the next value and is implicitly called at each loop increment. next() raises a StopIteration exception when there are no more value to return, which is implicitly captured by looping constructs to stop iterating. Here's a simple example of a counter: class Counter: def __init__(self, low, high): self.current = low self.high = high def __iter__(self): return self def next(self): # Python 3: def __next__(self) if self.current > self.high: raise StopIteration else: self.current += 1 return self.current - 1 for c in Counter(3, 8): print c This will print: 3 4 5 6 7 8 This is easier to write using a generator, as covered in a previous answer: def counter(low, high): current = low while current <= high: yield current current += 1 for c in counter(3, 8): print c The printed output will be the same. Under the hood, the generator object supports the iterator protocol and does something roughly similar to the class Counter. David Mertz's article, Iterators and Simple Generators, is a pretty good introduction. [INST] how to detect whether a python variable is a function? I have a variable, x, and I want to know whether it is pointing to a function or not. I had hoped I could do something like: >>> isinstance(x, function) But that gives me: Traceback (most recent call last): File "", line 1, in ? NameError: name 'function' is not defined The reason I picked that is because >>> type(x) [/INST] If this is for Python 2.x or for Python 3.2+, you can also use callable(). It used to be deprecated, but is now undeprecated, so you can use it again. You can read the discussion here: http://bugs.python.org/issue10518. You can do this with: callable(obj) If this is for Python 3.x but before 3.2, check if the object has a __call__ attribute. You can do this with: hasattr(obj, '__call__') The oft-suggested types.FunctionTypes approach is not correct because it fails to cover many cases that you would presumably want it to pass, like with builtins: >>> isinstance(open, types.FunctionType) False >>> callable(open) True The proper way to check properties of duck-typed objects is to ask them if they quack, not to see if they fit in a duck-sized container. Don't use types.FunctionType unless you have a very specific idea of what a function is. [INST] Is there any pythonic way to combine two dicts (adding values for keys that appear in both)? For example I have two dicts: Dict A: {'a':1, 'b':2, 'c':3} Dict B: {'b':3, 'c':4, 'd':5} I need a pythonic way of 'combining' two dicts such that the result is : {'a':1, 'b':5, 'c':7, 'd':5} That is to say: if a key appears in both dicts, add their values, if it appears in only one dict, keep its value. [/INST] Use collections.Counter: >>> from collections import Counter >>> A = Counter({'a':1, 'b':2, 'c':3}) >>> B = Counter({'b':3, 'c':4, 'd':5}) >>> A + B Counter({'c': 7, 'b': 5, 'd': 5, 'a': 1}) Counters are basically a subclass of dict, so you can still do everything else with them you'd normally do with that type, such as iterate over their keys and values. [INST] Convert Python dict to object? I'm searching for an elegant way to convert a normal Python dict with some nested dicts to an object. For example: >>> d = {'a': 1, 'b': {'c': 2}, 'd': ["hi", {'foo': "bar"}]} Should be accessible in this way: >>> x = dict2obj(d) >>> x.a 1 >>> x.b.c 2 >>> x.d[1].foo bar I think, this is not possible without recursion, but what would be a nice way to get an objectstyle for dicts? Thank you in advance. [/INST] Update: In Python 2.6 and onwards, consider whether the namedtuple data structure suits your needs: >>> from collections import namedtuple >>> MyStruct = namedtuple('MyStruct', 'a b d') >>> s = MyStruct(a=1, b={'c': 2}, d=['hi']) >>> s MyStruct(a=1, b={'c': 2}, d=['hi']) >>> s.a 1 >>> s.b {'c': 2} >>> s.c >>> s.d ['hi'] The alternative (original answer contents) is: class Struct: def __init__(self, **entries): self.__dict__.update(entries) Then, you can use: >>> args = {'a': 1, 'b': 2} >>> s = Struct(**args) >>> s <__main__.Struct instance at 0x01D6A738> >>> s.a 1 >>> s.b 2 [INST] Remove empty strings from a list of strings I want to remove all empty strings from a list of strings in python. My idea looks like this: while '' in str_list: str_list.remove('') Is there any more pythonic way to do this? [/INST] I would use filter: str_list = filter(None, str_list) # fastest str_list = filter(bool, str_list) # fastest str_list = filter(len, str_list) # a bit of slower str_list = filter(lambda item: item, str_list) # slower than list comprehension Python 3 returns an iterator from filter, so should be wrapped in a call to list() str_list = list(filter(None, str_list)) # fastest (etc.) Tests: >>> timeit('filter(None, str_list)', 'str_list=["a"]*1000', number=100000) 2.4797441959381104 >>> timeit('filter(bool, str_list)', 'str_list=["a"]*1000', number=100000) 2.4788150787353516 >>> timeit('filter(len, str_list)', 'str_list=["a"]*1000', number=100000) 5.2126238346099854 >>> timeit('[x for x in str_list if x]', 'str_list=["a"]*1000', number=100000) 13.354584932327271 >>> timeit('filter(lambda item: item, str_list)', 'str_list=["a"]*1000', number=100000) 17.427681922912598 [INST] What is the naming convention in Python for variable and function names? Coming from a C# background the naming convention for variables and method names are usually either CamelCase or Pascal Case: // C# example string thisIsMyVariable = "a" public void ThisIsMyMethod() In Python, I have seen the above but I have also seen underscores being used: # python example this_is_my_variable = 'a' def this_is_my_function(): Is there a more preferable, definitive coding style for Python? [/INST] See Python PEP 8. Function names should be lowercase, with words separated by underscores as necessary to improve readability. mixedCase is allowed only in contexts where that's already the prevailing style Variables... Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability. Personally, I deviate from this because I also prefer mixedCase over lower_case for my own projects. [INST] What is the standard Python docstring format? I have seen a few different styles of writing docstrings in Python, is there an official or "agreed-upon" style? [/INST] The Google style guide contains an excellent Python style guide. It includes conventions for readable docstring syntax that offers better guidance than PEP-257. For example: def square_root(n): """Calculate the square root of a number. Args: n: the number to get the square root of. Returns: the square root of n. Raises: TypeError: if n is not a number. ValueError: if n is negative. """ pass I like to extend this to also include type information in the arguments, as described in this Sphinx documentation tutorial. For example: def add_value(self, value): """Add a new value. Args: value (str): the value to add. """ pass [INST] Non-blocking read on a subprocess.PIPE in python I'm using the subprocess module to start a subprocess and connect to it's output stream (stdout). I want to be able to execute non-blocking reads on its stdout. Is there a way to make .readline non-blocking or to check if there is data on the stream before I invoke .readline? I'd like this to be portable or at least work under Windows and Linux. here is how I do it for now (It's blocking on the .readline if no data is avaible): p = subprocess.Popen('myprogram.exe', stdout = subprocess.PIPE) output_str = p.stdout.readline() [/INST] fcntl, select, asyncproc won't help in this case. A reliable way to read a stream without blocking regardless of operating system is to use Queue.get_nowait(): import sys from subprocess import PIPE, Popen from threading import Thread try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty # python 3.x ON_POSIX = 'posix' in sys.builtin_module_names def enqueue_output(out, queue): for line in iter(out.readline, b''): queue.put(line) out.close() p = Popen(['myprogram.exe'], stdout=PIPE, bufsize=1, close_fds=ON_POSIX) q = Queue() t = Thread(target=enqueue_output, args=(p.stdout, q)) t.daemon = True # thread dies with the program t.start() # ... do other things here # read line without blocking try: line = q.get_nowait() # or q.get(timeout=.1) except Empty: print('no output yet') else: # got line # ... do something with line [INST] open() in Python does not create a file if it doesn't exist What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it as read/write? From what I read, file = open('myfile.dat', 'rw') should do this, right? It is not working for me (Python 2.6.2) and I'm wondering if it is a version problem, or not supposed to work like that or what. The bottom line is, I just need a solution for the problem. I am curious about the other stuff, but all I need is a nice way to do the opening part. UPDATE: the enclosing directory was writeable by user and group, not other (I'm on a Linux system... so permissions 775 in other words), and the exact error was: IOError: no such file or directory. [/INST] You should use file = open('myfile.dat', 'w+') [INST] Converting a String to Dictionary? How can I convert the str representation of a dict, such as the following string, into a dict? s = "{'muffin' : 'lolz', 'foo' : 'kitty'}" I prefer not to use eval. What else can I use? The main reason for this, is one of my coworkers classes he wrote, converts all input into strings. I'm not in the mood to go and modify his classes, to deal with this issue. [/INST] Starting in Python 2.6 you can use the built-in ast.literal_eval: >>> import ast >>> ast.literal_eval("{'muffin' : 'lolz', 'foo' : 'kitty'}") {'muffin': 'lolz', 'foo': 'kitty'} This is safer than using eval. As its own docs say: >>> help(ast.literal_eval) Help on function literal_eval in module ast: literal_eval(node_or_string) Safely evaluate an expression node or a string containing a Python expression. The string or node provided may only consist of the following Python literal structures: strings, numbers, tuples, lists, dicts, booleans, and None. For example: >>> eval("shutil.rmtree('mongo')") Traceback (most recent call last): File "", line 1, in File "", line 1, in File "/opt/Python-2.6.1/lib/python2.6/shutil.py", line 208, in rmtree onerror(os.listdir, path, sys.exc_info()) File "/opt/Python-2.6.1/lib/python2.6/shutil.py", line 206, in rmtree names = os.listdir(path) OSError: [Errno 2] No such file or directory: 'mongo' >>> ast.literal_eval("shutil.rmtree('mongo')") Traceback (most recent call last): File "", line 1, in File "/opt/Python-2.6.1/lib/python2.6/ast.py", line 68, in literal_eval return _convert(node_or_string) File "/opt/Python-2.6.1/lib/python2.6/ast.py", line 67, in _convert raise ValueError('malformed string') ValueError: malformed string [INST] List filtering: list comprehension vs. lambda + filter I happened to find myself having a basic filtering need: I have a list and I have to filter it by an attribute of the items. My code looked like this: my_list = [x for x in my_list if x.attribute == value] But then I thought, wouldn't it be better to write it like this? my_list = filter(lambda x: x.attribute == value, my_list) It's more readable, and if needed for performance the lambda could be taken out to gain something. Question is: are there any caveats in using the second way? Any performance difference? Am I missing the Pythonic Way™ entirely and should do it in yet another way (such as using itemgetter instead of the lambda)? [/INST] It is strange how much beauty varies for different people. I find the list comprehension much clearer than the ugly filter+lambda, but use whichever you find easier. However, do stop giving your variables names already used for builtins, that's just ugly, and not open for discussion. There are two things that may slow down your use of filter. The first is the function call overhead: as soon as you use a Python function (whether created by def or lambda) it is likely that filter will be slower than the list comprehension. It almost certainly is not enough to matter, and you shouldn't think much about performance until you've timed your code and found it to be a bottleneck, but the difference will be there. The other overhead that might apply is that the lambda is being forced to access a scoped variable (value). That is slower than accessing a local variable and in Python 2.x the list comprehension only accesses local variables. If you are using Python 3.x the list comprehension runs in a separate function so it will also be accessing value through a closure and this difference won't apply. The other option to consider is to use a generator instead of a list comprehension: def filterbyvalue(seq, value): for el in seq: if el.attribute==value: yield el Then in your main code (which is where readability really matters) you've replaced both list comprehension and filter with a hopefully meaningful function name. [INST] Convert date to datetime in Python Silly question, but is there a built-in method for converting a date to a datetime in Python, ie. getting the datetime for the midnight of the date? The opposite conversion is easy - datetime has a .date() method. Do I really have to manually call datetime(d.year, d.month, d.day) ? [/INST] You can use datetime.combine(date, time); for the time, you create a datetime.time object initialized to midnight. from datetime import date from datetime import datetime d = date.today() datetime.combine(d, datetime.min.time()) [INST] How can I subtract a day from a Python date? I have a Python datetime.datetime object. What is the best way to subtract one day? [/INST] You can use a timedelta object: from datetime import datetime, timedelta d = datetime.today() - timedelta(days=days_to_subtract) [INST] fatal error: Python.h: No such file or directory I am trying to build a shared library using a C extension file but first I have to generate the output file using the command below: gcc -Wall utilsmodule.c -o Utilc After executing the command, I get this error message: utilsmodule.c:1:20: fatal error: Python.h: No such file or directory compilation terminated. in fact I have tried all the suggested solutions over the internet but the problem still exists ... also I have no problem with Python.h. I managed to locate the file on my machine ... anybody has faced the same problem before?? [/INST] Looks like you haven't properly installed the header files and static libraries for python dev. Use your package manager to install them system-wide. For apt (ubuntu, debian...): sudo apt-get install python-dev # for python2.x installs sudo apt-get install python3-dev # for python3.x installs For yum (centos, redhat, fedora...): sudo yum install python-devel [INST] JSON datetime between Python and JavaScript I want to send a datetime.datetime object in serialized form from Python using JSON and de-serialize in JavaScript using JSON. What is the best way to do this? [/INST] You can add the 'default' parameter to json.dumps to handle this: date_handler = lambda obj: ( obj.isoformat() if isinstance(obj, datetime.datetime) or isinstance(obj, datetime.date) else None ) json.dumps(datetime.datetime.now(), default=date_handler) '"2010-04-20T20:08:21.634121"' Which is ISO 8601 format. A more comprehensive default handler function: def handler(obj): if hasattr(obj, 'isoformat'): return obj.isoformat() elif isinstance(obj, ...): return ... else: raise TypeError, 'Object of type %s with value of %s is not JSON serializable' % (type(obj), repr(obj)) Update: Added output of type as well as value. Update: Also handle date [INST] Python - time.clock() vs. time.time() - accuracy? Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy? for example: start = time.clock() ... do something elapsed = (time.clock() - start) vs. start = time.time() ... do something elapsed = (time.time() - start) [/INST] As of 3.3, time.clock() is deprecated, and it's suggested to use time.process_time() or time.perf_counter() instead. Previously in 2.7, according to the time module docs: time.clock() On Unix, return the current processor time as a floating point number expressed in seconds. The precision, and in fact the very definition of the meaning of “processor time”, depends on that of the C function of the same name, but in any case, this is the function to use for benchmarking Python or timing algorithms. On Windows, this function returns wall-clock seconds elapsed since the first call to this function, as a floating point number, based on the Win32 function QueryPerformanceCounter(). The resolution is typically better than one microsecond. Additionally, there is the timeit module for benchmarking code snippets. [INST] Argparse optional positional arguments? I have script which is meant to be used like this: usage: installer.py dir [-h] [-v] dir is a positional argument which is defined like this: parser.add_argument('dir', default=os.getcwd()) I want dir to be optional: when it's not specified it should just be cwd. Unfortunately when I don't specify the dir argument, i get "Error: Too few arguments" [/INST] Try using nargs='?' parser.add_argument('dir', nargs='?', default=os.getcwd()) extended example: >>> import os, argparse >>> parser = argparse.ArgumentParser() >>> parser.add_argument('-v', action='store_true') _StoreTrueAction(option_strings=['-v'], dest='v', nargs=0, const=True, default=False, type=None, choices=None, help=None, metavar=None) >>> parser.add_argument('dir', nargs='?', default=os.getcwd()) _StoreAction(option_strings=[], dest='dir', nargs='?', const=None, default='/home/vinay', type=None, choices=None, help=None, metavar=None) >>> parser.parse_args('somedir -v'.split()) Namespace(dir='somedir', v=True) >>> parser.parse_args('-v'.split()) Namespace(dir='/home/vinay', v=True) >>> parser.parse_args(''.split()) Namespace(dir='/home/vinay', v=False) >>> parser.parse_args(['somedir']) Namespace(dir='somedir', v=False) >>> parser.parse_args('somedir -h -v'.split()) usage: [-h] [-v] [dir] positional arguments: dir optional arguments: -h, --help show this help message and exit -v [INST] Converting unix timestamp string to readable date in Python I have a string representing a unix timestamp (i.e. "1284101485") in Python, and I'd like to convert it to a readable date. When I use time.strftime, I get a TypeError: >>>import time >>>print time.strftime("%B %d %Y", "1284101485") Traceback (most recent call last): File "", line 1, in TypeError: argument must be 9-item sequence, not str [/INST] Use datetime module: import datetime print( datetime.datetime.fromtimestamp( int("1284101485") ).strftime('%Y-%m-%d %H:%M:%S') ) In this code datetime.datetime can look strange, but 1st datetime is module name and 2nd is class name. So datetime.datetime.fromtimestamp() is fromtimestamp() method of datetime class from datetime module. [INST] Python - Split Strings with Multiple Delimiters I think what I want to do is a fairly common task but I've found no reference on the web. I have text, with punctuation, and I want list of the words. "Hey, you - what are you doing here!?" should be ['hey', 'you', 'what', 'are', 'you', 'doing', 'here'] But Python's str.split() only works with one argument... So I have all words with the punctuation after I split with whitespace. Any ideas? [/INST] A case where regular expressions are justified: import re DATA = "Hey, you - what are you doing here!?" print re.findall(r"[\w']+", DATA) # Prints ['Hey', 'you', 'what', 'are', 'you', 'doing', 'here'] [Edited to include ' in the word characters - thanks, Danosaure.] [INST] How to fix "Attempted relative import in non-package" even with __init__.py I'm trying to follow PEP 328, with the following directory structure: pkg/ __init__.py components/ core.py __init__.py tests/ core_test.py __init__.py In core_test.py I have the following import statement from ..components.core import GameLoopEvents However, when I run, I get the following error: tests$ python core_test.py Traceback (most recent call last): File "core_test.py", line 3, in from ..components.core import GameLoopEvents ValueError: Attempted relative import in non-package Searching around I found "relative path not working even with __init__.py" and "Import a module from a relative path" but they didn't help. Is there anything I'm missing here? [/INST] To elaborate on @Ignacio's answer: The Python import mechanism works relative to the __name__ of the current file. When you execute a file directly, it doesn't have its usual name, but has "__main__" as its name instead. So relative imports don't work. You can, as Igancio suggested, execute it using the -m option. If you have a part of your package that is meant to be run as a script, you can also use the __package__ attribute to tell that file what name it's supposed to have in the package hierarchy. See http://www.python.org/dev/peps/pep-0366/ for details. [INST] Is there a simple way to delete a list element by value in python? a=[1,2,3,4] b=a.index(6) del a[b] print a The above shows the following error: Traceback (most recent call last): File "D:\zjm_code\a.py", line 6, in b=a.index(6) ValueError: list.index(x): x not in list So I have to do this: a=[1,2,3,4] try: b=a.index(6) del a[b] except: pass print a But is there not a simpler way to do this? [/INST] To remove an element's first occurrence in a list, simply use list.remove: >>> a = ['a', 'b', 'c', 'd'] >>> a.remove('b') >>> print a ['a', 'c', 'd'] Mind that it does not remove all occurrences of your element. Use a list comprehension for that. >>> a = [1, 2, 3, 4, 2, 3, 4, 2, 7, 2] >>> a = [x for x in a if x != 2] >>> print a [1, 3, 4, 3, 4, 7] [INST] What are the differences between the urllib, urllib2, and requests module? In Python, what are the differences between the urllib, urllib2, and requests module? Why are there three? They seem to do the same thing... [/INST] I know its been said already, but I'd highly recommend the Requests python package: http://docs.python-requests.org/en/latest/index.html If you've used languages other than python, you're probably thinking urllib and urllib2 are easy to use, not much code, and highly capable, that's how I used to think. But the Requests package is so unbelievably useful and short that everyone should be using it. First, it supports a fully restful API, and is as easy as: import requests ... resp = requests.get('http://www.mywebsite.com/user') resp = requests.post('http://www.mywebsite.com/user') resp = requests.put('http://www.mywebsite.com/user/put') resp = requests.delete('http://www.mywebsite.com/user/delete') Regardless of whether GET/POST you never have to encode parameters again, it simply takes a dictionary as an argument and is good to go. userdata = {"firstname": "John", "lastname": "Doe", "password": "jdoe123"} resp = requests.post('http://www.mywebsite.com/user', data=userdata) Plus it even has a built in json decoder (again, i know json.loads() isn't a lot more to write, but this sure is convenient): resp.json() Or if your response data is just text, use: resp.text This is just the tip of the iceberg. This is the list of features from the requests site: International Domains and URLs Keep-Alive & Connection Pooling Sessions with Cookie Persistence Browser-style SSL Verification Basic/Digest Authentication Elegant Key/Value Cookies Automatic Decompression Unicode Response Bodies Multipart File Uploads Connection Timeouts .netrc support List item Python 2.6—3.4 Thread-safe. [INST] Python's equivalent of && in an if statement Here's my code: # F. front_back # Consider dividing a string into two halves. # If the length is even, the front and back halves are the same length. # If the length is odd, we'll say that the extra char goes in the front half. # e.g. 'abcde', the front half is 'abc', the back half 'de'. # Given 2 strings, a and b, return a string of the form # a-front + b-front + a-back + b-back def front_back(a, b): # +++your code here+++ if len(a) % 2 == 0 && len(b) % 2 == 0: return a[:(len(a)/2)] + b[:(len(b)/2)] + a[(len(a)/2):] + b[(len(b)/2):] else: #todo! Not yet done. :P return I'm getting an error in the IF conditional. What am I doing wrong? [/INST] You would want and instead of &&. [INST] How do I "cd" in Python? cd as in the shell command to change the working directory. How do I change the current working directory in Python? [/INST] You can change the working directory with os.chdir(path) There are two best practices to follow when using this method: Catch the exception (WindowsError, OSError) on invalid path. If the exception is thrown, do not perform any recursive operations, especially destructive ones. They will operate on the old path and not the new one. Return to your old directory when you're done. This can be done in an exception-safe manner by wrapping your chdir call in a context manager, like Brian M. Hunt did in his answer. Changing the current working directory in a subprocess does not change the current working directory in the parent process. This is true of the Python interpreter as well. You cannot use os.chdir() to change the CWD of the calling process. [INST] Running shell command from Python and capturing the output I want to write a function that will execute a shell command and return its output as a string, no matter, is it an error or success message. I just want to get the same result that I would have gotten with the command line. What would be a code example that would do such a thing? For example: def run_command(cmd): # ?????? print run_command('mysqladmin create test -uroot -pmysqladmin12') # Should output something like: # mysqladmin: CREATE DATABASE failed; error: 'Can't create database 'test'; database exists' [/INST] For convenience, Python 2.7 provides the subprocess.check_output(*popenargs, **kwargs) function, which takes the same arguments as Popen, but returns a string containing the program's output. You can pass stderr=subprocess.STDOUT to ensure that error messages are included in the returned output -- but don't pass stderr=subprocess.PIPE to check_output. It can cause deadlocks. If you need to pipe from stderr, see the Popen example below. If you're using an older python, Vartec's method will work. But the better way to go -- at least in simple cases that don't require real-time output capturing -- is to use communicate. As in: output = subprocess.Popen(["mycmd", "myarg"], stdout=subprocess.PIPE).communicate()[0] Or >>> import subprocess >>> p = subprocess.Popen(['ls', '-a'], stdout=subprocess.PIPE, ... stderr=subprocess.PIPE) >>> out, err = p.communicate() >>> print out . .. foo If you set stdin=PIPE, communicate also allows you to pass data to the process via stdin: >>> cmd = ['awk', 'length($0) > 5'] >>> p = subprocess.Popen(cmd, stdout=subprocess.PIPE, ... stderr=subprocess.PIPE, ... stdin=subprocess.PIPE) >>> out, err = p.communicate('foo\nfoofoo\n') >>> print out foofoo Finally, note Aaron Hall's answer, which indicates that on some systems, you may need to set stdout, stderr, and stdin all to PIPE (or DEVNULL) to get communicate to work at all. [INST] Python __init__ and self what do they do? I'm learning the Python programming language, and I've come across certain things I don't fully understand. I'm coming from a C background, but I never went far with that either. What I'm trying to figure out is: In a method: def method(self, blah): def __init__(?): .... .... What does self do? what is it meant to be? and is it mandatory? What does the __init__ method do? why is it necessary? etc I think they might be oop constructs, but I don't know very much.. [/INST] In this code: class A(object): def __init__(self): self.x = 'Hello' def method_a(self, foo): print self.x + ' ' + foo ... the self variable represents the instance of the object itself. Most object-oriented languages pass this as a hidden parameter to the methods defined on an object; Python does not. You have to declare it explicitly. When you create an instance of the A class and call its methods, it will be passed automatically, as in ... a = A() # We do not pass any argument to the __init__ method a.method_a('Sailor!') # We only pass a single argument The __init__ method is roughly what represents a constructor in Python. When you call A() Python creates an object for you, and passes it as the first parameter to the __init__ method. Any additional parameters (e.g., A(24, 'Hello')) will also get passed as arguments--in this case causing an exception to be raised, since the constructor isn't expecting them. [INST] Why are Python's 'private' methods not actually private? Python gives us the ability to create 'private' methods and variables within a class by prepending double underscores to the name, like this: __myPrivateMethod(). How, then, can one explain this >>> class MyClass: ... def myPublicMethod(self): ... print 'public method' ... def __myPrivateMethod(self): ... print 'this is private!!' ... >>> obj = MyClass() >>> obj.myPublicMethod() public method >>> obj.__myPrivateMethod() Traceback (most recent call last): File "", line 1, in AttributeError: MyClass instance has no attribute '__myPrivateMethod' >>> dir(obj) ['_MyClass__myPrivateMethod', '__doc__', '__module__', 'myPublicMethod'] >>> obj._MyClass__myPrivateMethod() this is private!! What's the deal?! I'll explain this a little for those who didn't quite get that. >>> class MyClass: ... def myPublicMethod(self): ... print 'public method' ... def __myPrivateMethod(self): ... print 'this is private!!' ... >>> obj = MyClass() What I did there is create a class with a public method and a private method and instantiate it. Next, I call its public method. >>> obj.myPublicMethod() public method Next, I try and call its private method. >>> obj.__myPrivateMethod() Traceback (most recent call last): File "", line 1, in AttributeError: MyClass instance has no attribute '__myPrivateMethod' Everything looks good here; we're unable to call it. It is, in fact, 'private'. Well, actually it isn't. Running dir() on the object reveals a new magical method that python creates magically for all of your 'private' methods. >>> dir(obj) ['_MyClass__myPrivateMethod', '__doc__', '__module__', 'myPublicMethod'] This new method's name is always an underscore, followed by the class name, followed by the method name. >>> obj._MyClass__myPrivateMethod() this is private!! So much for encapsulation, eh? In any case, I'd always heard Python doesn't support encapsulation, so why even try? What gives? [/INST] The name scrambling is used to ensure that subclasses don't accidentally override the private methods and attributes of their superclasses. It's not designed to prevent deliberate access from outside. For example: >>> class Foo(object): ... def __init__(self): ... self.__baz = 42 ... def foo(self): ... print self.__baz ... >>> class Bar(Foo): ... def __init__(self): ... super(Bar, self).__init__() ... self.__baz = 21 ... def bar(self): ... print self.__baz ... >>> x = Bar() >>> x.foo() 42 >>> x.bar() 21 >>> print x.__dict__ {'_Bar__baz': 21, '_Foo__baz': 42} Of course, it breaks down if two different classes have the same name. [INST] What is the Python 3 equivalent of "python -m SimpleHTTPServer" What is the Python 3 equivalent of python -m SimpleHTTPServer? [/INST] From the docs: The SimpleHTTPServer module has been merged into http.server in Python 3.0. The 2to3 tool will automatically adapt imports when converting your sources to 3.0. So, your command is python3 -m http.server. [INST] How do I do a not equal in Django queryset filtering? In Django model QuerySets, I see that there is a __gt and __lt for comparitive values, but is there a __ne/!=/<> (not equals?) I want to filter out using a not equals: Example: Model: bool a; int x; I want results = Model.objects.exclude(a=true, x!=5) The != is not correct syntax. I tried __ne, <>. I ended up using: results = Model.objects.exclude(a=true, x__lt=5).exclude(a=true, x__gt=5) [/INST] Maybe Q objects could be of help for this problem. I've never used them but it seems they can be negated and combined much like normal python expressions. Update: I Just tried it out, it seems to work pretty well: >>> from myapp.models import Entry >>> from django.db.models import Q >>> Entry.objects.filter(~Q(id = 3)) [, , , ...] [INST] Python `if x is not None` or `if not x is None`? I've always thought of the if not x is None version to be more clear, but Google's style guide implies (based on this excerpt) that they use if x is not None. Is there any minor performance difference (I'm assuming not), and is there any case where one really doesn't fit (making the other a clear winner for my convention)?* *I'm referring to any singleton, rather than just None. ...to compare singletons like None. Use is or is not. [/INST] There's no performance difference, as they compile to the same bytecode: Python 2.6.2 (r262:71600, Apr 15 2009, 07:20:39) >>> import dis >>> def f(x): ... return x is not None ... >>> dis.dis(f) 2 0 LOAD_FAST 0 (x) 3 LOAD_CONST 0 (None) 6 COMPARE_OP 9 (is not) 9 RETURN_VALUE >>> def g(x): ... return not x is None ... >>> dis.dis(g) 2 0 LOAD_FAST 0 (x) 3 LOAD_CONST 0 (None) 6 COMPARE_OP 9 (is not) 9 RETURN_VALUE Stylistically, I try to avoid not x is y. Although the compiler will always treat it as not (x is y), a human reader might misunderstand the construct as (not x) is y. If I write x is not y then there is no ambiguity. [INST] What is the difference between dict.items() and dict.iteritems()? Are there any applicable differences between dict.items() and dict.iteritems()? From the Python docs: dict.items(): Return a copy of the dictionary’s list of (key, value) pairs. dict.iteritems(): Return an iterator over the dictionary’s (key, value) pairs. If I run the code below, each seems to return a reference to the same object. Are there any subtle differences that I am missing? #!/usr/bin/python d={1:'one',2:'two',3:'three'} print 'd.items():' for k,v in d.items(): if d[k] is v: print '\tthey are the same object' else: print '\tthey are different' print 'd.iteritems():' for k,v in d.iteritems(): if d[k] is v: print '\tthey are the same object' else: print '\tthey are different' Output: d.items(): they are the same object they are the same object they are the same object d.iteritems(): they are the same object they are the same object they are the same object [/INST] It's part of an evolution. Originally, Python items() built a real list of tuples and returned that. That could potentially take a lot of extra memory. Then, generators were introduced to the language in general, and that method was reimplemented as an iterator-generator method named iteritems(). The original remains for backwards compatibility. One of Python 3’s changes is that items() now return iterators, and a list is never fully built. The iteritems() method is also gone, since items() in Python 3 works like viewitems() in Python 2.7. [INST] Removing duplicates in lists Pretty much I need to write a program to check if a list has any duplicates and if it does it removes them and returns a new list with the items that werent duplicated/removed. This is what I have but to be honest I do not know what to do. def remove_duplicates(): t = ['a', 'b', 'c', 'd'] t2 = ['a', 'c', 'd'] for t in t2: t.append(t.remove()) return t [/INST] The common approach to get a unique collection of items is to use a set. Sets are unordered collections of distinct objects. To create a set from any iterable, you can simply pass it to the built-in set() function. If you later need a real list again, you can similarly pass the set to the list() function. The following example should cover whatever you are trying to do: >>> t = [1, 2, 3, 1, 2, 5, 6, 7, 8] >>> t [1, 2, 3, 1, 2, 5, 6, 7, 8] >>> list(set(t)) [1, 2, 3, 5, 6, 7, 8] >>> s = [1, 2, 3] >>> list(set(t) - set(s)) [8, 5, 6, 7] As you can see from the example result, the original order is not maintained. As mentioned above, sets themselves are unordered collections, so the order is lost. When converting a set back to a list, an arbitrary order is created. If order is important to you, then you will have to use a different mechanism. This question covers that topic in more detail. [INST] Retrieving python module path I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from. How do I retrieve a module's path in python? [/INST] import a_module print a_module.__file__ Will actually give you the path to the .pyc file that was loaded, at least on Mac OS X. So I guess you can do import os path = os.path.dirname(amodule.__file__) You can also try path = os.path.abspath(amodule.__file__) To get the directory to look for changes. ?�[INST] How to install lxml on Ubuntu I'm having difficulty installing lxml with easy_install on Ubuntu 11. When I type $ easy_install lxml I get: Searching for lxml Reading http://pypi.python.org/simple/lxml/ Reading http://codespeak.net/lxml Best match: lxml 2.3 Downloading http://lxml.de/files/lxml-2.3.tgz Processing lxml-2.3.tgz Running lxml-2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7UdQOZ/lxml-2.3/egg-dist-tmp-GacQGy Building lxml version 2.3. Building without Cython. ERROR: /bin/sh: xslt-config: not found ** make sure the development packages of libxml2 and libxslt are installed ** Using build configuration of libxslt In file included from src/lxml/lxml.etree.c:227:0: src/lxml/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory compilation terminated. It seems that libxslt or libxml2 is not installed. I've tried following the instructions at http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.php and http://www.techsww.com/tutorials/libraries/libxml/installation/installing_libxml_on_ubuntu_linux.php with no success. If I try wget ftp://xmlsoft.org/libxml2/libxml2-sources-2.6.27.tar.gz I get ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD (1) /libxml2 ... done. ==> SIZE libxml2-sources-2.6.27.tar.gz ... done. ==> PASV ... done. ==> RETR libxml2-sources-2.6.27.tar.gz ... No such file `libxml2-sources-2.6.27.tar.gz'. If I try the other first, I'll get to ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2 and that will fail eventually with: checking for libxml libraries >= 2.6.27... configure: error: Could not find libxml2 anywhere, check ftp://xmlsoft.org/. I've tried both versions 2.6.27 and 2.6.29 of libxml2 with no difference. Leaving no stone unturned, I have successfully done sudo apt-get install libxml2-dev, but this changes nothing. [/INST] Since you're on Ubuntu, don't bother with those source packages. Just install those development packages using apt-get. apt-get install libxml2-dev libxslt1-dev python-dev If you're happy with a possibly older version of lxml altogether though, you could try apt-get install python-lxml and be done with it. :) [INST] Pythonic way to create a long multi-line string I have a very long query. I would like to split it in several lines in python. A way to do it in javascript would be using several sentences and joining them with a + operator (I know, maybe it's not the most efficient way to do it, but I'm not really concerned about performance in this stage, just code readability). Example: var long_string='some text not important. just garbage to'+ 'illustrate my example'; I tried doing something similar in python, but it didn't work, so I used \ to split the long string. However, I'm not sure if this is the only/best/pythonicest way of doing it. It looks awkward. Actual code: query= 'SELECT action.descr as "action", '\ 'role.id as role_id,'\ 'role.descr as role'\ 'FROM '\ 'public.role_action_def,'\ 'public.role,'\ 'public.record_def, '\ 'public.action'\ 'WHERE role.id = role_action_def.role_id AND'\ 'record_def.id = role_action_def.def_id AND'\ 'action.id = role_action_def.action_id AND'\ 'role_action_def.account_id = '+account_id+' AND'\ 'record_def.account_id='+account_id+' AND'\ 'def_id='+def_id [/INST] Are you talking about multi-line strings? Easy, use triple quotes to start and end them. s = """ this is a very long string if I had the energy to type more and more ...""" You can use single quotes too (3 of them of course at start and end) and treat the resulting string s just like any other string. NOTE: Just as with any string, anything between the starting and ending quotes becomes part of the string, so this example has a leading blank (as pointed out by @root45). This string will also contain both blanks and newlines. I.e.,: ' this is a very\n long string if I had the\n energy to type more and more ...' Finally, one can also construct long lines in Python like this: s = ("this is a very" "long string too" "for sure ..." ) which will not include any extra blanks or newlines (this is a deliberate example showing what the effect of skipping blanks will result in): 'this is a verylong string toofor sure ...' No commas required, simply place the strings to be joined together into a pair of parenthesis and be sure to account for any needed blanks and newlines. [INST] Display number with leading zeros Given: a = 1 b = 10 c = 100 I want to display a leading zero for all numbers with less than 2 digits, i.e.: 01 10 100 [/INST] Here you are: print "%02d" % (1,) Basically % is like printf or sprint. [INST] Emulate a do-while loop in Python? I need to emulate a do-while loop in a Python program. Unfortunately, the following straightforward code does not work: l = [ 1, 2, 3 ] i = l.__iter__() s = None while True : if s : print s try : s = i.next() except StopIteration : break print "done" Instead of "1,2,3,done", it prints the following output: [stdout:]1 [stdout:]2 [stdout:]3 None['Traceback (most recent call last): ', ' File "test_python.py", line 8, in s = i.next() ', 'StopIteration '] What can I do in order to catch the 'stop iteration' exception and break a while loop properly? An example of why such a thing may be needed is shown below as pseudocode. State machine: s = "" while True : if state is STATE_CODE : if "//" in s : tokens.add( TOKEN_COMMENT, s.split( "//" )[1] ) state = STATE_COMMENT else : tokens.add( TOKEN_CODE, s ) if state is STATE_COMMENT : if "//" in s : tokens.append( TOKEN_COMMENT, s.split( "//" )[1] ) else state = STATE_CODE # Re-evaluate same line continue try : s = i.next() except StopIteration : break [/INST] I am not sure what you are trying to do. You can implement a do-while loop like this: while True: stuff() if fail_condition: break Or: stuff() while not fail_condition: stuff() What are you doing trying to use a do while loop to print the stuff in the list? Why not just use: for i in l: print i print "done" Update: So do you have a list of lines? And you want to keep iterating through it? How about: for s in l: while True: stuff() # use a "break" instead of s = i.next() Does that seem like something close to what you would want? With your code example, it would be: for s in some_list: while True : if state is STATE_CODE : if "//" in s : tokens.add( TOKEN_COMMENT, s.split( "//" )[1] ) state = STATE_COMMENT else : tokens.add( TOKEN_CODE, s ) if state is STATE_COMMENT : if "//" in s : tokens.append( TOKEN_COMMENT, s.split( "//" )[1] ) break # get next s else state = STATE_CODE # re-evaluate same line # continues automatically [INST] How to check file size in python? I am writing a Python script in Windows. I want to do something based on the file size. For example, if the size is greater than 0, I will send an email to somebody, otherwise continue to other things. How do I check the file size? [/INST] Like this (credit http://www.daniweb.com/forums/thread78629.html): >>> import os >>> b = os.path.getsize("/path/isa_005.mp3") >>> b 2071611L [INST] Delete column from pandas DataFrame When deleting a column in a DataFrame I use: del df['column_name'] and this works great. Why can't I use: del df.column_name As you can access the column/Series as df.column_name, I expect this to work. [/INST] The best way to do this in pandas is to use drop: df = df.drop('column_name', 1) where 1 is the axis number (0 for rows and 1 for columns.) To delete the column without having to reassign df you can do: df.drop('column_name', axis=1, inplace=True) Finally, to drop by column number instead of by column label, try this to delete, e.g. the 1st, 2nd and 4th columns: df.drop(df.columns[[0, 1, 3]], axis=1) # df.columns is zero-based pd.Index [INST] Is there a portable way to get the current username in Python? Is there a portable way to get the current user's username in Python (i.e., one that works under both Linux and Windows, at least). It would work like os.getuid: >>> os.getuid() 42 >>> os.getusername() 'slartibartfast' I googled around and was surprised not to find a definitive answer (although perhaps I was just googling poorly). The pwd module provides a relatively easy way to achieve this under, say, Linux, but it is not present on Windows. Some of the search results suggested that getting the username under Windows can be complicated in certain circumstances (e.g., running as a Windows service), although I haven't verified that. [/INST] Look at getpass module import getpass getpass.getuser() 'kostya' Availability: Unix, Windows p.s. Per comment below "this function looks at the values of various environment variables to determine the user name. Therefore, this function should not be relied on for access control purposes (or possibly any other purpose, since it allows any user to impersonate any other)." [INST] differentiate null=True, blank=True in django When we add a database field in django we generally write models.CharField(max_length=100, null=True, blank=True). The same is done with ForeignKey, DecimalField etc. What is the basic difference in having null=True only blank=True only null=True, blank=True in respect to different (CharField, ForeignKey, ManyToManyField, DateTimeField) fields. What are the advantages/disadvantages of using 1/2/3? [/INST] null=True sets NULL (versus NOT NULL) on the column in your DB. Blank values for Django field types such as DateTimeField or ForeignKey will be stored as NULL in the DB. blank=True determines whether the field will be required in forms. This includes the admin and your own custom forms. If blank=True then the field will not be required, whereas if it's False the field cannot be blank. The combo of the two is so frequent because typically if you're going to allow a field to be blank in your form, you're going to also need your database to allow NULL values for that field. The exception is CharFields and TextFields, which in Django are never saved as NULL. Blank values are stored in the DB as an empty string (''). A few examples: models.DateTimeField(blank=True) # raises IntegrityError if blank models.DateTimeField(null=True) # NULL allowed, but must be filled out in a form Obviously those two options don't make logical sense to use (though, there might be a use case for null=True, blank=False if you want a field to always be required in forms, but optional when dealing with an object through something like the shell.) models.CharField(blank=True) # No problem, blank is stored as '' models.CharField(null=True) # NULL allowed, but will never be set as NULL CHAR and TEXT types are never saved as NULL by Django, so null=True is unnecessary. However, you can manually set one of these fields to None to force set it as NULL. If you have a scenario where that might be necessary, you should still include null=True. [INST] How to install psycopg2 with "pip" on Python? I'm using virtualenv and I need to install "psycopg2". I have done the following: pip install http://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160 And I have the following messages: Downloading/unpacking http://pypi.python.org/packages/source/p/psycopg2/psycopg2 -2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160 Downloading psycopg2-2.4.tar.gz (607Kb): 607Kb downloaded Running setup.py egg_info for package from http://pypi.python.org/packages/sou rce/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160 Error: pg_config executable not found. Please add the directory containing pg_config to the PATH or specify the full executable path with the option: python setup.py build_ext --pg-config /path/to/pg_config build ... or with the pg_config option in 'setup.cfg'. Complete output from command python setup.py egg_info: running egg_info creating pip-egg-info\psycopg2.egg-info writing pip-egg-info\psycopg2.egg-info\PKG-INFO writing top-level names to pip-egg-info\psycopg2.egg-info\top_level.txt writing dependency_links to pip-egg-info\psycopg2.egg-info\dependency_links.txt writing manifest file 'pip-egg-info\psycopg2.egg-info\SOURCES.txt' warning: manifest_maker: standard file '-c' not found Error: pg_config executable not found. Please add the directory containing pg_config to the PATH or specify the full executable path with the option: python setup.py build_ext --pg-config /path/to/pg_config build ... or with the pg_config option in 'setup.cfg'. ---------------------------------------- Command python setup.py egg_info failed with error code 1 Storing complete log in C:\Documents and Settings\anlopes\Application Data\pip\p ip.log My question, I only need to do this to get the psycopg2 working? python setup.py build_ext --pg-config /path/to/pg_config build ... [/INST] I found this post searching for a Linux solution to this problem. This post by "goshawk" gave me the solution: run sudo apt-get install libpq-dev python-dev if you are on Ubuntu/Debian. Update Since more people have found this answer useful and posted their own solutions, here's a list of them: Debian/Ubuntu Python 2 sudo apt install libpq-dev python-dev Python 3 sudo apt install libpq-dev python3-dev Additional If none of the above solve your issue, try sudo apt install build-essential or sudo apt install postgresql-server-dev-all [INST] How do I read a text file into a string variable in Python I use the following code segment to read a file in python with open ("data.txt", "r") as myfile: data=myfile.readlines() input file is LLKKKKKKKKMMMMMMMMNNNNNNNNNNNNN GGGGGGGGGHHHHHHHHHHHHHHHHHHHHEEEEEEEE and when I print data I get ['LLKKKKKKKKMMMMMMMMNNNNNNNNNNNNN\n', 'GGGGGGGGGHHHHHHHHHHHHHHHHHHHHEEEEEEEE'] As I see data is in list form. How do I make it string. And also how do I remove "\n", "[", and "]" characters from it ? [/INST] You could use: with open('data.txt', 'r') as myfile: data=myfile.read().replace('\n', '') [INST] Adding a Method to an Existing Object Instance I've read that it is possible to add a method to an existing object (e.g. not in the class definition) in Python, I think this is called Monkey Patching (or in some cases Duck Punching). I understand that it's not always a good decision to do so. But, how might one do this? UPDATE 8/04/2008 00:21:01 EST: That looks like a good answer John Downey, I tried it but it appears that it ends up being not a true method. Your example defines the new patch function with an argument of self, but if you write actual code that way, the now patched class method asks for an argument named self (it doesn't automagically recognize it as the object to which it is supposed to bind, which is what would happen if defined within the class definition), meaning you have to call class.patch(obj) instead of just class.patch() if you want the same functionality as a true method. It looks like Python isn't really treating it as a method, but more just as a variable which happens to be a function (and as such is callable). Is there any way to attach an actual method to a class? Oh, and Ryan, that isn't exactly what I was looking for (it isn't a builtin functionality), but it is quite cool nonetheless. [/INST] In Python, there is a difference between functions and bound methods. >>> def foo(): ... print "foo" ... >>> class A: ... def bar( self ): ... print "bar" ... >>> a = A() >>> foo >>> a.bar > >>> Bound methods have been "bound" (how descriptive) to an instance, and that instance will be passed as the first argument whenever the method is called. Callables that are attributes of a class (as opposed to an instance) are still unbound, though, so you can modify the class definition whenever you want: >>> def fooFighters( self ): ... print "fooFighters" ... >>> A.fooFighters = fooFighters >>> a2 = A() >>> a2.fooFighters > >>> a2.fooFighters() fooFighters Previously defined instances are updated as well (as long as they haven't overridden the attribute themselves): >>> a.fooFighters() fooFighters The problem comes when you want to attach a method to a single instance: >>> def barFighters( self ): ... print "barFighters" ... >>> a.barFighters = barFighters >>> a.barFighters() Traceback (most recent call last): File "", line 1, in TypeError: barFighters() takes exactly 1 argument (0 given) The function is not automatically bound when it's attached directly to an instance: >>> a.barFighters To bind it, we can use the MethodType function in the types module: >>> import types >>> a.barFighters = types.MethodType( barFighters, a ) >>> a.barFighters > >>> a.barFighters() barFighters This time other instances of the class have not been affected: >>> a2.barFighters() Traceback (most recent call last): File "", line 1, in AttributeError: A instance has no attribute 'barFighters' More information can be found by reading about descriptors and metaclass programming. [INST] How can I sort a dictionary by key? What would be a nice way to go from {2:3, 1:89, 4:5, 3:0} to {1:89, 2:3, 3:0, 4:5}? I checked some posts but they all use the "sorted" operator that returns tuples. [/INST] Standard Python dictionaries are unordered. Even if you sorted the (key,value) pairs, you wouldn't be able to store them in a dict in a way that would preserve the ordering. The easiest way is to use OrderedDict, which remembers the order in which the elements have been inserted: In [1]: import collections In [2]: d = {2:3, 1:89, 4:5, 3:0} In [3]: od = collections.OrderedDict(sorted(d.items())) In [4]: od Out[4]: OrderedDict([(1, 89), (2, 3), (3, 0), (4, 5)]) Never mind the way od is printed out; it'll work as expected: In [11]: od[1] Out[11]: 89 In [12]: od[3] Out[12]: 0 In [13]: for k, v in od.iteritems(): print k, v ....: 1 89 2 3 3 0 4 5 Python 3 For Python 3 users, one needs to use the .items() instead of .iteritems(): In [13]: for k, v in od.items(): print(k, v) ....: 1 89 2 3 3 0 4 5 [INST] Python class inherits object Is there any reason for a class declaration to inherit from object? I just found some code that does this and I can't find a good reason why. class MyClass(object): # class code follows... [/INST] Python 3.x: class MyClass(object): = new-style class class MyClass: = new-style class (implicitly inherits from object) Python 2.x: class MyClass(object): = new-style class class MyClass: = OLD-STYLE CLASS Explanation: When defining base classes in Python 3.x, you’re allowed to drop the object from the definition. However, this can open the door for a seriously hard to track problem… Python introduced new-style classes back in Python 2.2, and by now old-style classes are really quite old. Discussion of old-style classes is buried in the 2.x docs, and non-existent in the 3.x docs. The problem is, the syntax for old-style classes in Python 2.x is the same as the alternative syntax for new-style classes in Python 3.x. Python 2.x is still very widely used (e.g. GAE, Web2Py), and any code (or coder) unwittingly bringing 3.x-style class definitions into 2.x code is going to end up with some seriously outdated base objects. And because old-style classes aren’t on anyone’s radar, they likely won’t know what hit them. So just spell it out the long way and save some 2.x developer the tears. [INST] How does Python's super() work with multiple inheritance? I'm pretty much new in Python object oriented programming and I have trouble understanding the super() function (new style classes) especially when it comes to multiple inheritance. For example if you have something like: class First(object): def __init__(self): print "first" class Second(object): def __init__(self): print "second" class Third(First, Second): def __init__(self): super(Third, self).__init__() print "that's it" What I don't get is: will the Third() class inherit both constructor methods? If yes, then which one will be run with super() and why? And what if you want to run the other one? I know it has something to do with Python method resolution order (MRO). [/INST] This is detailed with a reasonable amount of detail by Guido himself at http://python-history.blogspot.com/2010/06/method-resolution-order.html (including two earlier attempts). But, briefly: in your example, Third() will call First.__init__. For such simple situations, Python will look for the attribute (in this case, __init__) on the class's parents, left to right. So, if you define class Third(First, Second): ... Python will look at First, and, if First doesn't have the attribute, at Second. This situation becomes more complex when inheritance starts crossing paths (say, if First inherited from Second, for instance). Read the link above for more details, but, in a nutshell, Python will try to maintain the order in which each class appears on the inheritance list, child classes first. So, for instance, if you had: class First(object): def __init__(self): print "first" class Second(First): def __init__(self): print "second" class Third(First): def __init__(self): print "third" class Fourth(Second, Third): def __init__(self): super(Fourth, self).__init__() print "that's it" the MRO would be [Fourth, Second, Third, First]. By the way: if Python cannot find a coherent method resolution order, it'll raise an exception, instead of falling back to a behaviour which might surprise the user. Edited to add example of an ambiguous MRO: class First(object): def __init__(self): print "first" class Second(First): def __init__(self): print "second" class Third(First, Second): def __init__(self): print "third" Should Third's MRO be [First, Second] or [Second, First]? There's no obvious expectation, and Python will raise an error: TypeError: Error when calling the metaclass bases Cannot create a consistent method resolution order (MRO) for bases Second, First [Edit] I see several people arguing that the examples above lack super() calls, so let me explain: the point of the examples is to show how the MRO is constructed. They are not intended print "first\nsecond\third" or whatever. You can - and should, of course, play around with the example, add super() calls, see what happens, and gain a deeper understanding of Python's inheritance model. But my goal here is to keep it simple and show how the MRO is build. And it is built as I explained: >>> Fourth.__mro__ (, , , , ) [INST] Should you always favor xrange() over range()? Why or why not? [/INST] For performance, especially when you're iterating over a large range, xrange() is usually better. However, there are still a few cases why you might prefer range(): In python 3, range() does what xrange() used to do and xrange() does not exist. If you want to write code that will run on both Python 2 and Python 3, you can't use xrange(). range() can actually be faster in some cases - eg. if iterating over the same sequence multiple times. xrange() has to reconstruct the integer object every time, but range() will have real integer objects. (It will always perform worse in terms of memory however) xrange() isn't usable in all cases where a real list is needed. For instance, it doesn't support slices, or any list methods. [Edit] There are a couple of posts mentioning how range() will be upgraded by the 2to3 tool. For the record, here's the output of running the tool on some sample usages of range() and xrange() RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: ws_comma --- range_test.py (original) +++ range_test.py (refactored) @@ -1,7 +1,7 @@ for x in range(20): - a=range(20) + a=list(range(20)) b=list(range(20)) c=[x for x in range(20)] d=(x for x in range(20)) - e=xrange(20) + e=range(20) As you can see, when used in a for loop or comprehension, or where already wrapped with list(), range is left unchanged. [INST] Python List Comprehension Vs. Map Is there a reason to prefer using map() over list comprehension or vice versa? Is one generally more effecient or generally considered more pythonic than the other? [/INST] map may be microscopically faster in some cases (when you're NOT making a lambda for the purpose, but using the same function in map and a listcomp). List comprehensions may be faster in other cases and most (not all) pythonistas consider them more direct and clearer. An example of the tiny speed advantage of map when using exactly the same function: $ python -mtimeit -s'xs=range(10)' 'map(hex, xs)' 100000 loops, best of 3: 4.86 usec per loop $ python -mtimeit -s'xs=range(10)' '[hex(x) for x in xs]' 100000 loops, best of 3: 5.58 usec per loop An example of how performance comparison gets completely reversed when map needs a lambda: $ python -mtimeit -s'xs=range(10)' 'map(lambda x: x+2, xs)' 100000 loops, best of 3: 4.24 usec per loop $ python -mtimeit -s'xs=range(10)' '[x+2 for x in xs]' 100000 loops, best of 3: 2.32 usec per loop [INST] How to debug in Django, the good way? So, I started learning to code in Python and later Django. The first times it was hard looking at tracebacks and actually figure out what I did wrong and where the syntax error was. Some time has passed now and some way along the way, I guess I got a routine in debugging my Django code. As this was done early in my coding experience, I sat down and wondered if how I was doing this was ineffective and could be done faster. I usually manage to find and correct the bugs in my code, but I wonder if I should be doing it faster? I usually just use the debug info Django gives when enabled. When things do end up as I thought it would, I break the code flow a lot with a syntax error, and look at the variables at that point in the flow to figure out, where the code does something other than what I wanted. But can this be improved? Are there some good tools or better ways to debug your Django code? [/INST] There are a bunch of ways to do it, but the most straightforward is to simply use the Python debugger. Just add following line in to a Django view function: import pdb; pdb.set_trace() If you try to load that page in your browser, the browser will hang and you get a prompt to carry on debugging on actual executing code. However there are other options suggested by others (I won't recommend them): * return HttpResponse({variable to inspect}) * print {variable to inspect} * raise Exception({variable to inspect}) But the Python Debugger (pdb) is highly recommended for all types of Python code. If you are already into pdb, you'd also want to have a look at IPDB that uses ipython for debugging. Happy Coding. A useful reference provided by Seafangs : Using the Python debugger in Django [INST] What is the difference between range and xrange functions in Python 2.X? Apparently xrange is faster but I have no idea why it's faster (and no proof besides the anecdotal so far that it is faster) or what besides that is different about for i in range(0, 20): for i in xrange(0, 20): [/INST] range creates a list, so if you do range(1, 10000000) it creates a list in memory with 9999999 elements. xrange is a sequence object that evaluates lazily. [INST] Save plot to image file instead of displaying it using Matplotlib (so it can be used in batch scripts for example) I am writing a quick-and-dirty script to generate plots on the fly. I am using the code below (from Matplotlib documentation) as a starting point: from pylab import figure, axes, pie, title, show # Make a square figure and axes figure(1, figsize=(6, 6)) ax = axes([0.1, 0.1, 0.8, 0.8]) labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' fracs = [15, 30, 45, 10] explode = (0, 0.05, 0, 0) pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True) title('Raining Hogs and Dogs', bbox={'facecolor': '0.8', 'pad': 5}) show() # Actually, don't show, just save to foo.png I don't want to display the plot on a GUI, instead, I want to save the plot to a file (say foo.png) - how do I do that? [/INST] While the question has been answered, I'd like to add some useful tips when using savefig. The file format can be specified by the extension: savefig('foo.png') savefig('foo.pdf') Will give a rasterized or vectorized output respectively, both which could be useful. In addition, you'll find that pylab leaves a generous, often undesirable, whitespace around the image. Remove it with: savefig('foo.png', bbox_inches='tight') [INST] What is a clean, pythonic way to have multiple constructors in Python? I can't find a definitive answer for this. AFAIK, you can't have multiple __init__ functions in a Python class. So what is a good way to solve this problem? Suppose I have an class called Cheese with the number_of_holes property. How can I have two ways of creating cheese-objects... one that takes a number of holes like this: parmesan = Cheese(num_holes = 15) and one that takes no arguments and just randomizes the number_of_holes property: gouda = Cheese() I can think of only one way to do this, but that seems kinda clunky: class Cheese(): def __init__(self, num_holes = 0): if (num_holes == 0): # randomize number_of_holes else: number_of_holes = num_holes What do you say? Is there a better way? [/INST] Actually None is much better for "magic" values: class Cheese(): def __init__(self, num_holes = None): if num_holes is None: ... Now if you want complete freedom of adding more parameters: class Cheese(): def __init__(self, *args, **kwargs): #args -- tuple of anonymous arguments #kwargs -- dictionary of named arguments self.num_holes = kwargs.get('num_holes',random_holes()) To better explain the concept of *args and **kwargs (you can actually change these names): def f(*args, **kwargs): print 'args: ', args, ' kwargs: ', kwargs >>> f('a') args: ('a',) kwargs: {} >>> f(ar='a') args: () kwargs: {'ar': 'a'} >>> f(1,2,param=3) args: (1, 2) kwargs: {'param': 3} http://docs.python.org/reference/expressions.html#calls [INST] How to pip install packages according to requirements.txt from a local directory? Here is the problem I have a requirements.txt that looks like: BeautifulSoup==3.2.0 Django==1.3 Fabric==1.2.0 Jinja2==2.5.5 PyYAML==3.09 Pygments==1.4 SQLAlchemy==0.7.1 South==0.7.3 amqplib==0.6.1 anyjson==0.3 ... I have a local archive directory containing all the packages + others. I have created a new virtualenv with bin/virtualenv testing upon activating it, I tried to install the packages according to requirements.txt from the local archive directory. source bin/activate pip install -r /path/to/requirements.txt -f file:///path/to/archive/ I got some output that seems to indicate that the installation is fine Downloading/unpacking Fabric==1.2.0 (from -r ../testing/requirements.txt (line 3)) Running setup.py egg_info for package Fabric warning: no previously-included files matching '*' found under directory 'docs/_build' warning: no files found matching 'fabfile.py' Downloading/unpacking South==0.7.3 (from -r ../testing/requirements.txt (line 8)) Running setup.py egg_info for package South .... But later check revealed none of the package is installed properly. I cannot import the package, and none is found in the site-packages directory of my virtualenv. So what went wrong? [/INST] I've read the above, realize this is an old question, but it's totally unresolved and still at the top of my google search results so here's an answer that works for everyone: pip install -r /path/to/requirements.txt [INST] Try/Except in Python: How do you properly ignore Exceptions? When you just want to do a try-except without handling the exception, how do you do it in Python? Is the following the right way to do it? try : shutil.rmtree ( path ) except : pass [/INST] try: doSomething() except: pass or try: doSomething() except Exception: pass The difference is, that the first one will also catch KeyboardInterrupt, SystemExit and stuff like that, which are derived directly from exceptions.BaseException, not exceptions.Exception. See documentation for details: try statement — http://docs.python.org/reference/compound_stmts.html#try exceptions — http://docs.python.org/library/exceptions [INST] How can I reverse a list in python? How can I do this in python? array = [0,10,20,40] for (i = array.length() - 1 ;i >= 0; i--) I need to have the elements of an array but from the end to the beginning. [/INST] >>> L = [0,10,20,40] >>> L[::-1] [40, 20, 10, 0] Extended slice syntax is explained well here: http://docs.python.org/release/2.3.5/whatsnew/section-slices.html By special request in a comment this is the most current slice documentation. [INST] How do I find the location of my Python site-packages directory? How do I find the location of my site-packages directory? [/INST] >>> import site; site.getsitepackages() ['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages'] (or just first item with site.getsitepackages()[0]) [INST] Understanding kwargs in Python What are the uses for **kwargs in Python? I know you can do an objects.filter on a table and pass in a **kwargs argument.   Can I also do this for specifying time deltas i.e. timedelta(hours = time1)? How exactly does it work? Is it classes as 'unpacking'? Like a,b=1,2? [/INST] You can use **kwargs to let your functions take an arbitrary number of keyword arguments ("kwargs" means "keyword arguments"): >>> def print_keyword_args(**kwargs): ... # kwargs is a dict of the keyword args passed to the function ... for key, value in kwargs.iteritems(): ... print "%s = %s" % (key, value) ... >>> print_keyword_args(first_name="John", last_name="Doe") first_name = John last_name = Doe You can also use the **kwargs syntax when calling functions by constructing a dictionary of keyword arguments and passing it to your function: >>> kwargs = {'first_name': 'Bobby', 'last_name': 'Smith'} >>> print_keyword_args(**kwargs) first_name = Bobby last_name = Smith The Python Tutorial contains a good explanation of how it works, along with some nice examples. [INST] Behaviour of increment and decrement operators in Python I notice that a pre-increment/decrement operator can be applied on a variable (like ++count). It compiles, but it does not actually change the value of the variable! What is the behavior of the pre-increment/decrement operators (++/--) in Python? Why does Python deviate from the behavior of these operators seen in C/C++? [/INST] ++ is not an operator. It is two + operators. The + operator is the identity operator, which does nothing. (Clarification: the + and - unary operators only work on numbers, but I presume that you wouldn't expect a hypothetical ++ operator to work on strings.) ++count Parses as +(+count) Which translates to count You have to use the slightly longer += operator to do what you want to do: count += 1 I suspect the ++ and -- operators were left out for consistency and simplicity. I don't know the exact argument Guido van Rossum gave for the decision, but I can imagine a few arguments: Simpler parsing. Technically, parsing ++count is ambiguous, as it could be +, +, count (two unary + operators) just as easily as it could be ++, count (one unary ++ operator). It's not a significant syntactic ambiguity, but it does exist. Simpler language. ++ is nothing more than a synonym for += 1. It was a shorthand invented because C compilers were stupid and didn't know how to optimize a += 1 into the inc instruction most computers have. In this day of optimizing compilers and bytecode interpreted languages, adding operators to a language to allow programmers to optimize their code is usually frowned upon, especially in a language like Python that is designed to be consistent and readable. Confusing side-effects. One common newbie error in languages with ++ operators is mixing up the differences (both in precedence and in return value) between the pre- and post-incremend/decrement operators, and Python likes to eliminate language "gotcha"-s. The precedence issues of pre-/post-increment in C are pretty hairy, and incredibly easy to mess up. `�[INST] Getting the length of an array in Python In Python, is the following the only way to get the number of elements? arr.__len__() If so, why the strange syntax? [/INST] my_list = [1,2,3,4,5] len(my_list) The same works for tuples: my_tuple = (1,2,3,4,5) len(my_tuple) And strings, which are really just arrays of characters: my_string = 'hello world' len(my_string) It was intentionally done this way so that lists, tuples and other container types didn't all need to explicitly implement a public .length() method, instead you can just check the len() of anything that implements the 'magic' __len__() method. Sure, this may seem redundant, but length checking implementations can vary considerably, even within the same language. It's not uncommon to see one collection type use a .length() method while another type uses a .length property, while yet another uses .count(). Having a language-level keyword unifies the entry point for all these types. So even objects you may not consider to be lists of elements could still be length-checked. This includes strings, queues, trees, etc. [INST] How do I check if a variable exists? I want to check if a variable exists. Now I'm doing something like this: try: myVar except NameError: # Do something. Are there other ways without exceptions? [/INST] To check the existence of a local variable: if 'myVar' in locals(): # myVar exists. To check the existence of a global variable: if 'myVar' in globals(): # myVar exists. To check if an object has an attribute: if hasattr(obj, 'attr_name'): # obj.attr_name exists. [INST] What is the best project structure for a Python application? Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project's folder hierarchy? Desirable features are ease of maintenance, IDE-friendliness, suitability for source control branching/merging, and easy generation of install packages. In particular: Where do you put the source? Where do you put application startup scripts? Where do you put the IDE project cruft? Where do you put the unit/acceptance tests? Where do you put non-Python data such as config files? Where do you put non-Python sources such as C++ for pyd/so binary extension modules? [/INST] Doesn't too much matter. Whatever makes you happy will work. There aren't a lot of silly rules because Python projects can be simple. /scripts or /bin for that kind of command-line interface stuff /tests for your tests /lib for your C-language libraries /doc for most documentation /apidoc for the Epydoc-generated API docs. And the top-level directory can contain README's, Config's and whatnot. The hard choice is whether or not to use a /src tree. Python doesn't have a distinction between /src, /lib, and /bin like Java or C has. Since a top-level /src directory is seen by some as meaningless, your top-level directory can be the top-level architecture of your application. /foo /bar /baz I recommend putting all of this under the "name-of-my-product" directory. So, if you're writing an application named quux, the directory that contains all this stuff is named /quux. Another project's PYTHONPATH, then, can include /path/to/quux/foo to reuse the QUUX.foo module. In my case, since I use Komodo Edit, my IDE cuft is a single .KPF file. I actually put that in the top-level /quux directory, and omit adding it to SVN. [INST] How do I protect Python code? I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time restricted license file. If we distribute the .py files or even .pyc files it will be easy to (decompile and) remove the code that checks the license file. Another aspect is that my employer does not want the code to be read by our customers, fearing that the code may be stolen or at least the "novel ideas". Is there a good way to handle this problem? Preferably with an off-the-shelf solution. The software will run on Linux systems (so I don't think py2exe will do the trick). [/INST] "Is there a good way to handle this problem?" No. Nothing can be protected against reverse engineering. Even the firmware on DVD machines has been reverse engineered and AACS Encryption key exposed. And that's in spite of the DMCA making that a criminal offense. Since no technical method can stop your customers from reading your code, you have to apply ordinary commercial methods. Licenses. Contracts. Terms and Conditions. This still works even when people can read the code. Note that some of your Python-based components may require that you pay fees before you sell software using those components. Also, some open-source licenses prohibit you from concealing the source or origins of that component. Offer significant value. If your stuff is so good -- at a price that is hard to refuse -- there's no incentive to waste time and money reverse engineering anything. Reverse engineering is expensive. Make your product slightly less expensive. Offer upgrades and enhancements that make any reverse engineering a bad idea. When the next release breaks their reverse engineering, there's no point. This can be carried to absurd extremes, but you should offer new features that make the next release more valuable than reverse engineering. Offer customization at rates so attractive that they'd rather pay you do build and support the enhancements. Use a license key which expires. This is cruel, and will give you a bad reputation, but it certainly makes your software stop working. Offer it as a web service. SaaS involves no downloads to customers. [INST] Can someone explain __all__ in Python? I have been using Python more and more, and I keep seeing the variable __all__ set in different __init__.py files. Can someone explain what this does? [/INST] Linked to, but not explicitly mentioned here, is exactly when __all__ is used. It is a list of strings defining what symbols in a module will be exported when from import * is used on the module. For example, the following code in a foo.py explicitly exports the symbols bar and baz: __all__ = ['bar', 'baz'] waz = 5 bar = 10 def baz(): return 'baz' These symbols can then be imported like so: from foo import * print bar print baz # The following will trigger an exception, as "waz" is not exported by the module print waz If the __all__ above is commented out, this code will then execute to completion, as the default behaviour of import * is to import all symbols that do not begin with an underscore, from the given namespace. Reference: https://docs.python.org/3.5/tutorial/modules.html#importing-from-a-package NOTE: __all__ affects the from import * behavior only. Members that are not mentioned in __all__ are still accessible from outside the module and can be imported with from import . [INST] How do I unload (reload) a Python module? I have a long-running Python server and would like to be able to upgrade a service without restarting the server. What's the best way do do this? if foo.py has changed: unimport foo <-- How do I do this? import foo myfoo = foo.Foo() [/INST] You can reload a module when it has already been imported by using the reload builtin function in Python 2: import foo while True: # Do some things. if is_changed(foo): foo = reload(foo) In Python 3, reload was moved to the imp module. In 3.4, imp was deprecated in favor of importlib, and reload was added to the latter. When targeting 3 or later, either reference the appropriate module when calling reload or import it. I think that this is what you want. Web servers like Django's development server use this so that you can see the effects of your code changes without restarting the server process itself. To quote from the docs: Python modules’ code is recompiled and the module-level code reexecuted, defining a new set of objects which are bound to names in the module’s dictionary. The init function of extension modules is not called a second time. As with all other objects in Python the old objects are only reclaimed after their reference counts drop to zero. The names in the module namespace are updated to point to any new or changed objects. Other references to the old objects (such as names external to the module) are not rebound to refer to the new objects and must be updated in each namespace where they occur if that is desired. As you noted in your question, you'll have to reconstruct Foo objects if the Foo class resides in the foo module. [INST] Checking whether a variable is an integer or not How do I check whether a variable is an integer? [/INST] If you need to do this, do isinstance( , int ) unless you are in Python 2.x in which case you want isinstance( , ( int, long ) ) Do not use type. It is almost never the right answer in Python, since it blocks all the flexibility of polymorphism. For instance, if you subclass int, your new class should register as an int, which type will not do: class Spam( int ): pass x = Spam( 0 ) type( x ) == int # False isinstance( x, int ) # True This adheres to Python's strong polymorphism: you should allow any object that behaves like an int, instead of mandating that it be one. BUT The classical Python mentality, though, is that it's easier to ask forgiveness than permission. In other words, don't check whether x is an integer; assume that it is and catch the exception results if it isn't: try: x += 1 except TypeError: ... This mentality is slowly being overtaken by the use of abstract base classes, which let you register exactly what properties your object should have (adding? multiplying? doubling?) by making it inherit from a specially-constructed class. That would be the best solution, since it will permit exactly those objects with the necessary and sufficient attributes, but you will have to read the docs on how to use it. [INST] Directory listing in Python How do I get a list of all files (and directories) in a given directory in Python? [/INST] This is a way to traverse every file and directory in a directory tree: import os for dirname, dirnames, filenames in os.walk('.'): # print path to all subdirectories first. for subdirname in dirnames: print(os.path.join(dirname, subdirname)) # print path to all filenames. for filename in filenames: print(os.path.join(dirname, filename)) # Advanced usage: # editing the 'dirnames' list will stop os.walk() from recursing into there. if '.git' in dirnames: # don't go into any .git directories. dirnames.remove('.git') [INST] How do you remove duplicates from a list in whilst preserving order? Is there a built-in that removes duplicates from list in Python, whilst preserving order? I know that I can use a set to remove duplicates, but that destroys the original order. I also know that I can roll my own like this: def uniq(input): output = [] for x in input: if x not in output: output.append(x) return output (Thanks to unwind for that code sample.) But I'd like to avail myself of a built-in or a more Pythonic idiom if possible. Related question: In Python, what is the fastest algorithm for removing duplicates from a list so that all elements are unique while preserving order? [/INST] Here you have some alternatives: http://www.peterbe.com/plog/uniqifiers-benchmark Fastest one: def f7(seq): seen = set() seen_add = seen.add return [x for x in seq if not (x in seen or seen_add(x))] Why assign seen.add to seen_add instead of just calling seen.add? Python is a dynamic language, and resolving seen.add each iteration is more costly than resolving a local variable. seen.add could have changed between iterations, and the runtime isn't smart enough to rule that out. To play it safe, it has to check the object each time. If you plan on using this function a lot on the same dataset, perhaps you would be better off with an ordered set: http://code.activestate.com/recipes/528878/ O(1) insertion, deletion and member-check per operation. [INST] Convert hex string to int in Python How do I convert a hex string to an int in Python? I may have it as "0xffff" or just "ffff". [/INST] Without the 0x prefix, you need to specify the base explicitly, otherwise there's no way to tell: x = int("deadbeef", 16) With the 0x prefix, Python can distinguish hex and decimal automatically. >>> print int("0xdeadbeef", 0) 3735928559 >>> print int("10", 0) 10 (You must specify 0 as the base in order to invoke this prefix-guessing behavior; omitting the second parameter means to assume base-10. See the comments for more details.) ��[INST] Why does "not(True) in [False, True]" return False? If I do this: >>> False in [False, True] True That returns True. Simply because False is in the list. But if I do: >>> not(True) in [False, True] False That returns False. Whereas not(True) is equal to False: >>> not(True) False Why? [/INST] Operator precedence 2.x, 3.x. The precedence of not is lower than that of in. So it is equivalent to: >>> not (True in [False, True]) False This is what you want: >>> (not True) in [False, True] True As @Ben points out: It's recommended to never write not(True), prefer not True. The former makes it look like a function call, while not is an operator, not a function. [INST] How to create a constant in Python Is there a way to declare a constant in Python. In Java we can create constant in this manner: public static final String CONST_NAME = "Name"; What is the equivalent of the above Java constant declaration in Python? [/INST] No there is not. You cannot declare a variable or value as constant in Python. Just don't change it. If you are in a class, the equivalent would be: class Foo(object): CONST_NAME = "Name" if not, it is just CONST_NAME = "Name" But you might want to have a look at the code snippet Constants in Python by Alex Martelli. [INST] Generate random integers between 0 and 9 How can I generate random integer numbers between 0 and 9 (inclusive) in Python? i.e. 0 1 2 3 4 5 6 7 8 9 [/INST] Try: from random import randint print(randint(0,9)) More info: https://docs.python.org/3.1/library/random.html#random.randint [INST] Delete an element from a dictionary Is there a way to delete an element from a dictionary in Python? I know I can just call .pop on the dictionary, but that returns the element that was removed. What I'm looking for is something returns the dictionary minus the element in question. At present I have a helper function that accepts the dictionary in question as parameter, and then returns a dictionary with the element removed, Is there a more elegant solution? [/INST] The del statement removes an element: del d[key] However, this mutates the existing dictionary so the contents of the dictionary changes for anybody else who has a reference to the same instance. To return a new dictionary, make a copy of the dictionary: def removekey(d, key): r = dict(d) del r[key] return r The dict() constructor makes a shallow copy. To make a deep copy, see the copy module. [INST] Count occurrence of a character in a string What's the simplest way to count the number of occurrences of a character in a string? e.g. count the number of times 'a' appears in 'Mary had a little lamb' [/INST] str.count(sub[, start[, end]]) Return the number of non-overlapping occurrences of substring sub in the range [start, end]. Optional arguments start and end are interpreted as in slice notation. >>> sentence = 'Mary had a little lamb' >>> sentence.count('a') 4 Or: from collections import Counter sentence = 'Mary had a little lamb' print(Counter(list(sentence))['a']) [INST] How do you return multiple values in Python? The canonical way to return multiple values in languages that support it is often tupling. Option: Using a tuple Consider this trivial example: def f(x): y0 = x + 1 y1 = x * 3 y2 = y0 ** y3 return (y0,y1,y2) However, this quickly gets problematic as the number of values returned increases. What if you want to return four or five values? Sure, you could keep tupling them, but it gets easy to forget which value is where. It's also rather ugly to unpack them wherever you want to receive them. Option: Using a dictionary The next logical step seems to be to introduce some sort of 'record notation'. In python, the obvious way to do this is by means of a dict. Consider the following: def g(x): y0 = x + 1 y1 = x * 3 y2 = y0 ** y3 return {'y0':y0, 'y1':y1 ,'y2':y2 } (edit- Just to be clear, y0, y1 and y2 are just meant as abstract identifiers. As pointed out, in practice you'd use meaningful identifiers) Now, we have a mechanism whereby we can project out a particular member of the returned object. For example, result['y0'] Option: Using a class However, there is another option. We could instead return a specialized structure. I've framed this in the context of Python, but I'm sure it applies to other languages as well. Indeed, if you were working in C this might very well be your only option. Here goes: class ReturnValue(object): def __init__(self, y0, y1, y2): self.y0 = y0 self.y1 = y1 self.y2 = y2 def g(x): y0 = x + 1 y1 = x * 3 y2 = y0 ** y3 return ReturnValue(y0, y1, y2) In python the previous two are perhaps very similar in terms of plumbing- After all { y0, y1, y2 } just end up being entries in the internal __dict__ of the ReturnValue. There is one additional feature provided by Python though for tiny objects, the __slots__ attribute. The class could be expressed as: class ReturnValue(object): __slots__ = ["y0", "y1", "y2"] def __init__(self, y0, y1, y2): self.y0 = y0 self.y1 = y1 self.y2 = y2 From the Python Reference Manual: The __slots__ declaration takes a sequence of instance variables and reserves just enough space in each instance to hold a value for each variable. Space is saved because __dict__ is not created for each instance. Option: Using a list Another suggestion which I'd overlooked comes from Bill the Lizard: def h(x): result = [x + 1] result.append(x * 3) result.append(y0 ** y3) return result This is my least favorite method though. I suppose I'm tainted by exposure to Haskell, but the idea of mixed-type lists has always felt uncomfortable to me. In this particular example the list is -not- mixed type, but it conceivably could be. A list used in this way really doesn't gain anything with respect to the tuple as far as I can tell. The only real difference between lists and tuples in Python is that lists are mutable, wheras tuples are not. I personally tend to carry over the conventions from functional programming: use lists for any number of elements of the same type, and tuples for a fixed number of elements of predetermined types. Question After the lengthy preamble, comes the inevitable question. Which method (do you think) is best? I've typically found myself going the dictionary route because it involves less set-up work. From a types perspective however, you might be better off going the class route, since that may help you avoid confusing what a dictionary represents. On the other hand, there are some in the Python community that feel implied interfaces should be preferred to explicit interfaces, at which point the type of the object really isn't relevant, since you're basically relying on the convention that the same attribute will always have the same meaning. So, how do -you- return multiple values in Python? [/INST] Named tuples were added in 2.6 for this purpose. Also see os.stat for a similar builtin example. >>> import collections >>> point = collections.namedtuple('Point', ['x', 'y']) >>> p = point(1, y=2) >>> p.x, p.y 1 2 >>> p[0], p[1] 1 2 [INST] Map two lists into a dictionary in Python Imagine that you have: keys = ('name', 'age', 'food') values = ('Monty', 42, 'spam') What is the simplest way to produce the following dictionary ? dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'} This code works, but I'm not really proud of it : dict = {} junk = map(lambda k, v: dict.update({k: v}), keys, values) [/INST] Like this: >>> keys = ['a', 'b', 'c'] >>> values = [1, 2, 3] >>> dictionary = dict(zip(keys, values)) >>> print dictionary {'a': 1, 'b': 2, 'c': 3} Voila :-) The pairwise dict constructor and zip function are awesomely useful: https://docs.python.org/2/library/functions.html#func-dict [INST] mkdir -p functionality in Python Is there a way to get functionality similar to mkdir -p on the shell from within Python. I am looking for a solution other than a system call. I am sure the code is less than 20 lines, and I am wondering if someone has already written it? [/INST] mkdir -p functionality as follows: import errno import os def mkdir_p(path): try: os.makedirs(path) except OSError as exc: # Python >2.5 if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise Update For Python ≥ 3.2, os.makedirs has an optional third argument exist_ok that, when true, enables the mkdir -p functionality —unless mode is provided and the existing directory has different permissions than the intended ones; in that case, OSError is raised as previously. [INST] Is there a function in Python to print all the current properties and values of an object? So what I'm looking for here is something like PHP's print_r function. This is so I can debug my scripts by seeing what's the state of the object in question. [/INST] You want vars() mixed with pprint: from pprint import pprint pprint (vars(your_object)) [INST] Remove items from a list while iterating in Python I'm iterating over a list of tuples in Python, and am attempting to remove them if they meet certain criteria. for tup in somelist: if determine(tup): code_to_remove_tup What should I use in place of code_to_remove_tup? I can't figure out how to remove the item in this fashion. [/INST] The answers suggesting list comprehensions are ALMOST correct -- except that they build a completely new list and then give it the same name the old list as, they do NOT modify the old list in place. That's different from what you'd be doing by selective removal, as in @Lennart's suggestion -- it's faster, but if your list is accessed via multiple references the fact that you're just reseating one of the references and NOT altering the list object itself can lead to subtle, disastrous bugs. Fortunately, it's extremely easy to get both the speed of list comprehensions AND the required semantics of in-place alteration -- just code: somelist[:] = [tup for tup in somelist if determine(tup)] Note the subtle difference with other answers: this one is NOT assigning to a barename - it's assigning to a list slice that just happens to be the entire list, thereby replacing the list contents within the same Python list object, rather than just reseating one reference (from previous list object to new list object) like the other answers. [INST] Renaming columns in pandas I have a data table using pandas and column labels that I need to edit to replace the original column labels. I'd like to change the column names in a data table A where the original column names are: ['$a', '$b', '$c', '$d', '$e'] to ['a', 'b', 'c', 'd', 'e']. I have the edited column names stored it in a list, but I don't know how to replace the column names. [/INST] df = df.rename(columns={'$a': 'a', '$b': 'b'}) # OR df.rename(columns={'$a': 'a', '$b': 'b'}, inplace=True) http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rename.html [INST] How can I force division to be floating point in Python? Division keeps rounding down to 0 I have two integer values a and b, but I need their ratio in floating point. I know that a[INST] pip install mysql-python fails with EnvironmentError: mysql_config not found This is the error I get (mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python Downloading/unpacking mysql-python Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded Running setup.py egg_info for package mysql-python sh: mysql_config: not found Traceback (most recent call last): File "", line 14, in File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found Complete output from command python setup.py egg_info: sh: mysql_config: not found Traceback (most recent call last): File "", line 14, in File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found ---------------------------------------- Command python setup.py egg_info failed with error code 1 Storing complete log in /home/zjm1126/.pip/pip.log (mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python Downloading/unpacking mysql-python Running setup.py egg_info for package mysql-python sh: mysql_config: not found Traceback (most recent call last): File "", line 14, in File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found Complete output from command python setup.py egg_info: sh: mysql_config: not found Traceback (most recent call last): File "", line 14, in File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found ---------------------------------------- Command python setup.py egg_info failed with error code 1 Storing complete log in /home/zjm1126/.pip/pip.log What can I do to resolve this? [/INST] It seems mysql_config is missing on your system or the installer could not find it. Be sure mysql_config is really installed. For example on Debian/Ubuntu you must install the package: sudo apt-get install libmysqlclient-dev Maybe the mysql_config is not in your path, it will be the case when you compile by yourself the mysql suite. [INST] How to find if directory exists in Python In the os module in Python, is there a way to find if a directory exists, something like: >>> os.direxists(os.path.join(os.getcwd()), 'new_folder')) # in pseudocode True/False [/INST] You're looking for os.path.isdir, or os.path.exists if you don't care whether it's a file or a directory. Example: import os print(os.path.isdir("/home/el")) print(os.path.exists("/home/el/myfile.txt")) [INST] Terminating a Python script I am aware of the die() command in PHP which stops a script early. How can I do this in Python? [/INST] import sys sys.exit() details from the sys module documentation: sys.exit([arg]) Exit from Python. This is implemented by raising the SystemExit exception, so cleanup actions specified by finally clauses of try statements are honored, and it is possible to intercept the exit attempt at an outer level. The optional argument arg can be an integer giving the exit status (defaulting to zero), or another type of object. If it is an integer, zero is considered “successful termination” and any nonzero value is considered “abnormal termination” by shells and the like. Most systems require it to be in the range 0-127, and produce undefined results otherwise. Some systems have a convention for assigning specific meanings to specific exit codes, but these are generally underdeveloped; Unix programs generally use 2 for command line syntax errors and 1 for all other kind of errors. If another type of object is passed, None is equivalent to passing zero, and any other object is printed to stderr and results in an exit code of 1. In particular, sys.exit("some error message") is a quick way to exit a program when an error occurs. Since exit() ultimately “only” raises an exception, it will only exit the process when called from the main thread, and the exception is not intercepted. Note that this is the 'nice' way to exit. @glyphtwistedmatrix below points out that if you want a 'hard exit', you can use os._exit(errorcode), though it's likely os-specific to some extent (it might not take an errorcode under windows, for example), and it definitely is less friendly since it doesn't let the interpreter do any cleanup before the process dies. [INST] null object in Python? How do I refer to the null object in Python? [/INST] In Python, the 'null' object is the singleton None. The best way to check things for "Noneness" is to use the identity operator, is: if foo is None: ... [INST] How to get line count cheaply in Python? I need to get a line count of a large file (hundreds of thousands of lines) in python. What is the most efficient way both memory- and time-wise? At the moment I do: def file_len(fname): with open(fname) as f: for i, l in enumerate(f): pass return i + 1 is it possible to do any better? [/INST] One line, probably pretty fast: num_lines = sum(1 for line in open('myfile.txt')) [INST] Why is [] faster than list()? I recently compared the processing speeds of [] and list() and was surprised to discover that [] runs more than three times faster than list(). I ran the same test with {} and dict() and the results were practically identical: [] and {} both took around 0.128sec / million cycles, while list() and dict() took roughly 0.428sec / million cycles each. Why is this? Do [] and {} (probably () and '', too) immediately pass back a copies of some empty stock literal while their explicitly-named counterparts (list(), dict(), tuple(), str()) fully go about creating an object, whether or not they actually have elements? I have no idea how these two methods differ but I'd love to find out. I couldn't find an answer in the docs or on SO, and searching for empty brackets turned out to be more complicated than I'd expected. I got my timing results by calling timeit.timeit("[]") and timeit.timeit("list()"), and timeit.timeit("{}") and timeit.timeit("dict()"), to compare lists and dictionaries, respectively. I'm running Python 2.7.9. I recently discovered "Why is if True slower than if 1?" that compares the performance of if True to if 1 and seems to touch on a similar literal-versus-global scenario; perhaps it's worth considering as well. [/INST] Because [] and {} are literal syntax. Python can create bytecode just to create the list or dictionary objects: >>> import dis >>> dis.dis(compile('[]', '', 'eval')) 1 0 BUILD_LIST 0 3 RETURN_VALUE >>> dis.dis(compile('{}', '', 'eval')) 1 0 BUILD_MAP 0 3 RETURN_VALUE list() and dict() are separate objects. Their names need to be resolved, the stack has to be involved to push the arguments, the frame has to be stored to retrieve later, and a call has to be made. That all takes more time. For the empty case, that means you have at the very least a LOAD_NAME (which has to search through the global namespace as well as the __builtin__ module) followed by a CALL_FUNCTION, which has to preserve the current frame: >>> dis.dis(compile('list()', '', 'eval')) 1 0 LOAD_NAME 0 (list) 3 CALL_FUNCTION 0 6 RETURN_VALUE >>> dis.dis(compile('dict()', '', 'eval')) 1 0 LOAD_NAME 0 (dict) 3 CALL_FUNCTION 0 6 RETURN_VALUE You can time the name lookup separately with timeit: >>> import timeit >>> timeit.timeit('list', number=10**7) 0.30749011039733887 >>> timeit.timeit('dict', number=10**7) 0.4215109348297119 The time discrepancy there is probably a dictionary hash collision. Subtract those times from the times for calling those objects, and compare the result against the times for using literals: >>> timeit.timeit('[]', number=10**7) 0.30478692054748535 >>> timeit.timeit('{}', number=10**7) 0.31482696533203125 >>> timeit.timeit('list()', number=10**7) 0.9991960525512695 >>> timeit.timeit('dict()', number=10**7) 1.0200958251953125 So having to call the object takes an additional 1.00 - 0.31 - 0.30 == 0.39 seconds per 10 million calls. You can avoid the global lookup cost by aliasing the global names as locals (using a timeit setup, everything you bind to a name is a local): >>> timeit.timeit('_list', '_list = list', number=10**7) 0.1866450309753418 >>> timeit.timeit('_dict', '_dict = dict', number=10**7) 0.19016098976135254 >>> timeit.timeit('_list()', '_list = list', number=10**7) 0.841480016708374 >>> timeit.timeit('_dict()', '_dict = dict', number=10**7) 0.7233691215515137 but you never can overcome that CALL_FUNCTION cost. [INST] 'has_key()' or 'in'? I wonder what is better to do: d = {'a': 1, 'b': 2} 'a' in d True or: d = {'a': 1, 'b': 2} d.has_key('a') True [/INST] in is definitely more pythonic. In fact has_key() was removed in Python 3.x. I�[INST] What are "named tuples" in Python? Reading the changes in Python 3.1, I found something... unexpected: The sys.version_info tuple is now a named tuple: I never heard about named tuples before, and I thought elements could either be indexed by numbers (like in tuples and lists) or by keys (like in dicts). I never expected they could be indexed both ways. Thus, my questions are: What are named tuples? How to use them? Why/when should I use named tuples instead of normal tuples? Why/when should I use normal tuples instead of named tuples? Is there any kind of "named list" (a mutable version of the named tuple)? [/INST] Named tuples are basically easy to create, lightweight object types. Named tuple instances can be referenced using object like variable deferencing or the standard tuple syntax. They can be used similarly to struct or other common record types, except that they are immutable. They were added in Python 2.6 and Python 3.0, although there is a recipe for implementation in Python 2.4. For example, it is common to represent a point, for example as a tuple (x, y). This leads to code like the following: pt1 = (1.0, 5.0) pt2 = (2.5, 1.5) from math import sqrt line_length = sqrt((pt1[0]-pt2[0])**2 + (pt1[1]-pt2[1])**2) Using a named tuple it becomes more readable: from collections import namedtuple Point = namedtuple('Point', 'x y') pt1 = Point(1.0, 5.0) pt2 = Point(2.5, 1.5) from math import sqrt line_length = sqrt((pt1.x-pt2.x)**2 + (pt1.y-pt2.y)**2) However, named tuples are still backwards compatible with normal tuples, so the following will still work: Point = namedtuple('Point', 'x y') pt1 = Point(1.0, 5.0) pt2 = Point(2.5, 1.5) from math import sqrt # use index referencing line_length = sqrt((pt1[0]-pt2[0])**2 + (pt1[1]-pt2[1])**2) # use tuple unpacking x1, y1 = pt1 Thus, you should use named tuples instead of tuples anywhere you think object notation will make your code more pythonic and more easily readable. I personally have started using them to represent very simple value types, particularly when passing them as parameters to functions. It makes the functions more readable, without seeing the context of the tuple packing. Furthermore, you can also replace ordinary immutable classes that have no functions, only fields with them. You can even use your named tuple types as base classes: class Point(namedtuple('Point', 'x y')): [...] However, as with tuples, attributes in named tuples are immutable: >>> Point = namedtuple('Point', 'x y') >>> pt1 = Point(1.0, 5.0) >>> pt1.x = 2.0 AttributeError: can't set attribute If you want to be able change the values, you need another type. There is a handy recipe for mutable recordtypes which allow you to set new values to attributes. >>> from rcdtype import * >>> Point = recordtype('Point', 'x y') >>> pt1 = Point(1.0, 5.0) >>> pt1 = Point(1.0, 5.0) >>> pt1.x = 2.0 >>> print(pt1[0]) 2.0 I am not aware of any form of "named list" that lets you add new fields, however. You may just want to use a dictionary in this situation. Named tuples can be converted to dictionaries using pt1._asdict() which returns {'x': 1.0, 'y': 5.0} and can be operated upon with all the usual dictionary functions. As already noted, you should check the documentation for more information from which these examples were constructed. [INST] Installing specific package versions with pip I'm trying to install version 1.2.2 of the MySQL_python adaptor. The current version shown in PyPi is 1.2.3. Is there a way to install the older version? I found an article stating that this should do it: pip install MySQL_python==1.2.2 When installed, however, it still shows MySQL_python-1.2.3-py2.6.egg-info in the site packages. Is this a problem specific to this package, or am I doing something wrong? [/INST] First, I see two issues with what you're trying to do. Since you already have an installed version, you should either uninstall the current existing driver or use pip install -I MySQL_python==1.2.2 However, you'll soon find out that this doesn't work. If you look at pip's installation log, or if you do a pip install -Iv MySQL_python==1.2.2 you'll find that the PyPI URL link does not work for MySQL_python v1.2.2. You can verify this here: http://pypi.python.org/pypi/MySQL-python/1.2.2 The download link 404s and the fallback URL links are re-directing infinitely due to sourceforge.net's recent upgrade and PyPI's stale URL. So to properly install the driver, you can follow these steps: pip uninstall MySQL_python pip install -Iv http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download [INST] How to get file creation & modification date/times in Python? I have a script that needs to do some stuff based on file creation & modification dates but has to run on Linux & Windows. What's the best cross-platform way to get file creation & modification date/times in Python? [/INST] You have a couple of choices. For one, you can use the os.path.getmtime and os.path.getctime functions: import os.path, time print "last modified: %s" % time.ctime(os.path.getmtime(file)) print "created: %s" % time.ctime(os.path.getctime(file)) Your other option is to use os.stat: import os, time (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) = os.stat(file) print "last modified: %s" % time.ctime(mtime) Note: ctime() does not refer to creation time on *nix systems, but rather the last time the inode data changed. (thanks to kojiro for making that fact more clear in the comments by providing a link to an interesting blog post) [INST] UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128) I'm having problems dealing with unicode characters from text fetched from different web pages (on different sites). I am using BeautifulSoup. The problem is that the error is not always reproducible; it sometimes works with some pages, and sometimes, it barfs by throwing a UnicodeEncodeError. I have tried just about everything I can think of, and yet I have not found anything that works consistently without throwing some kind of Unicode-related error. One of the sections of code that is causing problems is shown below: agent_telno = agent.find('div', 'agent_contact_number') agent_telno = '' if agent_telno is None else agent_telno.contents[0] p.agent_info = str(agent_contact + ' ' + agent_telno).strip() Here is a stack trace produced on SOME strings when the snippet above is run: Traceback (most recent call last): File "foobar.py", line 792, in p.agent_info = str(agent_contact + ' ' + agent_telno).strip() UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128) I suspect that this is because some pages (or more specifically, pages from some of the sites) may be encoded, whilst others may be unencoded. All the sites are based in the UK and provide data meant for UK consumption - so there are no issues relating to internalization or dealing with text written in anything other than English. Does anyone have any ideas as to how to solve this so that I can CONSISTENTLY fix this problem? [/INST] You need to read the Python Unicode HOWTO. This error is the very first example. Basically, stop using str to convert from unicode to encoded text / bytes. Instead, properly use .encode() to encode the string: p.agent_info = u' '.join((agent_contact, agent_telno)).encode('utf-8').strip() or work entirely in unicode. [INST] Correct way to write line to file in Python I'm used to doing print >>f, "hi there" However, it seems that print >> is getting deprecated. What is the recommended way to do the line above? Update: Regarding all those answers with "\n"...is this universal or Unix-specific? IE, should I be doing "\r\n" on Windows? [/INST] You should use the new print() statement, available with Python 2.6+ from __future__ import print_function print("hi there", file=f) The alternative would be to use: f = open('myfile','w') f.write('hi there\n') # python will convert \n to os.linesep f.close() # you can omit in most cases as the destructor will call it Quoting from Python documentation regarding newlines: On output, if newline is None, any '\n' characters written are translated to the system default line separator, os.linesep. If newline is '', no translation takes place. If newline is any of the other legal values, any '\n' characters written are translated to the given string. [INST] Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster? I've been hearing a lot about the PyPy project. They claim it is 6.3 times faster than the CPython interpreter on their site. Whenever we talk about dynamic languages like Python, speed is one of the top issues. To solve this, they say PyPy is 6.3 times faster. The second issue is parallelism, the infamous Global Interpreter Lock (GIL). For this, PyPy says it can give GIL-less Python. If PyPy can solve these great challenges, what are its weaknesses that are preventing wider adoption? That is to say, what's preventing someone like me, a typical Python developer, from switching to PyPy right now? [/INST] PyPy, as others have been quick to mention, has tenuous support for C extensions. It has support, but typically at slower-than-Python speeds and it's iffy at best. Hence a lot of modules simply require CPython. Cython and Numpy are awesome for numerics, and most people who actually need speed in Python are using those (+ Pandas, SciPy, etc.) heavily. Since they're either non-existent or tenuously supported and slow the people who need a fast Python often are better off with CPython both for speed and ease-of-use. Secondly, Python 3 support is experimental at the moment. has just reached stable! As of 20th June 2014, PyPy3 2.3.1 - Fulcrum is out! Thirdly, PyPy sometimes isn't actually faster for "scripts", which a lot of people use Python for. These are the short-running programs that do something simple and small. Because PyPy is a JIT compiler its main advantages come from long run times and simple types (such as numbers). Frankly, PyPy's pre-JIT speeds are pretty bad compared to CPython. Fourthly, inertia. Moving to PyPy often requires retooling, which for some people and organizations is simply too much work. Those are the main reasons that affect me, I'd say. [INST] How do I remove/delete a folder that is not empty with Python? I am getting an 'access is denied' error when I attempt to delete a folder that is not empty. I used the following command in my attempt: os.remove("/folder_name"). What is the most effective way of removing/deleting a folder/directory that is not empty? [/INST] import shutil shutil.rmtree('/folder_name') Standard Library Reference: shutil.rmtree. [INST] python setup.py uninstall I have installed a python package with python setup.py install. How do I uninstall it? [/INST] You need to remove all files manually, and also undo any other stuff that installation did manually. If you don't know the list of all files, you can reinstall it with the --record option, and take a look at the list this produces. To record list of installed files, you can use: python setup.py install --record files.txt Once you want to uninstall you can use xargs to do the removal: cat files.txt | xargs rm -rf [INST] Way to create multiline comments? I have recently started studying Python, but I couldn't find how to implement multi-line comments. Most languages have block comment symbols like /* */ I tried this in Python, but it throws an error, so this probably is not the correct way. Does Python actually have a multiline comment feature? [/INST] You can use triple-quoted strings. When they're not a docstring (first thing in a class/function/module), they are ignored. ''' This is a multiline comment. ''' Guido van Rossum (creator of Python) tweeted this as a "pro tip". However, Python's style guide, PEP8, favors using consecutive single-line comments, and this is also what you'll find in many projects. Editors usually have a shortcut to do this easily. [INST] How do I download a file over HTTP using Python? I have a small utility that I use to download a MP3 from a website on a schedule and then builds/updates a podcast XML file which I've obviously added to iTunes. The text processing that creates/updates the XML file is written in Python. I use wget inside a Windows .bat file to download the actual MP3 however. I would prefer to have the entire utility written in Python though. I struggled though to find a way to actually down load the file in Python, thus why I resorted to wget. So, how do I download the file using Python? [/INST] One more, using urlretrieve: import urllib urllib.urlretrieve ("http://www.example.com/songs/mp3.mp3", "mp3.mp3") (for Python 3+ use 'import urllib.request' and urllib.request.urlretrieve) Yet another one, with a "progressbar" import urllib2 url = "http://download.thinkbroadband.com/10MB.zip" file_name = url.split('/')[-1] u = urllib2.urlopen(url) f = open(file_name, 'wb') meta = u.info() file_size = int(meta.getheaders("Content-Length")[0]) print "Downloading: %s Bytes: %s" % (file_name, file_size) file_size_dl = 0 block_sz = 8192 while True: buffer = u.read(block_sz) if not buffer: break file_size_dl += len(buffer) f.write(buffer) status = r"%10d [%3.2f%%]" % (file_size_dl, file_size_dl * 100. / file_size) status = status + chr(8)*(len(status)+1) print status, f.close() [INST] Python @property versus getters and setters Here is a pure Python-specific design question: class MyClass(object): ... def get_my_attr(self): ... def set_my_attr(self, value): ... and class MyClass(object): ... @property def my_attr(self): ... @my_attr.setter def my_attr(self, value): ... Python lets us to do it either way. If you would design a Python program, which approach would you use and why? [/INST] Prefer properties. It's what they're there for. The reason is that all attributes are public in Python. Starting names with an underscore or two is just a warning that the given attribute is an implementation detail that may not stay the same in future versions of the code. It doesn't prevent you from actually getting or setting that attribute. Therefore, standard attribute access is the normal, Pythonic way of, well, accessing attributes. The advantage of properties is that they are syntactically identical to attribute access, so you can change from one to another without any changes to client code. You could even have one version of a class that uses properties (say, for code-by-contract or debugging) and one that doesn't for production, without changing the code that uses it. At the same time, you don't have to write getters and setters for everything just in case you might need to better control access later. [INST] How to import a module given the full path? How can I load a Python module given its full path? Note that the file can be anywhere in the filesystem, as it is a configuration option. [/INST] For Python 3.5+ use: import importlib.util spec = importlib.util.spec_from_file_location("module.name", "/path/to/file.py") foo = importlib.util.module_from_spec(spec) spec.loader.exec_module(foo) foo.MyClass() For Python 3.3 and 3.4 use: from importlib.machinery import SourceFileLoader foo = SourceFileLoader("module.name", "/path/to/file.py").load_module() foo.MyClass() (Although this has been deprecated in Python 3.4.) Python 2 use: import imp foo = imp.load_source('module.name', '/path/to/file.py') foo.MyClass() There are equivalent convenience functions for compiled Python files and DLLs. See also. http://bugs.python.org/issue21436. [INST] Use different Python version with virtualenv I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python? I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries? [/INST] Just use the -p flag when creating your virtualenv instance to specify the Python executable you want to use, e.g.: virtualenv -p /usr/bin/python2.6 [INST] How can I print a literal "{}" characters in python string and also use .format on it? x = " \{ Hello \} {0} " print x.format(42) gives me : Key Error: Hello\\ I want to print the output: {Hello} 42 [/INST] You need to double the {{ and }}: >>> x = " {{ Hello }} {0} " >>> print x.format(42) ' { Hello } 42 ' Here's the relevant part of the Python documentation for format string syntax: Format strings contain “replacement fields” surrounded by curly braces {}. Anything that is not contained in braces is considered literal text, which is copied unchanged to the output. If you need to include a brace character in the literal text, it can be escaped by doubling: {{ and }}. [INST] Parsing values from a JSON file in Python I have this JSON in a file: { "maps": [ { "id": "blabla", "iscategorical": "0" }, { "id": "blabla", "iscategorical": "0" } ], "masks": [ "id": "valore" ], "om_points": "value", "parameters": [ "id": "valore" ] } I wrote this script which prints all of the json text: json_data=open(file_directory).read() data = json.loads(json_data) pprint(data) How can I parse the file and extract single values? [/INST] I think what Ignacio is saying is that your JSON file is incorrect. You have [] when you should have {}. [] are for lists, {} are for dictionaries. Here's how your JSON file should look, your JSON file wouldn't even load for me: { "maps": [ { "id": "blabla", "iscategorical": "0" }, { "id": "blabla", "iscategorical": "0" } ], "masks": { "id": "valore" }, "om_points": "value", "parameters": { "id": "valore" } } Then you can use your code: import json from pprint import pprint with open('data.json') as data_file: data = json.load(data_file) pprint(data) With data, you can now also find values like so: data["maps"][0]["id"] data["masks"]["id"] data["om_points"] Try those out and see if it starts to make sense. [INST] How do you change the size of figures drawn with matplotlib? How do you change the size of figure drawn with matplotlib? [/INST] figure tells you the call signature: figure(num=None, figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k') So figure(figsize=(1,1)) creates an inch-by-inch image, which will be 80-by-80 pixels unless you also give a different dpi argument. [INST] How do I parse XML in Python? I have many rows in a database that contains xml and I'm trying to write a Python script that will go through those rows and count how many instances of a particular node attribute show up. For instance, my tree looks like: How can I access the attributes 1 and 2 in the XML using Python? [/INST] I suggest ElementTree. There are other compatible implementations of the same API, such as lxml, and cElementTree in the Python standard library itself; but, in this context, what they chiefly add is even more speed -- the ease of programming part depends on the API, which ElementTree defines. After building an Element instance e from the XML, e.g. with the XML function, or by parsing a file with something like import xml.etree.ElementTree e = xml.etree.ElementTree.parse('thefile.xml').getroot() or any of the many other ways shown at ElementTree, you just do something like: for atype in e.findall('type'): print(atype.get('foobar')) and similar, usually pretty simple, code patterns. [INST] How do I check what version of Python is running my script? How can I check what version of the Python Interpreter is interpreting my script? [/INST] This information is available in the sys.version string in the sys module: >>> import sys Human readable: >>> print (sys.version) #parentheses necessary in python 3. 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] For further processing: >>> sys.version_info (2, 5, 2, 'final', 0) # or >>> sys.hexversion 34014192 To ensure a script runs with a minimal version requirement of the Python interpreter add this to your code: assert sys.version_info >= (2,5) This compares major and minor version information. Add micro (=0, 1, etc) and even releaselevel (='alpha','final', etc) to the tuple as you like. Note however, that it is almost always better to "duck" check if a certain feature is there, and if not, workaround (or bail out). Sometimes features go away in newer releases, being replaced by others. [INST] How to remove a key from a python dictionary? When trying to delete a key from a dictionary, I write: if 'key' in myDict: del myDict['key'] Is there a one line way of doing this? [/INST] Use dict.pop(): my_dict.pop('key', None) This will return my_dict[key] if key exists in the dictionary, and None otherwise. If the second parameter is not specified (ie. my_dict.pop('key')) and key does not exist, a KeyError is raised. [INST] How to use threading in Python? I am trying to understand threading in Python. I've looked at the documentation and examples, but quite frankly, many examples are overly sophisticated and I'm having trouble understanding them. How do you clearly show tasks being divided for multi-threading? [/INST] Here's a simple example: you need to try a few alternative URLs and return the contents of the first one to respond. import Queue import threading import urllib2 # called by each thread def get_url(q, url): q.put(urllib2.urlopen(url).read()) theurls = ["http://google.com", "http://yahoo.com"] q = Queue.Queue() for u in theurls: t = threading.Thread(target=get_url, args = (q,u)) t.daemon = True t.start() s = q.get() print s This is a case where threading is used as a simple optimization: each subthread is waiting for a URL to resolve and respond, in order to put its contents on the queue; each thread is a daemon (won't keep the process up if main thread ends -- that's more common than not); the main thread starts all subthreads, does a get on the queue to wait until one of them has done a put, then emits the results and terminates (which takes down any subthreads that might still be running, since they're daemon threads). Proper use of threads in Python is invariably connected to I/O operations (since CPython doesn't use multiple cores to run CPU-bound tasks anyway, the only reason for threading is not blocking the process while there's a wait for some I/O). Queues are almost invariably the best way to farm out work to threads and/or collect the work's results, by the way, and they're intrinsically threadsafe so they save you from worrying about locks, conditions, events, semaphores, and other inter-thread coordination/communication concepts. [INST] How can I get a list of locally installed Python modules? I would like to get a list of Python modules, which are in my Python installation (UNIX server). How can you get a list of Python modules installed in your computer? [/INST] help('modules') in a Python shell/prompt. [INST] How can I do a line break (line continuation) in Python? I have a long line of code that I want to break up among multiple lines. What do I use and what is the syntax? For example, adding a bunch of strings, e = 'a' + 'b' + 'c' + 'd' and have it like this: e = 'a' + 'b' + 'c' + 'd' [/INST] What is the line? You can just have arguments on the next line without any problems: a = dostuff(blahblah1, blahblah2, blahblah3, blahblah4, blahblah5, blahblah6, blahblah7) Otherwise you can do something like this: if a == True and \ b == False Check the style guide for more information. From your example line: a = '1' + '2' + '3' + \ '4' + '5' Or: a = ('1' + '2' + '3' + '4' + '5') Note that the style guide says that using the implicit continuation with parentheses is preferred, but in this particular case just adding parentheses around your expression is probably the wrong way to go. [INST] Most elegant way to check if the string is empty in Python? Does Python have something like an empty string variable where you can do?: if myString == string.empty: Regardless what's the most elegant way to check for empty string values? I find hard coding "" every time for checking an empty string not as good. [/INST] Empty strings are "falsy" which means they are considered false in a Boolean context, so you can just do this: if not myString: This is the preferred way if you know that your variable is a string. If your variable could also be some other type then you should use myString == "". See the documentation on Truth Value Testing for other values that are false in Boolean contexts. [INST] Convert bytes to a Python string I'm using this code to get standard output from an external program: >>> from subprocess import * >>> command_stdout = Popen(['ls', '-l'], stdout=PIPE).communicate()[0] The communicate() method returns an array of bytes: >>> command_stdout b'total 0\n-rw-rw-r-- 1 thomas thomas 0 Mar 3 07:03 file1\n-rw-rw-r-- 1 thomas thomas 0 Mar 3 07:03 file2\n' However, I'd like to work with the output as a normal Python string. So that I could print it like this: >>> print(command_stdout) -rw-rw-r-- 1 thomas thomas 0 Mar 3 07:03 file1 -rw-rw-r-- 1 thomas thomas 0 Mar 3 07:03 file2 I thought that's what the binascii.b2a_qp() method is for, but when I tried it, I got the same byte array again: >>> binascii.b2a_qp(command_stdout) b'total 0\n-rw-rw-r-- 1 thomas thomas 0 Mar 3 07:03 file1\n-rw-rw-r-- 1 thomas thomas 0 Mar 3 07:03 file2\n' Does anybody know how to convert the bytes value back to string? I mean, using the "batteries" instead of doing it manually. And I'd like it to be ok with Python 3. [/INST] You need to decode the bytes object to produce a string: >>> b"abcde" b'abcde' # utf-8 is used here because it is a very common encoding, but you # need to use the encoding your data is actually in. >>> b"abcde".decode("utf-8") 'abcde' [INST] What is a mixin, and why are they useful? In "Programming Python", Mark Lutz mentions "mixins". I'm from a C/C++/C# background and I have not heard the term before. What is a mixin? Reading between the lines of this example (which I've linked to because it's quite long), I'm presuming it's a case of using multiple inheritance to extend a class as opposed to 'proper' subclassing. Is this right? Why would I want to do that rather than put the new functionality into a subclass? For that matter, why would a mixin/multiple inheritance approach be better than using composition? What separates a mixin from multiple inheritance? Is it just a matter of semantics? [/INST] A mixin is a special kind of multiple inheritance. There are two main situations where mixins are used: You want to provide a lot of optional features for a class. You want to use one particular feature in a lot of different classes. For an example of number one, consider werkzeug's request and response system. I can make a plain old request object by saying: from werkzeug import BaseRequest class Request(BaseRequest): pass If I want to add accept header support, I would make that from werkzeug import BaseRequest, AcceptMixin class Request(BaseRequest, AcceptMixin): pass If I wanted to make a request object that supports accept headers, etags, authentication, and user agent support, I could do this: from werkzeug import BaseRequest, AcceptMixin, ETagRequestMixin, UserAgentMixin, AuthorizationMixin class Request(BaseRequest, AcceptMixin, ETagRequestMixin, UserAgentMixin, AuthorizationMixin): pass The difference is subtle, but in the above examples, the mixin classes weren't made to stand on their own. In more traditional multiple inheritance, The AuthenticationMixin (for example) would probably be something more like Authenticator. That is, the class would probably be designed to stand on its own. [INST] ASCII value of a character in Python How do I get the ASCII value of a character as an int in Python? [/INST] From here: function ord() would get the int value of the char. And in case you want to convert back after playing with the number, function chr() does the trick. >>> ord('a') 97 >>> chr(97) 'a' >>> chr(ord('a') + 3) 'd' >>> There is also the unichr function, returning the Unicode character whose ordinal is the unichr argument: >>> unichr(97) u'a' >>> unichr(1234) u'\u04d2' [INST] Import a module from a relative path How do I import a python module given its relative path? For example, if dirFoo contains Foo.py and dirBar, and dirBar contains Bar.py, how do I import Bar.py into Foo.py? Here's a visual representation: dirFoo\ Foo.py dirBar\ Bar.py Foo wishes to include Bar, but restructuring the folder hierarchy is not an option. [/INST] Be sure that dirBar has the __init__.py file -- this makes a directory into a Python package. [INST] What's the difference between list and tuples? What's the difference? What are the advantages / disadvantages of tuples / lists? [/INST] Apart from tuples being immutable there is also a semantic distinction that should guide their usage. Tuples are heterogeneous data structures (i.e., their entries have different meanings), while lists are homogeneous sequences. Tuples have structure, lists have order. Using this distinction makes code more explicit and understandable. One example would be pairs of page and line number to reference locations in a book, e.g.: my_location = (42, 11) # page number, line number You can then use this as a key in a dictionary to store notes on locations. A list on the other hand could be used to store multiple locations. Naturally one might want to add or remove locations from the list, so it makes sense that lists are mutable. On the other hand it doesn't make sense to add or remove items from an existing location - hence tuples are immutable. There might be situations where you want to change items within an existing location tuple, for example when iterating through the lines of a page. But tuple immutability forces you to create a new location tuple for each new value. This seems inconvenient on the face of it, but using immutable data like this is a cornerstone of value types and functional programming techniques, which can have substantial advantages. There are some interesting articles on this issue, e.g. "Python Tuples are Not Just Constant Lists" or "Understanding tuples vs. lists in Python". The official Python documentation also mentions this ("Tuples are immutable, and usually contain an heterogeneous sequence ..."). In a statically typed language like Haskell the values in a tuple generally have different types and the length of the tuple must be fixed. In a list the values all have the same type and the length is not fixed. So the difference is very obvious. Finally there is the namedtuple in Python, which makes sense because a tuple is already supposed to have structure. This underlines the idea that tuples are a light-weight alternative to classes and instances. [INST] Why do people write #!/usr/bin/env python on the first line of a Python script? It seems to me like the files run the same without that line. [/INST] If you have several versions of Python installed, /usr/bin/env will ensure the interpreter used is the first one on your environment's $PATH. The alternative would be to hardcode something like #!/usr/bin/python; that's ok, but less flexible. In Unix, an executable file that's meant to be interpreted can indicate what interpreter to use by having a #! at the start of the first line, followed by the interpreter (and any flags it may need). If you're talking about other platforms, of course, this rule does not apply (but that "shebang line" does no harm, and will help if you ever copy that script to a platform with a Unix base, such as Linux, Mac, etc). [INST] In Python, how do I determine if an object is iterable? Is there a method like isiterable? The only solution I have found so far is to call hasattr(myObj, '__iter__') But I am not sure how fool-proof this is. [/INST] Checking for __iter__ works on sequence types, but it would fail on e.g. strings. I would like to know the right answer too, until then, here is one possibility (which would work on strings, too): try: some_object_iterator = iter(some_object) except TypeError, te: print some_object, 'is not iterable' The iter built-in checks for the __iter__ method or in the case of strings the __getitem__ method. To check if an object is "list like" and not "string like" then the key is the attributes __getitem__ and __iter__: In [9]: hasattr([1,2,3,4], '__iter__') Out[9]: True In [11]: hasattr((1,2,3,4), '__iter__') Out[11]: True In [12]: hasattr(u"hello", '__iter__') Out[12]: False In [14]: hasattr(u"hello", '__getitem__') Out[14]: True Another general pythonic approach is to assume an iterable, then fail gracefully if it does not work on the given object. The Python glossary: Pythonic programming style that determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object ("If it looks like a duck and quacks like a duck, it must be a duck.") By emphasizing interfaces rather than specific types, well-designed code improves its flexibility by allowing polymorphic substitution. Duck-typing avoids tests using type() or isinstance(). Instead, it typically employs the EAFP (Easier to Ask Forgiveness than Permission) style of programming. ... try: _ = (e for e in my_object) except TypeError: print my_object, 'is not iterable' The collections module provides some abstract base classes, which allow to ask classes or instances if they provide particular functionality, for example: import collections if isinstance(e, collections.Iterable): # e is iterable [INST] How do I remove packages installed with Python's easy_install? Python's easy_install makes installing new packages extremely convenient. However, as far as I can tell, it doesn't implement the other common features of a dependency manager - listing and removing installed packages. What is the best way of finding out what's installed, and what is the preferred way of removing installed packages? Are there any files that need to be updated if I remove packages manually (e.g. by rm /usr/local/lib/python2.6/dist-packages/my_installed_pkg.egg or similar)? [/INST] pip, an alternative to setuptools/easy_install, provides an "uninstall" command. Install pip according to the installation instructions: $ wget https://bootstrap.pypa.io/get-pip.py $ python get-pip.py Then you can use pip uninstall to remove packages installed with easy_install [INST] What is the purpose of self in Python? What is the purpose of the self word in Python? I understand it refers to the specific object created from that class, but I can't see why it explicitly needs to be added to every function as a parameter. To illustrate, in Ruby I can do this: class myClass def myFunc(name) @name = name end end Which I understand, quite easily. However in Python I need to include self: class myClass: def myFunc(self, name): self.name = name Can anyone talk me through this? It is not something I've come across in my (admittedly limited) experience. [/INST] The reason you need to use self. is because Python does not use the @ syntax to refer to instance attributes. Python decided to do methods in a way that makes the instance to which the method belongs be passed automatically, but not received automatically: the first parameter of methods is the instance the method is called on. That makes methods entirely the same as functions, and leaves the actual name to use up to you (although self is the convention, and people will generally frown at you when you use something else.) self is not special to the code, it's just another object. Python could have done something else to distinguish normal names from attributes -- special syntax like Ruby has, or requiring declarations like C++ and Java do, or perhaps something yet more different -- but it didn't. Python's all for making things explicit, making it obvious what's what, and although it doesn't do it entirely everywhere, it does do it for instance attributes. That's why assigning to an instance attribute needs to know what instance to assign to, and that's why it needs self.. A�[INST] What's the canonical way to check for type in python? What is the best way to check whether a given object is of a given type? How about checking whether the object inherits from a given type? Let's say I have an object o. How do I check whether it's a str? [/INST] To check if the type of o is exactly str: type(o) is str To check if o is an instance of str or any subclass of str (this would be the "canonical" way): isinstance(o, str) The following also works, and can be useful in some cases: issubclass(type(o), str) type(o) in ([str] + str.__subclasses__()) See Built-in Functions in the Python Library Reference for relevant information. One more note: in this case, you may actually want to use: isinstance(o, basestring) because this will also catch Unicode strings (unicode is not a subclass of str; both str and unicode are subclasses of basestring). Alternatively, isinstance accepts a tuple of classes. This will return True if x is an instance of any subclass of any of (str, unicode): isinstance(o, (str, unicode)) [INST] How can I count the occurrences of a list item in Python? Given an item, how can I count its occurrences in a list in Python? [/INST] If you are using Python 2.7 or 3 and you want number of occurrences for each element: >>> from collections import Counter >>> z = ['blue', 'red', 'blue', 'yellow', 'blue', 'red'] >>> Counter(z) Counter({'blue': 3, 'red': 2, 'yellow': 1}) [INST] Why does comparing strings in Python using either '==' or 'is' sometimes produce a different result? I've got a Python program where two variables are set to the value 'public'. In a conditional expression I have the comparison var1 is var2 which fails, but if I change it to var1 == var2 it returns True. Now if I open my Python interpreter and do the same "is" comparison, it succeeds. >>> s1 = 'public' >>> s2 = 'public' >>> s2 is s1 True What am I missing here? [/INST] is is identity testing, == is equality testing. what happens in your code would be emulated in the interpreter like this: >>> a = 'pub' >>> b = ''.join(['p', 'u', 'b']) >>> a == b True >>> a is b False so, no wonder they're not the same, right? In other words: is is the id(a) == id(b) [INST] Proper way to declare custom exceptions in modern Python? What's the proper way to declare custom exception classes in modern Python? My primary goal is to follow whatever standard other exception classes have, so that (for instance) any extra string I include in the exception is printed out by whatever tool caught the exception. By "modern Python" I mean something that will run in Python 2.5 but be 'correct' for the Python 2.6 and Python 3.* way of doing things. And by "custom" I mean an Exception object that can include extra data about the cause of the error: a string, maybe also some other arbitrary object relevant to the exception. I was tripped up by the following deprecation warning in Python 2.6.2: >>> class MyError(Exception): ... def __init__(self, message): ... self.message = message ... >>> MyError("foo") _sandbox.py:3: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 It seems crazy that BaseException has a special meaning for attributes named message. I gather from PEP-352 that attribute did have a special meaning in 2.5 they're trying to deprecate away, so I guess that name (and that one alone) is now forbidden? Ugh. I'm also fuzzily aware that Exception has some magic parameter args, but I've never known how to use it. Nor am I sure it's the right way to do things going forward; a lot of the discussion I found online suggested they were trying to do away with args in Python 3. Update: two answers have suggested overriding __init__, and __str__/__unicode__/__repr__. That seems like a lot of typing, is it necessary? [/INST] Maybe I missed the question, but why not: class MyException(Exception): pass Edit: to override something (or pass extra args), do this: class ValidationError(Exception): def __init__(self, message, errors): # Call the base class constructor with the parameters it needs super(ValidationError, self).__init__(message) # Now for your custom code... self.errors = errors That way you could pass dict of error messages to the second param, and get to it later with e.errors [INST] Extracting extension from filename in Python Is there a function to extract the extension from a filename? [/INST] Yes. Use os.path.splitext: >>> import os >>> filename, file_extension = os.path.splitext('/path/to/somefile.ext') >>> filename '/path/to/somefile' >>> file_extension '.ext' [INST] What is the difference between old style and new style classes in Python? What is the difference between old style and new style classes in Python? Is there ever a reason to use old-style classes these days? [/INST] From http://docs.python.org/2/reference/datamodel.html#new-style-and-classic-classes : Up to Python 2.1, old-style classes were the only flavour available to the user. The concept of (old-style) class is unrelated to the concept of type: if x is an instance of an old-style class, then x.__class__ designates the class of x, but type(x) is always . This reflects the fact that all old-style instances, independently of their class, are implemented with a single built-in type, called instance. New-style classes were introduced in Python 2.2 to unify the concepts of class and type. A new-style class is simply a user-defined type, no more, no less. If x is an instance of a new-style class, then type(x) is typically the same as x.__class__ (although this is not guaranteed – a new-style class instance is permitted to override the value returned for x.__class__). The major motivation for introducing new-style classes is to provide a unified object model with a full meta-model. It also has a number of immediate benefits, like the ability to subclass most built-in types, or the introduction of "descriptors", which enable computed properties. For compatibility reasons, classes are still old-style by default. New-style classes are created by specifying another new-style class (i.e. a type) as a parent class, or the "top-level type" object if no other parent is needed. The behaviour of new-style classes differs from that of old-style classes in a number of important details in addition to what type returns. Some of these changes are fundamental to the new object model, like the way special methods are invoked. Others are "fixes" that could not be implemented before for compatibility concerns, like the method resolution order in case of multiple inheritance. Python 3 only has new-style classes. No matter if you subclass from object or not, classes are new-style in Python 3. It is however recommended that you still subclass from object. [INST] How to flush output of Python print? How do I force Python's print function to output to the screen? [/INST] import sys sys.stdout.flush() Print by default prints to sys.stdout. References: http://docs.python.org/reference/simple_stmts.html#the-print-statement http://docs.python.org/library/sys.html http://docs.python.org/library/stdtypes.html#file-objects [INST] How to determine the variable type in Python? How do I see the type of a variable whether it is unsigned 32 bit, signed 16 bit, etc.? How do I view it? [/INST] Python doesn't have the same types as C/C++, which appears to be your question. Try this: >>> i = 123 >>> type(i) >>> type(i) is int True >>> i = 123456789L >>> type(i) >>> type(i) is long True >>> i = 123.456 >>> type(i) >>> type(i) is float True The distinction between int and long goes away in Python 3.0, though. [INST] Limiting floats to two decimal points I want a to be rounded to 13.95. >>> a 13.949999999999999 >>> round(a, 2) 13.949999999999999 The round function does not work the way I expected. [/INST] You are running into the old problem with floating point numbers that all numbers cannot be represented. The command line is just showing you the full floating point form from memory. In floating point your rounded version is the same number. Since computers are binary they store floating point numbers as an integer and then divide it by a power of two so 13.95 will be represented in a similar fashion to 125650429603636838/(2**53). Double precision numbers have 53 bits (16 digits) of precision and regular floats have 24 bits (8 digits) of precision. The floating point in python uses double precision to store the values. for example >>> 125650429603636838/(2**53) 13.949999999999999 >>> 234042163/(2**24) 13.949999988079071 >>> a=13.946 >>> print(a) 13.946 >>> print("%.2f" % a) 13.95 >>> round(a,2) 13.949999999999999 >>> print("%.2f" % round(a,2)) 13.95 >>> print("{0:.2f}".format(a)) 13.95 >>> print("{0:.2f}".format(round(a,2))) 13.95 >>> print("{0:.15f}".format(round(a,2))) 13.949999999999999 If you are after only two decimal places as in currency then you have a couple of better choices use integers and store values in cents not dollars and then divide by 100 to convert to dollars. Or use a fixed point number like decimal [INST] Trimming a string in Python How do I remove leading and trailing whitespace from a string in Python? For example: " Hello " --> "Hello" " Hello" --> "Hello" "Hello " --> "Hello" "Bob has a cat" --> "Bob has a cat" [/INST] Just one space, or all such spaces? If the second, then strings already have a .strip() method: >>> ' Hello '.strip() 'Hello' >>> ' Hello'.strip() 'Hello' >>> 'Bob has a cat'.strip() 'Bob has a cat' >>> ' Hello '.strip() # ALL spaces at ends removed 'Hello' If you need only to remove one space however, you could do it with: def strip_one_space(s): if s.endswith(" "): s = s[:-1] if s.startswith(" "): s = s[1:] return s >>> strip_one_space(" Hello ") ' Hello' Also, note that str.strip() removes other whitespace characters as well (e.g. tabs and newlines). To remove only spaces, you can specify the character to remove as an argument to strip, i.e.: >>> " Hello\n".strip(" ") 'Hello\n' [INST] Why does Python code run faster in a function? def main(): for i in xrange(10**8): pass main() This piece of code in Python runs in real 0m1.841s user 0m1.828s sys 0m0.012s However, if the for loop isn't placed within a function, for i in xrange(10**8): pass then it runs for a much longer time: real 0m4.543s user 0m4.524s sys 0m0.012s Why is this? Note: The timing is done with the time function in BASH in Linux. [/INST] Inside a function, the bytecode is 2 0 SETUP_LOOP 20 (to 23) 3 LOAD_GLOBAL 0 (xrange) 6 LOAD_CONST 3 (100000000) 9 CALL_FUNCTION 1 12 GET_ITER >> 13 FOR_ITER 6 (to 22) 16 STORE_FAST 0 (i) 3 19 JUMP_ABSOLUTE 13 >> 22 POP_BLOCK >> 23 LOAD_CONST 0 (None) 26 RETURN_VALUE At top level, the bytecode is 1 0 SETUP_LOOP 20 (to 23) 3 LOAD_NAME 0 (xrange) 6 LOAD_CONST 3 (100000000) 9 CALL_FUNCTION 1 12 GET_ITER >> 13 FOR_ITER 6 (to 22) 16 STORE_NAME 1 (i) 2 19 JUMP_ABSOLUTE 13 >> 22 POP_BLOCK >> 23 LOAD_CONST 2 (None) 26 RETURN_VALUE The difference is that STORE_FAST is faster (!) than STORE_NAME. This is because in a function, i is a local but at toplevel it is a global. To examine bytecode, use the dis module. I was able to disassemble the function directly, but to disassemble the toplevel code I had to use the compile builtin. [INST] How to remove an element from a list by index in Python? How to remove an element from a list by index in Python? I found the list.remove method, but say I want to remove the last element, how do I do this? It seems like the default remove searches the list, but I don't want any search to be performed. [/INST] Use del and specify the element you want to delete with the index: In [9]: a = range(10) In [10]: a Out[10]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] In [11]: del a[-1] In [12]: a Out[12]: [0, 1, 2, 3, 4, 5, 6, 7, 8] Here is the section from the tutorial. [INST] How to trim whitespace (including tabs)? Is there a function that will trim not only spaces for whitespace, but also tabs? [/INST] Whitespace on the both sides: s = " \t a string example\t " s = s.strip() Whitespace on the right side: s = s.rstrip() Whitespace on the left side: s = s.lstrip() As thedz points out, you can provide an argument to strip arbitrary characters to any of these functions like this: s = s.strip(' \t\n\r') This will strip any space, \t, \n, or \r characters from the left-hand side, right-hand side, or both sides of the string. The examples above only remove strings from the left-hand and right-hand sides of strings. If you want to also remove characters from the middle of a string, try re.sub: import re print re.sub('[\s+]', '', s) That should print out: astringexample [INST] Access environment variables from Python I set an environment variable that I want to access in my Python application. How do I get this value? [/INST] Environment variables are accessed through os.environ import os print os.environ['HOME'] Or you can see a list of all the environment variables using: os.environ As sometimes you might need to see a complete list! # using get will return `None` if a key is not present rather than raise a `KeyError` print os.environ.get('KEY_THAT_MIGHT_EXIST') # os.getenv is equivalent, and can also give a default value instead of `None` print os.getenv('KEY_THAT_MIGHT_EXIST', default_value) Python default installation on Windows is C:\Python. If you want to find out while running python you can do: import sys print sys.prefix �w[INST] Nicest way to pad zeroes to string What is the nicest/shortest way to pad a string with zeroes to the left, so the string length has a specific length? [/INST] Strings: >>> n = '4' >>> print n.zfill(3) 004 And for numbers: >>> n = 4 >>> print '%03d' % n 004 >>> print format(4, '03') # python >= 2.6 004 >>> print '{0:03d}'.format(4) # python >= 2.6 004 >>> print '{foo:03d}'.format(foo=4) # python >= 2.6 004 >>> print('{:03d}'.format(4)) # python >= 2.7 + python3 004 >>> print('{0:03d}'.format(4)) # python 3 004 String formatting documentation. [INST] Converting integer to string in Python? I want to convert an integer to a string in Python. I am typecasting it in vain: t=raw_input() c=[] for j in range(0,int(t)): n=raw_input() a=[] a,b= (int(i) for i in n.split(' ')) d=pow(a,b) d.str() c.append(d[0]) for j in c: print j When I try to convert it to string, it's showing an error like int doesn't have any attribute called str. [/INST] >>> str(10) '10' >>> int('10') 10 [Edit] Links to the documentation: int() str() [Edit] The problem seems to come from this line: d.str() Conversion to string is done with the builtin str() function, which basically calls the __str__() method of its parameter. Also, it shouldn't be necessary to call pow(). Try using the ** operator. [INST] Python progression path - From apprentice to guru I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been at the very core of all the major contributions I have made in the lab. I more or less fell in love with the way Python permits me to express beautiful solutions and also with the semantics of the language that allows such a natural flow from thoughts to workable code. What I would like to know is your answer to a kind of question I have seldom seen in this or other forums. This question seems central to me for anyone on the path to Python improvement but who wonders what his next steps should be. Let me sum up what I do NOT want to ask first ;) I don't want to know how to QUICKLY learn Python Nor do I want to find out the best way to get acquainted with the language Finally, I don't want to know a 'one trick that does it all' approach. What I do want to know your opinion about, is: What are the steps YOU would recommend to a Python journeyman, from apprenticeship to guru status (feel free to stop wherever your expertise dictates it), in order that one IMPROVES CONSTANTLY, becoming a better and better Python coder, one step at a time. Some of the people on SO almost seem worthy of worship for their Python prowess, please enlighten us :) The kind of answers I would enjoy (but feel free to surprise the readership :P ), is formatted more or less like this: Read this (eg: python tutorial), pay attention to that kind of details Code for so manytime/problems/lines of code Then, read this (eg: this or that book), but this time, pay attention to this Tackle a few real-life problems Then, proceed to reading Y. Be sure to grasp these concepts Code for X time Come back to such and such basics or move further to... (you get the point :) I really care about knowing your opinion on what exactly one should pay attention to, at various stages, in order to progress CONSTANTLY (with due efforts, of course). If you come from a specific field of expertise, discuss the path you see as appropriate in this field. EDIT: Thanks to your great input, I'm back on the Python improvement track! I really appreciate! [/INST] I thought the process of Python mastery went something like: Discover list comprehensions Discover generators Incorporate map, reduce, filter, iter, range, xrange often into your code Discover Decorators Write recursive functions, a lot Discover itertools and functools Read Real World Haskell (read free online) Rewrite all your old Python code with tons of higher order functions, recursion, and whatnot. Annoy your cubicle mates every time they present you with a Python class. Claim it could be "better" implemented as a dictionary plus some functions. Embrace functional programming. Rediscover the Strategy pattern and then all those things from imperative code you tried so hard to forget after Haskell. Find a balance. [INST] How to leave/exit/deactivate a python virtualenv? I'm using virtualenv and the virtualenvwrapper. I can switch between virtualenv's just fine using the workon command. me@mymachine:~$ workon env1 (env1)me@mymachine:~$ workon env2 (env2)me@mymachine:~$ workon env1 (env1)me@mymachine:~$ However, how do I exit all virtual machines and workon my real machine again? Right now, the only way I have of getting back to me@mymachine:~$ is to exit the shell and start a new one. That's kind of annoying. Is there a command to workon "nothing", and if so, what is it? If such a command does not exist, how would I go about creating it? [/INST] Usually, activating a virtualenv gives you a shell function named: $ deactivate which puts things back to normal. Edit: I have just looked specifically again at the code for virtualenvwrapper, and, yes, it too supports "deactivate" as the way to escape from all virtualenvs. Edit: If you are trying to leave an Anaconda environment, the procedure is a bit different: run the two-word command source deactivate since they implement deactivation using a stand-alone script. bash-4.3$ deactivate pyenv-virtualenv: deactivate must be sourced. Run 'source deactivate' instead of 'deactivate' bash-4.3$ source deactivate pyenv-virtualenv: no virtualenv has been activated. [INST] The meaning of a single- and a double-underscore before an object name in Python I want to clear this up once and for all. Can someone please explain the exact meaning of having leading underscores before an object's name in Python? Also explain the difference between a single and a double leading underscore. Also, does that meaning stay the same whether the object in question is a variable, a function, a method, etcetera? [/INST] Single Underscore Names, in a class, with a leading underscore are simply to indicate to other programmers that the attribute or method is intended to be private. However, nothing special is done with the name itself. To quote PEP-8: _single_leading_underscore: weak "internal use" indicator. E.g. from M import * does not import objects whose name starts with an underscore. Double Underscore (Name Mangling) From the Python docs: Any identifier of the form __spam (at least two leading underscores, at most one trailing underscore) is textually replaced with _classname__spam, where classname is the current class name with leading underscore(s) stripped. This mangling is done without regard to the syntactic position of the identifier, so it can be used to define class-private instance and class variables, methods, variables stored in globals, and even variables stored in instances. private to this class on instances of other classes. And a warning from the same page: Name mangling is intended to give classes an easy way to define “private” instance variables and methods, without having to worry about instance variables defined by derived classes, or mucking with instance variables by code outside the class. Note that the mangling rules are designed mostly to avoid accidents; it still is possible for a determined soul to access or modify a variable that is considered private. Example >>> class MyClass(): ... def __init__(self): ... self.__superprivate = "Hello" ... self._semiprivate = ", world!" ... >>> mc = MyClass() >>> print mc.__superprivate Traceback (most recent call last): File "", line 1, in AttributeError: myClass instance has no attribute '__superprivate' >>> print mc._semiprivate , world! >>> print mc.__dict__ {'_MyClass__superprivate': 'Hello', '_semiprivate': ', world!'} [INST] How to print to stderr in Python? I've come across at least three ways to print to stderr: import sys print >> sys.stderr, 'spam' sys.stderr.write('spam\n') from __future__ import print_function print('spam', file=sys.stderr) It seems to contradict zen of Python #13 †, so what's the preferred way to do it? Are there any advantages or disadvantages to one way or the other? † There should be one — and preferably only one — obvious way to do it. [/INST] I found this to be the only one short + flexible + portable + readable: from __future__ import print_function import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) The function eprint can be used in the same was as the standard print function: >>> print("Test") Test >>> eprint("Test") Test >>> eprint("foo", "bar", "baz", sep="---") foo---bar---baz [INST] How do I connect to a MySQL Database in Python? How do I connect to a MySQL database using a python program? [/INST] Connecting to MYSQL with Python in 3 steps 1 - Setting You must install a MySQL driver before doing anything. Unlike PHP, only the SQLite driver is installed by default with Python. The most used package to do so is MySQLdb but it's hard to install it using easy_install. For Windows user, you can get an exe of MySQLdb. For Linux, this is a casual package (python-mysqldb). (You can use sudo apt-get install python-mysqldb (for debian based distros), yum install mysql-python (for rpm-based), or dnf install python-mysql (for modern fedora distro) in command line to download.) For Mac, you can install MySQLdb using Macport. 2 - Usage After installing, reboot. This is not mandatory, but will prevent me from answering 3 or 4 other questions in this post if something goes wrong. So please reboot. Then it is just like using another package : #!/usr/bin/python import MySQLdb db = MySQLdb.connect(host="localhost", # your host, usually localhost user="john", # your username passwd="megajonhy", # your password db="jonhydb") # name of the data base # you must create a Cursor object. It will let # you execute all the queries you need cur = db.cursor() # Use all the SQL you like cur.execute("SELECT * FROM YOUR_TABLE_NAME") # print all the first cell of all the rows for row in cur.fetchall(): print row[0] db.close() Of course, there are thousand of possibilities and options; this is a very basic example. You will have to look at the documentation. A good starting point. 3 - More advanced usage Once you know how it works, you may want to use an ORM to avoid writting SQL manually and manipulate your tables as they were Python objects. The most famous ORM in the Python community is SQLAlchemy. I strongly advise you to use it: your life is going to be much easier. I recently discovered another jewel in the Python world: peewee. It's a very lite ORM, really easy and fast to setup then use. It makes my day for small projects or stand alone apps, where using big tools like SQLAlchemy or Django is overkill : import peewee from peewee import * db = MySQLDatabase('jonhydb', user='john',passwd='megajonhy') class Book(peewee.Model): author = peewee.CharField() title = peewee.TextField() class Meta: database = db Book.create_table() book = Book(author="me", title='Peewee is cool') book.save() for book in Book.filter(author="me"): print book.title Peewee is cool This example works out of the box. Nothing other than having peewee (pip install peewee :-)) is required. No complicated setup. It's really cool. [INST] Random string generation with upper case letters and digits in Python I want to generate a string of size N. It should be made up of numbers and uppercase English letters such as: 6U1S75 4Z4UKK U911K4 How can I achieve this in a pythonic way? [/INST] Answer in one line: ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(N)) A more secure version; see http://stackoverflow.com/a/23728630/2213647: ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(N)) In details, with a clean function for further reuse: >>> import string >>> import random >>> def id_generator(size=6, chars=string.ascii_uppercase + string.digits): ... return ''.join(random.choice(chars) for _ in range(size)) ... >>> id_generator() 'G5G74W' >>> id_generator(3, "6793YUIO") 'Y3U' How does it work ? We import string, a module that contains sequences of common ASCII characters, and random, a module that deals with random generation. string.ascii_uppercase + string.digits just concatenates the list of characters representing uppercase ASCII chars and digits: >>> string.ascii_uppercase 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> string.digits '0123456789' >>> string.ascii_uppercase + string.digits 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' Then we use a list comprehension to create a list of 'n' elements: >>> range(4) # range create a list of 'n' numbers [0, 1, 2, 3] >>> ['elem' for _ in range(4)] # we use range to create 4 times 'elem' ['elem', 'elem', 'elem', 'elem'] In the example above, we use [ to create the list, but we don't in the id_generator function so Python doesn't create the list in memory, but generates the elements on the fly, one by one (more about this here). Instead of asking to create 'n' times the string elem, we will ask Python to create 'n' times a random character, picked from a sequence of characters: >>> random.choice("abcde") 'a' >>> random.choice("abcde") 'd' >>> random.choice("abcde") 'b' Therefore random.choice(chars) for _ in range(size) really is creating a sequence of size characters. Characters that are randomly picked from chars: >>> [random.choice('abcde') for _ in range(3)] ['a', 'b', 'b'] >>> [random.choice('abcde') for _ in range(3)] ['e', 'b', 'e'] >>> [random.choice('abcde') for _ in range(3)] ['d', 'a', 'c'] Then we just join them with an empty string so the sequence becomes a string: >>> ''.join(['a', 'b', 'b']) 'abb' >>> [random.choice('abcde') for _ in range(3)] ['d', 'c', 'b'] >>> ''.join(random.choice('abcde') for _ in range(3)) 'dac' [INST] Getting the class name of an instance in Python How do I find out a name of class that created an instance of an object in Python if the function I am doing this from is the base class of which the class of the instance has been derived? Was thinking maybe the inspect module might have helped me out here, but it doesn't seem to give me what I want. And short of parsing the __class__ member, I'm not sure how to get at this information. [/INST] Have you tried the __name__ attribute of the class? ie type(x).__name__ will give you the name of the class, which I think is what you want. >>> import itertools >>> x = itertools.count(0) >>> type(x).__name__ 'count' This method works with new-style classes only. Your code might use some old-style classes. The following works for both: x.__class__.__name__ [INST] How do I delete a file or folder in Python? How do I delete a file or folder in Python? I am using the Python scripting language running on the Windows XP operating system. [/INST] os.remove() will remove a file. os.rmdir() will remove an empty directory. shutil.rmtree() will delete a directory and all its contents. [INST] error: Unable to find vcvarsall.bat I tried to install the Python package dulwich: pip install dulwich But I get a cryptic error message: error: Unable to find vcvarsall.bat The same happens if I try installing the package manually: > python setup.py install running build_ext building 'dulwich._objects' extension error: Unable to find vcvarsall.bat [/INST] Update: Comments point out that the instructions here may be dangerous. Consider using the Visual C++ 2008 Express edition or the purpose-built Microsoft Visual C++ Compiler for Python (details) and NOT using the original answer below. Original error message means the required version of Visual C++ is not installed. For Windows installations: While running setup.py for package installations, Python 2.7 searches for an installed Visual Studio 2008. You can trick Python to use a newer Visual Studio by setting the correct path in VS90COMNTOOLS environment variable before calling setup.py. Execute the following command based on the version of Visual Studio installed: Visual Studio 2010 (VS10): SET VS90COMNTOOLS=%VS100COMNTOOLS% Visual Studio 2012 (VS11): SET VS90COMNTOOLS=%VS110COMNTOOLS% Visual Studio 2013 (VS12): SET VS90COMNTOOLS=%VS120COMNTOOLS% Visual Studio 2015 (VS14): SET VS90COMNTOOLS=%VS140COMNTOOLS% WARNING: As noted below, this answer is unlikely to work if you are trying to compile python modules. See Building lxml for Python 2.7 on Windows for details. [INST] Create a dictionary with list comprehension in Python I like the Python list comprehension syntax. Can it be used to create dictionaries too? For example, by iterating over pairs of keys and values: mydict = {(k,v) for (k,v) in blah blah blah} # doesn't work :( [/INST] In Python 2.6 and earlier, the dict constructor can receive an iterable of key/value pairs: d = dict((key, value) for (key, value) in iterable) From Python 2.7 and 3 onwards, you can just use the dict comprehension syntax directly: d = {key: value for (key, value) in iterable} Of course, you can use the iterable in any way you want (tuples and lists literals, generator comprehensions, list comprehensions, generator functions, functional composition... feel creative) as long as each element is an iterable itself of two elements: d = {value: foo(value) for value in sequence if bar(value)} def key_value_gen(k): yield chr(k+65) yield chr((k+13)%26+65) d = dict(map(key_value_gen, range(26))) [INST] Find all files in directory with extension .txt in Python How can I find all files in directory with the extension .txt in python? [/INST] You can use glob: import glob, os os.chdir("/mydir") for file in glob.glob("*.txt"): print(file) or simply os.listdir: import os for file in os.listdir("/mydir"): if file.endswith(".txt"): print(file) or if you want to traverse directory, use os.walk: import os for root, dirs, files in os.walk("/mydir"): for file in files: if file.endswith(".txt"): print(os.path.join(root, file)) [INST] How can you profile a Python script? Project Euler and other coding contests often have a maximum time to run or people boast of how fast their particular solution runs. With python, sometimes the approaches are somewhat kludgey - i.e., adding timing code to __main__. What is a good way to profile how long a python program takes to run? [/INST] Python includes a profiler called cProfile. It not only gives the total running time, but also times each function separately, and tells you how many times each function was called, making it easy to determine where you should make optimizations. You can call it from within your code, or from the interpreter, like this: import cProfile cProfile.run('foo()') Even more usefully, you can invoke the cProfile when running a script: python -m cProfile myscript.py To make it even easier, I made a little batch file called 'profile.bat': python -m cProfile %1 So all I have to do is run: profile euler048.py And I get this: 1007 function calls in 0.061 CPU seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.061 0.061 :1() 1000 0.051 0.000 0.051 0.000 euler048.py:2() 1 0.005 0.005 0.061 0.061 euler048.py:2() 1 0.000 0.000 0.061 0.061 {execfile} 1 0.002 0.002 0.053 0.053 {map} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler objects} 1 0.000 0.000 0.000 0.000 {range} 1 0.003 0.003 0.003 0.003 {sum} EDIT: Updated link to a good video resource from PyCon 2013: http://lanyrd.com/2013/pycon/scdywg/ zp[INST] How do you append to a file in Python? How do you append to the file instead of overwriting it? Is there a special function that appends to the file? [/INST] with open("test.txt", "a") as myfile: myfile.write("appended text") [INST] How to know if an object has an attribute in Python Is there a way in Python to determine if an object has some attribute? For example: >>> a = SomeClass() >>> a.someProperty = value >>> a.property Traceback (most recent call last): File "", line 1, in AttributeError: SomeClass instance has no attribute 'property' How can you tell if a has the attribute property before using it? [/INST] Try hasattr(): if hasattr(a, 'property'): a.property EDIT: See zweiterlinde's answer below, who offers good advice about asking forgiveness! A very pythonic approach! The general practice in python is that, if the property is likely to be there most of the time, simply call it and either let the exception propagate, or trap it with a try/except block. This will likely be faster than hasattr. If the property is likely to not be there most of the time, or you're not sure, using hasattr will probably be faster than repeatedly falling into an exception block. [INST] What is __init__.py for? What is __init__.py for in a Python source directory? [/INST] It's a part of a package. Here's the documentation. The __init__.py files are required to make Python treat the directories as containing packages; this is done to prevent directories with a common name, such as string, from unintentionally hiding valid modules that occur later (deeper) on the module search path. In the simplest case, __init__.py can just be an empty file, but it can also execute initialization code for the package or set the __all__ variable, described later. [INST] Reverse a string in Python There is no built in reverse function in Python's str object. What is the best way of implementing this? If supplying a very concise answer, please elaborate on it's efficiency. Is the str converted to a different object, etc. [/INST] How about: >>> 'hello world'[::-1] 'dlrow olleh' This is extended slice syntax. It works by doing [begin:end:step] - by leaving begin and end off and specifying a step of -1, it reverses a string. [INST] Find current directory and file's directory In Python, what commands can I use to find: the current directory (where I was in the terminal when I ran the Python script), and where the file I am executing is? [/INST] To get the full path to the directory a Python file is contained in, write this in that file: import os dir_path = os.path.dirname(os.path.realpath(__file__)) (Note that the incantation above won't work if you've already used os.chdir() to change your current working directory, since the value of the __file__ constant is relative to the current working directory and is not changed by an os.chdir() call.) To get the current working directory use import os cwd = os.getcwd() Documentation references for the modules, constants and functions used above: The os and os.path modules. The __file__ constant os.path.realpath(path) (returns "the canonical path of the specified filename, eliminating any symbolic links encountered in the path") os.path.dirname(path) (returns "the directory name of pathname path") os.getcwd() (returns "a string representing the current working directory") os.chdir(path) ("change the current working directory to path") [INST] Calling a function of a module from a string with the function's name in Python What is the best way to go about calling a function given a string with the function's name in a Python program. For example, let's say that I have a module foo, and I have a string whose contents are "bar". What is the best way to go about calling foo.bar()? I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this. [/INST] Assuming module foo with method bar: import foo methodToCall = getattr(foo, 'bar') result = methodToCall() As far as that goes, lines 2 and 3 can be compressed to: result = getattr(foo, 'bar')() if that makes more sense for your use case. You can use getattr in this fashion on class instance bound methods, module-level methods, class methods... the list goes on. �h[INST] How to print in Python without newline or space? The question is in the title. I'd like to do in python what I do in this example in c: #include int main() { int i; for (i=0; i<10; i++) printf("."); return 0; } Output: .......... In Python: >>> for i in xrange(0,10): print '.' . . . . . . . . . . >>> for i in xrange(0,10): print '.', . . . . . . . . . . In Python print will add a \n or a space, how can I avoid that? Now, it's just an example. Don't tell me I can first make a string then print it. I'd like to know how to "append" strings to the stdout (I don't know if it's worded correctly). [/INST] General way import sys sys.stdout.write('.') You may also need to call sys.stdout.flush() to ensure stdout is flushed immediately. Python 2.6+ From Python 2.6 you can import the print function from Python 3: from __future__ import print_function This allows you to use the Python 3 solution below. Python 3 In Python 3, the print statement has been changed into a function. In Python 3, you can instead do: print('.', end="") This also works in Python 2, provided that you've used from __future__ import print_function. If you are having trouble with buffering, you can flush the output by adding flush=True keyword argument: print('.', end="", flush=True) [INST] Replacements for switch statement in Python? I want to write a function in Python that returns different fixed values based on the value of an input index. In other languages I would use a switch or case statement, but Python does not appear to have a switch statement. What are the recommended Python solutions in this scenario? [/INST] If you'd like defaults you could use the dictionary get(key[, default]) method: def f(x): return { 'a': 1, 'b': 2, }.get(x, 9) # 9 is default if x not found �`[INST] How do I copy a file in python? How do I copy a file in Python? I couldn't find anything under os. [/INST] shutil has many methods you can use. One of which is: from shutil import copyfile copyfile(src, dst) Copy the contents of the file named src to a file named dst. The destination location must be writable; otherwise, an IOError exception will be raised. If dst already exists, it will be replaced. Special files such as character or block devices and pipes cannot be copied with this function. src and dst are path names given as strings. [INST] How do I sort a list of dictionaries by values of the dictionary in Python? I got a list of dictionaries and want that to be sorted by a value of that dictionary. This [{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}] sorted by name, should become [{'name':'Bart', 'age':10}, {'name':'Homer', 'age':39}] [/INST] It may look cleaner using a key instead a cmp: newlist = sorted(list_to_be_sorted, key=lambda k: k['name']) or as J.F.Sebastian and others suggested, from operator import itemgetter newlist = sorted(list_to_be_sorted, key=itemgetter('name')) For completeness (as pointed out in comments by fitzgeraldsteele), add reverse=True to sort descending newlist = sorted(l, key=itemgetter('name'), reverse=True) [INST] How do I randomly select an item from a list using Python? Assume I have the following list: foo = ['a', 'b', 'c', 'd', 'e'] What is the simplest way to retrieve an item at random from this list? [/INST] Use random.choice: import random foo = ['a', 'b', 'c', 'd', 'e'] print(random.choice(foo)) [INST] Getting the last element of a list in Python In Python, how do you get the last element of a list? [/INST] some_list[-1] is the shortest and most Pythonic. In fact, you can do much more with this syntax. The some_list[-n] syntax gets the nth-to-last element. So some_list[-1] gets the last element, some_list[-2] gets the second to last, etc, all the way down to some_list[-len(some_list)], which gives you the first element. You can also set list elements in this way. For instance: >>> some_list = [1, 2, 3] >>> some_list[-1] = 5 # Set the last element >>> some_list[-2] = 3 # Set the second to last element >>> some_list [1, 3, 5] [INST] Converting string into datetime Short and simple. I've got a huge list of date-times like this as strings: Jun 1 2005 1:33PM Aug 28 1999 12:00AM I'm going to be shoving these back into proper datetime fields in a database so I need to magic them into real datetime objects. Any help (even if it's just a kick in the right direction) would be appreciated. Edit: This is going through Django's ORM so I can't use SQL to do the conversion on insert. [/INST] from datetime import datetime date_object = datetime.strptime('Jun 1 2005 1:33PM', '%b %d %Y %I:%M%p') Link to the Python documentation for strptime and a link for the strftime format mask This is also a really nice reference for stftime [INST] How to convert string to lowercase in Python? Is there any way to convert an entire user inputted string from uppercase, or even part uppercase to lowercase? E.g. Kilometers --> kilometers. [/INST] s = "Kilometer" print(s.lower()) Official documentation here [INST] What does ** (double star) and * (star) do for Python parameters? In the following method definitions, what does the * and ** do for param2? def foo(param1, *param2): def bar(param1, **param2): [/INST] The *args and **kwargs is a common idiom to allow arbitrary number of arguments to functions as described in the section more on defining functions in the Python documentation. The *args will give you all function parameters as a tuple: In [1]: def foo(*args): ...: for a in args: ...: print a ...: ...: In [2]: foo(1) 1 In [4]: foo(1,2,3) 1 2 3 The **kwargs will give you all keyword arguments except for those corresponding to a formal parameter as a dictionary. In [5]: def bar(**kwargs): ...: for a in kwargs: ...: print a, kwargs[a] ...: ...: In [6]: bar(name='one', age=27) age 27 name one Both idioms can be mixed with normal arguments to allow a set of fixed and some variable arguments: def foo(kind, *args, **kwargs): pass Another usage of the *l idiom is to unpack argument lists when calling a function. In [9]: def foo(bar, lee): ...: print bar, lee ...: ...: In [10]: l = [1,2] In [11]: foo(*l) 1 2 In Python 3 it is possible to use *l on the left side of an assignment (Extended Iterable Unpacking): first, *rest = [1,2,3,4] first, *l, last = [1,2,3,4] Also Python 3 adds new semantic (refer PEP 3102): def func(arg1, arg2, arg3='default', *, kwarg1='abc', kwarg2='xyz'): pass Such function accepts only 2 positional arguments, and everything after * can only be passed as keyword argument, not positional one. In Python 2 similar was true for all parameters after *args. [INST] Determine the type of a Python object Is there a simple way to determine if a variable is a list, dictionary, or something else? I am getting an object back that may be either type and I need to be able to tell the difference. [/INST] To get the type of an object, you can use the built-in type() function. Passing an object as the only parameter will return the type object of that object: >>> type([]) is list True >>> type({}) is dict True >>> type('') is str True >>> type(0) is int True >>> type({}) >>> type([]) This of course also works for custom types: >>> class Test1 (object): pass >>> class Test2 (Test1): pass >>> a = Test1() >>> b = Test2() >>> type(a) is Test1 True >>> type(b) is Test2 True Note that type() will only return the immediate type of the object, but won’t be able to tell you about type inheritance. >>> type(b) is Test1 False To cover that, you should use the isinstance function. This of course also works for built-in types: >>> isinstance(b, Test1) True >>> isinstance(b, Test2) True >>> isinstance(a, Test1) True >>> isinstance(a, Test2) False >>> isinstance([], list) True >>> isinstance({}, dict) True isinstance() is usually the preferred way to ensure the type of an object because it will also accept derived types. So unless you actually need the type object (for whatever reason), using isinstance() is preferred over type(). The second parameter of isinstance() also accepts a tuple of types, so it’s possible to check for multiple types at once. isinstance will then return true, if the object is of any of those types: >>> isinstance([], (tuple, list, set)) True [INST] Python string formatting: % vs. .format Python 2.6 introduced the str.format() method with a slightly different syntax from the existing % operator. Which is better and for what situations? The following uses each method and has the same outcome, so what is the difference? #!/usr/bin/python sub1 = "python string!" sub2 = "an arg" a = "i am a %s" % sub1 b = "i am a {0}".format(sub1) c = "with %(kwarg)s!" % {'kwarg':sub2} d = "with {kwarg}!".format(kwarg=sub2) print a # "i am a python string!" print b # "i am a python string!" print c # "with an arg!" print d # "with an arg!" Furthermore when does string formatting occur in Python? For example, if my logging level is set to HIGH will I still take a hit for performing the following % operation? And if so, is there a way to avoid this? log.debug("some debug info: %s" % some_info) [/INST] To answer your first question... .format just seems more sophisticated in many ways. An annoying thing about % is also how it can either take a variable or a tuple. You'd think the following would always work: "hi there %s" % name yet, if name happens to be (1, 2, 3), it will throw a TypeError. To guarantee that it always prints, you'd need to do "hi there %s" % (name,) # supply the single argument as a single-item tuple which is just ugly. .format doesn't have those issues. Also in the second example you gave, the .format example is much cleaner looking. Why would you not use it? not knowing about it (me before reading this) having to be compatible with Python 2.5 To answer your second question, string formatting happens at the same time as any other operation - when the string formatting expression is evaluated. And Python, not being a lazy language, evaluates expressions before calling functions, so in your log.debug example, the expression "some debug info: %s"%some_infowill first evaluate to, e.g. "some debug info: roflcopters are active", then that string will be passed to log.debug(). [INST] How do you read from stdin in Python? I'm trying to do some of the code golf challenges, but they all require the input to be taken from stdin. How do I get that in Python? [/INST] You could use the fileinput module: import fileinput for line in fileinput.input(): pass fileinput will loop through all the lines in the input specified as file names given in command-line arguments, or the standard input if no arguments are provided. [INST] Upgrading all packages with pip Is it possible to upgrade all Python packages at one time with pip? Note that there is a feature request for this on the official issue tracker. [/INST] There isn't a built-in flag yet, but you can use pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U Note: there are infinite potential variations for this. I'm trying to keep this answer short and simple, but please do suggest variations in the comments! Relevant edits: Added a grep to skip "-e" package definitions, as suggested by @jawache (Yes, you could replace grep+cut with sed or awk or Perl or...). Newer versions of pip allow you to list outdated packages, though not in "requirements" format: pip list --outdated Added -n1 to xargs, prevents stopping everything if updating one package fails (thanks @andsens) [INST] How do I check if a string is a number (float) in Python? What is the best possible way to check if a string can be represented as a number in Python? The function I currently have right now is: def is_number(s): try: float(s) return True except ValueError: return False Which, not only is ugly and slow, seems clunky. However I haven't found a better method because calling float in the main function is even worse. [/INST] In case you are looking for parsing (positive, unsigned) integers instead of floats, you can use the isdigit() function for string objects. >>> a = "03523" >>> a.isdigit() True >>> b = "963spam" >>> b.isdigit() False String Methods - isdigit() There's also something on Unicode strings, which I'm not too familiar with Unicode - Is decimal/decimal [INST] Installing pip on Mac OS X I spent most of the day yesterday searching for a clear answer for installing pip. I can't find a good solution. Can somebody help me install it? [/INST] All you need to do is sudo easy_install pip [INST] How to read a file line by line into a list with Python How do I read every line of a file in Python and store each line as an element in list? I want to read the file line by line and each line is appended to the end of the list. [/INST] with open(fname) as f: content = f.readlines() I'm guessing that you meant list and not array. �O[INST] Python join, why is it string.join(list) instead of list.join(string)? This has always confused me. It seems like this would be nicer: my_list = ["Hello", "world"] print my_list.join("-") # Produce: "Hello-world" Than this: my_list = ["Hello", "world"] print "-".join(my_list) # Produce: "Hello-world" Is there a specific reason it does it like this? [/INST] It's because any iterable can be joined, not just lists, but the result and the "joiner" are always strings. E.G: import urllib2 print '\n############\n'.join( urllib2.urlopen('http://data.stackexchange.com/users/7095')) [INST] How to append list to second list (concatenate lists) How do I concatenate two lists in Python? Example: listone = [1, 2, 3] listtwo = [4, 5, 6] Expected outcome: joinedlist == [1, 2, 3, 4, 5, 6] [/INST] Python makes this ridiculously easy. mergedlist = listone + listtwo [INST] How to clone or copy a list? What are the options to clone or copy a list in Python? Using new_list = my_list then modifies new_list every time my_list changes. Why is this? [/INST] You have various possibilities: You can slice it: new_list = old_list[:] Alex Martelli's opinion (at least back in 2007) about this is, that it is a weird syntax and it does not make sense to use it ever. ;) (In his opinion, the next one is more readable). You can use the built in list() function: new_list = list(old_list) You can use generic copy.copy(): import copy new_list = copy.copy(old_list) This is a little slower than list() because it has to find out the datatype of old_list first. If the list contains objects and you want to copy them as well, use generic copy.deepcopy(): import copy new_list = copy.deepcopy(old_list) Obviously the slowest and most memory-needing method, but sometimes unavoidable. Example: import copy class Foo(object): def __init__(self, val): self.val = val def __repr__(self): return str(self.val) foo = Foo(1) a = ['foo', foo] b = a[:] c = list(a) d = copy.copy(a) e = copy.deepcopy(a) # edit orignal list and instance a.append('baz') foo.val = 5 print('original: %r\n slice: %r\n list(): %r\n copy: %r\n deepcopy: %r' % (a, b, c, d, e)) Result: original: ['foo', 5, 'baz'] slice: ['foo', 5] list(): ['foo', 5] copy: ['foo', 5] deepcopy: ['foo', 1] [INST] Static methods in Python? Is it possible to have static methods in Python so I can call them without initializing a class, like: ClassName.StaticMethod ( ) [/INST] Yep, using the staticmethod decorator class MyClass(object): @staticmethod def the_static_method(x): print x MyClass.the_static_method(2) # outputs 2 Note that some code might use the old method of defining a static method, using staticmethod as a function rather than a decorator. This should only be used if you have to support ancient versions of Python (2.2 and 2.3) class MyClass(object): def the_static_method(x): print x the_static_method = staticmethod(the_static_method) MyClass.the_static_method(2) # outputs 2 This is entirely identical to the first example (using @staticmethod), just not using the nice decorator syntax Finally, use staticmethod() sparingly! There are very few situations where static-methods are necessary in Python, and I've seen them used many times where a separate "top-level" function would have been clearer. The following is verbatim from the documentation:: A static method does not receive an implicit first argument. To declare a static method, use this idiom: class C: @staticmethod def f(arg1, arg2, ...): ... The @staticmethod form is a function decorator – see the description of function definitions in Function definitions for details. It can be called either on the class (such as C.f()) or on an instance (such as C().f()). The instance is ignored except for its class. Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see classmethod(). For more information on static methods, consult the documentation on the standard type hierarchy in The standard type hierarchy. New in version 2.2. Changed in version 2.4: Function decorator syntax added. [INST] How can I remove (chomp) a newline in Python? What is the Python equivalent of Perl's chomp function, which removes the last character of a value? [/INST] Try the rstrip method. >>> 'test string\n'.rstrip() 'test string' Note that Python's rstrip method strips all kinds of trailing whitespace by default, not just one newline as Perl does with chomp. To strip only newlines: >>> 'test string \n\n'.rstrip('\n') 'test string ' There is also the lstrip and strip methods. >>> s = " \n abc def " >>> s.strip() 'abc def' >>> s.rstrip() ' \n abc def' >>> s.lstrip() 'abc def ' >>> [INST] How do you split a list into evenly sized chunks? I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive. I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators. This should work: l = range(1, 1000) print chunks(l, 10) -> [ [ 1..10 ], [ 11..20 ], .., [ 991..999 ] ] I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though. Related question: What is the most “pythonic” way to iterate over a list in chunks? [/INST] Here's a generator that yields the chunks you want: def chunks(l, n): """Yield successive n-sized chunks from l.""" for i in range(0, len(l), n): yield l[i:i + n] import pprint pprint.pprint(list(chunks(range(10, 75), 10))) [[10, 11, 12, 13, 14, 15, 16, 17, 18, 19], [20, 21, 22, 23, 24, 25, 26, 27, 28, 29], [30, 31, 32, 33, 34, 35, 36, 37, 38, 39], [40, 41, 42, 43, 44, 45, 46, 47, 48, 49], [50, 51, 52, 53, 54, 55, 56, 57, 58, 59], [60, 61, 62, 63, 64, 65, 66, 67, 68, 69], [70, 71, 72, 73, 74]] If you're using Python 2, you should use xrange() instead of range(): def chunks(l, n): """Yield successive n-sized chunks from l.""" for i in xrange(0, len(l), n): yield l[i:i + n] Also you can simply use list comprehension instead of write a function. Python 3: [l[i:i + n] for i in range(0, len(l), n)] Python 2 version: [l[i:i + n] for i in xrange(0, len(l), n)] [INST] Is there a way to substring a string in Python? Is there a way to substring a string in Python, to get a new string from the 3rd character to the end of the string? Maybe like myString[2:end]? If leaving the second part means 'till the end', if you leave the first part, does it start from the start? [/INST] >>> x = "Hello World!" >>> x[2:] 'llo World!' >>> x[:2] 'He' >>> x[:-2] 'Hello Worl' >>> x[-2:] 'd!' >>> x[2:-2] 'llo Worl' Python calls this concept "slicing" and it works on more than just strings. Take a look here for a comprehensive introduction. [INST] How to get the size of a list items = [] items.append("apple") items.append("orange") items.append("banana") # FAKE METHOD:: items.amount() # Should return 3 How do I do it right? [/INST] The len() function can be used with a lot of types in Python - both built-in types and library types. >>> len([1,2,3]) 3 [INST] Static class variables in Python Is it possible to have static class variables or methods in python? What syntax is required to do this? [/INST] Variables declared inside the class definition, but not inside a method are class or static variables: >>> class MyClass: ... i = 3 ... >>> MyClass.i 3 As @millerdev points out, this creates a class-level "i" variable, but this is distinct from any instance-level "i" variable, so you could have >>> m = MyClass() >>> m.i = 4 >>> MyClass.i, m.i >>> (3, 4) This is different from C++ and Java, but not so different from C#, where a static member can't be accessed using a reference to an instance. See what the Python tutorial has to say on the subject of classes and class objects. @Steve Johnson has already answered regarding static methods, also documented under "Built-in Functions" in the Python Library Reference. class C: @staticmethod def f(arg1, arg2, ...): ... @beidy recommends classmethods over staticmethod, as the method then receives the class type as the first argument, but I'm still a little fuzzy on the advantages of this approach over staticmethod. If you are too, then it probably doesn't matter. [INST] Print in terminal with colors using Python? How can I output colored text to the terminal, in Python? What is the best Unicode symbol to represent a solid block? [/INST] This somewhat depends on what platform you are on. The most common way to do this is by printing ANSI escape sequences. For a simple example, here's some python code from the blender build scripts: class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' To use code like this, you can do something like print bcolors.WARNING + "Warning: No active frommets remain. Continue?" + bcolors.ENDC This will work on unixes including OS X, linux and windows (provided you use ANSICON, or in Windows 10 provided you enable VT100 emulation). There are ansi codes for setting the color, moving the cursor, and more. If you are going to get complicated with this (and it sounds like you are if you are writing a game), you should look into the "curses" module, which handles a lot of the complicated parts of this for you. The Python Curses HowTO is a good introduction. If you are not using extended ASCII (i.e. not on a PC), you are stuck with the ascii characters below 127, and '#' or '@' is probably your best bet for a block. If you can ensure your terminal is using a IBM extended ascii character set, you have many more options. Characters 176, 177, 178 and 219 are the "block characters". Some modern text-based programs, such as "Dwarf Fortress", emulate text mode in a graphical mode, and use images of the classic PC font. You can find some of these bitmaps that you can use on the Dwarf Fortress Wiki see (user-made tilesets). The Text Mode Demo Contest has more resources for doing graphics in text mode. Hmm.. I think got a little carried away on this answer. I am in the midst of planning an epic text-based adventure game, though. Good luck with your colored text! [INST] Making a flat list out of list of lists in Python I wonder whether there is a shortcut to make a simple list out of list of lists in Python. I can do that in a for loop, but maybe there is some cool "one-liner"? I tried it with reduce, but I get an error. Code l = [[1, 2, 3], [4, 5, 6], [7], [8, 9]] reduce(lambda x, y: x.extend(y), l) Error message Traceback (most recent call last): File "", line 1, in File "", line 1, in AttributeError: 'NoneType' object has no attribute 'extend' [/INST] [item for sublist in l for item in sublist] is faster than the shortcuts posted so far. (l is the list to flatten.) For evidence, as always, you can use the timeit module in the standard library: $ python -mtimeit -s'l=[[1,2,3],[4,5,6], [7], [8,9]]*99' '[item for sublist in l for item in sublist]' 10000 loops, best of 3: 143 usec per loop $ python -mtimeit -s'l=[[1,2,3],[4,5,6], [7], [8,9]]*99' 'sum(l, [])' 1000 loops, best of 3: 969 usec per loop $ python -mtimeit -s'l=[[1,2,3],[4,5,6], [7], [8,9]]*99' 'reduce(lambda x,y: x+y,l)' 1000 loops, best of 3: 1.1 msec per loop Explanation: the shortcuts based on + (including the implied use in sum) are, of necessity, O(L**2) when there are L sublists -- as the intermediate result list keeps getting longer, at each step a new intermediate result list object gets allocated, and all the items in the previous intermediate result must be copied over (as well as a few new ones added at the end). So (for simplicity and without actual loss of generality) say you have L sublists of I items each: the first I items are copied back and forth L-1 times, the second I items L-2 times, and so on; total number of copies is I times the sum of x for x from 1 to L excluded, i.e., I * (L**2)/2. The list comprehension just generates one list, once, and copies each item over (from its original place of residence to the result list) also exactly once. [INST] Iterating over dictionaries using for loops in Python I am a bit puzzled by the following code: d = {'x': 1, 'y': 2, 'z': 3} for key in d: print key, 'corresponds to', d[key] What I don't understand is the key portion. How does Python recognize that it needs only to read the key from the dictionary? Is key a special word in Python? Or is it simply a variable? [/INST] key is just a variable name. for key in d: will simply loop over the keys in the dictionary, rather than the keys and values. To loop over both key and value you can use the following: For Python 2.x: for key, value in d.iteritems(): For Python 3.x: for key, value in d.items(): To test for yourself, change the word key to poop. For Python 3.x, iteritems() has been replaced with simply items(), which returns a set-like view backed by the dict, like iteritems() but even better. This is also available in 2.7 as viewitems(). The operation items() will work for both 2 and 3, but in 2 it will return a list of the dictionary's (key, value) pairs, which will not reflect changes to the dict that happen after the items() call. If you want the 2.x behavior in 3.x, you can call list(d.items()). [INST] How can I make a time delay in Python? I would like to know how to put a time delay in a Python script. [/INST] import time time.sleep(5) # delays for 5 seconds Here is another example where something is run once a minute: import time while True: print "This prints once a minute." time.sleep(60) # Delay for 1 minute (60 seconds) [INST] Parse String to Float or Int In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 542.2222? Or parse the string "31" to an integer, 31? I just want to know how to parse a float string to a float, and (separately) an int string to an int. [/INST] >>> a = "545.2222" >>> float(a) 545.22220000000004 >>> int(float(a)) 545 [INST] How can I represent an 'Enum' in Python? I'm mainly a C# developer, but I'm currently working on a project in Python. How can I represent the equivalent of an Enum in Python? [/INST] Enums have been added to Python 3.4 as described in PEP 435. It has also been backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4 on pypi. For more advanced Enum techniques try the aenum library (2.7, 3.3+, same author as enum34. Code is not perfectly compatible between py2 and py3, e.g. you'll need __order__ in python 2). To use enum34, do $ pip install enum34 To use aenum, do $ pip install aenum Installing enum (no numbers) will install a completely different and incompatible version. from enum import Enum # for enum34, or the stdlib version # from aenum import Enum # for the aenum version Animal = Enum('Animal', 'ant bee cat dog') Animal.ant # returns Animal['ant'] # returns (string lookup) Animal.ant.name # returns 'ant' (inverse lookup) or equivalently: class Animal(Enum): ant = 1 bee = 2 cat = 3 dog = 4 In earlier versions, one way of accomplishing enums is: def enum(**enums): return type('Enum', (), enums) which is used like so: >>> Numbers = enum(ONE=1, TWO=2, THREE='three') >>> Numbers.ONE 1 >>> Numbers.TWO 2 >>> Numbers.THREE 'three' You can also easily support automatic enumeration with something like this: def enum(*sequential, **named): enums = dict(zip(sequential, range(len(sequential))), **named) return type('Enum', (), enums) and used like so: >>> Numbers = enum('ZERO', 'ONE', 'TWO') >>> Numbers.ZERO 0 >>> Numbers.ONE 1 Support for converting the values back to names can be added this way: def enum(*sequential, **named): enums = dict(zip(sequential, range(len(sequential))), **named) reverse = dict((value, key) for key, value in enums.iteritems()) enums['reverse_mapping'] = reverse return type('Enum', (), enums) This overwrites anything with that name, but it is useful for rendering your enums in output. It will throw KeyError if the reverse mapping doesn't exist. With the first example: >>> Numbers.reverse_mapping['three'] 'THREE' [INST] How to get current time in Python What is the module/method used to get current time? [/INST] >>> import datetime >>> datetime.datetime.now() datetime(2009, 1, 6, 15, 8, 24, 78915) And just the time: >>> datetime.datetime.time(datetime.datetime.now()) datetime.time(15, 8, 24, 78915) The same but slightly more compact: >>> datetime.datetime.now().time() See the documentation for more info. To save typing, you can import the datetime object from the datetime module: >>> from datetime import datetime Then remove the leading datetime. from all the above. [INST] Add key to a dictionary in Python? Is it possible to add a key to a Python dictionary after it has been created? It doesn't seem to have an .add() method. [/INST] >>> d = {'key':'value'} >>> print d {'key': 'value'} >>> d['mynewkey'] = 'mynewvalue' >>> print d {'mynewkey': 'mynewvalue', 'key': 'value'} [INST] Check if a given key already exists in a dictionary I wanted to test if a key exists in a dictionary before updating the value for the key. I wrote the following code: if 'key1' in dict.keys(): print "blah" else: print "boo" I think this is not the best way to accomplish this task. Is there a better way to test for a key in the dictionary? [/INST] in is the intended way to test for the existence of a key in a dict. d = dict() for i in xrange(100): key = i % 10 if key in d: d[key] += 1 else: d[key] = 1 If you wanted a default, you can always use dict.get(): d = dict() for i in xrange(100): key = i % 10 d[key] = d.get(key, 0) + 1 ... and if you wanted to always ensure a default value for any key you can use defaultdict from the collections module, like so: from collections import defaultdict d = defaultdict(lambda: 0) for i in xrange(100): d[i % 10] += 1 ... but in general, the in keyword is the best way to do it. [INST] Catch multiple exceptions in one line (except block) I know that I can do: try: # do something that may fail except: # do this if ANYTHING goes wrong I can also do this: try: # do something that may fail except IDontLikeYourFaceException: # put on makeup or smile except YouAreTooShortException: # stand on a ladder But if I want to do the same thing inside two different exceptions, the best I can think of right now is to do this: try: # do something that may fail except IDontLikeYouException: # say please except YouAreBeingMeanException: # say please Is there any way that I can do something like this (since the action to take in both exceptions is to say please): try: # do something that may fail except IDontLikeYouException, YouAreBeingMeanException: # say please Now this really won't work, as it matches the syntax for: try: # do something that may fail except Exception, e: # say please So, my effort to catch the two distinct exceptions doesn't exactly come through. Is there a way to do this? [/INST] From https://docs.python.org/2/tutorial/errors.html#handling-exceptions: "An except clause may name multiple exceptions as a parenthesized tuple, for example": except (IDontLikeYouException, YouAreBeingMeanException) as e: pass Separating the exception from the variable with a comma will still work in Python 2.6 and 2.7, but is now deprecated and does not work in Python 3; now you should be using as. [INST] Finding the index of an item given a list containing it in Python For a list ["foo", "bar", "baz"] and an item in the list "bar", what's the cleanest way to get its index (1) in Python? [/INST] >>> ["foo", "bar", "baz"].index("bar") 1 Reference: Data Structures > More on Lists [INST] Explain Python's slice notation I need a good explanation (references are a plus) on Python's slice notation. To me, this notation needs a bit of picking up. It looks extremely powerful, but I haven't quite got my head around it. [/INST] It's pretty simple really: a[start:end] # items start through end-1 a[start:] # items start through the rest of the array a[:end] # items from the beginning through end-1 a[:] # a copy of the whole array There is also the step value, which can be used with any of the above: a[start:end:step] # start through not past end, by step The key point to remember is that the :end value represents the first value that is not in the selected slice. So, the difference beween end and start is the number of elements selected (if step is 1, the default). The other feature is that start or end may be a negative number, which means it counts from the end of the array instead of the beginning. So: a[-1] # last item in the array a[-2:] # last two items in the array a[:-2] # everything except the last two items Python is kind to the programmer if there are fewer items than you ask for. For example, if you ask for a[:-2] and a only contains one element, you get an empty list instead of an error. Sometimes you would prefer the error, so you have to be aware that this may happen. [INST] Is there a way to run Python on Android? We are working on an S60 version and this platform has a nice Python API. However, there is nothing official about Python on Android, but since Jython exists, is there a way to let the snake and the robot work together? [/INST] One way is to use Kivy: Open source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps. Kivy runs on Linux, Windows, OS X, Android and iOS. You can run the same [python] code on all supported platforms. Kivy Showcase app �GLA[INST] "Least Astonishment" and the Mutable Default Argument Anyone tinkering with Python long enough has been bitten (or torn to pieces) by the following issue: def foo(a=[]): a.append(5) return a Python novices would expect this function to always return a list with only one element: [5]. The result is instead very different, and very astonishing (for a novice): >>> foo() [5] >>> foo() [5, 5] >>> foo() [5, 5, 5] >>> foo() [5, 5, 5, 5] >>> foo() A manager of mine once had his first encounter with this feature, and called it "a dramatic design flaw" of the language. I replied that the behavior had an underlying explanation, and it is indeed very puzzling and unexpected if you don't understand the internals. However, I was not able to answer (to myself) the following question: what is the reason for binding the default argument at function definition, and not at function execution? I doubt the experienced behavior has a practical use (who really used static variables in C, without breeding bugs?) Edit: Baczek made an interesting example. Together with most of your comments and Utaal's in particular, I elaborated further: >>> def a(): ... print "a executed" ... return [] ... >>> >>> def b(x=a()): ... x.append(5) ... print x ... a executed >>> b() [5] >>> b() [5, 5] To me, it seems that the design decision was relative to where to put the scope of parameters: inside the function or "together" with it? Doing the binding inside the function would mean that x is effectively bound to the specified default when the function is called, not defined, something that would present a deep flaw: the def line would be "hybrid" in the sense that part of the binding (of the function object) would happen at definition, and part (assignment of default parameters) at function invocation time. The actual behavior is more consistent: everything of that line gets evaluated when that line is executed, meaning at function definition. [/INST] Actually, this is not a design flaw, and it is not because of internals, or performance. It comes simply from the fact that functions in Python are first-class objects, and not only a piece of code. As soon as you get to think into this way, then it completely makes sense: a function is an object being evaluated on its definition; default parameters are kind of "member data" and therefore their state may change from one call to the other - exactly as in any other object. In any case, Effbot has a very nice explanation of the reasons for this behavior in Default Parameter Values in Python. I found it very clear, and I really suggest reading it for a better knowledge of how function objects work. [INST] How to list all files of a directory in Python How can I list all files of a directory in python and add them to a list? [/INST] os.listdir() will get you everything that's in a directory - files and directories. If you want just files, you could either filter this down using os.path: from os import listdir from os.path import isfile, join onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] or you could use os.walk() which will yield two lists for each directory it visits - splitting into files and dirs for you. If you only want the top directory you can just break the first time it yields from os import walk f = [] for (dirpath, dirnames, filenames) in walk(mypath): f.extend(filenames) break And lastly, as that example shows, adding one list to another you can either use .extend() or >>> q = [1, 2, 3] >>> w = [4, 5, 6] >>> q = q + w >>> q [1, 2, 3, 4, 5, 6] Personally, I prefer .extend() [INST] Accessing the index in Python 'for' loops How do I access the index itself for a list like the following? ints = [8, 23, 45, 12, 78] When I loop through it using a for loop, how do I access the loop index, from 1 to 5 in this case? [/INST] Using an additional state variable, such as an index variable (which you would normally use in languages such as C or PHP), is considered non-pythonic. The better option is to use the built-in function enumerate(), available in both Python 2 and 3: for idx, val in enumerate(ints): print(idx, val) Check out PEP 279 for more. [INST] Does Python have a string contains substring method? I'm looking for a string.contains or string.indexof method in Python. I want to do: if not somestring.contains("blah"): continue [/INST] You can use the in operator: if "blah" not in somestring: continue [INST] append vs. extend What's the difference between the list methods append() and extend()? [/INST] append: Appends object at end. x = [1, 2, 3] x.append([4, 5]) print (x) gives you: [1, 2, 3, [4, 5]] extend: Extends list by appending elements from the iterable. x = [1, 2, 3] x.extend([4, 5]) print (x) gives you: [1, 2, 3, 4, 5] [INST] What is the difference between @staticmethod and @classmethod in Python? What is the difference between a function decorated with @staticmethod and one decorated with @classmethod? [/INST] Maybe a bit of example code will help: Notice the difference in the call signatures of foo, class_foo and static_foo: class A(object): def foo(self,x): print "executing foo(%s,%s)"%(self,x) @classmethod def class_foo(cls,x): print "executing class_foo(%s,%s)"%(cls,x) @staticmethod def static_foo(x): print "executing static_foo(%s)"%x a=A() Below is the usual way an object instance calls a method. The object instance, a, is implicitly passed as the first argument. a.foo(1) # executing foo(<__main__.A object at 0xb7dbef0c>,1) With classmethods, the class of the object instance is implicitly passed as the first argument instead of self. a.class_foo(1) # executing class_foo(,1) You can also call class_foo using the class. In fact, if you define something to be a classmethod, it is probably because you intend to call it from the class rather than from a class instance. A.foo(1) would have raised a TypeError, but A.class_foo(1) works just fine: A.class_foo(1) # executing class_foo(,1) One use people have found for class methods is to create inheritable alternative constructors. With staticmethods, neither self (the object instance) nor cls (the class) is implicitly passed as the first argument. They behave like plain functions except that you can call them from an instance or the class: a.static_foo(1) # executing static_foo(1) A.static_foo('hi') # executing static_foo(hi) Staticmethods are used to group functions which have some logical connection with a class to the class. foo is just a function, but when you call a.foo you don't just get the function, you get a "partially applied" version of the function with the object instance a bound as the first argument to the function. foo expects 2 arguments, while a.foo only expects 1 argument. a is bound to foo. That is what is meant by the term "bound" below: print(a.foo) # > With a.class_foo, a is not bound to class_foo, rather the class A is bound to class_foo. print(a.class_foo) # > Here, with a staticmethod, even though it is a method, a.static_foo just returns a good 'ole function with no arguments bound. static_foo expects 1 argument, and a.static_foo expects 1 argument too. print(a.static_foo) # And of course the same thing happens when you call static_foo with the class A instead. print(A.static_foo) # [INST] Best way to check if a list is empty For example, if passed the following: a = [] How do I check to see if a is empty? [/INST] if not a: print("List is empty") Using the implicit booleanness of the empty list a is quite pythonic. [INST] How do I install pip on Windows? pip is a replacement for easy_install. But should I install pip using easy_install on Windows? Is there a better way? [/INST] Python 2.7.9+ and 3.4+ Good news! Python 3.4 (released March 2014) and Python 2.7.9 (released December 2014) ship with Pip. This is the best feature of any Python release. It makes the community's wealth of libraries accessible to everyone. Newbies are no longer excluded from using community libraries by the prohibitive difficulty of setup. In shipping with a package manager, Python joins Ruby, Node.js, Haskell, Perl, Go--almost every other contemporary language with a majority open-source community. Thank you Python. Of course, that doesn't mean Python packaging is problem solved. The experience remains frustrating. I discuss this in Stack Overflow question Does Python have a package/module management system?. And, alas for everyone using Python 2.7.8 or earlier (a sizable portion of the community). There's no plan to ship Pip to you. Manual instructions follow. Python 2 ≤ 2.7.8 and Python 3 ≤ 3.3 Flying in the face of its 'batteries included' motto, Python ships without a package manager. To make matters worse, Pip was--until recently--ironically difficult to install. Official instructions Per http://www.pip-installer.org/en/latest/installing.html: Download get-pip.py, being careful to save it as a .py file rather than .txt. Then, run it from the command prompt: python get-pip.py You possibly need an administrator command prompt to do this. Follow Start a Command Prompt as an Administrator (Microsoft TechNet). Alternative instructions The official documentation tells users to install Pip and each of its dependencies from source. That's tedious for the experienced, and prohibitively difficult for newbies. For our sake, Christoph Gohlke prepares Windows installers (.msi) for popular Python packages. He builds installers for all Python versions, both 32 and 64 bit. You need to Install setuptools Install pip For me, this installed Pip at C:\Python27\Scripts\pip.exe. Find pip.exe on your computer, then add its folder (for example, C:\Python27\Scripts) to your path (Start / Edit environment variables). Now you should be able to run pip from the command line. Try installing a package: pip install httpie There you go (hopefully)! Solutions for common problems are given below: Proxy problems If you work in an office, you might be behind a HTTP proxy. If so, set the environment variables http_proxy and https_proxy. Most Python applications (and other free software) respect these. Example syntax: http://proxy_url:port http://username:password@proxy_url:port If you're really unlucky, your proxy might be a Microsoft NTLM proxy. Free software can't cope. The only solution is to install a free software friendly proxy that forwards to the nasty proxy. http://cntlm.sourceforge.net/ Unable to find vcvarsall.bat Python modules can be part written in C or C++. Pip tries to compile from source. If you don't have a C/C++ compiler installed and configured, you'll see this cryptic error message. Error: Unable to find vcvarsall.bat You can fix that by installing a C++ compiler such as MinGW or Visual C++. Microsoft actually ship one specifically for use with Python. Or try Microsoft Visual C++ Compiler for Python 2.7. Often though it's easier to check Christoph's site for your package. [INST] Using global variables in a function other than the one that created them If I create a global variable in one function, how can I use that variable in another function? Do I need to store the global variable in a local variable of the function which needs its access? [/INST] You can use a global variable in other functions by declaring it as global in each function that assigns to it: globvar = 0 def set_globvar_to_one(): global globvar # Needed to modify global copy of globvar globvar = 1 def print_globvar(): print globvar # No need for global declaration to read value of globvar set_globvar_to_one() print_globvar() # Prints 1 I imagine the reason for it is that, since global variables are so dangerous, Python wants to make sure that you really know that's what you're playing with by explicitly requiring the global keyword. See other answers if you want to share a global variable across modules. [INST] How to check if a directory exists and create it if necessary? What is the most elegant way to check if the directory a file is going to be written to exists, and if not, create the directory using Python? Here is what I tried: filename = "/my/directory/filename.txt" dir = os.path.dirname(filename) try: os.stat(dir) except: os.mkdir(dir) f = file(filename) Somehow, I missed os.path.exists (thanks kanja, Blair, and Douglas). This is what I have now: def ensure_dir(f): d = os.path.dirname(f) if not os.path.exists(d): os.makedirs(d) Is there a flag for "open", that makes this happen automatically? [/INST] I see two answers with good qualities, each with a small flaw, so I will give my take on it: Try os.path.exists, and consider os.makedirs for the creation. if not os.path.exists(directory): os.makedirs(directory) As noted in comments and elsewhere, there's a race condition - if the directory is created between the os.path.exists and the os.makedirs calls, the os.makedirs will fail with an OSError. Unfortunately, blanket-catching OSError and continuing is not foolproof, as it will ignore a failure to create the directory due to other factors, such as insufficient permissions, full disk, etc. One option would be to trap the OSError and examine the embedded error code, if one knew what's what (on my OS, 13 seems to indicate that permission is denied, and 17 that the file exists - it's not clear that that's even remotely portable, but is explored in Is there a cross-platform way of getting information from Python’s OSError). Alternatively, there could be a second os.path.exists, but suppose another created the directory after the first check, then removed it before the second one - we could still be fooled. Depending on the application, the danger of concurrent operations may be more or less than the danger posed by other factors such as file permissions. The developer would have to know more about the particular application being developed and its expected environment before choosing an implementation. [INST] Sort a Python dictionary by value I have a dictionary of values read from two fields in a database: a string field and a numeric field. The string field is unique, so that is the key of the dictionary. I can sort on the keys, but how can I sort based on the values? Note: I have read Stack Overflow question How do I sort a list of dictionaries by values of the dictionary in Python? and probably could change my code to have a list of dictionaries, but since I do not really need a list of dictionaries I wanted to know if there is a simpler solution. [/INST] It is not possible to sort a dict, only to get a representation of a dict that is sorted. Dicts are inherently orderless, but other types, such as lists and tuples, are not. So you need a sorted representation, which will be a list—probably a list of tuples. For instance, import operator x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0} sorted_x = sorted(x.items(), key=operator.itemgetter(1)) sorted_x will be a list of tuples sorted by the second element in each tuple. dict(sorted_x) == x. And for those wishing to sort on keys instead of values: import operator x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0} sorted_x = sorted(x.items(), key=operator.itemgetter(0)) [INST] How to merge two Python dictionaries in a single expression? I have two Python dictionaries, and I want to write a single expression that returns these two dictionaries, merged. The update() method would be what I need, if it returned its result instead of modifying a dict in-place. >>> x = {'a':1, 'b': 2} >>> y = {'b':10, 'c': 11} >>> z = x.update(y) >>> print z None >>> x {'a': 1, 'b': 10, 'c': 11} How can I get that final merged dict in z, not x? (To be extra-clear, the last-one-wins conflict-handling of dict.update() is what I'm looking for as well.) [/INST] In your case, what you can do is: z = dict(x.items() + y.items()) This will, as you want it, put the final dict in z, and make the value for key b be properly overridden by the second (y) dict's value: >>> x = {'a':1, 'b': 2} >>> y = {'b':10, 'c': 11} >>> z = dict(x.items() + y.items()) >>> z {'a': 1, 'c': 11, 'b': 10} If you use Python 3, it is only a little more complicated. To create z: >>> z = dict(list(x.items()) + list(y.items())) >>> z {'a': 1, 'c': 11, 'b': 10} #[INST] What does `if __name__ == "__main__":` do? What does the if __name__ == "__main__": do? # Threading example import time, thread def myfunction(string, sleeptime, lock, *args): while 1: lock.acquire() time.sleep(sleeptime) lock.release() time.sleep(sleeptime) if __name__ == "__main__": lock = thread.allocate_lock() thread.start_new_thread(myfunction, ("Thread #: 1", 2, lock)) thread.start_new_thread(myfunction, ("Thread #: 2", 2, lock)) [/INST] When the Python interpreter reads a source file, it executes all of the code found in it. Before executing the code, it will define a few special variables. For example, if the python interpreter is running that module (the source file) as the main program, it sets the special __name__ variable to have a value "__main__". If this file is being imported from another module, __name__ will be set to the module's name. In the case of your script, let's assume that it's executing as the main function, e.g. you said something like python threading_example.py on the command line. After setting up the special variables, it will execute the import statement and load those modules. It will then evaluate the def block, creating a function object and creating a variable called myfunction that points to the function object. It will then read the if statement and see that __name__ does equal "__main__", so it will execute the block shown there. One of the reasons for doing this is that sometimes you write a module (a .py file) where it can be executed directly. Alternatively, it can also be imported and used in another module. By doing the main check, you can have that code only execute when you want to run the module as a program and not have it execute when someone just wants to import your module and call your functions themselves. See this page for some extra details. [INST] Calling an external command in Python How can I call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script? [/INST] Look at the subprocess module in the stdlib: from subprocess import call call(["ls", "-l"]) The advantage of subprocess vs system is that it is more flexible (you can get the stdout, stderr, the "real" status code, better error handling, etc...). I think os.system is deprecated, too, or will be: https://docs.python.org/2/library/subprocess.html#replacing-older-functions-with-the-subprocess-module For quick/dirty/one time scripts, os.system is enough, though. [INST] Does Python have a ternary conditional operator? If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs? [/INST] Yes, it was added in version 2.5. The syntax is: a if condition else b First condition is evaluated, then either a or b is returned based on the Boolean value of condition If condition evaluates to True a is returned, else b is returned. For example: >>> 'true' if True else 'false' 'true' >>> 'true' if False else 'false' 'false' Keep in mind that it's frowned upon by some Pythonistas for several reasons: The order of the arguments is different from many other languages (such as C, Ruby, Java, etc.), which may lead to bugs when people unfamiliar with Python's "surprising" behaviour use it (they may reverse the order). Some find it "unwieldy", since it goes contrary to the normal flow of thought (thinking of the condition first and then the effects). Stylistic reasons. If you're having trouble remembering the order, then remember that if you read it out loud, you (almost) say what you mean. For example, x = 4 if b > 8 else 9 is read aloud as x will be 4 if b is greater than 8 otherwise 9. Official documentation: Conditional expressions Is there an equivalent of C’s ”?:” ternary operator? [INST] How do I check whether a file exists using Python? How do I check whether a file exists, without using the try statement? [/INST] You can also use os.path.isfile Return True if path is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same path. import os.path os.path.isfile(fname) if you need to be sure it's a file. Starting with Python 3.4, the pathlib module offers an object-oriented approach: from pathlib import Path my_file = Path("/path/to/file") if my_file.is_file(): # file exists � G���V}�ui0���Zm��Ƒ��_�Y�]c��eH6Q|k����2"��,z�=3��f6��� ������l����DQ�N�Y/OU=U�����p�훷6/{g���k<�S��mL٘�����Ko~�J^��i�m{3�)J���/���{��� � ��]c:; ���x���ʭ��6�;�Wa����1�9��U�lGo��+��{�n�����klʺ�\���F������7ځ7�-n�dE���m�[��l�q��n�ƙ���s R;ۄ�h��j^�?���ٔ�����ŝ�?n�{�u�g�fo�j�u��z�龄��v� (�i�Ę�\�G3zw���Qz��������>"�� vh{�1\�ԣ���@�7�H���]o�Y�r����ۍu��{ܾ����=�8p7T�� ������״| $���βW��|~mn⢶�`�Y� y���uf&{{����o���;7����~|�ٻ?�M�m�rߩ�ͼ��.k�t����hS��w��7�o˦�����&}2Yh^_�_�G�Id��!˾�[������h�r(ȿg�`�����0�*��̸ ��,y��H���}I���6�7:�9R�I�� cf��4b�}������J��۱�0'���VM�2�5�v$Jxyc��� ���[���Z��#&q~c���_�c�.�K~�B���>��~�K�Oل��Dܚ�!�Ny3�N���MQ��|�6.���q���O��)� ��Q]�O��Lp��p ���?���w� oRve���pN����R=�N@�\7�����1����Uj1��Xz�x�o��-_��ȩ{뙊���w s7ӗC�y��ٳ_г��=�X�%���Q:��%0���)�Ni�ǜ�����ĢMC��L/~�\���/���'}���M��-c�?�e���d!���l�i�/��a5��t[���ȹ������ �§8����e)SR����2��w-�qa����H�&H��r�����8&���� �/��B,��FՕ�&��b��<]���p�XD��s�FR�I�Y��Nj"��/�����_>�އT��߭��~B���;[�T�0��ʻ�v�����˦���-��)��.|]�X�����t_H���% �n�1u�+�C�>�O��!��ևh�r�HB�;[H|nb��,X)����2-�D#y����Mij��\�t�F�Jd�¶�vAuIsW�����+�Uu��"��z.7���H���A�J-m�G�֠@F�MlW@`��}p�,�m!�?���-�<�RV�$ҵ dܚ_�㱴/A�]��6�E��N�ǀj��S~��$����s��Q�6�0�֌�������_�����D3��o~\�b.K6����:v����k~x��"�7n~5����{v(�h ��'ϵ ������l�zv�1Z�mb�\a%΃����VΒs^��}U��ߥ���u�u?w�_,����@�3 ��Lp0�e-� H����+Vlc&���O��Y5V�$e���*5I=�5�n�y )h��vf�9@*��1x� 2��obõ�"D'S���r�'� ��� �'p��B%�%�f���o۾Fύ@���1i���R�'��^"z b-�&���\8�����-F���\�+�Q���E�T�˅z�1���v7���\�l+I���L��c���*���.�8�1I$��� SG} `�Ʀ�QA<1���L�=�4\�My.���晋-��v�U�M)8\-{��:�c'A��j;?V6T���_H���0@{��qBt ��D��Em nK��j�dQ�_�AT�Q�b �|*���-�D�+����g����Y��s�� 󲭡�����c��{@P�̖w�Y���'�c ���w�ݏc�O *2i��X I >”������I�6nQ�i�яZ���"Rݕ�z �{!� �PÏ�8��)A�;kW��'��0�ѻHI���}>��1�M;�cn4�S�͸��3C]��2{�۾@ʅ��}WYI��8,]U�མ�q������>5�a�;�㞝�-�:�3{R@-�Z�sn�O�,��#���p� ϧ�b� �� E���� �[>�#�v=π�֎m���1܁\Z%0�T�|�(�%��$i*y&2���`Pv��~�P�b��X$S�6E�C�Q]� �؎��ӿ�^(C�����u�F*��5���*2�#^n���e<�cNf�Q���8�o@�:Vk(t� Q��<*���j��� 1-3 �8.C�#'� �g�G�M�lM@V� p`ʐ�s,��V�ih)y��!]��7i����.T��4 ���X�!���CY�So �\=��Z�U�*��#����G�p�9̗��������`����:��:�LN<7��rr���n��0ٌPP4q����sԓ��8����XC��='�+48 ��3/�R_N�i�V�Oq�ս�Ux¹���D�+.�lP]� JyrEF�-R��dB�X����!k�f����Z�Y{X�oH��fp�������6Ha�H�N�d�%��9�D���(ԡ�����&��H�+��B�CC�X����H�����t��?5�Dž�_Q���g�}�C���ڷ\�!)gP�s-;HJ���d�k[�Ե�2 F@���O̽� {�6�V���s(q��B�̽�K���b�]U��PGF��+}6yߣ=W!��8C��I'k��ȹ��C,Mq���#M�v-�*O�;�͍뤊��[ R����Y&A�p����߫U�8��T�M1�qr9���i�u���f��~w�� ��b���N���M�Դ�� D�I���{ !�D��E�K�j`.�m��E�I�h7���+��2�1�`��d@�j%i��a'�F���4��e�;�"}� F�Y����-9������a Su�x��g�Y��3�N�$�� =�ֳ�|W:�� ǽ���ْ��l��4V�*�AHI#���q�iR��e; �|T������$�љ��؆�e�A��s‹B���~����F�y6%�8�CȬa�H���r+H����`����_��W��o��Jv�n��βo�Cb��O� �܄M��׿�=�L�k,��p�:y{O�U=��fs��O��a~<�/+�k�G�&�fm��F���Zy '��Q��/!4Q��ma����a�U�]�j�t�~h;��Ճ��@��)�9��S������H�;��r.�y�`�r}n.n��D�3�eﭤ)����pL%y���Y^�謬� bT����t_��ޯ/찫�ro~)�G�n�A�����J���Y�P|QJר,n�e'J�B�=+\��Gej�ę�C��gz����^�p���Uk�8�J�ŘM�'_X�4N� =�{aj3�A�@�$���\QQ����(��_9�2Io�$+���"Nq�PRМu#h�����F �KG��Z �Yv�z'��r���@�ч��y�3�� ӓ Bp��)K������ގ_��X�Y�I` �,3�}�� ��i02BF����r۶�]_����j��K.��I�v�3I�i<��&I���"U��Ĥ����H�"m�͹͑f��ޱX,��������hŒ�MD"� ���<�*YpŮb!^�?�r�D�r6OB�c#�D��'iݐa@y ��� ��Z��fC�� ��(zJ�L�����&V;��]�x�����9u���� ��T�%c ��@~F$D�J�B��0k\F@>a+�6i+����.L�w<�����62�Ζ��a�`�h�Z0���s��< &8�i^i�%��#�f�*3x�)�S��_� -��� �����h"^������FE���;�Z�X�`PҚ^"�߂tJO%���mo#�k�����3oAp`#��#y<$�p~�8��:gwp���7ْ�=��w�!D��0դ�f7������p��9mC�%��퐗����b�q����|x�'��A�xP̵6,NL�3&���������O����B���wqHq���ۗ�{�R�JN�q��A+��O��U}�&@5o��~��61̌mS<�2V蒼��uk�� ��&�X����U8���5S�� ŪjֳRi]�x�ĸ ł.5�� 1<��. &��HC�cOz�� �̂���l�a� <��(����E�W�|e� ��Y�� �!9T�d�)�K��I�m�Ko�vAh��\�}��H� o�y�0��w0�7р1�g���5��qF����?u�M���ЦӰ%B�oɊ��ڜ��u��� s��,�9���ܛ��*N�;�j����ש#� [�F�� P�T8�pS(�x��� P��l�;cٹ�=���X�e�X�b�k�b�!'���H�ȴm�E��0y-�0Ra�k��,��X�i��2p&����<�C'� �}8���~�.D;#s�ȝ�Io��J�Dj[��Y��gD*��b�?�� t۪�-8 >!N�a#�g�2.�9��(W%�rC���0`ZK�x�����..�Z̏Lɰ �� �Y: R� ��֐�r>��}��3�:zB���������p1mkD�@D�ϟ+���F�@K�M�8�h�eg�L�|V���axΞ�#���d��V����,� 5� �K�R+��/� �<��E��8���&Φ�Ug�ui?��P\�tt5��\R�GPٕ:��d �i�^35����f����BP�d :JW��د`��P�EP=�/�Z�Uq��PY��pXiK��"�ޑ$ }���yc���2� 6ӻ�1j�=�7�ݑ��P�`A%1�UA���&!�a�S�jV�W�l�.FZ�\�s���ѷ��B+Utr�5 8�` Q�ۖ�4 ~�`��uD�Ś��Q���5bF0�d e�/�Qt���e���p�gG ]4�+��2l�`wR��R0�� �$��cfڎ�>e �J,`"��*;�"^� �^��Qmf&������H�a�3_���S���~�*�d��29FѼ�O<&�xH.a� �"ǡ���^��2�'������2�hCځI�~&�� �Dg��=����\���/㹼|2iߙ�P�W������4L����Z72����.sW�|e�0r=�N���B����X˳ ����_4��Mۺ$�1 zg����I�M���G� ��b"�fC�g1�߯�mm�=��X,�w!c�u��1\�;�a7[�獖��6Q�t���FN� �{�Vku��qDb��;�3ls�/�X;&o�k͐/=��Ϲ���&�疰Ի$�LX �eDX ?��O�\�ۍ�{IWa2j��]��N�1�d��95��EI%b]�����Ǡ�i���hxxb省�`��e��F��2���8.C���̸�[XU��*܅-�i[��c�9�vKH���ӵ��j���A��@4�H'�u�w��nN�:�m���f�|����v/V݌�Su3��$��Ğ����� � �F�mB��(#��ds�^����p� kOʀ�J��H��vP��A��O�!�u��k�Uk�jW|�s�׋��S� 1��8�N���)�18!���Wk�:�ܐ��*�O�Ig �:� �N�Q�h� �N�I�d� �N��*��m�7`; ϫϷ�߀���m7�M�nˆ����x4�;-Ϫ ϶�Ѐ�4�V!N��߀�4W!���߀�4���m�7`�I*��&�E���k�����g�W��57��)@"bH&����A}R�x8���%V��UT����mP~<�/@t'{"�ߞ����H&�Jc�z%:���J�d$O� �R����A �R�Ҩ.��(}��L�b� G�WQoko�ЩF}e�dҮǘ~� b�N�n��گ��A[B�l��LJ�����|v�s*���9��fk��as��r�������is=�G�6����f��8ovk���f��������i͉��t�#g�Yݙ����3��Z��+;�k�t��Ǭܛ��Gyɿ,��NA_Og��_l��q�0�m&vߥz�����-�f��Ț5F<�5{(վK�wz T��z[��v�4���+��p��:�wq_zݞ�ng���>�U�8�t=��p-����M��'7rΙ���_�6s�Ne�Vx�#��J�s��.�� 3�+��Q_� ҅ �T忒T2 �d�ઍ��^띈��I������[W�7ݜ~3�*��&�[�F�������t)&W1��>Z#r��Px�u��������^7�R���&�r���k����C�������$��������|�(n�o��\���x_]����/*� ���<���FD����f?�� ����0�0�c�v����4*#�]���}��s_�QaK��k��gSi.X�/ټ��_�y5]�^q}�Z%Ѳ"�}�������e�hF�͋K�=��0���Y(��+D��a��������=�B���/=V���c�8H�r�a���E�y�G�������' ��BF}u)���Z[s�~�_1�� q��2�L �C����Tʵޝ��E�YiQB����{f/�l���H�s�������}����?���,6*���e�U��Q��+S�z�+��2��- ��rU����*�� �֋�Pe�Е� ��/沒Uu�ײ�b�ʪ2U�([a�:��*_� ���)WZiz�:���`r���MU*�慩W��7e���(_f�,x��2���j���D>���������������`�1��{6ų�c���V��*l���%���ӓ������������ ^�jeR��U ��.��� �GY��x���,�b]Ց)T��������I+j�KX돕�����?8ԁ?T+XW:�P5�#�h���tvz2;8�͎��O������4<�Ey���.<~�����NN������P.u�P�H��P�,�9?'5�Ѕ�u��UREY�(Mu\�"�YRm��w&��U�UmB|Z�0F&�2��FU:����8ZY��������7�Cg �Vڮ2:�J#H6p$��Vٕ]����ݓ�)h?v�U���B��|�+o�L��KH}���6���a�sB�'�<$��E��/��p���,1�aC��OK�=^U�\Y��6 �_7���Z�����j>��x��ԋ[����Ba�~{"����u����=@11Y�&A�]}�� R|]�M����^�-@p�e��z#n���un Z#kҹ����j釤�qJ���c�M?�a2s�\v��F�p' ヽ� ���(6b�`��i6�`QK4ס�Tm�t%�B�꽒dp��t�#�����H�̉;���Q #;;��q@��y�7eu���D���;i��w�����|H��du|*�\��*��6ۣ�����0� ��ue��ㅎ��M�nU�����K�T ׉c�Bn�Έ��ya��)�M �6���fH��.r��� =N�n�`}�m q��2j��d������� z�Ƕ=D�l⼿б�6�6l*p�I�����~�cX(^Y%����G��0������P�U���H!b ����m�ZDk���rQ�]��ղ��6x ����G�`< �ڦ%pt�����B�pγ�Y���?�%4�Yj5¿&f�}z@;�x��=�"(G��� ��~k9�;V$��U~E������ �े�q> a�Ѣ�-��yX��>�� Ғ<���>�i�F7b7�9i;yY5"ݛ�(�I{�1sp0�O������ �0�F[z�x���8���Md/V��pR6����X)�T6p�W c� [��V���̸2�&R�UI�16���Ţ,9��8�Gv]�G]T3�bJ*�.!��:Q}�����/�sHh� �h�Sxg���)��z��������2E�m��c{����S�Ka4"l��2u͑c��� 1‚|�-�2��SJ�*���"��z�\�Ѡ��]���0x�Q�Z�%����f��dž&]��t,� c��m}�@����vw��5�W� k �w,�U&��n�"@W��7v��Q��Gkb�����d� �H�x�#� c�*�I#\��h��L�i �MY�H� ��)d��D�&��e��� =�{�%�C��1u �@jx�W�e"<��Ô y^THE��g^Nj�O�Y��rP/�C������Ŗ"Il:)� Gr�*�g}]��<�+^�C �8Ь!��6c�Dj*NN���&Vdu <�� �04 �uRu�C�3�ִjQ&T���-cgey���'�W2i4\��\�+�R|�sr�C��u4�-���Q(B��gR�:��Xg��r�{7���R2{qY�H����8S�%���� ��� ��w��z��/ ������_�ŸW�D}}��u��վ|�,Ҷ˽�-.H��z<~��O�`������>�z���A2*U[�4��������^N��%+X����˷/߼}�����z���~��n�������e#�%l�hYW'2�� x�C@���fR�R�-~h3>*Q8Xyr�RRLzd���Բ�ᑠ(Y9=����_� ���i2Wjm��O5�<\�Ӿꪜ��)}�)�D�W��N �|''�w���!�y'0T��� $��Hnϻb����۶��]�� �lV�t����7��LM� &5nҥ[�#���A.-(sN�)³`�8���,����֨���R��C0��[9� ( Q8���;��H�|̲=���us�5;�Tܺ{�8�"w����:����0Ḧ�ebL-0{N����gjN���˩NuE6���QMh�� �����=����������ý�^� `d���~��“2�7�Rv����Gx�몺�@�:��h�_��� �LJ�J�C`fq4�����URA�Ң�ı� ���^fQ�z6��kp�K!�i�6G`39p(�"���a;��J�7*�y�� �p�M��wDž�.�θ�5�9��v��^�ߛFX���A��o�����W]&U7��� f��:1��=�z�����D��.�`� �l ;�ϱjq/�ϼĀ����/��d�;��B��A��R�GO�N__IW{S������M�ޣ�7U���O��E�DUU "��ש�d�H�vm%4Bֺ0TnR���1�b�m+Ƕnㄩ-�خ>��j"G��˽ �B���d�Aʵ�ElR'{o�L�*UACy#6�#[��mw��g:��K�ˏX ���o���A��;���B���D`�;�b.mPl���tVr�HbT��2���k�f�.���*���-��� Fܗ�ĩ�{�. ���@��c���ȳ�Q���9���M6��P޴���.�;��6lY.���mn��H� �HDؗ(��Fw��j䢋|3�P�r0F.��j�e�����\�S���u�s�����Ֆ�� ��� Bww�@ ����m�(۲��s�Fn�/�5�xvQ6և�[��'���]��y� ļ؍��m�L�E�0�IL"WHқr���z�<�.���v�����8�n��B�2wu��ˌ��۷t�.�u)cc���`�:� ���i}�����1�$�� {��LJ�������fp1���gnb��v7V����,<:�����^!o��]n�ו[Qdt�x6�ה��SL;����/�q0G��kN;�:�ʳ�P��yW����\����ݮ����z}�˦�l�W�ͩtJ��ސѶ���ں��(�A��V;C\e�`������7�7�}1�Oo�p�n���O�����k(f$�m垀�ϻ�N�� 2Ω'Lܴ��Y{S3\I��;�X��EK�� ��+ �示�5��&������M�u)# ����Yms�6��_��7���t�K��W��^۩�/s�M��y\��$�$��eM��~��$��f��%�.���gW_����^��T?ouP�3^��_��V���O��u �j�R�T7�0��t^�^oMg��J���֪��轷���5p#'��JW�Z[| [S���me����o��j�}�T+S�ޓf�B�5Jw�Ǿ�v��F�Q�(��^�FU���zcԯK�:�BQi[Oޤ��-�JT�7[:`�����"gE�S׍�)s�WА$���3k���A�>��/;|�zc�`o��x���d����W�ܫb뜷�k�\���mP� �Fy]���� Ksc*�֦ �����y ��9e�4�|����|bi���4��RR���ꕃl5�[�.��W%��}g�G5t [�0j[������BS�L���\�0�� �ͭ&�#J���s���np��u;]Mu&+����~g���~�M�^Rh�`T��5�ƫ���}�#)]�����s���l��9"����\@ ܻ|���7A���u���g#GOI�l�`+�C�(�'�W�.�M�iJ/j�]�N� �)a�jM:��<��O_�|�� 2kX#܋R����_ۥB�� �J�6je7�E��g(��G�+�{ZA2i�<�x���ٓ��'˃�,��� �J�pڿ{�Z2�V����`+��0��i ]_��a���[S��ˆr���$�����:S��auR0�ٳ,8l��u��B�(�%�A�PaF�"u�D����T��6��;�qJfZ ���D�Zw��|- ]����2�b��Ы6�^NV�LT��o���zU�kɑ�PEA�N�Ղi�q���&�+��I(8��|�m�ǝ��l��͡��Aw�_Q�9��/�F!9�쑋gK�K^�f�����O�m�d[�m��#�� ���|-N�G���bB{{�w$�3\��� t��W�$_>gٯ0V�q@� �:�q��{��9�ěx�����J�]�������u�:�L����T�L�ɗ ���veOޓ��;L��'�U�����m�8�B��Uk��0d�2a�����R�� ��]�8���V�k$؀k95$����Z_�k��jp ��u���5�{d)��Z�}}� F�jP�P��ƛ��e�/ m;��t��?���z�`�X�͵ �0������x���Y��8�����>�|߲�V�����M4e��r������dV�٨�cm4�T{ȮЍk�5���M$b��-���1�BK�[�[�ɫ�M���D� đ:��s�~�%PB�xd-E����X��I���:I� 9)7�A���><�t\�Vݑ�;N��uJ7�O��)E?ޠ��i�"��� +FF�[�p���ƪ�G,E��NQ���LE����o�S&��� ���S���.��@iFQE��2�K�:J�?q:�[�y|򾻓��}A H���xuD� �%�P�Ȁ]nLc��AɩK�%�G�3�[S���c�� ���2tg�3X}��>�"1����[;'1�,ߦ���Y�h�t�["�y�H�=���=/l[�<Ġ� �� o��p݆��>.�4eHG]�7�R�ͤ�4��w#�8<^*��IE�/x�e����4w�6vILC��-�(��+sk��2�����ڗ�3�i!T1R�"��1DL�fٸ4��Rm:-u� J܁E@ jD-�@�� yI ��\�3�p��j]U�9�1���7������1������k��h�yR��j��fl�"���-x:�7`s�wL?j�@ߙc'I�K3W?9���n�4<�O�B$��Eh��55�w��!I�L�>�4�p�M�bH�N�xuE����}� %(�����%}�iG��QAt�� C�"�C�iR��z2���V ��:j���4�R�)f����6����dXF� �Q��>�� ҟ�)�l.��s��Ȁ�JwIf���c�k� �;�u|�,a���/9U_�n�x�8��j�X��E���G��9���$�,���nt�c?�P��}�ɝ�w@A=Խ��]�7x;E�%��~�5�c�@g�h�y�q� 2�g�������?���\�p����^�QǭI�� 40�^��gX��]���L"{M1��ʃ�.�s�-�[����k��5�q�ݙT�c�� �rǨUط2�X!詏 n�3і���[��;�����QW{�.n��r@O J���ey�,�?���D�����Æ'�w?r*���� �英���V�۶;#�=�]}ZE����!��W��'P��R}�/���O�����_��gǃ���Q�+�7*>��9����OE緷'��|�d/��vɓ���'C����Ϋ�|q��:x~@�����$�|��������:=�6�|{���`�%��w�/�/�S�����/����?���A��̇�Y.��_��y u�{eJ,�+�k�A6q+�P��p`5�J����e2�}%S�ɐUb?� �f 3�:��NJ��D9�TA}��X��� �$�C���Y~�8r�XT(T F�����?R��*$����y0�ކОm��*G6ըEյ����]!|�.��W�a��e�(�X�X̰r,��4� �����Z~��H{�a��P�6��L5�d`97��h� ?4�Ucm��(��L\�fDz�2rˈ���q��th�47�v����YǡQ��Ȍ�t˨8��.u�F�z�u:��2<����}N��89��#��_$hh�� ���԰����, ��,��u�z<�h;�Z�����N���[G���I��z�_�V8'�Q#&�,Q��.sz�1w�~�T}�9S��O�R�������%�Ǧ)���z�����1�� �P҈SR)�� �����D~�|����� 7c�Vi�ɧ���Q�ɍa�4ϡ�[���5@�Y�+��XO�$���#�?fm&������YmS9�>�B��*�:� / �%u��:�6�@*���gd[ KI�m~�=�̀�`+���U]( 3r���֣n��W�������7� *G�i�t��R��$T�� ��KZ�D�pX���e-���v�$�izIG�pi,�Z��!��l���Ď*!Ԕד��ak�$�nԪ��f��|�J�8%9� ��<�4de9�����S ���?�j2�2 �,�U�1�Y��B.�i��� 8T��K�j�̵J��FèN�3H�a& ���!�cn%myZ�K�#Bzr�|=)�1�y�Yʩe�߂N߸���\0ˈ*l^X2�j��� ���s?n�.b!�׸�n�\�o�&dA�f8\��D���:]���ƛ���.�$�X폅�N�0[�Q>�w�\�+X_Qc�3�M�|��������W���t��r5�]�oN��3��i �A�E�� *� �k�%�F��ˡ��w�O�W�ٔ�f,Ek1�]t��L�c�o��9�V=%�-�f�I�{�4%�l3 �!������0�K:�tl!���d�u���6�I�#CB���|z�i~E������~?�=��������str�w�۟ޓ�̹�U���Uv�3���Jñp�uhU�����0���q��<�n����ɗ�����n�]���ir�e�w�?�;�o�,|����d��p�')ig�d,%��5�K���T���<[�\^[^[韟�������Y�}t�����������w�����ڋO��*��M�<~��M��4�O�Ѱ�?��`��W��\���X\&K�,r��ѱP)�C��q��if��x3Z��j�' c�h�I�5���4QY!X���ڱ˼ф���B�S��,���a]U��/J� sIeY�̣S� �f�ӪJI;�2n�婑vy��jJ�T����}^V!���+*�H+M[�nAu��������5�k�<��k}�H.��vK��Orl�2�X�����K&�5�%I��+I�ZZ�l��f,m��ڨĨ��]��!-�3����Ԯ-Z�4�Y�}䂦���]���Z���!�~k ۯN�a���2�q&�3>ݮ � �z����e?�«r��.k �9�&�����_4]e� -��{�I>�����ϱ����͏KƷ� s��8A��6I\] �>�� �AcױA���������e��0�� "��}@9��"{�t��Ru�Xs;�|.5�4��Mb%6O�sj�A�A1JF��#m6���2� ���p��D���A�B��5���~���ʌ�d8\7m)����ejp��n�:l6���!6ȜZ$i2�y��ι���A�Іw��Kx M�}V��Tw�o m�G�����z������U�? <����>����y ��p ��]>�i ��n?�����OO����`�����������4r/�d�1������/� �+�!Rv�@T�^M�a%�)~ee�`�(R�������J��C`'��� ˽+�Iߌ�l扶�n���d+��ډ��37�Ǐ���_�P�բ�#�^�a[f�N�DX6���W �Eu1��(�g���a�����S�L�l�阣h��/�%s��}w�"j �ӡ�Ĥ�7�L�>'nYX7I:J"`�h����#�J���"P�T&w�nP�N_i��ܔT::!��%�\�˭�"F!�=�(;j�����.n4��k��p�+����de��T� �N)�1���t�/ �w�:���KynI?��"S$�?�I |��� !�����Õ�ҩ�%%ݢ;�&ԯ���rw��7��g ��7D��cW��������pe�[�Z�1��s����'e��ܽrf���\EՐ6V�CV����D��3�[�8�ְ�#�W�U)`KE�­�F0Sf �R��0����.4b��>g��V����5u1�Q;L�� ��ET��ڼ�hF��F���_]2� 8n�^Zwk��N�( ����w�f:���?���[ms�ȑ��_1��@� 1�x�rw[I��.��ک|`�X J � ���k��<݃w�ZY�׉�&����~������f����������^��G� �Hl}<�ۭ��~�%���F��V|x��郇6���b?}�;����>O�wfk�Ž�. -�'-��p�yq"�"�R-v�{O a�c�:�d�N�l�����*, ����E;M/{���v^��veG���k/�¥���Vn�i%1��4Dx �vzFP��8�жZ777"ţ���kI�ӫ�Y�·��?�� �����8��J7B��[�i���G�=�C�j����O!s�+Ox�P�Ig�Z��e��7�Xo�ljxBڀ�}�+�"R �b�QW��� �S�C����*}�B��G�Uc �+ ���������-���K�h~��M"4 �z�X��X��� ���i�^�n��� e&CȦ/�˱#���.?��+e��(��eJCE�f�͙W�+E6�(���Ģ�(��'w�xg 6>�{����Z8s���'�A@J�~�&P�A|t�X�=ZQ��%����W�.��-�+YD��҇(4�h�7�Lj�2�w)���-��Q{&~ �Em�� S7�d"Z-7���e,v[��V���1b�ʋU{��x�_���n0�x�c�QI�� ه+XL` `���yۅ�3*S -�~��D.������,ƆP�閧�[v�h���6��j�?Q'����p��p���(�>�Ǐ�����m����Mk��F�!�Ҭ � W�i���f�d-d ���k��������>�]rX3�N3�QU��l}�yk5�l]wN��׭O��<���}A��/_��߷���$�6S��}�_���?�� �e��E���Ñ9�o��4T }V$���$k ��¤k2��>����^�����T-���mu\��ش�:�ڀc���t � �ӱS��c�����O����Nڠm���o��X����R�jE{�H���ԑ^�^��-�:��LG)��q���c��/�~��-�J�Q")� �)�'$8���礵S��d{j'��b&Eᅸ��_�&>Q�E�ž4��~ [Yb����\l�Ѻ�B��&Ӑ�;LZ���{�]/�(-�|~Z������~�E���O�b� (�)Fp���m>��B@���qq�T���R<��n��&��� Ҋ�0*B�������ޕ����nf;��4�P�ށv�<���E���k<�̾yƋ� �#G�� W���N��ߊ� R��8?s�!7����<���6�0��v�gt�R/�u����y�X���m2�m>�q6ok�o�H �:�����\\����W�7en�{ ] �R� �w�9�w�d��i.%|��E�GϵuD�e�Ϫ@~g�S9��th�hj�@��v�4���,͠x} ���d���_z�а&a*���}�Ƨm��)�>��3 ��կ��]�iD�#��^Qy׆zrݞ\i��M��d���WϚ�io�EW��7���vȐ b�C��z���M#ۚ�{��]�,�&dkab��F�Q~���N��SW�9�ۦ������h����a7�L����Y�M�f�#�ϐ��Iȶ�@kv){�;���C*��:��T'�d��^�H�9j���^��]�_��.J��v���'����>ᴚ�r�P(��T���N��ֻ5� =�iA���uG);��H-�[#Y �*�<���GHM@�:37�\��*�+�'�u�H,W*�h��m��!F�� q��fѳ���g�o�6������r F8D�m#|��>˜1���vW��s�_��^%��<-?eQy�ۀ��>$X��1y�;�^�?���q�h�B2����df�ɦ'�C��$a�C� ���3����l��M��$$�%C��}� a�d�=�6Ql�6��I&6��e��$�>ɻ/Y��Ab&b�,pB�'b�$�>Q�'�}B�ӓ��#! H�B< �ǀ���Ӏ� ���= ��i�jsݒ�����Z��QC�s��� �C�}H��M�+!ƾ��#��z����Y��8�#B7"����a�#�-"q�d��1i|,����Ѝ%� }Mc�4&�����h���l�� �C|:��!�B�z��!B���C�B�g�3B}�P)���-0=۷B� �L�&q�}M�;D�u���V)�FT���2�/�����q��� �9�U�<��z�w�J��z��b°ܗ7��g��#�!�:�-s�f�x�+?@��vs+�]�6w�$��M�Y��L�e�i�ϴ�δ;���<� �� $��y��+�wM�Qf���+ qG�Kp7�!;x��[ 2µ�T��4F��>��%O{m���kC����!Ŷ�n�\m�,�z���ĽO�컃����j��vV♗�w� )fC/v����v[v���X /�.��+��>Q���쪴\�9��Q&�&��>��M�^�?.V�ޓÙ���d�N?d��aDu���&,)T6O��Q���9إ�ٓ�_�/k��S���*�^*���x�LȬh�Ѓ�$�eUOClw���:�4���3��R��QڋK� �t8���D �C��������h���7SMW�kaS �2��b�~�L~�iZ��J����yl�0 �������GxD:I�5,u�sG�]b�G����Sn�� 1�(��I`��w����-��x���r��+����Zh~P������ZU !A3Py:��A76�b��.JӈJ�@�Ơ��! ��YL�o��V~(�`���Z�A�6�$�x�G����e�:���K�Sǻ0v0ۂ"���k��n4��MTzr��iZ~�F�����[@3��^�{�#]�j�žO �c/���������k���-~�V��6�6��ݙn�|@�͌�{zljsoܳe�7�V7����ä�.>.�3���0�m� �G�ﰴ]�o]fc���s���Rq�&��o�4����CQ6�f��#z�eO�O��E=� u�'�ҩ0�5� W�o�t�kv��NY���8�h3�^x��O���Ӫh80\e��I���X) �� (����NM!x�D�tq�z�R���� �Q� ��)��v5:˅C�U��r ������?n�A�1DM�:Z���Z�<����P���i�S�z h{��1{���St�](�>�P:��TT:��*�neO �b�o�5��Nה���X��θ�Y�:���Ȯ��vϡР���0�U�;&�(�صh��=`:B�RJ��z<�| 'D�S 2���� ���B\�+β��� ͕?:�����|3��(8P� �� Z)9P�����)�x� K�+U�q�Vx*�+~т��D\�����?񽤲���=���|�zȂ~�8�Pm��'g�a���U���KJ�C��J{%�Jx���=���+~IN\�Ə"d�m��_�P�Ҽ>\İ��؎��ԝi��'����tl��ى#��U�����77�����,�O{���z���NAnzy@��p�`���憝�l9r.�o����W!:&H �A�-�Eh���<ƹt{�_.%:�롂�~RX�Ǹ ���AaF�����r2`������<��T�C�0���p%�^��ԋ��(�1j6!P]���Z��0��U�I���/["���n�'�H]�kj�^�M@黣�4�͇4��&D�� G��⋗ud�e2 �� ���,�"�VA����U_W�q��P�ri�^i� �7SY ��b�5��X���7E�]m��U����)l��c�t�/�{�Xά�d~������w�����G:9q��X6�5���N�~R'_u}����Ǘx����ɋ�52꣞���� ؆��'��|�(���b��N� *�.W���gtk6�ԒjcrH��%"�kk�XK��"#( ��@��������_��sNm����c^���Z}_��kˤ� L�Q�ӵ,;u������;�ޱn]㎴[�d�?���6����#���[�F�����8�'�M��It�i�t�F�� ,F�<�O�G?=R5*�����S�� �3��.���Ǧ�.��]�n�,���I�����0�X��/������W�%�l��ü�����%��Tk����|)�Ҕ͖x�Mn��߻?C ("���Z}s�F�_�b����%l�k쎋qʍ�]�L�׹���BK�+����ٕ� ;���9&о<���{y�[����'�4^0_��/�����j��\�x��� ���9}��...��'�W5�e�\ܩX�Z�y|xr�8:8j6���Ur�@5w�&�6��aӲ.)�\Dϒ�h���l�1�ā���x�'��T�"}� �G�����n�o��oo��s}y�ة���>��W����~�g��+�:S#Z�  Z� �x�̆�ǡ�i��h�w` �T�e�\T�'d ��S�en�N�������4�?f�!�Vs۳�übˡs�����D�@�%�qy�������)��j��N�_��;]j��_<��1��;m*�ўW�,�[�F޳zf���PNvzq��l1"�E4u��vn�6��!�ȍyZ5�Tb΃��F�6$ �! ����ֈ���Q��)��vɗ��iIyM��2 �?�4�b��H���QtKE ��J .-h�*�i�l�?�u/��A������m�����n���'?O���G-��텚:�tdr4�n:��x7��{�Ƿ��%��{�uY�{�G+�&��""A��c����u�7NO��_�n���ع|h���z�K��U������su��׾|��z5'�*���=���욊�T��)u�2��u���yA�|#���l1������>��_e�w{,/ʽw�Wć�EI����6p}�AN� ת� ] ��> ���1Zߤzk��gʮ!�@��}x�^���Qz�V��kj͸�v�D=�++W�DZ�o�yG�A���g˸�x )��ٶOA�J�􃝙_���������n�����9��Rk~"�yP]j��L���~�j�����˪h`���'ׇ��]�*c�e�@-�ʪ�4)!�d=1�Us� a�^��K q� �iH(֐w��#��S)�dF:���F��r��i< �����]�y)|K�Y���ST���,�2���D�p�_beC��Qu�+��I���R%}�]�Jq.�:/�>�?A��*�� �M=�|jF64O�q�*�i���F�y@eo�N�Sx�����MU�����b 0`f��N&|車���F�e�]�Q�TI��Ss�La�����k��tr5�,�Pٟ���\e�`��O�H�i�M�Q>�;���$�R�;��l��0�, '�^q�A$sw�W��:��3�X!U� ���-6* Ⱦis�ҙ/b���YA����Tg����&� cۻ��]���G^ �#��ɉ���d��C�[�T�>b���f�JD[GQջ&��ڇ�3�RVa��m��E>t"��%w��T˙�,�"Jp�� �cٴ�6[-�rIK�t��v��\��[K4�����,�~zj�$F�z��L�H��:[���yl� n�T�O����D=#}RK��לS-��F@�;z��k��*�`Q5�<b1m� [���p�g&���O���k�T�h(�d���2*@-�� [�tAh�'n��L��0�ՄU�`��a$� M.S _��sH���S1���܆��c�z $U<Y��N�X�g�ND�0^�c[h5t�R�� ��������@x�x@���,�ёm g/3��@e'ؕ�JdP��Z헊 ��x�\�\r]�J?{��W!�emA�� � E*�_`p����O���J�/"�]��n0U@q�\W�4��y3�I����sV(0��H�ږo�Q��x�v��? �=1��5���К�>�@$�t��/L�虫�=���m��`(�-}��V10c�N��BEɆm�]����g��߈ϱ���RO �;�6m����Qh>RO]6�~�3ś���S�'zۺ� <�k�) ����M�.Q<�G#�x!��bn�Y��F0C��:�+�r�F��>��K�-��w���� �("� ;���Y�n���ϧ�(�DhfW�ZC�l�Jb �-WR�� ̒��S��3Ԋ)��=�?v��ݦH7��"g��=���;������嵸�E�+�^j'�Uj��vڔ���\h��Ty��O�[�ቐ�pu�˥pF��B�NH�l��g�e���^��'��h� S�\ɺ$�USW�*�bm�<��U�����q+��G|W�*�L\��A,�t �������Sb6� +�T+B��v˥��0 �d���X��%ĭ5��*��r�jEf�N lrN�75y�T-�I'RS@��t����:��X]���%L���Y���B۔ZԔ���#פ�Q�c���)8�\���ܚDndF�{��%����4��p?{��$���sd�E���G":�A�\C��^`=6ɭh�H2�$%%���Vr �ed)+d� ?�Pɐ`l%7 ��)_�F���N�M�Ҋ��At,Jq(&^Ћ��N��e�P��pQ������{�����z8�'1�.�T�_��?�T�\� ެ���Y����sr4�Ŀ�`G���:�g�1�^���p+a���Iz��.а�8�ױ�&wPV*�\�� x���� J�M�i�����4 �Z��;1I�v�aF��]RkH\�Z�eKɱ�W%���Pi�.\M}�i(]0� �E�3��O����ƼѨ9n5~��M! X�./�ʽ �:��A��F�bi�z#��K]+�“u��Rw{Td\�@��Q�� _�5T�~��P�(P�T�&W�z���rd��R�����ԷEkU��ƃW�t���䈺��[�f�M����,5�}��� �7��M;��隫��<�7� �W T"B���`�&Z�Ŕ��1>J(�Z�7��k4-�D$��/�� >&0綤,we�K����PA����8�n� bٳ?�qB��V�, (Xn�g?���+�,x�0.�cr �B��}�C%e��\%+U��حI�WN�{��H�� ����LVN��si�^h�Y�@~��f��-���W�8��,����e���p�u̞SF<0��܎�2�X��F�g�G�PX�a�b�j՛����b�:H���0aFiT>���eI�0�-W�F�8���mC �=��ސ���7�{���c�|��4mj���� j �x�����\߬��2���� ݯ��,�q�w1�1|SD������)���iо���e%�e.��(_�/F_WŲ =��� ��[�[�����g��h�v�is7�m!���� �8�v�5k���2�����lA�Ql*W��Oj�τ��i�ؼ�{�45��ь�ʙ��e����R���:7�Dyg_ ��l3堗���nE�y�� �x�qGg��5Ӌ�������7�'����G'o�>}:?����ɇO�?���px(�髢rmNc4IDTz��W���iN���*��x�U��G������ ���'�?�c� e321������Ï㉞����A�� �0��k+�9��-��$�R{�0U���S�S�?/��C��5��<�2��9��(L��|b���Wd�9�ń��P����r8����L\��S�?ދES����?��v��3U�ۯϊ)����)�I wp�L{��WAL�.'I�Ä�m\�u��Lͳ}�Ӫ�Qa�ku䭇���Ğ�8C7l�O�X����=_�D���6��@����,�{&����tȢ:螠�������ʬ�'~Mh�� �!���9��v�*b���=bΣ�i2{�x����A�q�B�Iģ�)�-��o�v��S��c��V������\sϿ����亝��cSt*d�U���� ;A�6��W�C��B��e= N� ����������0������� ��0�|�?}��7^��Һ{�m�8�RQ��'a'�jz��� �j�%�;D5�~;G�������� l��k�� b��t���U_������pқ���4���=�!eX��ئ�? �&1 ?�iMI���MAS��I�;�m^{��_#����(�I@y�e��{��1�gi ��Ұ����@[�>���]�w����6U��;�;���Wo�6����� 4� 9���d]�mF��X�]1�D[�%R#);��{GJ��6I�H"[ǻw�~��8����_�M�s�g����pUV�zn|.m���T!]� ���wJ��������/� �? ��d�V*��^1/�Fv"�ER5����+Sd����Rdܬ����%��ОN"b��g��JEPkk�U)�|)��:�k'-S��}2д���G,^�ʚ�����ځ-� �'c���*`�J�4���� j䵷�s�Θ(�^�0�_�-�-%�I�v�@8OZw�$�2ʶ𡂁$���\)���ᙯEutZͅ� ��T�iɱ��Gis�� \��q� �Ss�L�$=?�5��rg��AWj2I�� h���a: 3���L)�>^X���\�9��Z�D%R{PR�>�tK�t�����1}�2�c� hv�fA�4 +�b'���5�z�✽l�l~���d5�Vۯei++�w��� �<�䦔YLV�������� rzX �Y8�� Ys4ڪk��Lm3:f�gЂ�c�|�,g��AT�(�lh�A+���=M�$S~�.��_Ɋ�>�'��c���Lg'��9����{�� �-��le�bϣ@�m[���OE�5� ߯j��6�b�P �t$���阿C��k��RG�ч}w��c���N��B �@��m���� ad_*���l ��#]�� ����ޡ v���>oj:����mmvO:t �励�t��:�C[q��ϝ�P1��Ѓ�Bbi���O#��l�$]6�cgL�7wP9���ܘm��?5Jl�Ѯo�佮�B��p����]�{��h���b{����ѭˆ%���<�I4gw�dl� 1 �qh� �{2B�C�7u�qm<_�Qkl.(�f�>*g}C�J�a�V�衋u��� 0�oW ����҂*L�.7ng�l�|�ZMZ;m�>�H�,�}��Z��R��J|ݳq �J�<U%uvd��KG�K�7:>��'���0����O�w�JKtC�q����f�&�B�+պ�-�0��2��6�>~�}��E��ߍy�`�_/RSbK�Pc�Ҷ%0Uw{��O�D)P�r�˲�M�mI�X�R�X����o�.j{��[����=�cC�/�=�����Y�#���]-t��Bo��!�"ނ ��i�Ս) A� �!c��M���A�]m��LnMA�0�֪&.�K����ښV[lNV ���xĿ��QH����WXZ~����g�^~��(��҄]���}>�!6��u��l�f̫�~|+��H���<����ݼ�N�?�|����� ��X73*Tc�qk����w��dӻ �0U��y�4�'9t,C%FZB��D�A�I���ݽ�D|��p��naJ�E�a���k�um�):ҋ��W� ( a������6�ӓ'�ӓ'������飾k=�}]:A��}�hԺM�~{G�.�o��I���m�^U4ZC ����j��!��1�t}M��{\4�΍��-Z�l4BS0\�)�̱e�6�%��wl�s\.�7�pS���E����n���}����0S.�߿ؼ?~������w�/cO>V; |)���Zێ�}����� ����k�dE��M�Ķ��`,�3M��3�t��R�c �/��<�C�˩��!��$D�$r�/�u9u���{/��������j�;�Z�Vj�ۚT�ֶT��T�;�tY�S۪�n�N])ݨ���m�J��w/M�рG2��^�`��6�S����~�1�t�Q���+[��Y��B=��]S�vE"�i��ҫ�xlW�i�o3�6��9շ���w�-��F��^m�vkZ��(>3��K!|P��(�+H���S�sX�f/ҩ�����ncˍ��B�ݺ`*�xi o�ֵ�.q�b��y>������Ft�����b�H]W�VtT�h[ϱE}C_a��� � ��[ s̕�ʅ*`.)!�ޒ��X�f�lk]�c�F��Z��C�R���~��� ���U��ʖ}��R0G�]�P�q4�J7���Z;�~k[�'��Fi��Ao:`����x��`�Ψ�� ے�p�p8��c�)7-�#�A��q}]�yX��9-4��h�JUN���*y|��`c#'mL�qU ?*�[x��=��C<3��畁�5����q�Vګ��m�`�f���E��J�`I1IA ���q��s���]����7t .���0��V��j�T�S��Z��z 73mw���L��W��o�޷��.轂���8����lXH����"���0G�u��Ұ��h��5�YQ��'���ho�maߟt�w{OES��GOچ<_ٔ)�F p��*����$�ڃ@R�=ر�i\g��f��7� �5b��.z[͎T�ޮ���+�(;���Kv$5%���Z ���K ���Pez�g�{�s׷ �y�����ُ���?� �^�2�D_��� ��2 b����,��#7L�iz*� 3ϟN/�L�<4t�#�����#��z���w֓�0Q$�̰���������@yM� ��ܥ��F�d_���~�^�/ �������޻^p00��#l�ބ�����t;a��U��@���r�+�=�r!�>@�,���Ѿ/݌�����L����%d��nY뭬�9q���%���m{O$��t��#�("�/ف��EHǭVᑐ֭��� �!�{��\�h�8��#�d p~B>��I�!:yP��"39�d�&�9�\(} �����l�>��}���&���`������j�J���F,3���X�T���۶LP�������yF�|�vN⭋�S��qsI�'O.��<<�S$!rO��H:���<����֔��%�� ����5B�='bq���i��� z( ~Kd[��=˫"S]! f��T��.�ᯉ��e :�fnm��8��9A=�O�Xq O���EUU�4$�C���P��2%��4��w gbW�����b8��X%`l�� ��ސ�E��,)J��ٮ�l�82����2M�(�;S�BHl%Ԝ�U�׳��eU; �'�)�s8��\k�z�ql��u\#�[�� ��y6�#a��lL{k�k�3D��Rsv�����F�}��4'ܜ;�MKJ待��/A���>�l����/�gŧ⤴_�X�! ނ�FY��^��b�s%"ő�#��k8��u0�����i/Y/�dp�]Q �IK%RY#7“����vK*�4�L٧��é�V�'�V�w�S�ɰ � AM AxK�iѢ''N �h��hB�"3Ke� ��IZ��{��ʜhT� ���8k�j������SS�����H���Z�r"�`v�#9�d ����� ��1ȴ���h�]��J��J���F�v(aJ���u<�q3��Kk�k��g����y�]���S�s%�-�Oٺ�z��t�,�9�Gy!��lTi%>�� ()o��Q|y��(0?*��P�"��r��$f��*;�z��E��|~����JdO:540/{f^uT���^ϩ|=�E�m{N��sls^������Yb�����Ui�W�Î�Gc�'{=���NB�)X{��ۘ1~!��@6L,�b��2 `����!�Æ��N�A���ɉ}ev��ĉc@����&��O�Օx.�GsD�m��:� �O�gfƞ(��L�����j��D�'u;b�X��O ���n�d�+�`HD~��ڸ��� KYa&�l�;+ܟ��7fE�h�����ن΁/R�e�S�Ɔ_���j���w2;�5�E..� =�K��(]���D�L�;�%��2���1 ADnm�MF�:�MB}����-={�u���k�2��by�*C�������{� p\vI�V:ț�]����i��"i���ت�n��ARMb��"FG� �࠙f��OM[�UY���\��"����ޢ8� 0��3�ݬ�����\��3� M5����Δڙ�-� )��셺�����`+�=��BQ@s�ꉀAB:d��x(9�S �#1�h��;�@�`J������M)/ '����!1����5J���$=>�ØŦRx�8-��D#���������+� ���H�mv��CDZ��^�'�I¨�kV$�A(BQ���]��EO= � ��HQ�6���b�5u����{�M-���;�����h��=�.�����QE�yM���ě5֑��Lf�i��f25�K�k�a�����%񢢸:dRvsD��@4��eU zs�x��*�$�b�����1�xT@%���Ŷ�X�%�g|�Ԗ`���~��>#��Ex�5]�@�~Y��!-F^��pE�����V��j���r�=������W�V�� �[��O#����+Ԝ%�L�xL%(5W6t V�%�$���;f�/Hc�q�OZ��1�c�ר�t��nt���Il~A�GGxzb�9����p��1qί^c�O�b%�{��X~<��ȥE;��PKK��6�!.ŵ�]m��D�'�Ӄƶ�����_y| �l�1�?*���>z+ Z�Q6@=���1K �R��Vh�7��p�8�.��Tk�z4�:���0�t�#w��bb-# w�9C6G$E��x�Jʥ����>��D��۷�܂�mt�{��J���,5��%�c��`0 �m"9�f����hDUs��ѓ�V̓m�~@J�F���M��6�����軖��� q���ČQ�����*�*^f�)+�-���Y�"���DM��r-��Y5���F*� ��o�[����Cx/�|�1�E䵃J��9����r��N-�8e��K������|@Wot�Ͳ��L׮�X�F��D7~��0����Eڠ�qP�I�p��{�l.�Q��1���_��J���� ��|ݣ���ʡ�������`�O�~S�IG:v�6���5_;�o6�}���;{|{��g�{��z��K[�(�����;p���pt���n�ߞ�+c���r�|��5mKl���hƧ�Z�2����@��N�&��h_63��e�I����"l��^o�)]~�Ο��*W�M��."׋������_n��X�?_�ѨB}�~��o���|)?2���[Os���S`vڑ�HK�x7L��][v�zeײ�t2EB�$���ʡ�^�~���^:�7���:���"����%�w-%�]{< ������@�H>�������aJ�D*/�htG�g��(U�PR���E�C�� _�ꋸ�hn���d��OX���Ɔ&Wq�lC��+�ɮ%���0�y�z� x2]��I����<�Rz0pä/h4@bo�KbJ��a���%�d(ڴ6���Q��"Wtg ���l;�-�=��b�H�����P0b�DӾ�����<�`N��G"�y�J�$}�=ФI�$�� �z�SX� ʈ<��X5�f�<��_�V�6lH� `�H(�sn4Zio��;c+$앓��$-�2�k��)��l5���)K�0�^@Y?L�,�������n���>e��e^����&e��Q٧}� %�8�ٰ�Q{������?�n�ڀMk�2��̷Q'�B1 �Fe[�8���� �o1ಯc���,���5G�w���d9�����;��a�}X=��%R�f�&^ �F�*����\E3���$��?v����*p��ܷ}~��a�b��Z�����V%Ռ(/�xr��\<�r �#�Aͼ8=ё�u�/C�+�p��R�?���Z�+L�N�Q��W�C�–,U�w`�7�bP�a�蠶L?,� -*�7JW�EI��@��ڬt��,�� hd�k�L.���6 �� *���t�M���U��I�H�j���y�@G��ٓ̋�01�f�*�l��P�n�P� ~�w��@nT���b�L��i��{��E� aay%U��v���MV4�����rw��-q��:�uO~u�Z����u=x��l�ǭ��V��Kw�A��9y=�W���]�R�r��5�U������k�z��Y��a����@�%��  ���VY��������-sA���g�}���v��ݸi����'�A�s��̋�W;1ȣP&0�T�N�s撎c��S��nl����Xƹ�,>ܚ�0d1�!��^Hu�B�[��A Yb!w�+�X�� ���A)d�,��Հ�\dB� K� 0 Y> ����*!p�!�A��@Ȫ�ǻr�!��oZ%R��(Y�]됓��y���Z,�� 4¯l����T�m�0ܮ� 5�V���}b�"s�/�?_�\g�*��׷ɥ�����Z J 9���3Y��> ���k��ۢ��B%�G�ˋ��u�N�?OǿeQ���Y7ƍ�6q�h�# �b��BL����X�7��'ə�Aɜ@ʦA|�-KFv�aD v��Bh0��KmR�:��?Ȭֹ�����)�s�*H�sĦw��O��vI�Qr�2[V�� V㥸��,��[���n��S���Z�h�����Bg �i3L?S��P�A<Q�,�݆����uLm��k�����\���LY-2�� ��ʼn'�Ch^X[��G؈xiS+����ȍ�C�Yuꔼ��dEt�~w�{z��i���}�����S�A�K n���[ʤښ��n�C& �sȀL{7qP��9n�ߡk%�'�Q�KW7i t�}��3��~�����|���?wD��t^��b#&;RM�}ֽ�Z�)b l�|di*�U���h$����]n]��2?�%���߾F��~VŪ1��SKE>(rF��աc�v�5�G��T���_KC�)Αe}r6�0��ޏhF_�#� �v�m�M�yā��5���u�YF��8�&�;u�8��l9���:��� fL�&�peվ�*�û���u=���2+el=_lB�>�D<,dU�b9!�Ÿ�2���P(�H���QW���~7^[�-Q�%ف�<}�����d�'����� �+4�� (���L�FٶA#��!�uyN��.��D$��� �u�k �5q*��)2���_ o��)ei"��nXaMk�{���4CupiAҼG��"��ݍ��P7�`�'��j��V|Dk�gOqo ������ 򫢈u���d �&�鯣����� �\�f�Q ��oDK��S.�0����%W�۬�6莈]n / y�bN ��[Gu�P‚.a�\ͨ���%��N��!�e�݅���s�&�k݃��!~� �0[��\����~��IO.�,J�L�m}w�H�u�w��i�r�G��5�%A��yYH���b��t�d����y4�m*� &���ž c���P�{~ʣh�� Pչ���fdΕQNg��@x̸���6�l� �"p<9y����81ѭ�_�� �u�'��k�zL�m ��p�b��,����H��њl������D2k�)���6�����A��ۿ�G���&P�4���U���^��U�0`�dbd�&��p��^Đ#���/;�lIr���D#R���.������aRO�D�?��:�e8|>QH�X�Sn�oO��6{IrE�X�S��ړqS�v3p��n�ŭ �-�G�ä �ɇpB�1��؇��!w�%���:�Pe|l)�+�nq����bǃ�M����\��h���*���Xk������5j����T��;�N�zY�1�����U��aU����+�]��3G�ϖ*9k�N�ޘ�B�R��Є[�"S�IZ���祎�"u"�J�6n��&�hKQ���wܢ�� I��^3V;�X�߼��%u�9���V�T��pʑn�-� ���7��zN��� �2�V���ZW����=�Άs�jb����*Rk@��� : Q �I��F��.ci�|)��FR\�p�K��T�V1���hh?W�@#앆O^#>��xͮ�I�O0��:3`|j^uǻqҍ �ٚ]i��P �NԹ�@���vh��74l  ����$�&�s����a�e��[͠��&4��&�QF��-����4�51����}��� �����gN��KΣY��c��B��Ѧ1D�˺\C aX�9L��8q���͵�����f�[�㣣���������^���e�;�hץ�x���[k����D/ċ����P6?ility unix windows p s per comment below this function looks at the values of various environment variables to determine the user name therefore this function should not be relied on for access control purposes or possibly any other purpose since it allows any user to impersonate any other s s inst delete column from pandas dataframe when deleting a column in a dataframe i use del df column name and this works great why can t i use del df column name as you can access the column series as df column name i expect this to work inst the best way to do this in pandas is to use drop df df drop column name where is the axis number for rows and for columns to delete the column without having to reassign df you can do df drop column name axis inplace true finally to drop by column number instead of by column label try this to delete e g the st nd and th columns df drop df columns axis df columns is zero based pd index s s inst how to check file size in python i am writing a python script in windows i want to do something based on the file size for example if the size is greater than i will send an email to somebody otherwise continue to other things how do i check the file size inst like this credit http www daniweb com forums thread html import os b os path getsize path isa mp b l s s inst emulate a do while loop in python i need to emulate a do while loop in a python program unfortunately the following straightforward code does not work l i l iter s none while true if s print s try s i next except stopiteration break print done instead of done it prints the following output stdout stdout stdout none traceback most recent call last file test python py line in module s i next stopiteration what can i do in order to catch the stop iteration exception and break a while loop properly an example of why such a thing may be needed is shown below as pseudocode state machine s while true if state is state code if in s tokens add token comment s split state state comment else tokens add token code s if state is state comment if in s tokens append token comment s split else state state code re evaluate same line continue try s i next except stopiteration break inst i am not sure what you are trying to do you can implement a do while loop like this while true stuff if fail condition break or stuff while not fail condition stuff what are you doing trying to use a do while loop to print the stuff in the list why not just use for i in l print i print done update so do you have a list of lines and you want to keep iterating through it how about for s in l while true stuff use a break instead of s i next does that seem like something close to what you would want with your code example it would be for s in some list while true if state is state code if in s tokens add token comment s split state state comment else tokens add token code s if state is state comment if in s tokens append token comment s split break get next s else state state code re evaluate same line continues automatically s s inst display number with leading zeros given a b c i want to display a leading zero for all numbers with less than digits i e inst here you are print d basically is like printf or sprint s s inst pythonic way to create a long multi line string i have a very long query i would like to split it in several lines in python a way to do it in javascript would be using several sentences and joining them with a operator i know maybe it s not the most efficient way to do it but i m not really concerned about performance in this stage just code readability example var long string some text not important just garbage to illustrate my example i tried doing something similar in python but it didn t work so i used to split the long string however i m not sure if this is the only best pythonicest way of doing it it looks awkward actual code query select action descr as action role id as role id role descr as role from public role action def public role public record def public action where role id role action def role id and record def id role action def def id and action id role action def action id and role action def account id account id and record def account id account id and def id def id inst are you talking about multi line strings easy use triple quotes to start and end them s this is a very long string if i had the energy to type more and more you can use single quotes too of them of course at start and end and treat the resulting string s just like any other string note just as with any string anything between the starting and ending quotes becomes part of the string so this example has a leading blank as pointed out by root this string will also contain both blanks and newlines i e this is a very long string if i had the energy to type more and more finally one can also construct long lines in python like this s this is a very long string too for sure which will not include any extra blanks or newlines this is a deliberate example showing what the effect of skipping blanks will result in this is a verylong string toofor sure no commas required simply place the strings to be joined together into a pair of parenthesis and be sure to account for any needed blanks and newlines s s inst how to install lxml on ubuntu i m having difficulty installing lxml with easy install on ubuntu when i type easy install lxml i get searching for lxml reading http pypi python org simple lxml reading http codespeak net lxml best match lxml downloading http lxml de files lxml tgz processing lxml tgz running lxml setup py q bdist egg dist dir tmp easy install udqoz lxml egg dist tmp gacqgy building lxml version building without cython error bin sh xslt config not found make sure the development packages of libxml and libxslt are installed using build configuration of libxslt in file included from src lxml lxml etree c src lxml etree defs h fatal error libxml xmlversion h no such file or directory compilation terminated it seems that libxslt or libxml is not installed i ve tried following the instructions at http www techsww com tutorials libraries libxslt installation installing libxslt on ubuntu linux php and http www techsww com tutorials libraries libxml installation installing libxml on ubuntu linux php with no success if i try wget ftp xmlsoft org libxml libxml sources tar gz i get successful connection info syst done pwd done type i done cwd libxml done size libxml sources tar gz done pasv done retr libxml sources tar gz no such file libxml sources tar gz if i try the other first i ll get to configure prefix usr local libxslt with libxml prefix usr local libxml and that will fail eventually with checking for libxml libraries configure error could not find libxml anywhere check ftp xmlsoft org i ve tried both versions and of libxml with no difference leaving no stone unturned i have successfully done sudo apt get install libxml dev but this changes nothing inst since you re on ubuntu don t bother with those source packages just install those development packages using apt get apt get install libxml dev libxslt dev python dev if you re happy with a possibly older version of lxml altogether though you could try apt get install python lxml and be done with it s s inst how does the property decorator work i would like to understand how the built in function property works what confuses me is that property can also be used as a decorator but it only takes arguments when used as a built in function and not when used as a decorator this example is from the documentation class c object def init self self x none def getx self return self x def setx self value self x value def delx self del self x x property getx setx delx i m the x property property s arguments are getx setx delx and a doc string in the code below property is used as decorator the object of it is the x function but in the code above there is no place for an object function in the arguments class c object def init self self x none property def x self i m the x property return self x x setter def x self value self x value x deleter def x self del self x and how are the x setter and x deleter decorators created i am confused inst the property function returns a special descriptor object property property object at x ff it is this object that has extra methods property getter built in method getter of property object at x ff property setter built in method setter of property object at x ff property deleter built in method deleter of property object at x ff these act as decorators too they return a new property object property getter none property object at x ff f that is a copy of the old object but with one of the functions replaced remember that the decorator syntax is just syntactic sugar the syntax property def foo self return self foo really means the same thing as def foo self return self foo foo property foo so foo the function is replaced by property foo which we saw above is a special object then when you use foo setter what you are doing is call that property setter method i showed you above which returns a new copy of the property but this time with the setter function replaced with the decorated method the following sequence also creates a full on property by using those decorator methods first we create some functions and a property object with just a getter def getter self print get def setter self value print set to r format value def deleter self print delete prop property getter prop fget is getter true prop fset is none true prop fdel is none true next we use the setter method to add a setter prop prop setter setter prop fget is getter true prop fset is setter true prop fdel is none true last we add a deleter with the deleter method prop prop deleter deleter prop fget is getter true prop fset is setter true prop fdel is deleter true last but not least the property object acts as a descriptor object so it has get set and delete methods to hook into instance attribute getting setting and deleting class foo object pass prop get foo foo get prop set foo bar set to bar prop delete foo delete the descriptor howto includes a pure python sample implementation of the property type class property object emulate pyproperty type in objects descrobject c def init self fget none fset none fdel none doc none self fget fget self fset fset self fdel fdel if doc is none and fget is not none doc fget doc self doc doc def get self obj objtype none if obj is none return self if self fget is none raise attributeerror unreadable attribute return self fget obj def set self obj value if self fset is none raise attributeerror can t set attribute self fset obj value def delete self obj if self fdel is none raise attributeerror can t delete attribute self fdel obj def getter self fget return type self fget self fset self fdel self doc def setter self fset return type self self fget fset self fdel self doc def deleter self fdel return type self self fget self fset fdel self doc s s inst retrieving python module path i want to detect whether module has changed now using inotify is simple you just need to know the directory you want to get notifications from how do i retrieve a module s path in python inst import a module print a module file will actually give you the path to the pyc file that was loaded at least on mac os x so i guess you can do import os path os path dirname amodule file you can also try path os path abspath amodule file to get the directory to look for changes s s inst removing duplicates in lists pretty much i need to write a program to check if a list has any duplicates and if it does it removes them and returns a new list with the items that werent duplicated removed this is what i have but to be honest i do not know what to do def remove duplicates t a b c d t a c d for t in t t append t remove return t inst the common approach to get a unique collection of items is to use a set sets are unordered collections of distinct objects to create a set from any iterable you can simply pass it to the built in set function if you later need a real list again you can similarly pass the set to the list function the following example should cover whatever you are trying to do t t list set t s list set t set s as you can see from the example result the original order is not maintained as mentioned above sets themselves are unordered collections so the order is lost when converting a set back to a list an arbitrary order is created if order is important to you then you will have to use a different mechanism this question covers that topic in more detail s s inst what is the difference between dict items and dict iteritems are there any applicable differences between dict items and dict iteritems from the python docs dict items return a copy of the dictionarya s list of key value pairs dict iteritems return an iterator over the dictionarya s key value pairs if i run the code below each seems to return a reference to the same object are there any subtle differences that i am missing usr bin python d one two three print d items for k v in d items if d k is v print they are the same object else print they are different print d iteritems for k v in d iteritems if d k is v print they are the same object else print they are different output d items they are the same object they are the same object they are the same object d iteritems they are the same object they are the same object they are the same object inst it s part of an evolution originally python items built a real list of tuples and returned that that could potentially take a lot of extra memory then generators were introduced to the language in general and that method was reimplemented as an iterator generator method named iteritems the original remains for backwards compatibility one of python a s changes is that items now return iterators and a list is never fully built the iteritems method is also gone since items in python works like viewitems in python s s inst python if x is not none or if not x is none i ve always thought of the if not x is none version to be more clear but google s style guide implies based on this excerpt that they use if x is not none is there any minor performance difference i m assuming not and is there any case where one really doesn t fit making the other a clear winner for my convention i m referring to any singleton rather than just none to compare singletons like none use is or is not inst there s no performance difference as they compile to the same bytecode python r apr import dis def f x return x is not none dis dis f load fast x load const none compare op is not return value def g x return not x is none dis dis g load fast x load const none compare op is not return value stylistically i try to avoid not x is y although the compiler will always treat it as not x is y a human reader might misunderstand the construct as not x is y if i write x is not y then there is no ambiguity s s inst how do i do a not equal in django queryset filtering in django model querysets i see that there is a gt and lt for comparitive values but is there a ne not equals i want to filter out using a not equals example model bool a int x i want results model objects exclude a true x the is not correct syntax i tried ne i ended up using results model objects exclude a true x lt exclude a true x gt inst maybe q objects could be of help for this problem i ve never used them but it seems they can be negated and combined much like normal python expressions update i just tried it out it seems to work pretty well from myapp models import entry from django db models import q entry objects filter q id entry entry object entry entry object entry entry object s s inst what is the python equivalent of python m simplehttpserver what is the python equivalent of python m simplehttpserver inst from the docs the simplehttpserver module has been merged into http server in python the to tool will automatically adapt imports when converting your sources to so your command is python m http server s s inst why are python s private methods not actually private python gives us the ability to create private methods and variables within a class by prepending double underscores to the name like this myprivatemethod how then can one explain this class myclass def mypublicmethod self print public method def myprivatemethod self print this is private obj myclass obj mypublicmethod public method obj myprivatemethod traceback most recent call last file line in attributeerror myclass instance has no attribute myprivatemethod dir obj myclass myprivatemethod doc module mypublicmethod obj myclass myprivatemethod this is private what s the deal i ll explain this a little for those who didn t quite get that class myclass def mypublicmethod self print public method def myprivatemethod self print this is private obj myclass what i did there is create a class with a public method and a private method and instantiate it next i call its public method obj mypublicmethod public method next i try and call its private method obj myprivatemethod traceback most recent call last file line in attributeerror myclass instance has no attribute myprivatemethod everything looks good here we re unable to call it it is in fact private well actually it isn t running dir on the object reveals a new magical method that python creates magically for all of your private methods dir obj myclass myprivatemethod doc module mypublicmethod this new method s name is always an underscore followed by the class name followed by the method name obj myclass myprivatemethod this is private so much for encapsulation eh in any case i d always heard python doesn t support encapsulation so why even try what gives inst the name scrambling is used to ensure that subclasses don t accidentally override the private methods and attributes of their superclasses it s not designed to prevent deliberate access from outside for example class foo object def init self self baz def foo self print self baz class bar foo def init self super bar self init self baz def bar self print self baz x bar x foo x bar print x dict bar baz foo baz of course it breaks down if two different classes have the same name s s inst python init and self what do they do i m learning the python programming language and i ve come across certain things i don t fully understand i m coming from a c background but i never went far with that either what i m trying to figure out is in a method def method self blah def init what does self do what is it meant to be and is it mandatory what does the init method do why is it necessary etc i think they might be oop constructs but i don t know very much inst in this code class a object def init self self x hello def method a self foo print self x foo the self variable represents the instance of the object itself most object oriented languages pass this as a hidden parameter to the methods defined on an object python does not you have to declare it explicitly when you create an instance of the a class and call its methods it will be passed automatically as in a a we do not pass any argument to the init method a method a sailor we only pass a single argument the init method is roughly what represents a constructor in python when you call a python creates an object for you and passes it as the first parameter to the init method any additional parameters e g a hello will also get passed as arguments in this case causing an exception to be raised since the constructor isn t expecting them s s inst running shell command from python and capturing the output i want to write a function that will execute a shell command and return its output as a string no matter is it an error or success message i just want to get the same result that i would have gotten with the command line what would be a code example that would do such a thing for example def run command cmd print run command mysqladmin create test uroot pmysqladmin should output something like mysqladmin create database failed error can t create database test database exists inst for convenience python provides the subprocess check output popenargs kwargs function which takes the same arguments as popen but returns a string containing the program s output you can pass stderr subprocess stdout to ensure that error messages are included in the returned output but don t pass stderr subprocess pipe to check output it can cause deadlocks if you need to pipe from stderr see the popen example below if you re using an older python vartec s method will work but the better way to go at least in simple cases that don t require real time output capturing is to use communicate as in output subprocess popen mycmd myarg stdout subprocess pipe communicate or import subprocess p subprocess popen ls a stdout subprocess pipe stderr subprocess pipe out err p communicate print out foo if you set stdin pipe communicate also allows you to pass data to the process via stdin cmd awk length p subprocess popen cmd stdout subprocess pipe stderr subprocess pipe stdin subprocess pipe out err p communicate foo foofoo print out foofoo finally note aaron hall s answer which indicates that on some systems you may need to set stdout stderr and stdin all to pipe or devnull to get communicate to work at all s s inst how do i cd in python cd as in the shell command to change the working directory how do i change the current working directory in python inst you can change the working directory with os chdir path there are two best practices to follow when using this method catch the exception windowserror oserror on invalid path if the exception is thrown do not perform any recursive operations especially destructive ones they will operate on the old path and not the new one return to your old directory when you re done this can be done in an exception safe manner by wrapping your chdir call in a context manager like brian m hunt did in his answer changing the current working directory in a subprocess does not change the current working directory in the parent process this is true of the python interpreter as well you cannot use os chdir to change the cwd of the calling process s s inst python s equivalent of in an if statement here s my code f front back consider dividing a string into two halves if the length is even the front and back halves are the same length if the length is odd we ll say that the extra char goes in the front half e g abcde the front half is abc the back half de given strings a and b return a string of the form a front b front a back b back def front back a b your code here if len a len b return a len a b len b a len a b len b else todo not yet done p return i m getting an error in the if conditional what am i doing wrong inst you would want and instead of s s inst what are the differences between the urllib urllib and requests module in python what are the differences between the urllib urllib and requests module why are there three they seem to do the same thing inst i know its been said already but i d highly recommend the requests python package http docs python requests org en latest index html if you ve used languages other than python you re probably thinking urllib and urllib are easy to use not much code and highly capable that s how i used to think but the requests package is so unbelievably useful and short that everyone should be using it first it supports a fully restful api and is as easy as import requests resp requests get http www mywebsite com user resp requests post http www mywebsite com user resp requests put http www mywebsite com user put resp requests delete http www mywebsite com user delete regardless of whether get post you never have to encode parameters again it simply takes a dictionary as an argument and is good to go userdata firstname john lastname doe password jdoe resp requests post http www mywebsite com user data userdata plus it even has a built in json decoder again i know json loads isn t a lot more to write but this sure is convenient resp json or if your response data is just text use resp text this is just the tip of the iceberg this is the list of features from the requests site international domains and urls keep alive connection pooling sessions with cookie persistence browser style ssl verification basic digest authentication elegant key value cookies automatic decompression unicode response bodies multipart file uploads connection timeouts netrc support list item python a thread safe s s inst is there a simple way to delete a list element by value in python a b a index del a b print a the above shows the following error traceback most recent call last file d jm code py line in module b a index valueerror list index x x not in list so i have to do this a try b a index del a b except pass print a but is there not a simpler way to do this inst to remove an element s first occurrence in a list simply use list remove a a b c d a remove b print a a c d mind that it does not remove all occurrences of your element use a list comprehension for that a a x for x in a if x print a s s inst how to fix attempted relative import in non package even with init py i m trying to follow pep with the following directory structure pkg init py components core py init py tests core test py init py in core test py i have the following import statement from components core import gameloopevents however when i run i get the following error tests python core test py traceback most recent call last file core test py line in module from components core import gameloopevents valueerror attempted relative import in non package searching around i found relative path not working even with init py and import a module from a relative path but they didn t help is there anything i m missing here inst to elaborate on ignacio s answer the python import mechanism works relative to the name of the current file when you execute a file directly it doesn t have its usual name but has main as its name instead so relative imports don t work you can as igancio suggested execute it using the m option if you have a part of your package that is meant to be run as a script you can also use the package attribute to tell that file what name it s supposed to have in the package hierarchy see http www python org dev peps pep for details s s inst python split strings with multiple delimiters i think what i want to do is a fairly common task but i ve found no reference on the web i have text with punctuation and i want list of the words hey you what are you doing here should be hey you what are you doing here but python s str split only works with one argument so i have all words with the punctuation after i split with whitespace any ideas inst a case where regular expressions are justified import re data hey you what are you doing here print re findall r data prints hey you what are you doing here edited to include in the word characters thanks danosaure s s inst converting unix timestamp string to readable date in python i have a string representing a unix timestamp i e in python and i d like to convert it to a readable date when i use time strftime i get a typeerror import time print time strftime b d y traceback most recent call last file stdin line in module typeerror argument must be item sequence not str inst use datetime module import datetime print datetime datetime fromtimestamp int strftime y m d h m s in this code datetime datetime can look strange but st datetime is module name and nd is class name so datetime datetime fromtimestamp is fromtimestamp method of datetime class from datetime module s s inst argparse optional positional arguments i have script which is meant to be used like this usage installer py dir h v dir is a positional argument which is defined like this parser add argument dir default os getcwd i want dir to be optional when it s not specified it should just be cwd unfortunately when i don t specify the dir argument i get error too few arguments inst try using nargs parser add argument dir nargs default os getcwd extended example import os argparse parser argparse argumentparser parser add argument v action store true storetrueaction option strings v dest v nargs const true default false type none choices none help none metavar none parser add argument dir nargs default os getcwd storeaction option strings dest dir nargs const none default home vinay type none choices none help none metavar none parser parse args somedir v split namespace dir somedir v true parser parse args v split namespace dir home vinay v true parser parse args split namespace dir home vinay v false parser parse args somedir namespace dir somedir v false parser parse args somedir h v split usage h v dir positional arguments dir optional arguments h help show this help message and exit v s s inst python time clock vs time time accuracy which is better to use for timing in python time clock or time time which one provides more accuracy for example start time clock do something elapsed time clock start vs start time time do something elapsed time time start inst as of time clock is deprecated and it s suggested to use time process time or time perf counter instead previously in according to the time module docs time clock on unix return the current processor time as a floating point number expressed in seconds the precision and in fact the very definition of the meaning of a processor timea depends on that of the c function of the same name but in any case this is the function to use for benchmarking python or timing algorithms on windows this function returns wall clock seconds elapsed since the first call to this function as a floating point number based on the win function queryperformancecounter the resolution is typically better than one microsecond additionally there is the timeit module for benchmarking code snippets s s inst json datetime between python and javascript i want to send a datetime datetime object in serialized form from python using json and de serialize in javascript using json what is the best way to do this inst you can add the default parameter to json dumps to handle this date handler lambda obj obj isoformat if isinstance obj datetime datetime or isinstance obj datetime date else none json dumps datetime datetime now default date handler t which is iso format a more comprehensive default handler function def handler obj if hasattr obj isoformat return obj isoformat elif isinstance obj return else raise typeerror object of type s with value of s is not json serializable type obj repr obj update added output of type as well as value update also handle date s s inst fatal error python h no such file or directory i am trying to build a shared library using a c extension file but first i have to generate the output file using the command below gcc wall utilsmodule c o utilc after executing the command i get this error message utilsmodule c fatal error python h no such file or directory compilation terminated in fact i have tried all the suggested solutions over the internet but the problem still exists also i have no problem with python h i managed to locate the file on my machine anybody has faced the same problem before inst looks like you haven t properly installed the header files and static libraries for python dev use your package manager to install them system wide for apt ubuntu debian sudo apt get install python dev for python x installs sudo apt get install python dev for python x installs for yum centos redhat fedora sudo yum install python devel s s inst how can i subtract a day from a python date i have a python datetime datetime object what is the best way to subtract one day inst you can use a timedelta object from datetime import datetime timedelta d datetime today timedelta days days to subtract s s inst convert date to datetime in python silly question but is there a built in method for converting a date to a datetime in python ie getting the datetime for the midnight of the date the opposite conversion is easy datetime has a date method do i really have to manually call datetime d year d month d day inst you can use datetime combine date time for the time you create a datetime time object initialized to midnight from datetime import date from datetime import datetime d date today datetime combine d datetime min time s s inst list filtering list comprehension vs lambda filter i happened to find myself having a basic filtering need i have a list and i have to filter it by an attribute of the items my code looked like this my list x for x in my list if x attribute value but then i thought wouldn t it be better to write it like this my list filter lambda x x attribute value my list it s more readable and if needed for performance the lambda could be taken out to gain something question is are there any caveats in using the second way any performance difference am i missing the pythonic waya entirely and should do it in yet another way such as using itemgetter instead of the lambda inst it is strange how much beauty varies for different people i find the list comprehension much clearer than the ugly filter lambda but use whichever you find easier however do stop giving your variables names already used for builtins that s just ugly and not open for discussion there are two things that may slow down your use of filter the first is the function call overhead as soon as you use a python function whether created by def or lambda it is likely that filter will be slower than the list comprehension it almost certainly is not enough to matter and you shouldn t think much about performance until you ve timed your code and found it to be a bottleneck but the difference will be there the other overhead that might apply is that the lambda is being forced to access a scoped variable value that is slower than accessing a local variable and in python x the list comprehension only accesses local variables if you are using python x the list comprehension runs in a separate function so it will also be accessing value through a closure and this difference won t apply the other option to consider is to use a generator instead of a list comprehension def filterbyvalue seq value for el in seq if el attribute value yield el then in your main code which is where readability really matters you ve replaced both list comprehension and filter with a hopefully meaningful function name s s inst converting a string to dictionary how can i convert the str representation of a dict such as the following string into a dict s muffin lolz foo kitty i prefer not to use eval what else can i use the main reason for this is one of my coworkers classes he wrote converts all input into strings i m not in the mood to go and modify his classes to deal with this issue inst starting in python you can use the built in ast literal eval import ast ast literal eval muffin lolz foo kitty muffin lolz foo kitty this is safer than using eval as its own docs say help ast literal eval help on function literal eval in module ast literal eval node or string safely evaluate an expression node or a string containing a python expression the string or node provided may only consist of the following python literal structures strings numbers tuples lists dicts booleans and none for example eval shutil rmtree mongo traceback most recent call last file stdin line in module file string line in module file opt python lib python shutil py line in rmtree onerror os listdir path sys exc info file opt python lib python shutil py line in rmtree names os listdir path oserror errno no such file or directory mongo ast literal eval shutil rmtree mongo traceback most recent call last file stdin line in module file opt python lib python ast py line in literal eval return convert node or string file opt python lib python ast py line in convert raise valueerror malformed string valueerror malformed string s s inst open in python does not create a file if it doesn t exist what is the best way to open a file as read write if it exists or if it does not then create it and open it as read write from what i read file open myfile dat rw should do this right it is not working for me python and i m wondering if it is a version problem or not supposed to work like that or what the bottom line is i just need a solution for the problem i am curious about the other stuff but all i need is a nice way to do the opening part update the enclosing directory was writeable by user and group not other i m on a linux system so permissions in other words and the exact error was ioerror no such file or directory inst you should use file open myfile dat w s s inst non blocking read on a subprocess pipe in python i m using the subprocess module to start a subprocess and connect to it s output stream stdout i want to be able to execute non blocking reads on its stdout is there a way to make readline non blocking or to check if there is data on the stream before i invoke readline i d like this to be portable or at least work under windows and linux here is how i do it for now it s blocking on the readline if no data is avaible p subprocess popen myprogram exe stdout subprocess pipe output str p stdout readline inst fcntl select asyncproc won t help in this case a reliable way to read a stream without blocking regardless of operating system is to use queue get nowait import sys from subprocess import pipe popen from threading import thread try from queue import queue empty except importerror from queue import queue empty python x on posix posix in sys builtin module names def enqueue output out queue for line in iter out readline b queue put line out close p popen myprogram exe stdout pipe bufsize close fds on posix q queue t thread target enqueue output args p stdout q t daemon true thread dies with the program t start do other things here read line without blocking try line q get nowait or q get timeout except empty print no output yet else got line do something with line s s inst what is the standard python docstring format i have seen a few different styles of writing docstrings in python is there an official or agreed upon style inst the google style guide contains an excellent python style guide it includes conventions for readable docstring syntax that offers better guidance than pep for example def square root n calculate the square root of a number args n the number to get the square root of returns the square root of n raises typeerror if n is not a number valueerror if n is negative pass i like to extend this to also include type information in the arguments as described in this sphinx documentation tutorial for example def add value self value add a new value args value str the value to add pass s s inst what is the naming convention in python for variable and function names coming from a c background the naming convention for variables and method names are usually either camelcase or pascal case c example string thisismyvariable a public void thisismymethod in python i have seen the above but i have also seen underscores being used python example this is my variable a def this is my function is there a more preferable definitive coding style for python inst see python pep function names should be lowercase with words separated by underscores as necessary to improve readability mixedcase is allowed only in contexts where that s already the prevailing style variables use the function naming rules lowercase with words separated by underscores as necessary to improve readability personally i deviate from this because i also prefer mixedcase over lower case for my own projects s s inst remove empty strings from a list of strings i want to remove all empty strings from a list of strings in python my idea looks like this while in str list str list remove is there any more pythonic way to do this inst i would use filter str list filter none str list fastest str list filter bool str list fastest str list filter len str list a bit of slower str list filter lambda item item str list slower than list comprehension python returns an iterator from filter so should be wrapped in a call to list str list list filter none str list fastest etc tests timeit filter none str list str list a number timeit filter bool str list str list a number timeit filter len str list str list a number timeit x for x in str list if x str list a number timeit filter lambda item item str list str list a number s s inst convert python dict to object i m searching for an elegant way to convert a normal python dict with some nested dicts to an object for example d a b c d hi foo bar should be accessible in this way x dict obj d x a x b c x d foo bar i think this is not possible without recursion but what would be a nice way to get an objectstyle for dicts thank you in advance inst update in python and onwards consider whether the namedtuple data structure suits your needs from collections import namedtuple mystruct namedtuple mystruct a b d s mystruct a b c d hi s mystruct a b c d hi s a s b c s c s d hi the alternative original answer contents is class struct def init self entries self dict update entries then you can use args a b s struct args s main struct instance at x d a s a s b s s inst is there any pythonic way to combine two dicts adding values for keys that appear in both for example i have two dicts dict a a b c dict b b c d i need a pythonic way of combining two dicts such that the result is a b c d that is to say if a key appears in both dicts add their values if it appears in only one dict keep its value inst use collections counter from collections import counter a counter a b c b counter b c d a b counter c b d a counters are basically a subclass of dict so you can still do everything else with them you d normally do with that type such as iterate over their keys and values s s inst how to detect whether a python variable is a function i have a variable x and i want to know whether it is pointing to a function or not i had hoped i could do something like isinstance x function but that gives me traceback most recent call last file stdin line in nameerror name function is not defined the reason i picked that is because type x type function inst if this is for python x or for python you can also use callable it used to be deprecated but is now undeprecated so you can use it again you can read the discussion here http bugs python org issue you can do this with callable obj if this is for python x but before check if the object has a call attribute you can do this with hasattr obj call the oft suggested types functiontypes approach is not correct because it fails to cover many cases that you would presumably want it to pass like with builtins isinstance open types functiontype false callable open true the proper way to check properties of duck typed objects is to ask them if they quack not to see if they fit in a duck sized container don t use types functiontype unless you have a very specific idea of what a function is s s inst build a basic python iterator how would one create an iterative function or iterator object in python inst iterator objects in python conform to the iterator protocol which basically means they provide two methods iter and next the iter returns the iterator object and is implicitly called at the start of loops the next method returns the next value and is implicitly called at each loop increment next raises a stopiteration exception when there are no more value to return which is implicitly captured by looping constructs to stop iterating here s a simple example of a counter class counter def init self low high self current low self high high def iter self return self def next self python def next self if self current self high raise stopiteration else self current return self current for c in counter print c this will print this is easier to write using a generator as covered in a previous answer def counter low high current low while current high yield current current for c in counter print c the printed output will be the same under the hood the generator object supports the iterator protocol and does something roughly similar to the class counter david mertz s article iterators and simple generators is a pretty good introduction s s inst how can i tell if a string repeats itself in python i m looking for a way to test whether or not a given string repeats itself for the entire string or not examples are strings which repeat themselves and are examples of ones that do not the repeating sections of the strings i m given can be quite long and the strings themselves can be or more characters so looping through each character trying to build a pattern then checking the pattern vs the rest of the string seems awful slow multiply that by potentially hundreds of strings and i can t see any intuitive solution i ve looked into regexes a bit and they seem good for when you know what you re looking for or at least the length of the pattern you re looking for unfortunately i know neither how can i tell if a string is repeating itself and if it is what the shortest repeating subsequence is inst here s a concise solution which avoids regular expressions and slow in python loops def principal period s i s s find s return none if i else s i see the community wiki answer started by davidism for benchmark results in summary david zhang s solution is the clear winner outperforming all others by at least x for the large example set that answer s words not mine this is based on the observation that a string is periodic if and only if it is equal to a nontrivial rotation of itself kudos to aleksitorhamo for realizing that we can then recover the principal period from the index of the first occurrence of s in s s and for informing me of the optional start and end arguments of python s string find s s inst good way to append to a string i want an efficient way to append string to another is there any good built in method to use inst if you only have one reference to a string and you concatenate another string to the end cpython now special cases this and tries to extend the string in place the end result is that the operation is amortized o n eg s for i in range n s str n used to be o n but now it is o n from the source bytesobject c void pybytes concatanddel register pyobject pv register pyobject w pybytes concat pv w py xdecref w the following function breaks the notion that strings are immutable it changes the size of a string we get away with this only if there is only one module referencing the object you can also think of it as creating a new string object and destroying the old one only more efficiently in any case don t use this if the string may already be known to some other part of the code note that if there s not enough memory to resize the string the original string object at pv is deallocated pv is set to null an out of memory exception is set and is returned else on success is returned and the value in pv may or may not be the same as on input as always an extra byte is allocated for a trailing byte newsize does not include that and a trailing byte is stored int pybytes resize pyobject pv py ssize t newsize register pyobject v register pybytesobject sv v pv if pybytes check v py refcnt v newsize pv py decref v pyerr badinternalcall return xxx unref newref interface should be more symmetrical py dec reftotal py forgetreference v pv pyobject pyobject realloc char v pybytesobject size newsize if pv null pyobject del v pyerr nomemory return py newreference pv sv pybytesobject pv py size sv newsize sv ob sval newsize sv ob shash invalidate cached hash value return it s easy enough to verify empirically python m timeit s s for i in xrange s a loops best of usec per loop python m timeit s s for i in xrange s a loops best of usec per loop python m timeit s s for i in xrange s a loops best of usec per loop python m timeit s s for i in xrange s a loops best of msec per loop python m timeit s s for i in xrange s a loops best of msec per loop python m timeit s s for i in xrange s a loops best of msec per loop it s important however to note that this optimisation isn t part of the python spec it s only in the cpython implementation as far as i know the same empirical testing on pypy or jython for example might show the older o n performance pypy m timeit s s for i in xrange s a loops best of usec per loop pypy m timeit s s for i in xrange s a loops best of usec per loop pypy m timeit s s for i in xrange s a loops best of msec per loop pypy m timeit s s for i in xrange s a loops best of msec per loop so far so good but then pypy m timeit s s for i in xrange s a loops best of sec per loop ouch even worse than quadratic so pypy is doing something that works well with short strings but performs poorly for larger strings s s inst how to print date in a regular format in python this is my code import datetime today datetime date today print today this prints which is exactly what i want but i have a list i m appending this to and then suddenly everything goes wonky here is the code import datetime mylist today datetime date today mylist append today print mylist this prints the following datetime date how on earth can i get just a simple date like inst the why dates are objects in python dates are objects therefore when you manipulate them you manipulate objects not strings not timestamps nor anything any object in python have two string representations the regular representation that is used by print can be get using the str function it is most of the time the most common human readable format and is used to ease display so str datetime datetime gives you the alternative representation that is used to represent the object nature as a data it can be get using the repr function and is handy to know what kind of data your manipulating while you are developing or debugging repr datetime datetime gives you datetime datetime what happened is that when you have printed the date using print it used str so you could see a nice date string but when you have printed mylist you have printed a list of objects and python tried to represent the set of data using repr the how what do you want to do with that well when you manipulate dates keep using the date objects all long the way they got thousand of useful methods and most of the python api expect dates to be objects when you want to display them just use str in python the good practice is to explicitly cast everything so just when it s time to print get a string representation of your date using str date one last thing when you tried to print the dates you printed mylist if you want to print a date you must print the date objects not their container the list e g you want to print all the date in a list for date in mylist print str date note that in that specific case you can even omit str because print will use it for you but it should not become a habit practical case using your code import datetime mylist today datetime date today mylist append today print mylist print the date object not the container it s better to always use str because print this is a new day mylist will work this is a new day print this is a new day mylist will crash cannot concatenate str and datetime date objects print this is a new day str mylist this is a new day advanced date formatting dates have a default representation but you may want to print them in a specific format in that case you can get a custom string representation using the strftime method strftime expects a string pattern explaining how you want to format your date e g print today strftime we are the d b y we are the nov all the letter after a represent a format for something d is the day number m is the month number b is the month abbreviation y is the year last two digits y is the all year etc have a look at the official documentation or mccutchen s quick reference you can t know them all since pep every object can have its own format used automatically by the method format of any string in the case of the datetime the format is the same used in strftime so you can do the same as above like this print we are the d b y format today we are the nov the advantage of this form is that you can also convert other objects at the same time localization dates can automatically adapt to the local language and culture if you use them the right way but it s a bit complicated maybe for another question on so stack overflow s s inst use a glob to find files recursively in python this is what i have glob os path join src c but i want to search the subfolders of src something like this would work glob os path join src c glob os path join src c glob os path join src c glob os path join src c but this is obviously limited and clunky inst python starting with python version the glob module supports the directive which is parsed only if you pass recursive flag import glob for filename in glob iglob src c recursive true print filename if you need an list just use glob glob instead of glob iglob python to for older python versions starting with python use os walk to recursively walk a directory and fnmatch filter to match against a simple expression import fnmatch import os matches for root dirnames filenames in os walk src for filename in fnmatch filter filenames c matches append os path join root filename python and earlier for even older python versions use glob glob against each filename instead of fnmatch filter s s inst python s use of new and init i m just trying to streamline one of my classes and have introduced some functionality in the same style as the flyweight design pattern however i m a bit confused as to why init is always called after new i wasn t expecting this can anyone tell me why this is happening and how i implement this functionality otherwise apart from putting the implementation into the new which feels quite hacky here s an example class a object dict dict def new cls if key in a dict print exists return a dict key else print new return super a cls new cls def init self print init a dict key self print a a a a a a outputs new init exists init exists init why inst use new when you need to control the creation of a new instance use init when you need to control initialization of a new instance new is the first step of instance creation it s called first and is responsible for returning a new instance of your class in contrast init doesn t return anything it s only responsible for initializing the instance after it s been created in general you shouldn t need to override new unless you re subclassing an immutable type like str int unicode or tuple from http mail python org pipermail tutor april html you should consider that what you are trying to do is usually done with a factory and that s the best way to do it using new is not a good clean solution so please consider the usage of a factory here you have a good factory example s s inst how do i install a python package with a whl file i m having trouble installing a python package specifically jpype on my windows machine and would like to install it with christoph gohlke s window binaries which to my experience alleviated much of the fuss for many other package installations however while christoph used to provide exe files in the past recently it seems he s uploading whl files instead http www lfd uci edu gohlke pythonlibs jpype but how do i install whl files notes i ve found documents on wheel but they don t seem so staightforward in explaining how to install whl files this question is a duplicate with this question which wasn t directly answered inst i just used the following which was quite simple first open a console then cd to where you ve downloaded your file like some package whl and use pip install some package whl note if pip exe is not recognized you may find it in the scripts directory from where python has been installed if pip is not installed this page can help how do i install pip on windows note for clarification if you copy the whl file to your local drive ex c ome dir ome file whl use the following command line parameters pip install c some dir some file whl s s inst what is the python equivalent of static variables inside a function what is the idiomatic python equivalent of this c c code void foo static int counter counter printf counter is d counter specifically how does one implement the static member at the function level as opposed to the class level and does placing the function into a class change anything inst a bit reversed but this should work def foo foo counter print counter is d foo counter foo counter if you want the counter initialization code at the top instead of the bottom you can create a decorator def static var varname value def decorate func setattr func varname value return func return decorate then use the code like this static var counter def foo foo counter print counter is d foo counter it ll still require you to use the foo prefix unfortunately edit thanks to ony this looks even nicer def static vars kwargs def decorate func for k in kwargs setattr func k kwargs k return func return decorate static vars counter def foo foo counter print counter is d foo counter s s inst how to make a class json serializable how to make a python class serializable a simple class class fileitem def init self fname self fname fname what should i do to be able to get output of json dumps without an error fileitem instance at is not json serializable inst here is a simple solution for a simple feature tojson method instead of a json serializable class implement a serializer method import json class object def tojson self return json dumps self default lambda o o dict sort keys true indent so you just call it to serialize me object me name onur me age me dog object me dog name apollo print me tojson will output age dog name apollo name onur s s inst how to parse an iso formatted date in python i need to parse rfc strings like t z into python s datetime type i have found strptime in the python standard library but it is not very convenient what is the best way to do this inst the python dateutil package can parse not only rfc datetime strings like the one in the question but also other iso date and time strings that don t comply with rfc such as ones with no utc offset or ones that represent only a date import dateutil parser dateutil parser parse t z rfc format datetime datetime tzinfo tzutc dateutil parser parse t iso extended format datetime datetime dateutil parser parse t iso basic format datetime datetime dateutil parser parse iso basic format date only datetime datetime s s inst how do you get the logical xor of two variables in python how do you get the logical xor of two variables in python for example i have two variables that i expect to be strings i want to test that only one of them contains a true value is not none or the empty string str raw input enter string one str raw input enter string two if logical xor str str print ok else print bad the operator seems to be bitwise and not defined on all objects abc traceback most recent call last file stdin line in module typeerror unsupported operand type s for str and str inst if you re already normalizing the inputs to booleans then is xor bool a bool b s s inst how to sort a list of objects in python based on an attribute of the objects i ve got a list of python objects that i d like to sort by an attribute of the objects themselves the list looks like ut tag tag tag tag actionscript tag addresses tag aes tag ajax each object has a count ut count l i need to sort the list by number of counts descending i ve seen several methods for this but i m looking for best practice in python inst to sort the list in place ut sort key lambda x x count reverse true to return a new list use the sorted built in function newlist sorted ut key lambda x x count reverse true more on sorting by keys s s inst how to put the legend out of the plot i have a series of plots not subplots to be made in a single figure i want the legend to be outside of the box at the same time i do not want to change the axes as the size of the figure gets reduced kindly help me for the following queries i want to keep the legend box outside the plot area i want the legend to be outside at the right side of the plot area is there anyway that i reduce the font size of the text inside the legend box so that the size of the legend box will be small inst there are a number of ways to do what you want to add to what inalis and navi already said you can use the bbox to anchor keyword argument to place the legend partially outside the axes and or decrease the font size before you consider decreasing the font size which can make things awfully hard to read try playing around with placing the legend in different places so let s start with a generic example import matplotlib pyplot as plt import numpy as np x np arange fig plt figure ax plt subplot for i in xrange ax plot x i x label y ix i ax legend plt show if we do the same thing but use the bbox to anchor keyword argument we can shift the legend slightly outside the axes boundaries import matplotlib pyplot as plt import numpy as np x np arange fig plt figure ax plt subplot for i in xrange ax plot x i x label y ix i ax legend bbox to anchor plt show similarly you can make the legend more horizontal and or put it at the top of the figure i m also turning on rounded corners and a simple drop shadow import matplotlib pyplot as plt import numpy as np x np arange fig plt figure ax plt subplot for i in xrange line ax plot x i x label y ix i ax legend loc upper center bbox to anchor ncol fancybox true shadow true plt show alternatively you can shrink the current plot s width and put the legend entirely outside the axis of the figure import matplotlib pyplot as plt import numpy as np x np arange fig plt figure ax plt subplot for i in xrange ax plot x i x label y ix i shrink current axis by box ax get position ax set position box x box y box width box height put a legend to the right of the current axis ax legend loc center left bbox to anchor plt show and in a similar manner you can shrink the plot vertically and put the a horizontal legend at the bottom import matplotlib pyplot as plt import numpy as np x np arange fig plt figure ax plt subplot for i in xrange line ax plot x i x label y ix i shrink current axis s height by on the bottom box ax get position ax set position box x box y box height box width box height put a legend below current axis ax legend loc upper center bbox to anchor fancybox true shadow true ncol plt show have a look at the matplotlib legend guide you might also take a look at plt figlegend hope that helps a bit anyway s s inst traverse a list in reverse order in python so i can start from len collection and end in collection edit sorry i forgot to mention i also want to be able to access the loop index inst use the reversed built in function a foo bar baz for i in reversed a print i baz bar foo to also access the original index for i e in reversed list enumerate a print i e baz bar foo s s inst how can i use python to get the system hostname i m writing a chat program for a local network i would like be able to identify computers and get the user set computer name with python inst use socket and its gethostname functionality this will get the hostname of the computer where the python interpreter is running import socket print socket gethostname s s inst favorite django tips features inspired by the question series hidden features of i am curious to hear about your favorite django tips or lesser known but useful features you know of please include only one tip per answer add django version requirements if there are any inst i m just going to start with a tip from myself use os path dirname in settings py to avoid hardcoded dirnames don t hardcode path s in your settings py if you want to run your project in different locations use the following code in settings py if your templates and static files are located within the django project directory settings py import os project dir os path dirname file static doc root os path join project dir static template dirs os path join project dir templates credits i got this tip from the screencast django from the ground up s s inst how to do relative imports in python imagine this directory structure app init py sub init py mod py sub init py mod py i m coding mod and i need to import something from mod how should i do it i tried from sub import mod but i m getting an attempted relative import in non package i googled around but found only sys path manipulation hacks isn t there a clean way edit all my init py s are currently empty edit i m trying to do this because sub contains classes that are shared across sub packages sub subx etc edit the behaviour i m looking for is the same as described in pep thanks john b inst everyone seems to want to tell you what you should be doing rather than just answering the question the problem is that you re running the module as main by passing the mod py as an argument to the interpreter from pep relative imports use a module s name attribute to determine that module s position in the package hierarchy if the module s name does not contain any package information e g it is set to main then relative imports are resolved as if the module were a top level module regardless of where the module is actually located on the file system in python they re adding the ability to reference modules relative to the main module pep describes the change update according to nick coghlan the recommended alternative is to run the module inside the package using the m switch s s inst python try else what is the intended use of the optional else clause of the try statement inst the statements in the else block are executed if execution falls off the bottom of the try if there was no exception honestly i ve never found a need however handling exceptions notes the use of the else clause is better than adding additional code to the try clause because it avoids accidentally catching an exception that wasna t raised by the code being protected by the try except statement so if you have a method that could for example throw an ioerror and you want to catch exceptions it raises but there s something else you want to do if the first operation succeeds and you don t want to catch an ioerror from that operation you might write something like this try operation that can throw ioerror except ioerror handle the exception somehow else we don t want to catch the ioerror if it s raised another operation that can throw ioerror finally something we always need to do if you just put another operation that can throw ioerror after operation that can throw ioerror the except would catch the second call s errors and if you put it after the whole try block it ll always be run and not until after the finally the else lets you make sure the second operation s only run if there s no exception it s run before the finally block and any ioerrors it raises aren t caught here s s inst how to get an absolute file path in python given a path such as mydir myfile txt how do i find the absolute filepath relative to the current working directory in python e g on windows i might end up with c example cwd mydir myfile txt inst import os os path abspath mydir myfile txt s s inst proper indentation for python multiline strings what is the proper indentation for python multiline strings within a function def method string line one line two line three or def method string line one line two line three or something else it looks kind of weird to have the string hanging outside the function in the first example inst you probably want to line up with the def foo string line one line two line three since the newlines and spaces are included in the string itself you will have to postprocess it if you don t want to do that and you have a whole lot of text you might want to store it separately in a text file if a text file does not work well for your application and you don t want to postprocess i d probably go with def foo string this is an implicitly joined string if you want to postprocess a multiline string to trim out the parts you don t need you should consider the textwrap module or the technique for postprocessing docstrings presented in pep def trim docstring if not docstring return convert tabs to spaces following the normal python rules and split into a list of lines lines docstring expandtabs splitlines determine minimum indentation first line doesn t count indent sys maxint for line in lines stripped line lstrip if stripped indent min indent len line len stripped remove indentation first line is special trimmed lines strip if indent sys maxint for line in lines trimmed append line indent rstrip strip off trailing and leading blank lines while trimmed and not trimmed trimmed pop while trimmed and not trimmed trimmed pop return a single string return join trimmed s s inst get last day of the month in python is there a way using python s standard library to easily determine i e one function call the last day of a given month if the standard library doesn t support that does the dateutil package support this inst i didn t notice this earlier when i was looking at the documentation for the calendar module but a method called monthrange provides this information monthrange year month returns weekday of first day of the month and number of days in month for the specified year and month import calendar calendar monthrange calendar monthrange calendar monthrange so calendar monthrange year month seems like the simplest way to go just to be clear monthrange supports leap years as well from calendar import monthrange monthrange my previous answer still works but is clearly suboptimal s s inst how to get a function name as a string in python in python how do i get a function name as a string without calling the function def my function pass print get function name as string my function my function is not in quotes should output my function is this available in python if not any idea how to write get function name as string in python inst my function name using name is the preferred method as it applies uniformly unlike func name it works on built in functions as well import time time time func name traceback most recent call last file stdin line in attributeerror builtin function or method object has no attribute func name time time name time also the double underscores indicate to the reader this is a special attribute as a bonus classes and modules have a name attribute too so you only have remember one special name s s inst usage of slots what is the purpose of slots in python a especially with respect to when would i want to use it and when not inst quoting jacob hallen the proper use of slots is to save space in objects instead of having a dynamic dict that allows adding attributes to objects at anytime there is a static structure which does not allow additions after creation this saves the overhead of one dict for every object that uses slots while this is sometimes a useful optimization it would be completely unnecessary if the python interpreter was dynamic enough so that it would only require the dict when there actually were additions to the object unfortunately there is a side effect to slots they change the behavior of the objects that have slots in a way that can be abused by control freaks and static typing weenies this is bad because the control freaks should be abusing the metaclasses and the static typing weenies should be abusing decorators since in python there should be only one obvious way of doing something making cpython smart enough to handle saving space without slots is a major undertaking which is probably why it is not on the list of changes for p k yet s s inst how to change a string into uppercase i have problem in changing a string into uppercase with python in my research i got string ascii uppercase but it doesn t work the following code s sdsd s ascii uppercase gives this error message traceback most recent call last file console line in module attributeerror str object has no attribute ascii uppercase my question is how can i convert a string into uppercase in python inst s sdsd s upper sdsd see string methods s s inst pg config executable not found i am having trouble installing psycopg i get the following error when i try to pip install psycopg error pg config executable not found please add the directory containing pg config to the path or specify the full executable path with the option python setup py build ext pg config path to pg config build or with the pg config option in setup cfg command python setup py egg info failed with error code in tmp pip build psycopg but the problem is pg config is actually in my path it runs without any problem which pg config usr pgsql bin pg config i tried adding the pg config path to the setup cfg file and building it using the source files i downloaded from their website http initd org psycopg and i get the following error message error unable to find pg config file in usr pgsql bin but it is actually there i am baffled by these errors can anyone help please by the way i sudo all the commands also i am on rhel inst pg config is in postgresql devel libpq dev in debian ubuntu libpq devel on cygwin babun s s inst difference between abstract class and interface in python what is the difference between abstract class and interface in python inst what you ll see sometimes is the following class abstract object some description that tells you it s abstract often listing the methods you re expected to supply def amethod self raise notimplementederror should have implemented this because python doesn t have and doesn t need a formal interface contract the java style distinction between abstraction and interface doesn t exist if someone goes through the effort to define a formal interface it will also be an abstract class the only differences would be in the stated intent in the docstring and the difference between abstract and interface is a hairsplitting thing when you have duck typing java uses interfaces because it doesn t have multiple inheritance because python has multiple inheritance you may also see something like this class someabstraction object pass lots of stuff but missing something class mixin object def something self pass one implementation class mixin object def something self pass another class concrete someabstraction mixin pass class concrete someabstraction mixin pass this uses a kind of abstract superclass with mixins to create concrete subclasses that are disjoint s s inst getting key with maximum value in dictionary i have a dictionary keys are strings values are integers example stats a b c i d like to get b as an answer since it s the key with a higher value i did the following using an intermediate list with reversed key value tuples inverse value key for key value in stats items print max inverse is that one the better or even more elegant approach inst max stats key stats get s s inst how to define two dimensional array in python i want to define a two dimensional array without an initialized length like this matrix but it does not work i ve tried the code below but it is wrong too matrix error traceback indexerror list index out of range what is my mistake inst you re technically trying to index an uninitialized array you have to first initialize the outer list with lists before adding items python calls this list comprehension creates a list containing lists each of items all set to w h matrix for x in range w for y in range h you can now add items to the list matrix matrix error range matrix valid print matrix prints x y print matrix x y prints be careful with indexing although you can name them as you wish i look at it this way to avoid some confusion that could arise with the indexing if you use x for both the inner and outer lists and want a non square matrix s s inst how to make ipython notebook matplotlib plot inline i am trying to use ipython notebook on macos x with python and ipython i cannot get matplotlib graphics to show up inline import matplotlib import numpy as np import matplotlib pyplot as plt matplotlib inline i have also tried pylab inline and the ipython command line arguments pylab inline but this makes no difference x np linspace np pi plt plot x np sin x plt title a simple chirp plt show instead of inline graphics i get this matplotlib figure figure at x b c and matplotlib get backend shows that i have the module ipython kernel zmq pylab backend inline backend inst i used matplotlib inline in the first cell of the notebook and it works i think you should try matplotlib inline import matplotlib import numpy as np import matplotlib pyplot as plt you can also always start all your ipython kernels in inline mode by default by setting the following config options in your config files c ipkernelapp matplotlib caselessstrenum default none choices auto gtk gtk inline nbagg notebook osx qt qt qt tk wx configure matplotlib for interactive use with the default matplotlib backend s s inst how to check for nan in python float nan results in a thingy simply called nan but how do i check for it should be very easy but i cannot find it inst math isnan checks if the float x is a nan not a number nans are part of the ieee standards operation like but not limited to inf inf inf or any operation involving a nan e g nan return a nan new in version import math x float nan math isnan x true s s inst is there a difference between and is in python my google fu has failed me in python are the following two tests for equality equivalent ha n test one if n print yay test two if n is print yay does this hold true for objects where you would be comparing instances a list say okay so this kind of answers my question l l append if l print yay holds true but if l is print yay doesn t so tests value where is tests to see if they are the same object inst is will return true if two variables point to the same object if the objects referred to by the variables are equal a b a b is a true b a true b a b is a false b a true in your case the second test only works because python caches small integer objects which is an implementation detail for larger integers this does not work is false true the same holds true for string literals a is a true aa is a true x a aa is x false aa is intern x true please see this question as well s s inst django set up a scheduled job i ve been working on a web app using django and i m curious if there is a way to schedule a job to run periodically basically i just want to run through the database and make some calculations updates on an automatic regular basis but i can t seem to find any documentation on doing this does anyone know how to set this up to clarify i know i can set up a cron job to do this but i m curious if there is some feature in django that provides this functionality i d like people to be able to deploy this app themselves without having to do much config preferably zero i ve considered triggering these actions retroactively by simply checking if a job should have been run since the last time a request was sent to the site but i m hoping for something a bit cleaner inst one solution that i have employed is to do this create a custom management command e g python manage py my cool command use cron on linux or at on windows to run my command at the required times this is a simple solution that doesn t require installing a heavy amqp stack however there are nice advantages to using something like celery mentioned in the other answers in particular with celery it is nice to not have to spread your application logic out into crontab files however the cron solution works quite nicely for a small to medium sized application and where you don t want a lot of external dependencies edit in later version of windows the at command is deprecated for windows server and above you can use schtasks exe for same use s s inst if else in python s list comprehension how can i do the following in python row unicode x strip for x in row if x is not none else essentially replace all the nones with empty strings and then carry out a function inst you can totally do that it s just an ordering issue unicode x strip if x is not none else for x in row note that this actually uses a different language construct a conditional expression which itself is not part of the comprehension syntax while the if after the fora in is part of list comprehensions and used to filter elements from the source iterable s s inst creating a singleton in python this question is not for the discussion of whether or not the singleton design pattern is desirable is an anti pattern or for any religious wars but to discuss how this pattern is best implemented in python in such a way that is most pythonic in this instance i define most pythonic to mean that it follows the principle of least astonishment i have multiple classes which would become singletons my use case is for a logger but this is not important i do not wish to clutter several classes with added gumph when i can simply inherit or decorate best methods method a decorator def singleton class instances def getinstance args kwargs if class not in instances instances class class args kwargs return instances class return getinstance singleton class myclass baseclass pass pros decorators are additive in a way that is often more intuitive than multiple inheritance cons while objects created using myclass would be true singleton objects myclass itself is a a function not a class so you cannot call class methods from it also for m myclass n myclass o type n then m n m o n o method a base class class singleton object instance none def new class args kwargs if not isinstance class instance class class instance object new class args kwargs return class instance class myclass singleton baseclass pass pros it s a true class cons multiple inheritance eugh new could be overwritten during inheritance from a second base class one has to think more than is necessary method a metaclass class singleton type instances def call cls args kwargs if cls not in cls instances cls instances cls super singleton cls call args kwargs return cls instances cls python class myclass baseclass metaclass singleton python class myclass baseclass metaclass singleton pass pros it s a true class auto magically covers inheritance uses metaclass for its proper purpose and made me aware of it cons are there any method decorator returning a class with the same name def singleton class class class w class instance none def new class args kwargs if class w instance is none class w instance super class w class new class args kwargs class w instance sealed false return class w instance def init self args kwargs if self sealed return super class w self init args kwargs self sealed true class w name class name return class w singleton class myclass baseclass pass pros it s a true class auto magically covers inheritance cons is there not an overhead for creating each new class here we are creating two classes for each class we wish to make a singleton while this is fine in my case i worry that this might not scale of course there is a matter of debate as to whether it aught to be too easy to scale this pattern what is the point of the sealed attribute can t call methods of the same name on base classes using super because they will recurse this means you can t customize new and can t subclass a class that needs you to call up to init inst use a metaclass i would recommend method but you re better off using a metaclass than a base class here is a sample implementation class singleton type instances def call cls args kwargs if cls not in cls instances cls instances cls super singleton cls call args kwargs return cls instances cls class logger object metaclass singleton or in python class logger metaclass singleton pass if you want to run init every time the class is called add else cls instances cls init args kwargs to the if statement in singleton call a few words about metaclasses a metaclass is the class of a class that is a class is an instance of its metaclass you find the metaclass of an object in python with type obj normal new style classes are of type type logger in the code above will be of type class your module singleton just as the only instance of logger will be of type class your module logger when you call logger with logger python first asks the metaclass of logger singleton what to do allowing instance creation to be pre empted this process is the same as python asking a class what to do by calling getattr when you reference one of it s attributes by doing myclass attribute a metaclass essentially decides what the definition of a class means and how to implement that definition see for example http code activestate com recipes which essentially recreates c style structs in python using metaclasses the thread what are your concrete use cases for metaclasses in python also provides some examples they generally seem to be related to declarative programming especially as used in orms in this situation if you use your method and a subclass defines a new method it will be executed every time you call subclassofsingleton because it is responsible for calling the method that returns the stored instance with a metaclass it will only be called once when the only instance is created you want to customize what it means to call the class which is decided by it s type in general it makes sense to use a metaclass to implement a singleton a singleton is special because is created only once and a metaclass is the way you customize the creation of a class using a metaclass gives you more control in case you need to customize the singleton class definitions in other ways your singletons won t need multiple inheritance because the metaclass is not a base class but for subclasses of the created class that use multiple inheritance you need to make sure the singleton class is the first leftmost one with a metaclass that redefines call this is very unlikely to be an issue the instance dict is not in the instance s namespace so it won t accidentally overwrite it you will also hear that the singleton pattern violates the single responsibility principle each class should do only one thing that way you don t have to worry about messing up one thing the code does if you need to change another because they are separate and encapsulated the metaclass implementation passes this test the metaclass is responsible for enforcing the pattern and the created class and subclasses need not be aware that they are singletons method fails this test as you noted with myclass itself is a a function not a class so you cannot call class methods from it python and compatible version writing something that works in both python and requires using a slightly more complicated scheme since metaclasses are usually subclasses of type type it s possible to use one to dynamically create an intermediary base class at run time with it as its metaclass and then use that as the baseclass of the public singleton base class it s harder to explain than to do as illustrated next works in python class singleton type a metaclass that creates a singleton base class when called instances def call cls args kwargs if cls not in cls instances cls instances cls super singleton cls call args kwargs return cls instances cls class singleton singleton singletonmeta object pass class logger singleton pass an ironic aspect of this approach is that it s using subclassing to implement a metaclass one possible advantage is that unlike with a pure metaclass isinstance inst singleton will return true corrections on another topic you ve probably already noticed this but the base class implementation in your original post is wrong instances needs to be referenced on the class you need to use super or you re recursing and new is actually a static method that you have to pass the class to not a class method as the actual class hasn t been created yet when it is called all of these things will be true for a metaclass implementation as well class singleton object instances def new class args kwargs if class not in class instances class instances class super singleton class new class args kwargs return class instances class class myclass singleton pass c myclass decorator returning a class i originally was writing a comment but it was too long so i ll add this here method is better than the other decorator version but it s more code than needed for a singleton and it s not as clear what it does the main problems stem from the class being it s own base class first isn t it weird to have a class be a subclass of a nearly identical class with the same name that exists only in its class attribute this also means that you can t define any methods that call the method of the same name on their base class with super because they will recurse this means your class can t customize new and can t derive from any classes that need init called on them when to use the singleton pattern your use case is one of the better examples of wanting to use a singleton you say in one of the comments to me logging has always seemed a natural candidate for singletons you re absolutely right when people say singletons are bad the most common reason is they are implicit shared state while with global variables and top level module imports are explicit shared state other objects that are passed around are generally instantiated this is a good point with two exceptions the first and one that gets mentioned in various places is when the singletons are constant use of global constants especially enums is widely accepted and considered sane because no matter what none of the users can mess them up for any other user this is equally true for a constant singleton the second exception which get mentioned less is the opposite when the singleton is only a data sink not a data source directly or indirectly this is why loggers feel like a natural use for singletons as the various users are not changing the loggers in ways other users will care about there is not really shared state this negates the primary argument against the singleton pattern and makes them a reasonable choice because of their ease of use for the task here is a quote from http googletesting blogspot com root cause of singletons html now there is one kind of singleton which is ok that is a singleton where all of the reachable objects are immutable if all objects are immutable than singleton has no global state as everything is constant but it is so easy to turn this kind of singleton into mutable one it is very slippery slope therefore i am against these singletons too not because they are bad but because it is very easy for them to go bad as a side note java enumeration are just these kind of singletons as long as you don t put state into your enumeration you are ok so please don t the other kind of singletons which are semi acceptable are those which don t effect the execution of your code they have no side effects logging is perfect example it is loaded with singletons and global state it is acceptable as in it will not hurt you because your application does not behave any different whether or not a given logger is enabled the information here flows one way from your application into the logger even thought loggers are global state since no information flows from loggers into your application loggers are acceptable you should still inject your logger if you want your test to assert that something is getting logged but in general loggers are not harmful despite being full of state s s inst how to detect a christmas tree which image processing techniques could be used to implement an application that detects the christmas trees displayed in the following images i m searching for solutions that are going to work on all these images therefore approaches that require training haar cascade classifiers or template matching are not very interesting i m looking for something that can be written in any programming language as long as it uses only open source technologies the solution must be tested with the images that are shared on this question there are input images and the answer should display the results of processing each of them finally for each output image there must be red lines draw to surround the detected tree how would you go about programmatically detecting the trees in these images inst edit note i edited this post to i process each tree image individually as requested in the requirements ii to consider both object brightness and shape in order to improve the quality of the result below is presented an approach that takes in consideration the object brightness and shape in other words it seeks for objects with triangle like shape and with significant brightness it was implemented in java using marvin image processing framework the first step is the color thresholding the objective here is to focus the analysis on objects with significant brightness output images source code public class christmastree private marvinimageplugin fill marvinpluginloader loadimageplugin org marvinproject image fill boundaryfill private marvinimageplugin threshold marvinpluginloader loadimageplugin org marvinproject image color thresholding private marvinimageplugin invert marvinpluginloader loadimageplugin org marvinproject image color invert private marvinimageplugin dilation marvinpluginloader loadimageplugin org marvinproject image morphological dilation public christmastree marvinimage tree iterate each image for int i i i tree marvinimageio loadimage res trees tree i png threshold threshold setattribute threshold threshold process tree clone tree public static void main string args new christmastree in the second step the brightest points in the image are dilated in order to form shapes the result of this process is the probable shape of the objects with significant brightness applying flood fill segmentation disconnected shapes are detected output images source code public class christmastree private marvinimageplugin fill marvinpluginloader loadimageplugin org marvinproject image fill boundaryfill private marvinimageplugin threshold marvinpluginloader loadimageplugin org marvinproject image color thresholding private marvinimageplugin invert marvinpluginloader loadimageplugin org marvinproject image color invert private marvinimageplugin dilation marvinpluginloader loadimageplugin org marvinproject image morphological dilation public christmastree marvinimage tree iterate each image for int i i i tree marvinimageio loadimage res trees tree i png threshold threshold setattribute threshold threshold process tree clone tree dilate invert process tree clone tree tree marvincolormodelconverter rgbtobinary tree marvinimageio saveimage tree res trees new tree i threshold png dilation setattribute matrix marvinmath gettruematrix dilation process tree clone tree marvinimageio saveimage tree res trees new tree dilation png tree marvincolormodelconverter binarytorgb tree segment shapes marvinimage trees tree clone fill tree trees marvinimageio saveimage trees res trees new tree i fill png private void fill marvinimage imagein marvinimage imageout boolean found int color xffff while true found false outerloop for int y y imagein getheight y for int x x imagein getwidth x if imageout getintcomponent x y fill setattribute x x fill setattribute y y fill setattribute color color fill setattribute threshold fill process imagein imageout color newcolor color found true break outerloop if found break private int newcolor int color int red color x ff int green color x ff int blue color x ff if red green red blue red else if green red green blue green else blue return xff red green blue public static void main string args new christmastree as shown in the output image multiple shapes was detected in this problem there a just a few bright points in the images however this approach was implemented to deal with more complex scenarios in the next step each shape is analyzed a simple algorithm detects shapes with a pattern similar to a triangle the algorithm analyze the object shape line by line if the center of the mass of each shape line is almost the same given a threshold and mass increase as y increase the object has a triangle like shape the mass of the shape line is the number of pixels in that line that belongs to the shape imagine you slice the object horizontally and analyze each horizontal segment if they are centralized to each other and the length increase from the first segment to last one in a linear pattern you probably has an object that resembles a triangle source code private int detecttrees marvinimage image hashset integer analysed new hashset integer boolean found while true found false for int y y image getheight y for int x x image getwidth x int color image getintcolor x y if analysed contains color if istree image color return getobjectrect image color analysed add color found true if found break return null private boolean istree marvinimage image int color int mass new int image getheight int ystart int xstart for int y y image getheight y int mc int xs int xe for int x x image getwidth x if image getintcolor x y color mc if ystart ystart y xstart x if xs xs x if x xe xe x mass y xs mass y xe mass y mc int validlines for int y y image getheight y if mass y math abs mass y mass y xstart mass y mass ystart y ystart mass y mass ystart y ystart validlines if validlines return true return false finally the position of each shape similar to a triangle and with significant brightness in this case a christmas tree is highlighted in the original image as shown below final output images final source code public class christmastree private marvinimageplugin fill marvinpluginloader loadimageplugin org marvinproject image fill boundaryfill private marvinimageplugin threshold marvinpluginloader loadimageplugin org marvinproject image color thresholding private marvinimageplugin invert marvinpluginloader loadimageplugin org marvinproject image color invert private marvinimageplugin dilation marvinpluginloader loadimageplugin org marvinproject image morphological dilation public christmastree marvinimage tree iterate each image for int i i i tree marvinimageio loadimage res trees tree i png threshold threshold setattribute threshold threshold process tree clone tree dilate invert process tree clone tree tree marvincolormodelconverter rgbtobinary tree marvinimageio saveimage tree res trees new tree i threshold png dilation setattribute matrix marvinmath gettruematrix dilation process tree clone tree marvinimageio saveimage tree res trees new tree dilation png tree marvincolormodelconverter binarytorgb tree segment shapes marvinimage trees tree clone fill tree trees marvinimageio saveimage trees res trees new tree i fill png detect tree like shapes int rect detecttrees trees draw the result marvinimage original marvinimageio loadimage res trees tree i png drawboundary trees original rect marvinimageio saveimage original res trees new tree i out jpg private void drawboundary marvinimage shape marvinimage original int rect int ylines new int ylines rect ylines rect int rect ylines rect rect ylines rect rect ylines rect int rect ylines rect rect list point points new arraylist point for int i i ylines length i boolean in false point startpoint null point endpoint null for int x rect x rect rect x if shape getintcolor x ylines i xffffffff if in if startpoint null startpoint new point x ylines i in true else if in endpoint new point x ylines i in false if endpoint null endpoint new point rect rect ylines i points add startpoint points add endpoint drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original drawline points get x points get y points get x points get y original private void drawline int x int y int x int y int length marvinimage image int lx lx ly ly for int i i length i lx x i image getwidth image getwidth i x lx x i image getwidth image getwidth i x ly y i image getheight image getheight i y ly y i image getheight image getheight i y image drawline lx i ly lx i ly color red image drawline lx ly i lx ly i color red private void fillrect marvinimage image int rect int length for int i i length i image drawrect rect i rect i rect i rect i color red private void fill marvinimage imagein marvinimage imageout boolean found int color xffff while true found false outerloop for int y y imagein getheight y for int x x imagein getwidth x if imageout getintcomponent x y fill setattribute x x fill setattribute y y fill setattribute color color fill setattribute threshold fill process imagein imageout color newcolor color found true break outerloop if found break private int detecttrees marvinimage image hashset integer analysed new hashset integer boolean found while true found false for int y y image getheight y for int x x image getwidth x int color image getintcolor x y if analysed contains color if istree image color return getobjectrect image color analysed add color found true if found break return null private boolean istree marvinimage image int color int mass new int image getheight int ystart int xstart for int y y image getheight y int mc int xs int xe for int x x image getwidth x if image getintcolor x y color mc if ystart ystart y xstart x if xs xs x if x xe xe x mass y xs mass y xe mass y mc int validlines for int y y image getheight y if mass y math abs mass y mass y xstart mass y mass ystart y ystart mass y mass ystart y ystart validlines if validlines return true return false private int getobjectrect marvinimage image int color int x int x int y int y for int y y image getheight y for int x x image getwidth x if image getintcolor x y color if x x x x x if x x x x x if y y y y y if y y y y y return new int x y x x y y private int newcolor int color int red color x ff int green color x ff int blue color x ff if red green red blue red else if green red green blue green else blue return xff red green blue public static void main string args new christmastree the advantage of this approach is the fact it will probably work with images containing other luminous objects since it analyzes the object shape merry christmas edit note there is a discussion about the similarity of the output images of this solution and some other ones in fact they are very similar but this approach does not just segment objects it also analyzes the object shapes in some sense it can handle multiple luminous objects in the same scene in fact the christmas tree does not need to be the brightest one i m just abording it to enrich the discussion there is a bias in the samples that just looking for the brightest object you will find the trees but does we really want to stop the discussion at this point at this point how far the computer is really recognizing an object that resembles a christmas tree let s try to close this gap below is presented a result just to elucidate this point input image output s s inst how to get the filename without the extension from a path in python how to get the filename without the extension from a path in python i found out a method called os path basename to get the filename with extension but even when i import os i am not able to call it path basename is it possible to call it as directly as basename inst getting the name of the file without the extension import os print os path splitext path to file as for your import problem you solve it this way from os path import basename now you can call it directly with basename print basename a b c txt s s inst python remove all whitespace in a string i want to eliminate all the whitespace from a string on both ends and in between words i have this python code def my handle self sentence hello apple sentence strip but that only eliminates the whitespace on both sides of the string how do i remove all whitespace inst if you want to remove leading and ending spaces use str strip sentence hello apple sentence strip hello apple if you want to remove all spaces use str replace sentence hello apple sentence replace helloapple if you want to remove duplicated spaces use str split sentence hello apple join sentence split hello apple s s inst how to get time of a python program execution i have a command line program in python that takes a while to finish i want to know the exact time it takes to finish running i ve looked at the timeit module but it seems it s only for small snippets of code i want to time the whole program inst the simplest way in python import time start time time time main print s seconds time time start time this assumes that your program takes at least a tenth of second to run prints seconds s s inst best practice for python assert is there a performance or code maintenance issue with using assert as part of the standard code instead of using it just for debugging purposes is assert x x is less than zero better or worse than if x raise exception x is less than zero also is there any way to set a business rule like if x raise error that is always checked without the try except finally so if at anytime throughout the code x is less than an error is raised like if you set assert x at the start of a function anywhere within the function where x becomes less then an exception is raised inst asserts should be used to test conditions that should never happen the purpose is to crash early in the case of a corrupt program state exceptions should be used for errors that can conceivably happen and you should almost always create your own exception classes for example if you re writing a function to read from a configuration file into a dict improper formatting in the file should raise a configurationsyntaxerror while you can assert that you re not about to return none in your example if x is a value set via a user interface or from an external source an exception is best if x is only set by your own code in the same program go with an assertion s s inst how to print number with commas as thousands separators i am trying to print an integer in python with commas as thousands separators for example i want to show the number as how would i go about doing this i have seen many examples on google but i am looking for the simplest practical way it does not need to be locale specific to decide between periods and commas i would prefer something as simple as reasonably possible inst i too prefer the simplest practical way for format value http docs python org library string html format specification mini language s s inst shuffling a list of objects in python i have a list of objects in python and i want to shuffle them i thought i could use the random shuffle method but this seems to fail when the list is of objects is there a method for shuffling object or another way around this import random class a foo bar a a a a b a a print random shuffle b this will fail inst random shuffle should work here s an example where the objects are lists from random import shuffle x i for i in range shuffle x print x gives of course your results will vary note that shuffle works in place and returns none s s inst finding local ip addresses using python s stdlib how can i find local ip addresses i e x x or x x in python platform independently and using only the standard library inst i just found this but it seems a bit hackish however they say tried it on nix and i did on windows and it worked import socket s socket socket socket af inet socket sock dgram s connect gmail com print s getsockname s close this assumes you have an internet access and that there is no local proxy s s inst what are the differences between json and simplejson python modules i have seen many projects using simplejson module instead of json module from the standard library also there are many different simplejson modules why would use these alternatives instead of the one in the standard library inst json is simplejson added to the stdlib but since json was added in simplejson has the advantage of working on more python versions simplejson is also updated more frequently than python so if you need or want the latest version it s best to use simplejson itself if possible a good practice in my opinion is to use one or the other as a fallback try import simplejson as json except importerror import json s s inst importing files from different folder in python i have the following folder structure application app folder file py and i want to import some functions from file py in another python file which resides in application app some folder some file py i ve tried from application app folder file import func name and some other various attempts but so far i couldn t manage to import properly how can i do this inst by default you can t when importing a file python only searches the current directory the directory that the entry point script is running from and sys path which includes locations such as the package installation directory it s actually a little more complex than this but this covers most cases however you can add to the python path at runtime some file py import sys sys path insert path to application app folder import file s s inst how do i write json data to a file in python i have json data stored in the variable data i want to write this to a text file for testing so i don t have to grab the data from the server each time currently i am trying this obj open data txt wb obj write data obj close and am receiving the error typeerror must be string or buffer not dict how to fix this inst you forgot the actual json part data is a dictionary and not yet json encoded write it like this import json with open data txt w as outfile json dump data outfile note works on both x and x s s inst how do i capture sigint in python i m working on a python script that starts several processes and database connections every now and then i want to kill the script with a ctrl c signal and i d like to do some cleanup in perl i d do this sig int exit gracefully sub exit gracefully print caught c exit how do i do the analogue of this in python inst register your handler with signal signal like this usr bin env python import signal import sys def signal handler signal frame print you pressed ctrl c sys exit signal signal signal sigint signal handler print press ctrl c signal pause code adapted from here more documentation on signal can be found here s s inst running unittest with typical test directory structure the very common directory structure for even a simple python module seems to be to separate the unit tests into their own test directory new project antigravity antigravity py test test antigravity py setup py etc for example see this python project howto my question is simply what s the usual way of actually running the tests i suspect this is obvious to everyone except me but you can t just run python test antigravity py from the test directory as its import antigravity will fail as the module is not on the path i know i could modify pythonpath and other search path related tricks but i can t believe that s the simplest way it s fine if you re the developer but not realistic to expect your users to use if they just want to check the tests are passing the other alternative is just to copy the test file into the other directory but it seems a bit dumb and misses the point of having them in a separate directory to start with so if you had just downloaded the source to my new project how would you run the unit tests i d prefer an answer that would let me say to my users to run the unit tests do x inst the best solution in my opinion is to use the unittest command line interface which will add the directory to the sys path so you don t have to done in the testloader class for example for a directory structure like this new project a a a antigravity py a a a test antigravity py you can just run cd new project python m unittest test antigravity for a directory structure like yours new project a a a antigravity a a a a a a init py make it a package a a a a a a antigravity py a a a test a a a init py also make test a package a a a test antigravity py and in the test modules inside the test package you can import the antigravity package and its modules as usual import the package import antigravity import the antigravity module from antigravity import antigravity or an object inside the antigravity module from antigravity antigravity import my object running a single test module to run a single test module in this case test antigravity py cd new project python m unittest test test antigravity just reference the test module the same way you import it running a single test case or test method also you can run a single testcase or a single test method python m unittest test test antigravity gravitytestcase python m unittest test test antigravity gravitytestcase test method running all tests you can also use test discovery which will discover and run all the tests for you they must be modules or packages named test py can be changed with the p pattern flag cd new project python m unittest discover this will run all the test py modules inside the test package s s inst where do the python unit tests go if you re writing a library or an app where do the unit test files go it s nice to separate the test files from the main app code but it s awkward to put them into a tests subdirectory inside of the app root directory because it makes it harder to import the modules that you ll be testing is there a best practice here inst for a file module py the unit test should normally be called test module py following pythonic naming conventions there are several commonly accepted places to put test module py in the same directory as module py in tests test module py at the same level as the code directory in tests test module py one level under the code directory i prefer for its simplicity of finding the tests and importing them whatever build system you re using can easily be configured to run files starting with test actually the default unittest pattern used for test discovery is test py s s inst python create unix timestamp five minutes in the future i have to create an expires value minutes in the future but i have to supply it in unix timestamp format i have this so far but it seems like a hack def expires return a unix style timestamp representing minutes from now epoch datetime datetime seconds in a day five minutes datetime timedelta seconds five minutes from now datetime datetime now five minutes since epoch five minutes from now epoch return since epoch days seconds in a day since epoch seconds is there a module or function that does the timestamp conversion for me inst another way is to use calendar timegm future datetime datetime utcnow datetime timedelta minutes return calendar timegm future timetuple it s also more portable than s flag to strftime which doesn t work on windows s s inst how do you test that a python function throws an exception how does one write a unittest that fails only if a function doesn t throw an expected exception inst use testcase assertraises or testcase failunlessraises from the unittest module for example import mymod class mytestcase unittest testcase def test self self assertraises somecoolexception mymod myfunc s s inst disable output buffering is output buffering enabled by default in python s interpreter for sys stdout if the answer is positive what are all the ways to disable it suggestions so far use the u command line switch wrap sys stdout in an object that flushes after every write set pythonunbuffered env var sys stdout os fdopen sys stdout fileno w is there any other way to set some global flag in sys sys stdout programmatically during execution inst from magnus lycka answer on a mailing list you can skip buffering for a whole python process using python u or usr bin env python u etc or by setting the environment variable pythonunbuffered you could also replace sys stdout with some other stream like wrapper which does a flush after every call class unbuffered object def init self stream self stream stream def write self data self stream write data self stream flush def getattr self attr return getattr self stream attr import sys sys stdout unbuffered sys stdout print hello s s inst what is setup py can anyone please explain what is setup py and how can it be configured or used inst setup py is a python file which usually tells you that the module package you are about to install have been packaged and distributed with distutils which is the standard for distributing python modules this allows you to easily install python packages often it s enough to write python setup py install and the module will install itself http docs python org install index html s s inst how to print the full traceback without halting the program i m writing a program that parses websites locates data files saves the files and then parses them to make data that can be readily used in the numpy library there are tons of errors this file encounters through bad links poorly formed xml missing entries and other things i ve yet to categorize i initially made this program to handle errors like this try do stuff except pass but now i want to log errors try do stuff except exception err print exception err note this is printing to a log file for later review this usually prints very useless data what i want is to print the exact same lines printed when the error triggers without the try except intercepting the exception but i don t want it to halt my program since it is nested in a series of for loops that i would like to see to completion inst traceback format exc or sys exc info will yield more info if that s what you want import traceback import sys try do stuff except exception print traceback format exc or print sys exc info s s inst how can i open multiple files using with open in python i want to change a couple of files at one time iff i can write to all of them i m wondering if i somehow can combine the multiple open calls with the with statement try with open a w as a and open b w as b do something except ioerror as e print operation failed s e strerror if that s not possible what would an elegant solution to this problem look like inst as of python or respectively you can write with open a w as a open b w as b do something in earlier versions of python you can sometimes use contextlib nested to nest context managers this won t work as expected for opening multiples files though see the linked documentation for details s s inst python decimal range step value is there a way to step between and by i thought i could do it like the following but it failed for i in range print i instead it says that the step argument cannot be zero which i did not expect inst you can also use the numpy library which isn t part of standard library but is relatively easy to obtain which has the arange function import numpy as np np arange array as well as the linspace function which lets you have control over what happens at the endpoint non trivial for floating point numbers when things won t always divide into the correct number of slices np linspace array np linspace endpoint false array s s inst best way to strip punctuation from a string in python it seems like there should be a simpler way than import string s string with punctuation sample string out s translate string maketrans string punctuation is there inst from an efficiency perspective you re not going to beat translate it s performing raw string operations in c with a lookup table there s not much that will beat that but writing your own c code if speed isn t a worry another option though is exclude set string punctuation s join ch for ch in s if ch not in exclude this is faster than s replace with each char but won t perform as well as non pure python approaches such as regexes or string translate as you can see from the below timings for this type of problem doing it at as low a level as possible pays off timing code import re string timeit s string with punctuation exclude set string punctuation table string maketrans regex re compile s re escape string punctuation def test set s return join ch for ch in s if ch not in exclude def test re s from vinko s solution with fix return regex sub s def test trans s return s translate table string punctuation def test repl s from s lott s solution for c in string punctuation s s replace c return s print sets timeit timer f s from main import s test set as f timeit print regex timeit timer f s from main import s test re as f timeit print translate timeit timer f s from main import s test trans as f timeit print replace timeit timer f s from main import s test repl as f timeit this gives the following results sets regex translate replace s s inst iterating over a string in c i could do for int i i str length i std cout str i std endl how do i iterate over a string in python inst as johannes pointed out for c in string do something with c you can iterate pretty much anything in python using the for loop construct for example open file txt returns a file object and opens the file iterating over it iterates over lines in that file for line in open filename do something with line if that seems like magic well it kinda is but the idea behind it is really simple there s a simple iterator protocol that can be applied to any kind of object to make the for loop work on it simply implement an iterator that defines a next method and implement an iter method on a class to make it iterable the iter of course should return an iterator object that is an object that defines next see official documentation s s inst dynamic module import in python i m writing a python application that takes as a command as an argument for example python myapp py command i want the application to be extensible that is to be able to add new modules that implement new commands without having to change the main application source the tree looks something like myapp init py commands init py command py command py foo py bar py so i want the application to find the available command modules at runtime and execute the appropriate one currently this is implemented something like command sys argv try command module import myapp commands s command fromlist myapp commands except importerror display error message command module run this works just fine i m just wondering if there is possibly a more idiomatic way to accomplish what we are doing with this code note that i specifically don t want to get in to using eggs or extension points this is not an open source project and i don t expect there to be plugins the point is to simplify the main application code and remove the need to modify it each time a new command module is added inst with python older than that s pretty much how you do it for newer versions see importlib import module for and for you can use exec if you want to as well note you can import a list of modules by doing this modulenames sys os re unittest modulenames sys os re unittest modules map import modulenames ripped straight from dive into python s s inst what is a python egg i m new to python and am just trying to understand how its packages work presumably eggs are some sort of packaging mechanism but what would be a quick overview of what role they play and maybe some information on why they re useful and how to create them inst same concept as a jar file in java it is a zip file with some metadata files renamed egg for distributing code as bundles specifically the internal structure of python eggs a python egg is a logical structure embodying the release of a specific version of a python project comprising its code resources and metadata there are multiple formats that can be used to physically encode a python egg and others can be developed however a key principle of python eggs is that they should be discoverable and importable that is it should be possible for a python application to easily and efficiently find out what eggs are present on a system and to ensure that the desired eggs contents are importable the egg format is well suited to distribution and the easy uninstallation or upgrades of code since the project is essentially self contained within a single directory or file unmingled with any other projects code or resources it also makes it possible to have multiple versions of a project simultaneously installed such that individual programs can select the versions they wish to use note egg packaging has been superseded by wheel packaging s s inst how to get full path of current file s directory in python i want to get the current file s directory path i tried os path abspath file c python test py but how can i retrieve the directory s path for example c python inst if you mean the directory of the script being run import os os path dirname os path abspath file if you mean the current working directory import os os getcwd note that before and after file is two underscores not just one s s inst multiprocessing vs threading python i am trying to understand the advantages of multiprocessing over threading i know that multiprocessing gets around the global interpreter lock but what other advantages are there and can threading not do the same thing inst here are some pros cons i came up with multiprocessing pros separate memory space code is usually straightforward takes advantage of multiple cpus cores avoids gil limitations for cpython eliminates most needs for synchronization primitives unless if you use shared memory instead it s more of a communication model for ipc child processes are interruptible killable python multiprocessing module includes useful abstractions with an interface much like threading thread a must with cpython for cpu bound processing cons ipc a little more complicated with more overhead communication model vs shared memory objects larger memory footprint threading pros lightweight low memory footprint shared memory makes access to state from another context easier allows you to easily make responsive uis cpython c extension modules that properly release the gil will run in parallel great option for i o bound applications cons cpython subject to the gil not interruptible killable if not following a command queue message pump model using the queue module then manual use of synchronization primitives become a necessity decisions are needed for the granularity of locking code is usually harder to understand and to get right the potential for race conditions increases dramatically s s inst what is the use of assert in python i have been reading some source code and in several places i have seen the usage of assert what does it mean exactly what is its usage inst the assert statement exists in almost every programming language when you do assert condition you re telling the program to test that condition and trigger an error if the condition is false in python it s roughly equivalent to this if not condition raise assertionerror try it in the python shell assert true assert false traceback most recent call last file stdin line in module assertionerror assertions can include an optional message and you can disable them when you re done debugging see here for the relevant documentation s s inst does python have a privatea variables in classes i m coming from the java world and reading bruce eckels python patterns recipes and idioms while reading about classes it goes on to say that in python there is no need to declare instance variables you just use them in the constructor and boom they are there so for example class simple def init self str print inside the simple constructor self s str def show self print self s def showmsg self msg print msg self show if thata s true then any object of class simple can just change the value of variable s outside of the class for example if name main x simple constructor argument x s test this changes the value x show x showmsg a message in java we have been taught about public private protected variables those keywords make sense because at times you want variables in a class to which no one outside the class has access to why is that not required in python inst it s cultural in python you don t write to other classes instance or class variables in java nothing prevents you from doing the same if you really want to after all you can always edit the source of the class itself to achieve the same effect python drops that pretence of security and encourages programmers to be responsible in practice this works very nicely if you want to emulate private variables for some reason you can always use the prefix from pep python mangles the names of variables like foo so that they re not easily visible to code outside the class that contains them although you can get around it if you re determined enough just like you can get around java s protections if you work at it by the same convention the prefix means stay away even if you re not technically prevented from doing so you don t play around with another class s variables that look like foo or bar s s inst what is a slug in django when i read django code i often see in models what is called a slug i am not quite sure what this is but i do know it has something to do with urls how and when is this slug thing supposed to be used i have read its definition in this glossary inst it s a way of generating a valid url generally using data already obtained for instance using the title of an article to generate a url i d advise to generate the slug using a function given a title or other piece of data rather than setting it manually an example title the year old virgin title content a silly comedy movie content slug the year old virgin slug now let s pretend that we have a django model such as class article models model title models charfield max length content models textfield max length slug models slugfield max length how would you reference this object with a url with a meaningful name you could use article id so the url would look like this www example com article or you could reference the title like so www example com article the year old virgin problem is spaces aren t valid in urls they need to be replaced by which is ugly making it the following www example com article the year old virgin that s not solving our meaningful url wouldn t this be better www example com article the year old virgin that s a slug the year old virgin all letters are downcased and spaces are replaced by hyphens see the url of this very webpage for an example s s inst how can i iterate through two lists in parallel in python i have two iterables in python and i want to go over them in pairs foo bar for f b in some iterator foo bar print f f b b it should result in f b f b f b one way to do it is to iterate over the indices for i in xrange len foo print f foo i b b i but that seems somewhat unpythonic to me is there a better way to do it inst for f b in zip foo bar print f b zip stops when the shorter of foo or bar stops in python zip returns a list of tuples this is fine when foo and bar are not massive if they are both massive then forming zip foo bar is an unnecessarily massive temporary variable and should be replaced by itertools izip or itertools izip longest which returns an iterator instead of a list import itertools for f b in itertools izip foo bar print f b for f b in itertools izip longest foo bar print f b izip stops when either foo or bar is exhausted izip longest stops when both foo and bar are exhausted when the shorter iterator s are exhausted izip longest yields a tuple with none in the position corresponding to that iterator you can also set a different fillvalue besides none if you wish see here for the full story in python zip returns an iterator of tuples like itertools izip in python to get a list of tuples use list zip foo bar and to zip until both iterators are exhausted you would use itertools zip longest note also that zip and its zip like brethen can accept an arbitrary number of iterables as arguments for example for num cheese color in zip manchego stilton brie red blue green print format num color cheese prints red manchego blue stilton green brie s s inst how do i remove the first item from a python list possible duplicate good primer for python slice notation i have the list i d like to make it into how do i go about this inst python list list pop index l l pop l del list index l del l l these both modify your original list others have suggested using slicing copies the list can return a subset also if you are performing many pop you should look at collections deque from collections import deque l deque l popleft l deque provides higher performance popping from left end of the list s s inst python intersection of two lists i know how to get an intersection of two flat lists b b b val for val in b if val in b or def intersect a b return list set a set b print intersect b b but when i have to find intersection for nested lists then my problems starts c c in the end i would like to receive c can you guys give me a hand with this related flattening a shallow list in python inst you don t need to define intersection it s already a first class part of set b b set b intersection b set s s inst call a parent class s method from child class in python when creating a simple object hierarchy in python i d like to be able to invoke methods of the parent class from a derived class in perl and java there is a keyword for this super in perl i might do this package foo sub frotz return bamf package bar isa qw foo sub frotz my str super frotz return uc str in python it appears that i have to name the parent class explicitly from the child in the example above i d have to do something like foo frotz this doesn t seem right since this behavior makes it hard to make deep hierarchies if children need to know what class defined an inherited method then all sorts of information pain is created is this an actual limitation in python a gap in my understanding or both inst yes but only with new style classes use the super function class foo bar def baz self arg return super foo self baz arg s s inst how do i determine the size of an object in python in c we can find the size of an int char etc i want to know how to get size of objects like a string integer etc in python related question how many bytes per element are there in a python list tuple i am using an xml file which contains size fields that specify the size of value i must parse this xml and do my coding when i want to change the value of a particular field i will check the size field of that value here i want to compare whether the new value that i m gong to enter is of the same size as in xml i need to check the size of new value in case of a string i can say its the length but in case of int float etc i am confused inst just use the sys getsizeof function defined in the sys module sys getsizeof object default return the size of an object in bytes the object can be any type of object all built in objects will return correct results but this does not have to hold true for third party extensions as it is implementation specific the default argument allows to define a value which will be returned if the object type does not provide means to retrieve the size and would cause a typeerror getsizeof calls the objecta s sizeof method and adds an additional garbage collector overhead if the object is managed by the garbage collector usage example in python import sys x sys getsizeof x sys getsizeof sys getsizeof sys getsizeof this sys getsizeof this also if you are in python and don t have sys getsizeof you can use this extensive module instead never used it though s s inst how to generate all permutations of a list in python how do you generate all the permutations of a list in python independently of the type of elements in that list for example permutations permutations permutations permutations edit eliben pointed to a solution that s similar to mine although simpler so i m choosing it as the accepted answer although python has a builtin solution in the itertools module import itertools itertools permutations inst and in python onwards import itertools itertools permutations returned as a generator use list permutations l to return as a list s s inst how do i convert datetime to date in python how do i convert a datetime datetime object for example the return value of datetime datetime now to a datetime date object in python inst use the date method datetime datetime now date s s inst how to check what os am i running on in python what do i need to look at to see if i m on windows unix etc inst import os print os name posix import platform platform system linux platform release generic see platform a access to underlying platforma s identifying data s s inst calling c c from python what would be the quickest way to construct a python binding to a c or c library using windows if this matters inst i like ctypes a lot swig always tended to give me problems also ctypes has the advantage that you don t need to satisfy any compile time dependency on python and your binding will work on any python that has ctypes not just the one it was compiled against suppose you have a simple c example class you want to talk to in a file called foo cpp include iostream class foo public void bar std cout hello std endl since ctypes can only talk to c functions you need to provide those declaring them as extern c extern c foo foo new return new foo void foo bar foo foo foo bar next you have to compile this to a shared library g c fpic foo cpp o foo o g shared wl soname libfoo so o libfoo so foo o and finally you have to write your python wrapper e g in foowrapper py from ctypes import cdll lib cdll loadlibrary libfoo so class foo object def init self self obj lib foo new def bar self lib foo bar self obj once you have that you can call it like f foo f bar and you will see hello on the screen s s inst what is the common header format of python files i came across the following header format for python source files in a document about python coding guidelines usr bin env python foobar py description of what foobar does author barack obama copyright copyright planet earth is this the standard format of headers in the python world what other fields information can i put in the header python gurus share your guidelines for good python source headers inst its all metadata for the foobar module the first one is the docstring of the module that is already explained in peter s answer how do i organize my modules source files archive the first line of each file shoud be usr bin env python this makes it possible to run the file as a script invoking the interpreter implicitly e g in a cgi context next should be the docstring with a description if the description is long the first line should be a short summary that makes sense on its own separated from the rest by a newline all code including import statements should follow the docstring otherwise the docstring will not be recognized by the interpreter and you will not have access to it in interactive sessions i e through obj doc or when generating documentation with automated tools import built in modules first followed by third party modules followed by any changes to the path and your own modules especially additions to the path and names of your modules are likely to change rapidly keeping them in one place makes them easier to find next should be authorship information this information should follow this format author rob knight gavin huttley and peter maxwell copyright copyright the cogent project credits rob knight peter maxwell gavin huttley matthew wakefield license gpl version maintainer rob knight email rob spot colorado edu status production status should typically be one of prototype development or production maintainer should be the person who will fix bugs and make improvements if imported credits differs from author in that credits includes people who reported bug fixes made suggestions etc but did not actually write the code here you have more information listing author authors contact copyright license deprecated date and version as recognized metadata s s inst python style multiple line conditions in ifs sometimes i break long conditions in ifs to several lines the most obvious way to do this is if cond val and cond val and cond val and cond val do something isn t very very appealing visually because the action blends with the conditions however it is the natural way using correct python indentation of spaces for the moment i m using if cond val and cond val and cond val and cond val do something but this isn t very pretty can you recommend an alternative way inst you don t need to use spaces on your second conditional line maybe use if cond val and cond val and cond val and cond val do something also don t forget the whitespace is more flexible than you might think if cond val and cond val and cond val and cond val do something if cond val and cond val and cond val and cond val do something both of those are fairly ugly though maybe lose the brackets the style guide discourages this though if cond val and cond val and cond val and cond val do something this at least gives you some differentiation or even if cond val and cond val and cond val and cond val do something i think i prefer if cond val and cond val and cond val and cond val do something here s the style guide which since recommends using brackets s s inst how do i do a case insensitive string comparison in python what s the best way to do case insensitive string comparison in python i would like to encapsulate comparison of a regular strings to a repository string using in a very simple and pythonic way i also would like to have ability to look up values in a dict hashed by strings using regular python strings much obliged for advice inst assuming ascii strings string hello string hello if string lower string lower print the strings are the same case insensitive else print the strings are not the same case insensitive s s inst python reverse invert a mapping given a dictionary like so my map a b how can one invert this map to get inv map a b editor note map changed to my map to avoid conflicts with the built in function map some comments may be affected below inst for python x inv map v k for k v in my map iteritems for python inv map v k for k v in my map items s s inst command line arguments in python i am originally a c programmer i have seen numerous tricks and hacks to read many different arguments what are some of the ways python programmers can do this related whata s the best way to grab parse command line arguments passed to a python script implementing a a command action parameter a style command line interfaces how can i process command line arguments in python how do i format positional argument help using pythona s optparse inst import sys print join sys argv sys argv is a list that contains all the arguments passed to the script on the command line basically import sys print sys argv s s inst how to capitalize the first letter of each word in a string python s the brown fox do something here s should be the brown fox what s the easiest way to do this inst the title method of a string either ascii or unicode is fine does this hello world title hello world u hello world title u hello world however look out for strings with embedded apostrophes as noted in the docs the algorithm uses a simple language independent definition of a word as groups of consecutive letters the definition works in many contexts but it means that apostrophes in contractions and possessives form word boundaries which may not be the desired result they re bill s friends from the uk title they re bill s friends from the uk s s inst what is the quickest way to http get in python what is the quickest way to http get in python if i know the content will be a string i am searching the docs for a quick one liner like contents url get http example com foo bar but all i can find using google are httplib and urllib and i am unable to find a shortcut in those libraries does standard python have a shortcut in some form as above or should i write a function url get i would prefer not to capture the output of shelling out to wget or curl inst python x import urllib urllib urlopen http example com foo bar read python x import urllib request urllib request urlopen http example com foo bar read documentation for urllib request and read how is that s s inst how to check if type of a variable is string is there a way to check if the type of a variable in python is string like isinstance x int for integer values inst in python x you would do isinstance s basestring basestring is the abstract superclass of str and unicode it can be used to test whether an object is an instance of str or unicode equivalent code isinstance s str unicode in python x it would be isinstance s str basestring is not defined in python s s inst why are there no and a operators in python why are there no and operators in python inst it s not because it doesn t make sense it makes perfect sense to define x as x evaluating to the previous binding of x if you want to know the original reason you ll have to either wade through old python mailing lists or ask somebody who was there eg guido but it s easy enough to justify after the fact simple increment and decrement aren t needed as much as in other languages you don t write things like for int i i i in python very often instead you do things like for i in range since it s not needed nearly as often there s much less reason to give it its own special syntax when you do need to increment is usually just fine it s not a decision of whether it makes sense or whether it can be done it does and it can it s a question of whether the benefit is worth adding to the core syntax of the language remember this is four operators postinc postdec preinc predec and each of these would need to have its own class overloads they all need to be specified and tested it would add opcodes to the language implying a larger and therefore slower vm engine every class that supports a logical increment would need to implement them on top of and this is all redundant with and so it would become a net loss s s inst what does functools wraps do in a comment on the answer to another question someone said they weren t sure what functools wraps was doing so i m asking this question so that there will be a record of it on stackoverflow for future reference what does functools wraps do exactly inst when you use a decorator you re replacing one function with another in other words if you have a decorator def logged func def with logging args kwargs print func name was called return func args kwargs return with logging then when you say logged def f x does some math return x x x it s exactly the same as saying def f x does some math return x x x f logged f and your function f is replaced with the function with logging unfortunately this means that if you then say print f name it will print with logging because that s the name of your new function in fact if you look at the docstring for f it will be blank because with logging has no docstring and so the docstring you wrote won t be there anymore also if you look at the pydoc result for that function it won t be listed as taking one argument x instead it ll be listed as taking args and kwargs because that s what with logging takes if using a decorator always meant losing this information about a function it would be a serious problem that s why we have functools wraps this takes a function used in a decorator and adds the functionality of copying over the function name docstring arguments list etc and since wraps is itself a decorator the following code does the correct thing from functools import wraps def logged func wraps func def with logging args kwargs print func name was called return func args kwargs return with logging logged def f x does some math return x x x print f name prints f print f doc prints does some math s s inst should i put shebang in python scripts and what form should it take should i put the shebang in my python scripts in what form usr bin env python or usr local bin python are these equally portable which form is used most note the tornado project uses the shebang on the other hand the django project doesn t inst the shebang line in any script determines the script s ability to be executed like an standalone executable without typing python beforehand in the terminal or when double clicking it in a file manager when configured properly it isn t necessary but generally put there so when someone sees the file opened in an editor they immediately know what they re looking at however which shebang line you use is important correct usage is usr bin env python usr bin env python usually defaults to python latest and the following defaults to latest usr bin env python do not use usr local bin python python may be installed at usr bin python or bin python in those cases the above will fail usr bin env python vs usr local bin python s s inst why are some float integer comparisons four times slower than others when comparing floats to integers some pairs of values take much longer to be evaluated than other values of a similar magnitude for example import timeit timeit timeit run million times but if the float or integer is made smaller or larger by a certain amount the comparison runs much more quickly timeit timeit integer increased by timeit timeit float increased by changing the comparison operator e g using or instead does not affect the times in any noticeable way this is not solely related to magnitude because picking larger or smaller values can result in faster comparisons so i suspect it is down to some unfortunate way the bits line up clearly comparing these values is more than fast enough for most use cases i am simply curious as to why python seems to struggle more with some pairs of values than with others inst a comment in the python source code for float objects acknowledges that comparison is pretty much a nightmare this is especially true when comparing a float to an integer because unlike floats integers in python can be arbitrarily large and are always exact trying to cast the integer to a float might lose precision and make the comparison inaccurate trying to cast the float to an integer is not going to work either because any fractional part will be lost to get around this problem python performs a series of checks returning the result if one of the checks succeeds it compares the signs of the two values then whether the integer is too big to be a float then compares the exponent of the float to the length of the integer if all of these checks fail it is necessary to construct two new python objects to compare in order to obtain the result when comparing a float v to an integer long w the worst case is that v and w have the same sign both positive or both negative the integer w has few enough bits that it can be held in the size t type typically or bits the integer w has at least bits the exponent of the float v is the same as the number of bits in w and this is exactly what we have for the values in the question import math math frexp gives the float s significand exponent pair bit length we see that is both the exponent of the float and the number of bits in the integer both numbers are positive and so the four criteria above are met choosing one of the values to be larger or smaller can change the number of bits of the integer or the value of the exponent and so python is able to determine the result of the comparison without performing the expensive final check this is specific to the cpython implementation of the language the comparison in more detail the float richcompare function handles the comparison between two values v and w below is a step by step description of the checks that the function performs the comments in the python source are actually very helpful when trying to understand what the function does so i ve left them in where relevant i ve also summarised these checks in a list at the foot of the answer the main idea is to map the python objects v and w to two appropriate c doubles i and j which can then be easily compared to give the correct result both python and python use the same ideas to do this the former just handles int and long types separately the first thing to do is check that v is definitely a python float and map it to a c double i next the function looks at whether w is also a float and maps it to a c double j this is the best case scenario for the function as all the other checks can be skipped the function also checks to see whether v is inf or nan static pyobject float richcompare pyobject v pyobject w int op double i j int r assert pyfloat check v i pyfloat as double v if pyfloat check w j pyfloat as double w else if py is finite i if pylong check w j else goto unimplemented now we know that if w failed these checks it is not a python float now the function checks if it s a python integer if this is the case the easiest test is to extract the sign of v and the sign of w return if zero if negative if positive if the signs are different this is all the information needed to return the result of the comparison else if pylong check w int vsign i i int wsign pylong sign w size t nbits int exponent if vsign wsign magnitudes are irrelevant the signs alone determine the outcome i double vsign j double wsign goto compare if this check failed then v and w have the same sign the next check counts the number of bits in the integer w if it has too many bits then it can t possibly be held as a float and so must be larger in magnitude than the float v nbits pylong numbits w if nbits size t pyerr occurred this long is so large that size t isn t big enough to hold the of bits replace with little doubles that give the same outcome w is so large that its magnitude must exceed the magnitude of any finite float pyerr clear i double vsign assert wsign j wsign goto compare on the other hand if the integer w has or fewer bits it can safely turned in a c double j and compared if nbits j pylong asdouble w it s impossible that bits overflowed assert j pyerr occurred goto compare from this point onwards we know that w has or more bits it will be convenient to treat w as a positive integer so change the sign and the comparison operator as necessary if nbits multiply both sides by this also swaps the comparator i i op py swappedop op now the function looks at the exponent of the float recall that a float can be written ignoring sign as significand exponent and that the significand represents a number between and void frexp i exponent if exponent size t exponent nbits i j goto compare this checks two things if the exponent is less than then the float is smaller than and so smaller in magnitude than any integer or if the exponent is less than the number of bits in w then we have that v w since significand exponent is less than nbits failing these two checks the function looks to see whether the exponent is greater than the number of bit in w this shows that significand exponent is greater than nbits and so v w if size t exponent nbits i j goto compare if this check did not succeed we know that the exponent of the float v is the same as the number of bits in the integer w the only way that the two values can be compared now is to construct two new python integers from v and w the idea is to discard the fractional part of v double the integer part and then add one w is also doubled and these two new python objects can be compared to give the correct return value using an example with small values would be determined by the comparison returning false double fracpart double intpart pyobject result null pyobject one null pyobject vv null pyobject ww w snip fracpart modf i intpart split i the double that v mapped to vv pylong fromdouble intpart snip if fracpart shift left and or a bit into vv to represent the lost fraction pyobject temp one pylong fromlong temp pynumber lshift ww one left shift doubles an integer ww temp temp pynumber lshift vv one vv temp temp pynumber or vv one a doubled integer is even so this adds vv temp snip for brevity i ve left out the additional error checking and garbage tracking python has to do when it creates these new objects needless to say this adds additional overhead and explains why the values highlighted in the question are significantly slower to compare than others here is a summary of the checks that are performed by the comparison function let v be a float and cast it as a c double now if w is also a float check whether w is nan or inf if so handle this special case separately depending on the type of w if not compare v and w directly by their representations as c doubles if w is an integer extract the signs of v and w if they are different then we know v and w are different and which is the greater value the signs are the same check whether w has too many bits to be a float more than size t if so w has greater magnitude than v check if w has or fewer bits if so it can be safely cast to a c double without losing its precision and compared with v w has more than bits we will now treat w as a positive integer having changed the compare op as appropriate consider the exponent of the float v if the exponent is negative then v is less than and therefore less than any positive integer else if the exponent is less than the number of bits in w then it must be less than w if the exponent of v is greater than the number of bits in w then v is greater than w the exponent is the same as the number of bits in w the final check split v into its integer and fractional parts double the integer part and add to compensate for the fractional part now double the integer w compare these two new integers instead to get the result s s inst is operator behaves unexpectedly with integers why does the following behave unexpectedly in python a b a is b true this is an expected result a b a is b false what happened here why is this false is true yet the literal numbers compare properly i am using python trying some different versions of python it appears that python shows the above behaviour between and based on the above i can hypothesize that python is internally implemented such that small integers are stored in a different way than larger integers and the is operator can tell the difference why the leaky abstraction what is a better way of comparing two arbitrary objects to see whether they are the same when i don t know in advance whether they are numbers or not inst take a look at this a b id a id b a b id a id b edit here s what i found in the python documentation plain integer objects it s the same for python the current implementation keeps an array of integer objects for all integers between and when you create an int in that range you actually just get back a reference to the existing object so it should be possible to change the value of i suspect the behaviour of python in this case is undefined s s inst what does ruby have that python doesn t and vice versa there is a lot of discussions of python vs ruby and i all find them completely unhelpful because they all turn around why feature x sucks in language y or that claim language y doesn t have x although in fact it does i also know exactly why i prefer python but that s also subjective and wouldn t help anybody choosing as they might not have the same tastes in development as i do it would therefore be interesting to list the differences objectively so no python s lambdas sucks instead explain what ruby s lambdas can do that python s can t no subjectivity example code is good don t have several differences in one answer please and vote up the ones you know are correct and down those you know are incorrect or are subjective also differences in syntax is not interesting we know python does with indentation what ruby does with brackets and ends and that is called self in python update this is now a community wiki so we can add the big differences here ruby has a class reference in the class body in ruby you have a reference to the class self already in the class body in python you don t have a reference to the class until after the class construction is finished an example class kaka puts self end self in this case is the class and this code would print out kaka there is no way to print out the class name or in other ways access the class from the class definition body in python outside method definitions all classes are mutable in ruby this lets you develop extensions to core classes here s an example of a rails extension class string def starts with other head self other length head other end end python imagine there were no startswith method def starts with s prefix return s len prefix prefix you could use it on any sequence not just strings in order to use it you should import it explicitly e g from some module import starts with ruby has perl like scripting features ruby has first class regexps variables the awk perl line by line input loop and other features that make it more suited to writing small shell scripts that munge text files or act as glue code for other programs ruby has first class continuations thanks to the callcc statement in python you can create continuations by various techniques but there is no support built in to the language ruby has blocks with the do statement you can create a multi line anonymous function in ruby which will be passed in as an argument into the method in front of do and called from there in python you would instead do this either by passing a method or with generators ruby amethod here many lines of code goes here python ruby blocks correspond to different constructs in python with amethod as here amethod is a context manager many lines of code goes here or for here in amethod amethod is an iterable many lines of code goes here or def function here many lines of code goes here amethod function function is a callback interestingly the convenience statement in ruby for calling a block is called yield which in python will create a generator ruby def themethod yield end themethod do foo puts foo end python def themethod yield for foo in themethod print foo although the principles are different the result is strikingly similar ruby supports functional style pipe like programming more easily mylist map description reject empty join python descriptions f description for f in mylist join filter len descriptions python has built in generators which are used like ruby blocks as noted above python has support for generators in the language in ruby you can use the generator module which uses continuations to create a generator from a block or you could just use a block proc lambda moreover in ruby fibers are and can be used as generators and the enumerator class is a built in generator docs python org has this generator example def reverse data for index in range len data yield data index contrast this with the above block examples python has flexible name space handling in ruby when you import a file with require all the things defined in that file will end up in your global namespace this causes namespace pollution the solution to that is rubys modules but if you create a namespace with a module then you have to use that namespace to access the contained classes in python the file is a module and you can import its contained names with from themodule import thereby polluting the namespace if you want but you can also import just selected names with from themodule import aname another or you can simply import themodule and then access the names with themodule aname if you want more levels in your namespace you can have packages which are directories with modules and an init py file python has docstrings docstrings are strings that are attached to modules functions and methods and can be introspected at runtime this helps for creating such things as the help command and automatic documentation def frobnicate bar frobnicate takes a bar and frobnicates it bar bar bar is frobnicated false frobnicate bar bar is frobnicated true ruby s equivalent are similar to javadocs and located above the method instead of within it they can be retrieved at runtime from the files by using s method source location example use python has multiple inheritance ruby does not on purpose see ruby s website see here how it s done in ruby it does reuse the module concept as a type of abstract classes python has list dict comprehensions python res x x for x in range ruby res map x x x python x x for x in range generator object genexpr at xb c ccd list ruby p proc x x x map p python x str y y for x y in items ruby hash map x y x y y to s python has decorators things similar to decorators can also be created in ruby and it can also be argued that they aren t as necessary as in python syntax differences ruby requires end or to close all of its scopes while python uses white space only there have been recent attempts in ruby to allow for whitespace only indentation http github com michaeledgar seamless inst ruby has the concepts of blocks which are essentially syntactic sugar around a section of code they are a way to create closures and pass them to another method which may or may not use the block a block can be invoked later on through a yield statement for example a simple definition of an each method on array might be something like class array def each for i in self yield i if a block has been passed control will be passed here end end end then you can invoke this like so add five to each element each e puts e python has anonymous functions closures lambdas but it doesn t quite have blocks since it s missing some of the useful syntactic sugar however there s at least one way to get it in an ad hoc fashion see for example here s s inst super raises typeerror must be type not classobj for new style class the following use of super raises a typeerror why from htmlparser import htmlparser class textparser htmlparser def init self super textparser self init self all data textparser typeerror must be type not classobj there is a similar question on stackoverflow python super raises typeerror why where the error is explained by the fact that the user class is not a new style class however the class above is a new style class as it inherits from object isinstance htmlparser object true what am i missing how can i use super here using htmlparser init self instead of super textparser self init would work but i would like to understand the typeerror ps joachim pointed out that being a new style class instance is not equivalent to being an object i read the opposite many times hence my confusion example of new style class instance test based on object instance test http stackoverflow com revisions inst alright it s the usual super cannot be used with an old style class however the important point is that the correct test for is this a new style instance i e object is class oldstyle pass instance oldstyle issubclass instance class object false and not as in the question isinstance instance object true for classes the correct is this a new style class test is issubclass oldstyle object oldstyle is not a new style class false issubclass int object int is a new style class true the crucial point is that with old style classes the class of an instance and its type are distinct here oldstyle class is oldstyle which does not inherit from object while type oldstyle is the instance type which does inherit from object basically an old style class just creates objects of type instance whereas a new style class creates objects whose type is the class itself this is probably why the instance oldstyle is an object its type inherits from object the fact that its class does not inherit from object does not count old style classes merely construct new objects of type instance partial reference http stackoverflow com a ps the difference between a new style class and an old style one can also be seen with type oldstyle oldstyle creates objects but is not itself a type classobj isinstance oldstyle type false type int a new style class is a type type old style classes are not types so they cannot be the type of their instances s s inst get difference between two lists i have two lists in python like these temp one two three four temp one two i need to create a third list with items from the first list which aren t present in the second one from the example i have to get temp three four are there any fast ways without cycles and checking inst in list set temp set temp out four three s s inst how do i get the path and name of the file that is currently executing i have scripts calling other script files but i need to get the filepath of the file that is currently running within the process for example let s say i have three files using execfile script py calls script py in turn script py calls script py how can i get the file name and path of script py from code within script py without having to pass that information as arguments from script py executing os getcwd returns the original starting script s filepath not the current file s inst file as others have said you may want to use os path realpath file s s inst pretty printing xml in python what is the best way or even the various ways to pretty print xml in python inst import xml dom minidom xml xml dom minidom parse xml fname or xml dom minidom parsestring xml string pretty xml as string xml toprettyxml s s inst how to move a file in python i looked into the python os interface but was unable to locate a method to move a file how would i do the equivalent of mv in python source files path to folder destination folder path to folder equivalent of mv source files destination folder inst os rename or shutil move both employ the same syntax os rename path to current file foo path to new desination for file foo shutil move path to current file foo path to new destination for file foo note that in both cases the directory in which the new file is being created must already exist but on windows a file with that name must not or an exception will be raised note also you must include the file name file foo in both the source and destination arguments if it is changed the file will be renamed as well as moved as has been noted in comments on other answers shutil move simply calls os rename in most cases however if the destination is on a different disk than the source it will instead copy and then delete the source file s s inst how do i find the location of python module sources how do i learn where the source file for a given python module is installed is the method different on windows than on linux i m trying to look for the source of the datetime module in particular but i m interested in a more general answer as well inst for a pure python module you can find the source by looking at themodule file the datetime module however is written in c and therefore datetime file points to a so file there is no datetime file on windows and therefore you can t see the source if you download a python source tarball and extract it the modules code can be found in the modules subdirectory for example if you want to find the datetime code for python you can look at python modules datetimemodule c you can also find the latest mercurial version on the web at https hg python org cpython file tip modules datetimemodule c s s inst measure time elapsed in python what i want is to start counting time somewhere in my code and then get the passed time to measure the time it took to execute few function i think i m using the timeit module wrong but the docs are just confusing for me import timeit start timeit timeit print hello end timeit timeit print end start inst if you just want to measure the elapsed wall clock time between two points you could use time time import time start time time print hello end time time print end start this gives the execution time in seconds edit a better option might be to use time clock thanks amber on unix return the current processor time as a floating point number expressed in seconds the precision and in fact the very definition of the meaning of a processor timea depends on that of the c function of the same name but in any case this is the function to use for benchmarking python or timing algorithms on windows this function returns wall clock seconds elapsed since the first call to this function as a floating point number based on the win function queryperformancecounter the resolution is typically better than one microsecond s s inst clang error unknown argument mno fused madd python package installation failure i get the following error when attempting to install psycopg via pip on mavericks clang error unknown argument mno fused madd wunused command line argument hard error in future not sure how to proceed and have searched here and elsewhere for this particular error any help is much appreciated here is the complete output from pip pip install psycopg downloading unpacking psycopg downloading psycopg tar gz kb kb downloaded running setup py path private var folders z ljjwsjmn v zwm vhxj m gn t pip build tino psycopg setup py egg info for package psycopg installing collected packages psycopg running setup py install for psycopg building psycopg psycopg extension cc fno strict aliasing fno common dynamic arch x arch i g os pipe fno common fno strict aliasing fwrapv mno fused madd denable dtrace dmacosx dndebug wall wstrict prototypes wshorten to dndebug g fwrapv os wall wstrict prototypes denable dtrace arch x arch i pipe dpsycopg default pydatetime dpsycopg version dt dec pq ext dpg version hex x dpsycopg extensions dpsycopg new boolean dhave pqfreemem i system library frameworks python framework versions include python i i usr local cellar postgresql include i usr local cellar postgresql include server c psycopg psycopgmodule c o build temp macosx intel psycopg psycopgmodule o clang error unknown argument mno fused madd wunused command line argument hard error in future clang note this will be a hard error cannot be downgraded to a warning in the future error command cc failed with exit status complete output from command usr bin python c import setuptools tokenize file private var folders z ljjwsjmn v zwm vhxj m gn t pip build tino psycopg setup py exec compile getattr tokenize open open file read replace file exec install record var folders z ljjwsjmn v zwm vhxj m gn t pip bnwiwb record install record txt single version externally managed compile running install running build running build py creating build creating build lib macosx intel creating build lib macosx intel psycopg copying lib init py build lib macosx intel psycopg copying lib json py build lib macosx intel psycopg copying lib range py build lib macosx intel psycopg copying lib errorcodes py build lib macosx intel psycopg copying lib extensions py build lib macosx intel psycopg copying lib extras py build lib macosx intel psycopg copying lib pool py build lib macosx intel psycopg copying lib psycopg py build lib macosx intel psycopg copying lib tz py build lib macosx intel psycopg creating build lib macosx intel psycopg tests copying tests init py build lib macosx intel psycopg tests copying tests dbapi py build lib macosx intel psycopg tests copying tests dbapi tpc py build lib macosx intel psycopg tests copying tests test async py build lib macosx intel psycopg tests copying tests test bug gc py build lib macosx intel psycopg tests copying tests test bugx py build lib macosx intel psycopg tests copying tests test cancel py build lib macosx intel psycopg tests copying tests test connection py build lib macosx intel psycopg tests copying tests test copy py build lib macosx intel psycopg tests copying tests test cursor py build lib macosx intel psycopg tests copying tests test dates py build lib macosx intel psycopg tests copying tests test extras dictcursor py build lib macosx intel psycopg tests copying tests test green py build lib macosx intel psycopg tests copying tests test lobject py build lib macosx intel psycopg tests copying tests test module py build lib macosx intel psycopg tests copying tests test notify py build lib macosx intel psycopg tests copying tests test psycopg dbapi py build lib macosx intel psycopg tests copying tests test quote py build lib macosx intel psycopg tests copying tests test transaction py build lib macosx intel psycopg tests copying tests test types basic py build lib macosx intel psycopg tests copying tests test types extras py build lib macosx intel psycopg tests copying tests test with py build lib macosx intel psycopg tests copying tests testconfig py build lib macosx intel psycopg tests copying tests testutils py build lib macosx intel psycopg tests running build ext building psycopg psycopg extension creating build temp macosx intel creating build temp macosx intel psycopg cc fno strict aliasing fno common dynamic arch x arch i g os pipe fno common fno strict aliasing fwrapv mno fused madd denable dtrace dmacosx dndebug wall wstrict prototypes wshorten to dndebug g fwrapv os wall wstrict prototypes denable dtrace arch x arch i pipe dpsycopg default pydatetime dpsycopg version dt dec pq ext dpg version hex x dpsycopg extensions dpsycopg new boolean dhave pqfreemem i system library frameworks python framework versions include python i i usr local cellar postgresql include i usr local cellar postgresql include server c psycopg psycopgmodule c o build temp macosx intel psycopg psycopgmodule o clang error unknown argument mno fused madd wunused command line argument hard error in future clang note this will be a hard error cannot be downgraded to a warning in the future error command cc failed with exit status cleaning up command usr bin python c import setuptools tokenize file private var folders z ljjwsjmn v zwm vhxj m gn t pip build tino psycopg setup py exec compile getattr tokenize open open file read replace file exec install record var folders z ljjwsjmn v zwm vhxj m gn t pip bnwiwb record install record txt single version externally managed compile failed with error code in private var folders z ljjwsjmn v zwm vhxj m gn t pip build tino psycopg inst you can tell clang to not raise this as an error by setting the following environment variables prior compilation export cflags qunused arguments export cppflags qunused arguments then pip install psycopg should work i had the same when trying to pip install lxml edit if you are installing as superuser which will likely be the case if you are trying to append to library python site packages the native apple factory installed python distribution which ships with os x rather than to some other python distribution which you have subsequently installed yourself then you will need to do as described by thijs kuipers in comments below sudo e pip install psycopg or the equivalent for whatever other package name you may be substituting in place of psycopg update apple has fixed this problem with updated system pythons and in os x so the workaround is no longer necessary when using the latest mavericks and xcode however as of now the workaround is still required for os x x mountain lion currently if you are using xcode there s s inst dead simple argparse example wanted argument results the documentation for the argparse python module while excellent i m sure is too much for my tiny beginner brain to grasp right now likewise for many questions here on the stack i don t need to do math on the command line or meddle with formatting lines on the screen or change option characters all i want to do is if arg is a do this if b do that if none of the above show help and quit inst here s the way i do it with argparse with multiple args parser argparse argumentparser description description of your program parser add argument f foo help description for foo argument required true parser add argument b bar help description for bar argument required true args vars parser parse args args will be a dictionary containing the arguments if args foo hello code here if args bar world code here in your case simply add only one argument s s inst python image library fails with message decoder jpeg not available pil pil does support jpeg in my system whenever i do an upload my code is failing with file pil image py line in getdecoder raise ioerror decoder s not available decoder name ioerror decoder jpeg not available how can i resolve this inst libjpeg dev is required to be able to process jpegs with pillow or pil so you need to install it and then recompile pillow it also seems that libjpeg dev is needed on ubuntu if you re still using pil then you should really be using pillow these days though so first pip uninstall pil before following these instructions to switch or if you have a good reason for sticking with pil then replace pillow with pil in the below on ubuntu install libjpeg dev with apt sudo apt get install libjpeg dev if you re on ubuntu also install this sudo apt get install libjpeg dev reinstall pillow pip install no cache dir i pillow if that doesn t work try one of the below depending on whether you are on bit or bit ubuntu for ubuntu x sudo ln s usr lib x linux gnu libjpeg so usr lib sudo ln s usr lib x linux gnu libfreetype so usr lib sudo ln s usr lib x linux gnu libz so usr lib or for ubuntu bit sudo ln s usr lib i linux gnu libjpeg so usr lib sudo ln s usr lib i linux gnu libfreetype so usr lib sudo ln s usr lib i linux gnu libz so usr lib then reinstall pillow pip install no cache dir i pillow edits to include feedback from comments thanks charles offenbacher for pointing out this differs for bit and t mart for suggesting use of no cache dir s s inst convert a unicode string to a string in python containing extra symbols how do you convert a unicode string containing extra characters like a etc into a python string inst title u kla ft skra ms infa r pa fa da ral a lectoral groa e import unicodedata unicodedata normalize nfkd title encode ascii ignore kluft skrams infor pa federal electoral groe s s inst converting from a string to boolean in python does anyone know how to do convert from a string to a boolean in python i found this link but it doesn t look like a proper way to do it i e using a built in functionality etc edit the reason i asked this is because i learned int string from here i tried bool string but always got true inst really you just compare the string to whatever you expect to accept as representing true so you can do this s true or to checks against a whole bunch of values s in true t y yes yeah yup certainly uh huh be cautious when using the following bool foo true bool false empty strings evaluate to false but everything else evaluates to true so this should not be used for any kind of parsing purposes s s inst python check if an object is a list or tuple but not string this is what i normally do in order to ascertain that the input is a list tuple but not a str because many times i stumbled upon bugs where a function passes a str object by mistake and the target function does for x in lst assuming that lst is actually a list or tuple assert isinstance lst list tuple my question is is there a better way of achieving this inst i think assert not isinstance lst basestring is actually what you want otherwise you ll miss out on a lot of things which act like lists but aren t subclasses of list or tuple s s inst how do i use python s itertools groupby i haven t been able to find an understandable explanation of how to actually use python s itertools groupby function what i m trying to do is this take a list in this case the children of an objectified lxml element divide it into groups based on some criteria then later iterate over each of these groups separately i ve reviewed the documentation and the examples but i ve had trouble trying to apply them beyond a simple list of numbers so how do i use of itertools groupby is there another technique i should be using pointers to good prerequisite reading would also be appreciated inst as sebastjan said you first have to sort your data this is important the part i didn t get is that in the example construction groups uniquekeys for k g in groupby data keyfunc groups append list g store group iterator as a list uniquekeys append k k is the current grouping key and g is an iterator that you can use to iterate over the group defined by that grouping key in other words the groupby iterator itself returns iterators here s an example of that using clearer variable names from itertools import groupby things animal bear animal duck plant cactus vehicle speed boat vehicle school bus for key group in groupby things lambda x x for thing in group print a s is a s thing key print this will give you the output a bear is a animal a duck is a animal a cactus is a plant a speed boat is a vehicle a school bus is a vehicle in this example things is a list of tuples where the first item in each tuple is the group the second item belongs to the groupby function takes two arguments the data to group and the function to group it with here lambda x x tells groupby to use the first item in each tuple as the grouping key in the above for statement groupby returns three key group iterator pairs once for each unique key you can use the returned iterator to iterate over each individual item in that group here s a slightly different example with the same data using a list comprehension for key group in groupby things lambda x x listofthings and join thing for thing in group print key s listofthings this will give you the output animals bear and duck plants cactus vehicles speed boat and school bus s s inst flatten an irregular list of lists in python yes i know this subject has been covered before here here here here but as far as i know all solutions except for one fail on a list like this l where the desired output is or perhaps even better an iterator the only solution i saw that works for an arbitrary nesting is found in this question def flatten x result for el in x if hasattr el iter and not isinstance el basestring result extend flatten el else result append el return result flatten l is this the best model did i overlook something any problems inst using generator functions can make your example a little easier to read and probably boost the performance python def flatten l for el in l if isinstance el collections iterable and not isinstance el basestring for sub in flatten el yield sub else yield el i used the iterable abc added in python in python the basestring is no more but you can use a tuple of str and bytes to get the same effect there the yield from operator returns an item from a generator one at a time this syntax for delegating to a subgenerator was added in def flatten l for el in l if isinstance el collections iterable and not isinstance el str bytes yield from flatten el else yield el s s inst how to read large file line by line in python i want to iterate over each line of an entire file one way to do this is by reading the entire file saving it to a list then going over the line of interest this method uses a lot of memory so i am looking for an alternative my code so far for each line in fileinput input input file do something each line for each line again in fileinput input input file do something each line again executing this code gives an error message device active any suggestions edit the purpose is to calculate pair wise string similarity meaning for each line in file i want to calculate the levenshtein distance with every other line inst nobody has given the correct fully pythonic way to read a file it s the following with open as f for line in f do something with line the with statement handles opening and closing the file including if an exception is raised in the inner block the for line in f treats the file object f as an iterable which automatically uses buffered io and memory management so you don t have to worry about large files there should be one and preferably only one obvious way to do it s s inst how to sort list tuple of lists tuples i have some data either in list contains lists or list contains tuples data data and i want to sort by the nd element in the subset meaning sorting by where is from is from what is the common way to do this should i store tuples or lists in my list since tuples are more inflexible inst sorted by second sorted data key lambda tup tup or data sort key lambda tup tup sorts in place s s inst how to re import an updated package while in python interpreter i often test my module in the python interpreter and when i see an error i quickly update the py file but how do i make it reflect on the interpreter so far i have been exiting and reentering the interpreter because re importing the file again is not working for me inst reload is no longer a function in python use imp reload instead copied from comments use the reload builtin function https docs python org library functions html reload when reload module is executed python modulesa code is recompiled and the module level code reexecuted defining a new set of objects which are bound to names in the modulea s dictionary the init function of extension modules is not called a second time as with all other objects in python the old objects are only reclaimed after their reference counts drop to zero the names in the module namespace are updated to point to any new or changed objects other references to the old objects such as names external to the module are not rebound to refer to the new objects and must be updated in each namespace where they occur if that is desired example make a simple function that prints version shell echo def x print version mymodule py run the module shell python import mymodule mymodule x version change mymodule to print version without exiting the python repl shell echo def x print version mymodule py back in that same python session reload mymodule module mymodule from mymodule pyc mymodule x version s s inst what is the purpose of the single underscore variable in python what is the meaning of after for in this code if tbh bag n for in tbh bag atom set n inst has main conventional uses in python to hold the result of the last executed statement in an interactive interpreter session this precedent was set by the standard cpython interpreter and other interpreters have followed suit for translation lookup in i n imported from the corresponding c conventions i believe as in code like raise forms validationerror please enter a correct username as a general purpose throwaway variable name to indicate that part of a function result is being deliberately ignored as in code like label has label text partition the latter two purposes can conflict so it is necessary to avoid using as a throwaway variable in any code block that also uses it for i n translation many folks prefer a double underscore as their throwaway variable for exactly this reason s s inst fastest way to list all primes below n this is the best algorithm i could come up def get primes n numbers set range n primes while numbers p numbers pop primes append p numbers difference update set range p n p return primes timeit timer stmt get primes get primes setup import get primes timeit can it be made even faster this code has a flaw since numbers is an unordered set there is no guarantee that numbers pop will remove the lowest number from the set nevertheless it works at least for me for some input numbers sum get primes l that s the correct sum of all numbers below million in get primes false in get primes true inst warning timeit results may vary due to differences in hardware or version of python below is a script which compares a number of implementations ambi sieve plain rwh primes rwh primes rwh primes sieveofatkin sieveoferatosthenes sundaram sieve wheel ambi sieve requires numpy primesfrom to requires numpy primesfrom to requires numpy many thanks to stephan for bringing sieve wheel to my attention credit goes to robert william hanks for primesfrom to primesfrom to rwh primes rwh primes and rwh primes of the plain python methods tested with psyco for n rwh primes was the fastest tested method ms rwh primes sieveofatkin rwh primes sieve wheel rwh primes sieveoferatosthenes ambi sieve plain sundaram of the plain python methods tested without psyco for n rwh primes was the fastest method ms rwh primes rwh primes rwh primes sieve wheel sieveoferatosthenes ambi sieve plain sieveofatkin sundaram of all the methods tested allowing numpy for n primesfrom to was the fastest tested method ms primesfrom to primesfrom to ambi sieve timings were measured using the command python mtimeit s import primes primes method with method replaced by each of the method names primes py usr bin env python import psyco psyco full from math import sqrt ceil import numpy as np def rwh primes n http stackoverflow com questions fastest way to list all primes below n in python returns a list of primes n sieve true n for i in xrange int n if sieve i sieve i i i false n i i i return i for i in xrange n if sieve i def rwh primes n http stackoverflow com questions fastest way to list all primes below n in python returns a list of primes n sieve true n for i in xrange int n if sieve i sieve i i i false n i i i return i for i in xrange n if sieve i def rwh primes n http stackoverflow com questions fastest way to list all primes below n in python input n returns a list of primes p n correction n n n n n n n n n sieve true n sieve false for i in xrange int n if sieve i k i sieve k k k false n k k k sieve k k k k i k false n k k k k i k return i for i in xrange n correction if sieve i def sieve wheel n http zerovolt com p returns a list of primes n using wheel criterion copyright by zerovolt com this code is free for non commercial purposes in which case you can just leave this comment as a credit for my work if you need this code for commercial purposes please contact me by sending an email to info at zerovolt dot com smallp wheel const if n return if n const pos while smallp pos n pos return list smallp pos make the offsets list offsets prepare the list p dim n const tk true dim tk true dim tk true dim tk true dim tk true dim tk true dim tk true dim tk true dim tk false help dictionary d d a b c if i want to find the smallest useful multiple of pos a on tkc then i need the index given by the product of pos a pos b in general if b a i need pos a pos b d for x in offsets for y in offsets res x y const if res in offsets d x res y another help dictionary gives tkx calling tmptk x tmptk tk tk tk tk tk tk tk tk pos prime lastadded stop int ceil sqrt n inner functions definition def del mult tk start step for k in xrange start len tk step tk k false end of inner functions definition cpos const pos while prime stop k if tk pos prime cpos p append prime lastadded for off in offsets tmp d off start pos prime if off else prime const pos if tmp else tmp const del mult tmptk off start prime k if tk pos prime cpos p append prime lastadded for off in offsets tmp d off start pos prime if off else prime const pos if tmp else tmp const del mult tmptk off start prime k if tk pos prime cpos p append prime lastadded for off in offsets tmp d off start pos prime if off else prime const pos if tmp else tmp const del mult tmptk off start prime k if tk pos prime cpos p append prime lastadded for off in offsets tmp d off start pos prime if off else prime const pos if tmp else tmp const del mult tmptk off start prime k if tk pos prime cpos p append prime lastadded for off in offsets tmp d off start pos prime if off else prime const pos if tmp else tmp const del mult tmptk off start prime k if tk pos prime cpos p append prime lastadded for off in offsets tmp d off start pos prime if off else prime const pos if tmp else tmp const del mult tmptk off start prime k if tk pos prime cpos p append prime lastadded for off in offsets tmp d off start pos prime if off else prime const pos if tmp else tmp const del mult tmptk off start prime now we go back to top tk so we need to increase pos by pos cpos const pos k if tk pos prime cpos p append prime lastadded for off in offsets tmp d off start pos prime if off else prime const pos tmp const del mult tmptk off start prime time to add remaining primes if lastadded remove last element and start adding them from tk this way we don t need an if within the last while if lastadded p pop now complete for every other possible prime while pos len tk cpos const pos if tk pos p append cpos if tk pos p append cpos if tk pos p append cpos if tk pos p append cpos if tk pos p append cpos if tk pos p append cpos if tk pos p append cpos if tk pos p append cpos pos remove exceeding if present pos len p while p pos n pos if pos len p del p pos return p list return p def sieveoferatosthenes n sieveoferatosthenes n return the list of the primes n code from dickinsm gmail com nov http groups google com group comp lang python msg f f ced c c d if n return sieve range n top len sieve for si in sieve if si bottom si si if bottom top break sieve bottom si bottom top si return el for el in sieve if el def sieveofatkin end sieveofatkin end return a list of all the prime numbers end using the sieve of atkin code by steve krenzel sgk gmail com improved code https web archive org web http krenzel info p info http en wikipedia org wiki sieve of atkin assert end lng end sieve false lng x max x xd int sqrt end for xd in xrange x max x xd y max int sqrt end x n n diff x y max y max y max if not n n n diff n diff for d in xrange n diff m n if m or m m n sieve m not sieve m n d x max x xd int sqrt end for xd in xrange x max x xd y max int sqrt end x n n diff x y max y max y max if not n n n diff n diff for d in xrange n diff if n m n sieve m not sieve m n d x max y min x xd int sqrt end for x in xrange x max x xd xd if x end y min int ceil sqrt x end n n diff x x x x for d in xrange n diff y min if n m n sieve m not sieve m n d primes if end return primes max end for n in xrange int sqrt end if sieve n primes append n aux n aux aux for k in xrange aux end aux sieve k false s int sqrt end if s s primes extend i for i in xrange s end if sieve i return primes def ambi sieve plain n s range n for m in xrange int n if s m for t in xrange m m n m s t return t for t in s if t def sundaram max n http stackoverflow com questions fastest way to list all primes below n in python numbers range max n half max n initial for step in xrange max n for i in xrange initial half step numbers i initial step if initial half return filter none numbers using numpy def ambi sieve n http tommih blogspot com fast prime number generator html s np arange n for m in xrange int n if s m s m m m return np r s s def primesfrom to n http stackoverflow com questions fastest way to list all primes below n in python returns a array of primes p n assert n sieve np ones n dtype np bool for i in xrange int n if sieve i sieve i i i false return np r np nonzero sieve def primesfrom to n http stackoverflow com questions fastest way to list all primes below n in python input n returns a array of primes p n sieve np ones n n dtype np bool sieve false for i in xrange int n if sieve i k i sieve k k k false sieve k k k k i k false return np r np nonzero sieve if name main import itertools import sys def test f f num print testing f and f return same results format f f func name f f func name if not all a b for a b in itertools izip longest f num f num sys exit error s s s s f func name num f func name num n test sieveofatkin sieveoferatosthenes n test sieveofatkin ambi sieve n test sieveofatkin ambi sieve plain n test sieveofatkin sundaram n test sieveofatkin sieve wheel n test sieveofatkin primesfrom to n test sieveofatkin primesfrom to n test sieveofatkin rwh primes n test sieveofatkin rwh primes n test sieveofatkin rwh primes n running the script tests that all implementations give the same result s s inst how do you express binary literals in python how do you express an integer as a binary number with python literals i was easily able to find the answer for hex x af x and octal how do you use literals to express binary in python summary of answers python and earlier can express binary using int but not with a literal python and earlier there is no way to express binary literals python beta you can do like so b or b python beta will also allow o or o second character is the letter o to represent an octal python beta same as but will no longer allow the older syntax for octals inst for reference future python possibilities starting with python you can express binary literals using the prefix b or b b you can also use the new bin function to get the binary representation of a number bin b development version of the documentation what s new in python s s inst showing the stack trace from a running python application i have this python application that gets stuck from time to time and i can t find out where is there any way to signal python interpreter to show you the exact code that s running some kind of on the fly stacktrace related questions print current call stack from a method in python code check what a running process is doing print stack trace of an uninstrumented python program inst i have module i use for situations like this where a process will be running for a long time but gets stuck sometimes for unknown and irreproducible reasons its a bit hacky and only works on unix requires signals import code traceback signal def debug sig frame interrupt running process and provide a python prompt for interactive debugging d frame frame allow access to frame object d update frame f globals unless shadowed by global d update frame f locals i code interactiveconsole d message signal received entering python shell traceback message join traceback format stack frame i interact message def listen signal signal signal sigusr debug register handler to use just call the listen function at some point when your program starts up you could even stick it in site py to have all python programs use it and let it run at any point send the process a sigusr signal using kill or in python os kill pid signal sigusr this will cause the program to break to a python console at the point it is currently at showing you the stack trace and letting you manipulate the variables use control d eof to continue running though note that you will probably interrupt any i o etc at the point you signal so it isn t fully non intrusive i ve another script that does the same thing except it communicates with the running process through a pipe to allow for debugging backgrounded processes etc its a bit large to post here but i ve added it as a python cookbook recipe s s inst creating a json response using django and python i m trying to convert a server side ajax response script into a django httpresponse but apparently it s not working this is the server side script receive value validatevalue post validatevalue validateid post validateid validateerror post validateerror return value arraytojs array arraytojs validateid arraytojs validateerror if validatevalue testuser validate arraytojs true return true echo jsonvalidatereturn json encode arraytojs return array with success else for x x x if x arraytojs false echo jsonvalidatereturn json encode arraytojs returns array with error and this is the converted code def validate user request if request method post vld value request post get validatevalue vld id request post get validateid vld error request post get validateerror array to js vld id vld error false if vld value testuser array to js true x simplejson dumps array to js return httpresponse x else array to js false x simplejson dumps array to js error error return render to response index html error error context instance requestcontext request return render to response index html context instance requestcontext request i m using simplejson to encode the python list so it will return a json array i couldn t figure out the problem yet but i think that i did something wrong about the echo inst i usually use a dictionary not a list to return json content import json from django http import httpresponse response data response data result error response data message some error message pre django you d return it like this return httpresponse json dumps response data content type application json for django use jsonresponse as shown in this so answer like so from django http import jsonresponse return jsonresponse foo bar s s inst how do i correctly clean up a python object class package def init self self files def del self for file in self files os unlink file del self above fails with an attributeerror exception i understand python doesn t guarantee the existence of global variables member data in this context when del is invoked if that is the case and this is the reason for the exception how do i make sure the object destructs properly inst i d recommend using python s with statement for managing resources that need to be cleaned up the problem with using an explicit close statement is that you have to worry about people forgetting to call it at all or forgetting to place it in a finally block to prevent a resource leak when an exception occurs to use the with statement create a class with the following methods def enter self def exit self exc type exc value traceback in your example above you d use class package def init self self files def enter self return self def exit self exc type exc value traceback for file in self files os unlink file then when someone wanted to use your class they d do the following with package as package obj use package obj the variable package obj will be an instance of type package it s the value returned by the enter method its exit method will automatically be called regardless of whether or not an exception occurs you could even take this approach a step further in the example above someone could still instantiate package using its constructor without using the with clause you don t want that to happen you can fix this by creating a packageresource class that defines the enter and exit methods then the package class would be defined strictly inside the enter method and returned that way the caller never could instantiate the package class without using a with statement class packageresource def enter self class package self package obj package return self package obj def exit self exc type exc value traceback self package obj cleanup you d use this as follows with packageresource as package obj use package obj s s inst proper way to use kwargs in python what is the proper way to use kwargs in python when it comes to default values kwargs returns a dictionary but what is the best way to set default values or is there one should i just access it as a dictionary use get function class exampleclass def init self kwargs self val kwargs val self val kwargs get val a simple question but one that i can t find good resources on people do it different ways in code that i ve seen and it s hard to know what to use inst you can pass a default value to get for keys that are not in the dictionary self val kwargs get val default value however if you plan on using a particular argument with a particular default value why not use named arguments in the first place def init self val default value kwargs s s inst no module named pkg resources i m deploying a django app to a dev server and am hitting this error when i run pip install requirements txt traceback most recent call last file var www mydir virtualenvs dev bin pip line in module from pkg resources import load entry point importerror no module named pkg resources pkg resources appears to be distributed with setuptools initially i thought this might not be installed to the python in the virtualenv so i installed setuptools same version as python to the python site packages in the virtualenv with the following command sh setuptools c py egg install dir var www mydir virtualenvs dev lib python site packages edit this only happens inside the virtualenv if i open a console outside the virtualenv then pkg resources is present but i am still getting the same error any ideas as to why pkg resources is not on the path inst i encountered the same importerror today while trying to use pip somehow the setuptools package had been deleted in my python environment to fix the issue run the setup script for setuptools wget https bootstrap pypa io ez setup py o python or if you don t have wget installed e g os x try curl https bootstrap pypa io ez setup py python possibly with sudo prepended if you have any version of distribute or any setuptools below you will have to uninstall it first see installation instructions for further details if you already have a working distribute upgrading it to the compatibility wrapper that switches you over to setuptools is easier but if things are already broken don t try that s s inst rename files in python i m trying to rename some files in a directory using python say i have a file called cheese cheese type and want to remove cheese so my resulting filename would be cheese type i m trying to use the os path split but it s not working properly i have also considered using string manipulations but have not been successful with that either inst do you want something like this ls cheese cheese type bar cheese cheese type foo python import os for filename in os listdir if filename startswith cheese os rename filename filename ls cheese type bar cheese type foo s s inst find which version of package is installed with pip using pip is it possible to figure out which version of a package is currently installed i know about pip install xyz upgrade but i am wondering if there is anything like pip info xyz if not what would be the best way to tell what version i am currently using inst as of pip there is a pip show command pip show jinja name jinja version location path to virtualenv lib python site packages requires markupsafe in older versions pip freeze and grep should do the job nicely pip freeze grep jinja jinja s s inst how to create a guid uuid in python how do i create a guid in python that is platform independent i hear there is a method using activepython on windows but it s windows only because it uses com is there a method using plain python inst if you re using python or later the uuid module is already included with the python standard distribution ex import uuid uuid uuid uuid a b c bf bdb e c ada s s inst indentationerror unindent does not match any outer indentation level when i compile the python code below i get indentationerror unindent does not match any outer indentation level import sys def factorial n return factorial result for i in range n result result i print factorial is result return result why inst edit other posters are probably correct there might be spaces mixed in with your tabs try doing a search replace to replace all tabs with a few spaces try this import sys def factorial n return factorial result for i in range n result result i print factorial is result return result print factorial s s inst a transpose unzip function in python inverse of zip i have a list of item tuples and i d like to convert them to lists where the first contains the first item in each tuple and the second list holds the second item for example original a b c d and i want to become result a b c d is there a builtin function that does that inst zip is its own inverse provided you use the special operator zip a b c d a b c d the way this works is by calling zip with the arguments zip a b c d a except the arguments are passed to zip directly after being converted to a tuple so there s no need to worry about the number of arguments getting too big s s inst what is the most pythonic way to iterate over a list in chunks i have a python script which takes as input a list of integers which i need to work with four integers at a time unfortunately i don t have control of the input or i d have it passed in as a list of four element tuples currently i m iterating over it this way for i in xrange len ints dummy op for example code foo ints i ints i ints i ints i it looks a lot like c think though which makes me suspect there s a more pythonic way of dealing with this situation the list is discarded after iterating so it needn t be preserved perhaps something like this would be better while ints foo ints ints ints ints ints still doesn t quite feel right though related question how do you split a list into evenly sized chunks in python inst def chunker seq size return seq pos pos size for pos in xrange len seq size simple easy fast works with any sequence text i am a very very helpful text for group in chunker text print repr group i am a very v ery hel pful te xt print join chunker text i am a ver y very he lpful text animals cat dog rabbit duck bird cow gnu fish for group in chunker animals print group cat dog rabbit duck bird cow gnu fish s s inst what exactly do u and r string flags do in python and what are raw string literals while asking this question i realized i didn t know much about raw strings for somebody claiming to be a django trainer this sucks i know what an encoding is and i know what u alone does since i get what is unicode but what does r do exactly what kind of string does it result in and above all what the heck does ur do finally is there any reliable way to go back from a unicode string to a simple raw string ah and by the way if your system and your text editor charset are set to utf does u actually do anything inst there s not really any raw string there are raw string literals which are exactly the string literals marked by a r before the opening quote a raw string literal is a slightly different syntax for a string literal in which a backslash is taken as meaning just a backslash except when it comes right before a quote that would otherwise terminate the literal no escape sequences to represent newlines tabs backspaces form feeds and so on in normal string literals each backslash must be doubled up to avoid being taken as the start of an escape sequence this syntax variant exists mostly because the syntax of regular expression patterns is heavy with backslashes but never at the end so the except clause above doesn t matter and it looks a bit better when you avoid doubling up each of them that s all it also gained some popularity to express native windows file paths with backslashes instead of regular slashes like on other platforms but that s very rarely needed since normal slashes mostly work fine on windows too and imperfect due to the except clause above r is a byte string in python ur is a unicode string again in python and any of the other three kinds of quoting also produces exactly the same types of strings so for example r r r r are all byte strings and so on not sure what you mean by going back there is no intrinsically back and forward directions because there s no raw string type it s just an alternative syntax to express perfectly normal string objects byte or unicode as they may be and yes in python u is of course always distinct from just the former is a unicode string the latter is a byte string what encoding the literal might be expressed in is a completely orthogonal issue e g consider python sys getsizeof ciao sys getsizeof u ciao the unicode object of course takes more memory space very small difference for a very short string obviously s s inst how to save a python interactive session i find myself frequently using python s interpreter to work with databases files etc basically a lot of manual formatting of semi structured data i don t properly save and clean up the useful bits as often as i would like is there a way to save my input into the shell db connections variable assignments little for loops and bits of logic some history of the interactive session if i use something like script i get too much stdout noise i don t really need to pickle all the objects though if there is a solution that does that it would be ok ideally i would just be left with a script that ran as the one i created interactively and i could just delete the bits i didn t need is there a package that does this or a diy approach update i am really amazed at the quality and usefulness of these packages for those with a similar itch ipython should have been using this for ages kind of what i had in mind reinteract very impressive i want to learn more about visualization and this seems like it will shine there sort of a gtk gnome desktop app that renders graphs inline imagine a hybrid shell graphing calculator mini eclipse source distribution here http www reinteract org trac wiki gettingit built fine on ubuntu integrates into gnome desktop windows and mac installers too bpython extremely cool lots of nice features autocomplete rewind one keystroke save to file indentation well done python source distribution pulled a couple of dependencies from sourceforge i am converted these really fill a need between interpreter and editor inst ipython is extremely useful if you like using interactive sessions for example for your usecase there is the save magic command you just input save my useful session to save input lines to and to my useful session py to help with this every line is prefixed by its number look at the videos on the documentation page to get a quick overview of the features s s inst python about catching any exception how can i write a try except block that catches all exceptions inst apart from a bare except clause which as others have said you shouldn t use you can simply catch exception import traceback import logging try whatever except exception as e logging error traceback format exc logs the error appropriately you would normally only ever consider doing this at the outermost level of your code if for example you wanted to handle any otherwise uncaught exceptions before terminating the advantage of except exception over the bare except is that there are a few exceptions that it wont catch most obviously keyboardinterrupt and systemexit if you caught and swallowed those then you could make it hard for anyone to exit your script s s inst check if a python list item contains a string inside another string i have a list my list abc def ghi abc and want to search for items that contain the string abc how can i do that if abc in my list would check if abc exists in the list but it is a part of abc and abc abc does not exist on its own so how can i get all items that contain abc inst if you only want to check for the presence of abc in any string in the list you could try some list abc def ghi abc if any abc in s for s in some list whatever if you really want to get all the items containing abc use matching s for s in some list if abc in s s s inst elegant python function to convert camelcase to snake case example convert camelcase camel case inst this is pretty thorough def convert name s re sub a z a z r name return re sub a z a z r s lower works with all these and doesn t harm already un cameled versions convert camelcase camel case convert camelcamelcase camel camel case convert camel camel case camel camel case convert gethttpresponsecode get http response code convert get httpresponsecode get http response code convert httpresponsecode http response code convert httpresponsecodexyz http response code xyz or if you re going to call it a zillion times you can pre compile the regexes first cap re re compile a z a z all cap re re compile a z a z def convert name s first cap re sub r name return all cap re sub r s lower don t forget to import the regular expression module import re s s inst maximum and minimum values for ints i am looking for minimum and maximum values for integers in python for eg in java we have integer min value and integer max value is there something like this in python inst in python there s sys maxint sys maxint and you can calculate the minimum value with sys maxint as seen here of course python just switches from plain to long integers once you exceed this value in python this value has no significance at all for integers however a closely related value is still available as sys maxsize in case you re actually looking for the machine s word size s s inst is it worth using python s re compile is there any benefit in using compile for regular expressions in python h re compile hello h match hello world vs re match hello hello world inst i ve had a lot of experience running a compiled regex s of times versus compiling on the fly and have not noticed any perceivable difference obviously this is anecdotal and certainly not a great argument against compiling but i ve found the difference to be negligible edit after a quick glance at the actual python library code i see that python internally compiles and caches regexes whenever you use them anyway including calls to re match so you re really only changing when the regex gets compiled and shouldn t be saving much time at all only the time it takes to check the cache a key lookup on an internal dict type from module re py comments are mine def match pattern string flags return compile pattern flags match string def compile key does cache check at top of function cachekey type key key p cache get cachekey if p is not none return p does actual compilation on cache miss caches compiled regex if len cache maxcache cache clear cache cachekey p return p i still often pre compile regular expressions but only to bind them to a nice reusable name not for any expected performance gain s an shrink the plot vertically, and put the a horizontal legend at the bottom: import matplotlib.pyplot as plt import numpy as np x = np.arange(10) fig = plt.figure() ax = plt.subplot(111) for i in xrange(5): line, = ax.plot(x, i * x, label='$y = %ix$'%i) # Shrink current axis's height by 10% on the bottom box = ax.get_position() ax.set_position([box.x0, box.y0 + box.height * 0.1, box.width, box.height * 0.9]) # Put a legend below current axis ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.05), fancybox=True, shadow=True, ncol=5) plt.show()  ��� l����� �$���!�(�,h0R5n7 <�A�C�G�L�NjS�Y5\���������^�a�ci�kPndpYs�v:y/|����8������>��y�@����������������������9�2�<������� � ����E7$�(M���x.|���29�:�=�>C�F�K>����O`V�W?[�]�g�mor�t{3����������;���F��S���V�������������v�~����I����� �B���<���0� ����&;,��  $Y(�,�3p9�>CFhGwN^R�S�Udaq�����tpw��ۈ�-�� ����ʵ�v��G��!���d�k����Y��� ��u�5����� %�*�,�/L6=EK�O"T�V�W�[ b�i�p�|#�"���΍���Wf�����$�V���سl�:��ܿ������a�9�����}���y�%�����}���> 4���#L�&�7�����_-w��I�_�k�SYF��]���/$�lϘ��{�DŽR�u~��$���f{�< ���r:q�v�d�{���}�6޻��m��a�����u�Szewj .��X�[INST] How do I test one variable against multiple values? I'm trying to make a function that will compare multiple variables to an integer and output a string of three letters. I was wondering if there was a way to translate this into Python. So say: x = 0 y = 1 z = 3 Mylist = [] if x or y or z == 0 : Mylist.append("c") elif x or y or z == 1 : Mylist.append("d") elif x or y or z == 2 : Mylist.append("e") elif x or y or z == 3 : Mylist.append("f") which would return a list of ["c", "d", "f"] Is something like this possible? [/INST] You misunderstand how boolean expressions work; they don't work like an English sentence and guess that you are talking about the same comparison for all names here. You are looking for: if x == 1 or y == 1 or z == 1: x and y are otherwise evaluated on their own (False if 0, True otherwise). You can shorten that to: if 1 in (x, y, z): or better still: if 1 in {x, y, z}: using a set to take advantage of the constant-cost membership test (in takes a fixed amount of time whatever the left-hand operand is). When you use or, python sees each side of the operator as separate expressions. The expression x or y == 1 is treated as first a boolean test for x, then if that is False, the expression y == 1 is tested. This is due to operator precedence. The or operator has a lower precedence than the == test, so the latter is evaluated first. However, even if this were not the case, and the expression x or y or z == 1 was actually interpreted as (x or y or z) == 1 instead, this would still not do what you expect it to do. x or y or z would evaluate to the first argument that is 'truthy', e.g. not False, numeric 0 or empty (see boolean expressions for details on what Python considers false in a boolean context). So for the values x = 2; y = 1; z = 0, x or y or z would resolve to 2, because that is the first true-like value in the arguments. Then 2 == 1 would be False, even though y == 1 would be True. [INST] Class method differences in Python: bound, unbound and static What is the difference between the following class methods? Is it that one is static and the other is not? class Test(object): def method_one(self): print "Called method_one" def method_two(): print "Called method_two" a_test = Test() a_test.method_one() a_test.method_two() [/INST] In Python, there is a distinction between bound and unbound methods. Basically, a call to a member function (like method_one), a bound function a_test.method_one() is translated to Test.method_one(a_test) i.e. a call to an unbound method. Because of that, a call to your version of method_two will fail with a TypeError >>> a_test = Test() >>> a_test.method_two() Traceback (most recent call last): File "", line 1, in TypeError: method_two() takes no arguments (1 given) You can change the behavior of a method using a decorator class Test(object): def method_one(self): print "Called method_one" @staticmethod def method_two(): print "Called method two" The decorator tells the built-in default metaclass type (the class of a class, cf. this question) to not create bound methods for method_two. Now, you can invoke static method both on an instance or on the class directly: >>> a_test = Test() >>> a_test.method_one() Called method_one >>> a_test.method_two() Called method_two >>> Test.method_two() Called method_two [INST] Reloading submodules in IPython Currently I am working on a python project that contains sub modules and uses numpy/scipy. Ipython is used as interactive console. Unfortunately I am not very happy with workflow that I am using right now, I would appreciate some advice. In IPython, the framework is loaded by a simple import command. However, it is often necessary to change code in one of the submodules of the framework. At this point a model is already loaded and I use IPython to interact with it. Now, the framework contains many modules that depend on each other, i.e. when the framework is initially loaded the main module is importing and configuring the submodules. The changes to the code are only executed if the module is reloaded using reload(main_mod.sub_mod). This is cumbersome as I need to reload all changed modules individually using the full path. It would be very convenient if reload(main_module) would also reload all sub modules, but without reloading numpy/scipy.. [/INST] IPython comes with some automatic reloading magic: %load_ext autoreload %autoreload 2 It will reload all changed modules every time before executing a new line. The way this works is slightly different than dreload. Some caveats apply, type %autoreload? to see what can go wrong. If you want to always enable this settings, modify your IPython configuration file ~/.ipython/profile_default/ipython_config.py[1] and appending: c.InteractiveShellApp.extensions = ['autoreload'] c.InteractiveShellApp.exec_lines = ['%autoreload 2'] Credit to @Kos via a comment below. [1] If you don't have the file ~/.ipython/profile_default/ipython_config.py, you need to call ipython profile create first. Or the file may be located at $IPYTHONDIR. [INST] Understanding __get__ and __set__ and Python descriptors I am trying to understand what Python's descriptors are and what they can useful for. However, I am failing at it. I understand how they work, but here are my doubts. Consider the following code: class Celsius(object): def __init__(self, value=0.0): self.value = float(value) def __get__(self, instance, owner): return self.value def __set__(self, instance, value): self.value = float(value) class Temperature(object): celsius = Celsius() Why do I need the descriptor class? Please explain using this example or the one you think is better. What is instance and owner here? (in __get__). So my question is, what is the purpose of the third parameter here? How would I call/ use this example? [/INST] The descriptor is how Python's property type is implemented. A descriptor simply implements __get__, __set__, etc. and is then added to another class in its definition (as you did above with the Temperature class). For example: temp=Temperature() temp.celsius #calls celsius.__get__ Accessing the property you assigned the descriptor to (celsius in the above example) calls the appropriate descriptor method. instance in __get__ is the instance of the class (so above, __get__ would receive temp, while owner is the class with the descriptor (so it would be Temperature). You need to use a descriptor class to encapsulate the logic that powers it. That way, if the descriptor is used to cache some expensive operation (for example), it could store the value on itself and not its class. An article about descriptors can be found at http://martyalchin.com/2007/nov/23/python-descriptors-part-1-of-2/ EDIT: As jchl pointed out in the comments, if you simply try Temperature.celsius, instance will be None. [INST] Is there any difference between "foo is None" and "foo == None"? Is there any difference between: if foo is None: pass and if foo == None: pass The convention that I've seen in most Python code (and the code I myself write) is the former, but I recently came across code which uses the latter. None is an instance (and the only instance, IIRC) of NoneType, so it shouldn't matter, right? Are there any circumstances in which it might? [/INST] is always returns True if it compares the same object instance Whereas == is ultimately determined by the __eq__() method i.e. >>> class foo(object): def __eq__(self, other): return True >>> f = foo() >>> f == None True >>> f is None False [INST] How can I install packages in my $HOME folder with pip? Is it possible? When installing pip, install the python packages inside my $HOME folder. (for example, I want to install mercurial, using pip, but inside $HOME instead of /usr/local) I'm with a mac machine and just thought about this possibility, instead of "polluting" my /usr/local, I would use my $HOME instead. PEP370 is exactly about this. Is just creating a ˜/.local and do a pip install package enough to make these packages to be installed only at my $HOME folder? [/INST] While you can use a virtualenv, you don't need to. The trick is passing the PEP370 --user argument to the setup.py script. With the latest version of pip, one way to do it is: pip install --user mercurial This should result in the hg script being installed in $HOME/.local/bin/hg and the rest of the hg package in $HOME/.local/lib/pythonx.y/site-packages/. Note, that the above is true for Python 2.6. There has been a bit of controversy among the Python core developers about what is the appropriate directory location on Mac OS X for PEP370-style user installations. In Python 2.7 and 3.2, the location on Mac OS X was changed from $HOME/.local to $HOME/Library/Python. This might change in a future release. But, for now, on 2.7 (and 3.2, if hg were supported on Python 3), the above locations will be $HOME/Library/Python/x.y/bin/hg and $HOME/Library/Python/x.y/lib/python/site-packages. [INST] How do I calculate number of days betwen two dates using Python? If I have two dates (ex. '8/18/2008' and '9/26/2008') what is the best way to get the difference measured in days? [/INST] If you have two date objects, you can just subtract them. from datetime import date d0 = date(2008, 8, 18) d1 = date(2008, 9, 26) delta = d0 - d1 print delta.days The relevant section of the docs: https://docs.python.org/library/datetime.html [INST] How can I check for Python version in a program that uses new language features? If I have a Python script that requires at least a particular version of Python, what is the correct way to fail gracefully when an earlier version of Python is used to launch the script? How do I get control early enough to issue an error message and exit? For example, I have a program that uses the ternery operator (new in 2.5) and "with" blocks (new in 2.6). I wrote a simple little interpreter-version checker routine which is the first thing the script would call ... except it doesn't get that far. Instead, the script fails during python compilation, before my routines are even called. Thus the user of the script sees some very obscure synax error tracebacks - which pretty much require an expert to deduce that it is simply the case of running the wrong version of Python. I know how to check the version of Python. The issue is that some syntax is illegal in older versions of Python. Consider this program: import sys if sys.version_info < (2, 4): raise "must use python 2.5 or greater" else: # syntax error in 2.4, ok in 2.5 x = 1 if True else 2 print x When run under 2.4, I want this result $ ~/bin/python2.4 tern.py must use python 2.5 or greater and not this result: $ ~/bin/python2.4 tern.py File "tern.py", line 5 x = 1 if True else 2 ^ SyntaxError: invalid syntax (Channeling for a coworker.) [/INST] You can test using eval: try: eval("1 if True else 2") except SyntaxError: # doesn't have ternary Also, with is available in Python 2.5, just add from __future__ import with_statement . EDIT: to get control early enough, you could split it do different .py files and check compatibility in the main file before importing (e.g. in __init__.py in a package): # __init__.py # Check compatibility try: eval("1 if True else 2") except SyntaxError: raise ImportError("requires ternary support") # import from another module from impl import * [INST] What are Class methods in Python for? I'm teaching myself Python and my most recent lesson was that Python is not Java, and so I've just spent a while turning all my Class methods into functions. I now realise that I don't need to use Class methods for what I would done with static methods in Java, but now I'm not sure when I would use them. All the advice I can find about Python Class methods is along the lines of newbies like me should steer clear of them, and the standard documentation is at its most opaque when discussing them. Does anyone have a good example of using a Class method in Python or at least can someone tell me when Class methods can be sensibly used? [/INST] Class methods are for when you need to have methods that aren't specific to any particular instance, but still involve the class in some way. The most interesting thing about them is that they can be overridden by subclasses, something that's simply not possible in Java's static methods or Python's module-level functions. If you have a class MyClass, and a module-level function that operates on MyClass (factory, dependency injection stub, etc), make it a classmethod. Then it'll be available to subclasses. [INST] Install a Python package into a different directory using pip? I know the obvious answer is to use virtualenv and virtualenvwrapper, but for various reasons I can't/don't want to do that. So how do I modify the command pip install package_name to make pip install the package somewhere other than the default site-packages? [/INST] Use: pip install --install-option="--prefix=$PREFIX_PATH" package_name You might also want to use --ignore-installed to force all dependencies to be reinstalled using this new prefix. You can use --install-option to multiple times to add any of the options you can use with python setup.py install (--prefix is probably what you want, but there are a bunch more options you could use). [INST] Why doesn't Python have multiline comments? OK, I'm aware that triple-quotes strings can serve as multiline comments. For example, """Hello, I am a multiline comment""" and '''Hello, I am a multiline comment''' But technically speaking these are strings, correct? I've googled and read the Python style guide, but I was unable to find a technical answer to why there is no formal implementation of multiline, /* */ type of comments. I have no problem using triple quotes, but I am a little curious as to what led to this design decision. [/INST] I doubt you'll get a better answer than, "Guido didn't feel the need for multi-line comments". Guido has tweeted about this, Python tip: You can use multi-line strings as multi-line comments. Unless used as docstrings, they generate no code! :-) [INST] Why is "except: pass" a bad programming practice? I often see comments on other Stack Overflow questions about how the use of except: pass is discouraged. Why is this bad? Sometimes I just don't care what the errors, are and I want to just continue with the code. try: something except: pass Why is using an except: pass block bad? What makes it bad? Is it the fact that I pass on an error or that I except any error? [/INST] The main problem here is that it ignores all and any error: Out of memory, CPU is burning, user wants to stop, program wants to exit, Jabberwocky is killing users. This is way too much. In your head, you're thinking "I want to ignore this network error". If something unexpected goes wrong, then your code silently continues and breaks in completely unpredictable ways that no one can debug. That's why you should limit yourself to ignoring specifically only some errors and let the rest pass. [INST] How do I disable log messages from the Requests library? By default, the Requests library writes log messages to the console, along the lines of Starting new HTTP connection (1): example.com etc. I'm usually not interested in these messages, how do I disable them? [/INST] I found out how to configure requests's logging level, it's done via the standard logging module. I decided to configure it to not log messages unless they are at least warnings: import logging logging.getLogger("requests").setLevel(logging.WARNING) If you wish to apply this setting for the urllib3 library (typically used by requests) too, add the following: logging.getLogger("urllib3").setLevel(logging.WARNING) [INST] How to find out if a Python object is a string? How can I check if a Python object is a string (either regular or Unicode)? [/INST] Python 2 Use isinstance(obj, basestring) for an object-to-test obj. Docs. [INST] Python List vs. Array - when to use? If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library. I have always used Lists for 1d arrays. What is the reason or circumstance where I would want to use the array module instead? Is it for performance and memory optimization, or am I missing something obvious? [/INST] Basically, Python lists are very flexible and can hold completely heterogeneous, arbitrary data, and they can be appended to very efficiently, in amortized constant time. If you need to shrink and grow your array time-efficiently and without hassle, they are the way to go. But they use a lot more space than C arrays. The array.array type, on the other hand, is just a thin wrapper on C arrays. It can hold only homogeneous data, all of the same type, and so it uses only sizeof(one object) * length bytes of memory. Mostly, you should use it when you need to expose a C array to an extension or a system call (for example, ioctl or fctnl). It's also a good way to represent a mutable string (array('B', bytes)) until that actually becomes available in Python 3.0. However, if you want to do math on a homogeneous array of numeric data, then you're much better off using NumPy, which can automatically vectorize operations on complex multi-dimensional arrays. To make a long story short: array.array is useful when you need a homogeneous C array of data for reasons other than doing math. [INST] Python access to first element in dictionary If dict is not empty, the way I use to access first element in dict is: dict[dict.keys()[0]] Is there any better way to do this? [/INST] Non-destructively you can: dict.itervalues().next() On Python 3 this becomes next (iter (dict.values())) If you want it to work in both Python 2 & 3, you can use the six library: six.next(six.itervalues(dict)) though at this point it is quite cryptic and I'd rather prefer your code. If you want to remove any item, do: key, value = dict.popitem() Note that "first" is not an appropriate term here. This is "any" item, because dict is not an ordered type. [INST] What does the Python Ellipsis object do? While idly surfing the namespace I noticed an odd looking object called "Ellipsis", it does not seem to be or do anything special, but it's a globally available builtin. After a search I found that it is used in some obscure variant of the slicing syntax by Numpy and Scipy... but almost nothing else. Was this object added to the language specifically to support Numpy + Scipy? Does Ellipsis have any generic meaning or use at all? D:\workspace\numpy>python Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> Ellipsis Ellipsis [/INST] This came up in another question recently. I'll elaborate on my answer from there: Ellipsis is an object that can appear in slice notation. For example: myList[1:2, ..., 0] Its interpretation is purely up to whatever implements the __getitem__ function and sees Ellipsis objects there, but its main (and intended) use is in the numeric python extension, which adds a multidimensional array type. Since there are more than one dimensions, slicing becomes more complex than just a start and stop index; it is useful to be able to slice in multiple dimensions as well. E.g., given a 4x4 array, the top left area would be defined by the slice [:2,:2]: >>> a array([[ 1, 2, 3, 4], [ 5, 6, 7, 8], [ 9, 10, 11, 12], [13, 14, 15, 16]]) >>> a[:2,:2] # top left array([[1, 2], [5, 6]]) Extending this further, Ellipsis is used here to indicate a placeholder for the rest of the array dimensions not specified. Think of it as indicating the full slice [:] for all the dimensions in the gap it is placed, so for a 3d array, a[...,0] is the same as a[:,:,0] and for 4d, a[:,:,:,0], similarly, a[0,...,0] is a[0,:,:,0] (with however many colons in the middle make up the full number of dimensions in the array). Interestingly, in python3, the Ellipsis literal (...) is usable outside the slice syntax, so you can actually write: >>> ... Ellipsis Other than the various numeric types, no, I don't think it's used. As far as I'm aware, it was added purely for numpy use and has no core support other than providing the object and corresponding syntax. The object being there didn't require this, but the literal "..." support for slices did. [INST] How do I resize an image using PIL and maintain its aspect ratio? Is there an obvious way to do this that I'm missing? I'm just trying to make thumbnails. [/INST] Define a maximum size. Then, compute a resize ratio by taking min(maxwidth/width, maxheight/height). The proper size is oldsize*ratio. There is of course also a library method to do this: the method Image.thumbnail. Below is an (edited) example from the PIL documentation. import os, sys import Image size = 128, 128 for infile in sys.argv[1:]: outfile = os.path.splitext(infile)[0] + ".thumbnail" if infile != outfile: try: im = Image.open(infile) im.thumbnail(size, Image.ANTIALIAS) im.save(outfile, "JPEG") except IOError: print "cannot create thumbnail for '%s'" % infile [INST] How do I watch a file for changes using Python? I have a log file being written by another process which I want to watch for changes. Each time a change occurrs I'd like to read the new data in to do some processing on it. What's the best way to do this? I was hoping there'd be some sort of hook from the PyWin32 library. I've found the win32file.FindNextChangeNotification function but have no idea how to ask it to watch a specific file. If anyone's done anything like this I'd be really grateful to hear how... [Edit] I should have mentioned that I was after a solution that doesn't require polling. [Edit] Curses! It seems this doesn't work over a mapped network drive. I'm guessing windows doesn't 'hear' any updates to the file the way it does on a local disk. [/INST] Did you try using Watchdog? Python API library and shell utilities to monitor file system events. Directory monitoring made easy with A cross-platform API. A shell tool to run commands in response to directory changes. Get started quickly with a simple example in Quickstart... [INST] Circular (or cyclic) imports in Python What will happen if two modules import each other? To generalize the problem, what about the cyclic imports in Python? [/INST] There was a really good discussion on this over at comp.lang.python last year. It answers your question pretty thoroughly. Imports are pretty straightforward really. Just remember the following: 'import' and 'from xxx import yyy' are executable statements. They execute when the running program reaches that line. If a module is not in sys.modules, then an import creates the new module entry in sys.modules and then executes the code in the module. It does not return control to the calling module until the execution has completed. If a module does exist in sys.modules then an import simply returns that module whether or not it has completed executing. That is the reason why cyclic imports may return modules which appear to be partly empty. Finally, the executing script runs in a module named __main__, importing the script under its own name will create a new module unrelated to __main__. Take that lot together and you shouldn't get any surprises when importing modules. [INST] pip install from github repo branch Seems to be rather straightforward but I just can't get it right. Trying to pip install a repo's specific branch. Googling tells me to pip install https://github.com/user/repo.git@branch The branch's name is issue/34/oscar-0.6 so I did pip install https://github.com/tangentlabs/django-oscar-paypal.git@/issue/34/oscar-0.6 but its returning a 404. How do I install this branch? [/INST] Prepend the url prefix git+ (See VCS Support): pip install git+https://github.com/tangentlabs/django-oscar-paypal.git@issue/34/oscar-0.6 And specify the branch name without the leading /. [INST] Importing modules from parent folder I am running Python 2.5. This is my folder tree: ptdraft/ nib.py simulations/ life/ life.py (I also have __init__.py in each folder, omitted here for readability) How do I import the nib module from inside the life module? I am hoping it is possible to do without tinkering with sys.path. Note: The main module being run is in the ptdraft folder. [/INST] You could use relative imports (python >= 2.5): from ... import nib (What’s New in Python 2.5) PEP 328: Absolute and Relative Imports EDIT: added another dot '.' to go up two packages M�[INST] Using module 'subprocess' with timeout Here's the Python code to run an arbitrary command returning its stdout data, or raise an exception on non-zero exit codes: proc = subprocess.Popen( cmd, stderr=subprocess.STDOUT, # Merge stdout and stderr stdout=subprocess.PIPE, shell=True) communicate is used to wait for the process to exit: stdoutdata, stderrdata = proc.communicate() The subprocess module does not support timeout--ability to kill a process running for more than X number of seconds--therefore, communicate may take forever to run. What is the simplest way to implement timeouts in a Python program meant to run on Windows and Linux? [/INST] I don't know much about the low level details; but, given that in python 2.6 the API offers the ability to wait for threads and terminate processes, what about running the process in a separate thread? import subprocess, threading class Command(object): def __init__(self, cmd): self.cmd = cmd self.process = None def run(self, timeout): def target(): print 'Thread started' self.process = subprocess.Popen(self.cmd, shell=True) self.process.communicate() print 'Thread finished' thread = threading.Thread(target=target) thread.start() thread.join(timeout) if thread.is_alive(): print 'Terminating process' self.process.terminate() thread.join() print self.process.returncode command = Command("echo 'Process started'; sleep 2; echo 'Process finished'") command.run(timeout=3) command.run(timeout=1) The output of this snippet in my machine is: Thread started Process started Process finished Thread finished 0 Thread started Process started Terminating process Thread finished -15 where it can be seen that, in the first execution, the process finished correctly (return code 0), while the in the second one the process was terminated (return code -15). I haven't tested in windows; but, aside from updating the example command, I think it should work since I haven't found in the documentation anything that says that thread.join or process.terminate is not supported. [INST] How to declare an array in Python? How do I declare an array in Python? I can't find any reference to arrays in the documentation. [/INST] variable = [] Now variable refers to an empty list*. Of course this is an assignment, not a declaration. There's no way to say in Python "this variable should never refer to anything other than a list", since Python is dynamically typed. *The default built-in Python type is called a list, not an array. It is an ordered container of arbitrary length that can hold a heterogenous collection of objects (their types do not matter and can be freely mixed). This should not be confused with the array module, which offers a type closer to the C array type; the contents must be homogenous (all of the same type), but the length is still dynamic. [INST] Reading binary file in Python and looping over each byte In Python, how do I read in a binary file and loop over each byte of that file? [/INST] f = open("myfile", "rb") try: byte = f.read(1) while byte != "": # Do stuff with byte. byte = f.read(1) finally: f.close() By suggestion of chrispy: with open("myfile", "rb") as f: byte = f.read(1) while byte != "": # Do stuff with byte. byte = f.read(1) Note that the with statement is not available in versions of Python below 2.5. To use it in v 2.5 you'll need to import it: from __future__ import with_statement In 2.6 this is not needed. In Python 3, it's a bit different. We will no longer get raw characters from the stream in byte mode but byte objects, thus we need to alter the condition: with open("myfile", "rb") as f: byte = f.read(1) while byte != b"": # Do stuff with byte. byte = f.read(1) Or as benhoyt says, skip the not equal and take advantage of the fact that b"" evaluates to false. This makes the code compatible between 2.6 and 3.x without any changes. It would also save you from changing the condition if you go from byte mode to text or the reverse. with open("myfile", "rb") as f: byte = f.read(1) while byte: # Do stuff with byte. byte = f.read(1) [INST] Django - How to rename a model field using South? I would like to change a name of specific fields in a model: class Foo(models.Model): name = models.CharField() rel = models.ForeignKey(Bar) should change to: class Foo(models.Model): full_name = models.CharField() odd_relation = models.ForeignKey(Bar) What's the easiest way to do this using South? [/INST] You can use the db.rename_column function. class Migration: def forwards(self, orm): # Rename 'name' field to 'full_name' db.rename_column('app_foo', 'name', 'full_name') def backwards(self, orm): # Rename 'full_name' field to 'name' db.rename_column('app_foo', 'full_name', 'name') The first argument of db.rename_column is the table name, so it's important to remember how Django creates table names: Django automatically derives the name of the database table from the name of your model class and the app that contains it. A model's database table name is constructed by joining the model's "app label" -- the name you used in manage.py startapp -- to the model's class name, with an underscore between them. In the case where you have a multi-worded, camel-cased model name, such as ProjectItem, the table name will be app_projectitem (i.e., an underscore will not be inserted between project and item even though they are camel-cased). [INST] How to get the position of a character in Python? How can I get the position of a character inside a string in python? [/INST] There are two string methods for this, find and index. Example: >>> myString = "Position of a character" >>> myString.index('s') 2 The difference is that find returns -1 when what you're looking for isn't found. index throws an exception. Function str.find(sub[, start[, end]]) Return the lowest index in the string where substring sub is found, such that sub is contained in the range [start, end]. Optional arguments start and end are interpreted as in slice notation. Return -1 if sub is not found. And: Function str.index(sub[, start[, end]]) Like find(), but raise ValueError when the substring is not found. [INST] How to Python prettyprint a JSON file I have a JSON file that is a mess that I want to prettyprint-- what's the easiest way to do this in python? I know PrettyPrint takes an "object", which I think can be a file, but I don't know how to pass a file in-- just using the filename doesn't work. [/INST] The json module already implements some basic pretty printing with the indent parameter: >>> import json >>> >>> your_json = '["foo", {"bar":["baz", null, 1.0, 2]}]' >>> parsed = json.loads(your_json) >>> print json.dumps(parsed, indent=4, sort_keys=True) [ "foo", { "bar": [ "baz", null, 1.0, 2 ] } ] To parse a file, use json.load: with open('filename.txt', 'r') as handle: parsed = json.load(handle) [INST] How to make an unaware datetime timezone aware in python What I need to do I have a timezone-unaware datetime object, to which I need to add a time zone in order to be able to compare it with other timezone-aware datetime objects. I do not want to convert my entire application to timezone unaware for this one legacy case. What I've Tried First, to demonstrate the problem: Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> import pytz >>> unaware = datetime.datetime(2011,8,15,8,15,12,0) >>> unaware datetime.datetime(2011, 8, 15, 8, 15, 12) >>> aware = datetime.datetime(2011,8,15,8,15,12,0,pytz.UTC) >>> aware datetime.datetime(2011, 8, 15, 8, 15, 12, tzinfo=) >>> aware == unaware Traceback (most recent call last): File "", line 1, in TypeError: can't compare offset-naive and offset-aware datetimes First, I tried astimezone: >>> unaware.astimezone(pytz.UTC) Traceback (most recent call last): File "", line 1, in ValueError: astimezone() cannot be applied to a naive datetime >>> It's not terribly surprising this failed, since it's actually trying to do a conversion. Replace seemed like a better choice (as per Python: How to get a value of datetime.today() that is "timezone aware"?): >>> unaware.replace(tzinfo=pytz.UTC) datetime.datetime(2011, 8, 15, 8, 15, 12, tzinfo=) >>> unaware == aware Traceback (most recent call last): File "", line 1, in TypeError: can't compare offset-naive and offset-aware datetimes >>> But as you can see, replace seems to set the tzinfo, but not make the object aware. I'm getting ready to fall back to doctoring the input string to have a timezone before parsing it (I'm using dateutil for parsing, if that matters), but that seems incredibly kludgy. Also, I've tried this in both python 2.6 and python 2.7, with the same results. Context I am writing a parser for some data files. There is an old format I need to support where the date string does not have a timezone indicator. I've already fixed the data source, but I still need to support the legacy data format. A one time conversion of the legacy data is not an option for various business BS reasons. While in general, I do not like the idea of hard-coding a default timezone, in this case it seems like the best option. I know with reasonable confidence that all the legacy data in question is in UTC, so I'm prepared to accept the risk of defaulting to that in this case. [/INST] In general, to make a naive datetime timezone-aware, use the localize method: import datetime import pytz unaware = datetime.datetime(2011, 8, 15, 8, 15, 12, 0) aware = datetime.datetime(2011, 8, 15, 8, 15, 12, 0, pytz.UTC) now_aware = pytz.utc.localize(unaware) assert aware == now_aware For the UTC timezone, it is not really necessary to use localize since there is no daylight savings time calculation to handle: now_aware = unaware.replace(tzinfo=pytz.UTC) works. (.replace returns a new datetime; it does not modify unaware.) [INST] mysql_config not found when installing mysqldb python interface I am trying to get a Python script to run on the linux server I'm connected to via ssh. The script uses mysqldb. I have all the other components I need, but when I try to install mySQLdb via setuptools like so:, python setup.py install I get the following error report related to the mysql_config command. sh: mysql_config: command not found Traceback (most recent call last): File "setup.py", line 15, in metadata, options = get_config() File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found Has anyone else encountered this error and if so how did you resolve it/what can I do to successfully install mysqldb? [/INST] mySQLdb is a python interface for mysql, but it is not mysql itself. And apparently mySQLdb needs the command 'mysql_config', so you need to install that first. Can you confirm that you did or did not install mysql itself, by running "mysql" from the shell? That should give you a response other than "mysql: command not found". Which linux distribution are you using? Mysql is pre-packaged for most linux distributions. For example, for debian / ubuntu, installing mysql is as easy as sudo apt-get install mysql-server mysql-config is in a different package, which can be installed from (again, assuming debian / ubuntu): sudo apt-get install libmysqlclient-dev if you are using mariadb, the drop in replacement for mysql, then run sudo apt-get install libmariadbclient-dev [INST] Understanding dict.copy() - shallow or deep? While reading up the documentation for dict.copy(), it says that it makes a shallow copy of the dictionary. Same goes for the book I am following (Beazley's Python Reference), which says: The m.copy() method makes a shallow copy of the items contained in a mapping object and places them in a new mapping object. Consider this: >>> original = dict(a=1, b=2) >>> new = original.copy() >>> new.update({'c': 3}) >>> original {'a': 1, 'b': 2} >>> new {'a': 1, 'c': 3, 'b': 2} So I assumed this would update the value of original (and add 'c': 3) also since I was doing a shallow copy. Like if you do it for a list: >>> original = [1, 2, 3] >>> new = original >>> new.append(4) >>> new, original ([1, 2, 3, 4], [1, 2, 3, 4]) This works as expected. Since both are shallow copies, why is that the dict.copy() doesn't work as I expect it to? Or my understanding of shallow vs deep copying is flawed? [/INST] By "shallow copying" it means the content of the dictionary is not copied by value, but just creating a new reference. >>> a = {1: [1,2,3]} >>> b = a.copy() >>> a, b ({1: [1, 2, 3]}, {1: [1, 2, 3]}) >>> a[1].append(4) >>> a, b ({1: [1, 2, 3, 4]}, {1: [1, 2, 3, 4]}) In contrast, a deep copy will copy all contents by value. >>> c = copy.deepcopy(a) >>> a, c ({1: [1, 2, 3, 4]}, {1: [1, 2, 3, 4]}) >>> a[1].append(5) >>> a, c ({1: [1, 2, 3, 4, 5]}, {1: [1, 2, 3, 4]}) So: a = b: Reference assignment, Make a and b points to the same object. a ---, v {1: L} ^ | b ---' '----> [1,2,3] a = b.copy(): Shallow copying, a and b will become two isolated objects, but their contents still share the same reference a ---> {1: L} | >---> [1,2,3] | b ---> {1: M} a = copy.deepcopy(b): Deep copying, a and b's structure and content become completely isolated. a ---> {1: L} ‘-----> [1,2,3] b ---> {1: M} ‘-----> [1,2,3] [INST] TypeError: 'str' does not support the buffer interface plaintext = input("Please enter the text you want to compress") filename = input("Please enter the desired filename") with gzip.open(filename + ".gz", "wb") as outfile: outfile.write(plaintext) The above python code is giving me following error: Traceback (most recent call last): File "C:/Users/Ankur Gupta/Desktop/Python_works/gzip_work1.py", line 33, in compress_string() File "C:/Users/Ankur Gupta/Desktop/Python_works/gzip_work1.py", line 15, in compress_string outfile.write(plaintext) File "C:\Python32\lib\gzip.py", line 312, in write self.crc = zlib.crc32(data, self.crc) & 0xffffffff TypeError: 'str' does not support the buffer interface [/INST] If you use Python3x then string is not the same type as for Python 2.x, you must cast it to bytes (encode it). plaintext = input("Please enter the text you want to compress") filename = input("Please enter the desired filename") with gzip.open(filename + ".gz", "wb") as outfile: outfile.write(bytes(plaintext, 'UTF-8')) Also do not use variable names like string or file while those are names of module or function. EDIT @Tom Yes, non-ASCII text is also compressed/decompressed. I use Polish letters with UTF-8 encoding: plaintext = 'Polish text: ąćęłńóśźżĄĆĘŁŃÓŚŹŻ' filename = 'foo.gz' with gzip.open(filename, 'wb') as outfile: outfile.write(bytes(plaintext, 'UTF-8')) with gzip.open(filename, 'r') as infile: outfile_content = infile.read().decode('UTF-8') print(outfile_content) [INST] Can I get JSON to load into an OrderedDict in Python? Ok so I can use an OrderedDict in json.dump. That is, an OrderedDict can be used as an input to JSON. But can it be used as an output? If so how? In my case I'd like to load into an OrderedDict so I can keep the order of the keys in the file. If not, is there some kind of workaround? [/INST] Yes, you can. By specifying the object_pairs_hook argument to JSONDecoder. In fact, this is the exact example given in the documentation. >>> json.JSONDecoder(object_pairs_hook=collections.OrderedDict).decode('{"foo":1, "bar": 2}') OrderedDict([('foo', 1), ('bar', 2)]) >>> You can pass this parameter to json.loads (if you don't need a Decoder instance for other purposes) like so: >>> import json >>> from collections import OrderedDict >>> data = json.loads('{"foo":1, "bar": 2}', object_pairs_hook=OrderedDict) >>> print json.dumps(data, indent=4) { "foo": 1, "bar": 2 } >>> Using json.load is done in the same way: >>> data = json.load(open('config.json'), object_pairs_hook=OrderedDict) [INST] How to set the current working directory in Python? How to set the current working directory in Python? [/INST] Try os.chdir os.chdir(path)         Change the current working directory to path. Availability: Unix, Windows. [INST] How can I fill out a Python string with spaces? I want to fill out a string with spaces. I know that the following works for zero's: >>> print "'%06d'"%4 '000004' But what should I do when I want this?: 'hi ' of course I can measure string length and do str+" "*leftover, but I'd like the shortest way. [/INST] You can do this with str.ljust(width[, fillchar]): Return the string left justified in a string of length width. Padding is done using the specified fillchar (default is a space). The original string is returned if width is less than len(s). >>> 'hi'.ljust(10) 'hi ' [INST] Get unique values from a list in python I want to get the unique values from the following list: [u'nowplaying', u'PBS', u'PBS', u'nowplaying', u'job', u'debate', u'thenandnow'] The output which I require is: [u'nowplaying', u'PBS', u'job', u'debate', u'thenandnow'] I tried the following code: output = [] for x in trends: if x not in output: output.append(x) print output but it didn't work. Any help would be appreciated. [/INST] First declare your list properly, separated by commas You can get the unique values by converting the list to a set mylist = [u'nowplaying', u'PBS', u'PBS', u'nowplaying', u'job', u'debate', u'thenandnow'] myset = set(mylist) print myset If you use it further as a list, you should convert it back to list by doing mynewlist = list(myset) Another possibility, probably faster would be to use a set from the beginning, instead of a list. Then your code should be output = set() for x in trends: output.add(x) print output As it has been pointed out, the sets do not maintain the original order. If you need so, you should look up about the ordered set [INST] Pythonic way to avoid "if x: return x" statements I have a method that calls 4 other methods in sequence to check for specific conditions, and returns immediately (not checking the following ones) whenever one returns something Truthy. def check_all_conditions(): x = check_size() if x: return x x = check_color() if x: return x x = check_tone() if x: return x x = check_flavor() if x: return x return None This seems like a lot of baggage code. Instead of each 2-line if statement, I'd rather do something like: x and return x But that is invalid Python. Am I missing a simple, elegant solution here? Incidentally, in this situation, those four check methods may be expensive, so I do not want to call them multiple times. [/INST] Alternatively to Martijn's fine answer, you could chain or. This will return the first truthy value, or None if there's no truthy value: def check_all_conditions(): return check_size() or check_color() or check_tone() or check_flavor() or None Demo: >>> x = [] or 0 or {} or -1 or None >>> x -1 >>> x = [] or 0 or {} or '' or None >>> x is None True [INST] Should Python import statements always be at the top of a module? PEP 08 states: Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants. However if the class/method/function that I am importing is only used in rare cases, surely it is more efficient to do the import when it is needed? Isn't this: class SomeClass(object): def not_often_called(self) from datetime import datetime self.datetime = datetime.now() more efficient than this? from datetime import datetime class SomeClass(object): def not_often_called(self) self.datetime = datetime.now() [/INST] Module importing is quite fast, but not instant. This means that: Putting the imports at the top of the module is fine, because it's a trivial cost that's only paid once. Putting the imports within a function will cause calls to that function to take longer. So if you care about efficiency, put the imports at the top. Only move them into a function if your profiling shows that would help (you did profile to see where best to improve performance, right??) The best reasons I've seen to perform lazy imports are: Optional library support. If your code has multiple paths that use different libraries, don't break if an optional library is not installed. In the __init__.py of a plugin, which might be imported but not actually used. Examples are Bazaar plugins, which use bzrlib's lazy-loading framework. [INST] Typical Angular.js workflow and project structure (with Python Flask) I am pretty new to this whole MV* client-side framework frenzy. It doesn't have to be Angular.js, but I picked it because it feels more natural to me than either Knockout, Ember or Backbone. Anyway what is the workflow like? Do people start with developing a client-side application in Angular.js and then hooking up the back-end to it? Or the other way around by first building the back-end in Django, Flask, Rails and then attaching an Angular.js app to it? Is there a "right" way of doing it, or is it just a personal preference in the end? I am also not sure whether to structure my project according to the Flask or Angular.js? community practices. For example, Flask's minitwit app is structured like so: minitwit |-- minitwit.py |-- static |-- css, js, images, etc... `-- templates |-- html files and base layout Angular.js tutorial app is structured like this: angular-phonecat |-- app `-- css `-- img `-- js `-- lib `-- partials `-- index.html |-- scripts `-- node.js server and test server files I could picture a Flask app by itself, and it's fairly easy to see Angular.js app like ToDo List by itself but when it comes to using both of these technologies I don't understand how they work together. It almost seems like I don't need a server-side web-framework when you already have Angular.js, a simple Python web server will suffice. In the Angular to-do app for example they use MongoLab to talk to the database using Restful API. There was no need having a web framework on the back-end. Maybe I am just awfully confused, and Angular.js is nothing more than a fancy jQuery library so I should use just like I would use jQuery in my Flask projects (assuming I change Angular's template syntax to something that doesn't conflict with Jinja2). I hope my questions make some sense. I mainly work on the back-end and this client-side framework is an unknown territory for me. [/INST] I would start out by organizing the Flask app in the standard structure as follows: app |-- app.py |-- static |-- css |-- img |-- js |-- templates And as btford mentioned, if you are doing an Angular app, you'll want to focus on using Angular client-side templates and stay away from server-side templates. Using render_template('index.html') will cause Flask to interpret your angular templates as jinja templates, so they won't render correctly. Instead, you'll want to do the following: @app.route("/") def index(): return send_file('templates/index.html') Note that using send_file() means that the files will be cached, so you might want to use make_response() instead, at least for development: return make_response(open('templates/index.html').read()) Afterwards, build out the AngularJS part of your app, modifying the app structure so that it looks like this: app |-- app.py |-- static |-- css |-- img |-- js |-- app.js, controllers.js, etc. |-- lib |-- angular |-- angular.js, etc. |-- partials |-- templates |-- index.html Make sure your index.html includes AngularJS, as well as any other files: At this point, you haven't yet constructed your RESTful API, so you can have your js controllers return predefined sample data (only a temporary setup). When you're ready, implement the RESTful API and hook it up to your angular app with angular-resource.js. EDIT: I put together an app template that, though a little more complex that what I've described above, illustrates how one could build an app with AngularJS + Flask, complete with communication between AngularJS and a simple Flask API. Here it is if you want to check it out: https://github.com/rxl/angular-flask [INST] What does the at (@) symbol do in Python I'm looking at some Python code which used the @ symbol, but I have no idea what it does. I also do not know what to search for as searching python docs or Google does not return relevant results when the @ symbol is included. [/INST] Preamble I admit it took more than a few moments to fully grasp this concept for me, so I'll share what I've learned to save others the trouble. The name decorator - the thing we define using the @ syntax before a function definition - was probably the main culprit here. Example class Pizza(object): def __init__(self): self.toppings = [] def __call__(self, topping): # when using '@instance_of_pizza' before a function def # the function gets passed onto 'topping' self.toppings.append(topping()) def __repr__(self): return str(self.toppings) pizza = Pizza() @pizza def cheese(): return 'cheese' @pizza def sauce(): return 'sauce' print pizza # ['cheese', 'sauce'] What this shows is that the function/method/class you're defining after a decorator is just basically passed on as an argument to the function/method immediatelly after the @ sign. First sighting The microframework Flask introduces decorators from the very beginning in the following format: from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" This in turn translates to: rule = "/" view_func = hello # they go as arguments here in 'flask/app.py' def add_url_rule(self, rule, endpoint=None, view_func=None, **options): pass Realizing this finally allowed me to feel at peace with flask. [INST] How to avoid .pyc files? Can I run the python interpreter without generating the compiled .pyc files? [/INST] From "What’s New in Python 2.6 - Interpreter Changes": Python can now be prevented from writing .pyc or .pyo files by supplying the -B switch to the Python interpreter, or by setting the PYTHONDONTWRITEBYTECODE environment variable before running the interpreter. This setting is available to Python programs as the sys.dont_write_bytecode variable, and Python code can change the value to modify the interpreter’s behaviour. Update 2010-11-27: Python 3.2 addresses the issue of cluttering source folders with .pyc files by introducing a special __pycache__ subfolder, see What's New in Python 3.2 - PYC Repository Directories. [INST] How can I parse a YAML file in Python How can I parse a YAML file in Python? [/INST] The easiest and pureist method without relying on C headers is PyYaml: #!/usr/bin/env python import yaml with open("example.yaml", 'r') as stream: try: print(yaml.load(stream)) except yaml.YAMLError as exc: print(exc) Err.. that's it... how many lines of code would that take me in Java... any ideas? : ) more info here: http://pyyaml.org/wiki/PyYAMLDocumentation [INST] How do I fix 'ImportError: cannot import name IncompleteRead'? When I try to install anything with pip or pip3, I get: $ sudo pip3 install python3-tk Traceback (most recent call last): File "/usr/bin/pip3", line 9, in load_entry_point('pip==1.5.6', 'console_scripts', 'pip3')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 356, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2476, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2190, in load ['__name__']) File "/usr/lib/python3/dist-packages/pip/__init__.py", line 61, in from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/usr/lib/python3/dist-packages/pip/vcs/mercurial.py", line 9, in from pip.download import path_to_url File "/usr/lib/python3/dist-packages/pip/download.py", line 25, in from requests.compat import IncompleteRead ImportError: cannot import name 'IncompleteRead' I have a Ubuntu 14.10 system. How can I fix this problem? [/INST] While this previous answer might be the reason, this snipped worked for me as a solution (in Ubuntu 14.04): First remove the package from the package manager: # apt-get remove python-pip And then install the latest version by side: # easy_install pip (thanks to @Aufziehvogel, @JunchaoGu) [INST] Why do some functions have underscores "__" before and after the function name? This seems to occur a lot, and was wondering if this was a requirement in the Python language, or merely a matter of convention? Also, could someone name and explain which functions tend to have the underscores, and why (__init__, for instance)? [/INST] From the Python PEP 8 -- Style Guide for Python Code (http://www.python.org/dev/peps/pep-0008/): the following special forms using leading or trailing underscores are recognized (these can generally be combined with any case convention): _single_leading_underscore: weak "internal use" indicator. E.g. "from M import *" does not import objects whose name starts with an underscore. single_trailing_underscore_: used by convention to avoid conflicts with Python keyword, e.g. Tkinter.Toplevel(master, class_='ClassName') __double_leading_underscore: when naming a class attribute, invokes name mangling (inside class FooBar, __boo becomes _FooBar__boo; see below). __double_leading_and_trailing_underscore__: "magic" objects or attributes that live in user-controlled namespaces. E.g. __init__, __import__ or __file__. Never invent such names; only use them as documented. Note that names with double leading and trailing underscores are essentially reserved for Python itself: "Never invent such names; only use them as documented". [INST] Adding new column to existing DataFrame in Python pandas I have a DataFrame with named columns and rows indexed with not- continuous numbers like from the code: df1 = DataFrame(np.random.randn(10, 4), columns=['a', 'b', 'c', 'd']) mask = df1.applymap(lambda x: x <-0.7) df1 = df1[-mask.any(axis=1)] sLength = len(df1['a']) e = Series(np.random.randn(sLength)) I would like to add a new column, 'e', to the existing data frame and do not change anything in the data frame. (The series always got the same length as a dataframe.) I tried different versions of join, append, merge, but I did not get it as what I want, only errors at the most. The series and data frame is already given and the above code is only to illustrate it with an example. I am sure there is some easy way to that, but I can't figure it out. [/INST] Use the original df1 indexes to create the series: df1['e'] = Series(np.random.randn(sLength), index=df1.index) Edit 2015 Some reported to get the SettingWithCopyWarning with this code. However, the code still runs perfect with the current pandas version 0.16.1. >>> sLength = len(df1['a']) >>> df1 a b c d 6 -0.269221 -0.026476 0.997517 1.294385 8 0.917438 0.847941 0.034235 -0.448948 >>> df1['e'] = p.Series(np.random.randn(sLength), index=df1.index) >>> df1 a b c d e 6 -0.269221 -0.026476 0.997517 1.294385 1.757167 8 0.917438 0.847941 0.034235 -0.448948 2.228131 >>> p.version.short_version '0.16.1' The SettingWithCopyWarning aims to inform of a possibly invalid assignment on a copy of the Dataframe. It doesn't necessarily say you did it wrong (it can trigger false positives) but from 0.13.0 it let you know there are more adequate methods for the same purpose. Then, if you get the warning, just follow its advise: Try using .loc[row_index,col_indexer] = value instead >>> df1.loc[:,'f'] = p.Series(np.random.randn(sLength), index=df1.index) >>> df1 a b c d e f 6 -0.269221 -0.026476 0.997517 1.294385 1.757167 -0.050927 8 0.917438 0.847941 0.034235 -0.448948 2.228131 0.006109 >>> In fact, this is currently the more efficient method as described in pandas docs [INST] How do I execute a program from python? os.system fails due to spaces in path I have a python script that needs to execute an external program, but for some reason fails. If I have the following script: import os; os.system("C:\\Temp\\a b c\\Notepad.exe"); raw_input(); Then it fails with the following error: 'C:\Temp\a' is not recognized as an internal or external command, operable program or batch file. If I escape the program with quotes: import os; os.system('"C:\\Temp\\a b c\\Notepad.exe"'); raw_input(); Then it works. However, if I add a parameter, it stops working again: import os; os.system('"C:\\Temp\\a b c\\Notepad.exe" "C:\\test.txt"'); raw_input(); What is the right way to execute a program and wait for it to complete? I do not need to read output from it, as it is a visual program that does a job and then just exits, but I need to wait for it to complete. Also note, moving the program to a non-spaced path is not an option either. Edit This does not work either: import os; os.system("'C:\\Temp\\a b c\\Notepad.exe'"); raw_input(); Note the swapped single/double quotes. with or without a parameter to notepad here, it fails with the error message The filename, directory name, or volume label syntax is incorrect. [/INST] subprocess.call will avoid problems with having to deal with quoting conventions of various shells. It accepts a list, rather than a string, so arguments are more easily delimited. i.e. import subprocess subprocess.call(['C:\\Temp\\a b c\\Notepad.exe', 'C:\\test.txt']) [INST] Can I use Python as a Bash replacement? I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl. I've seen mentioned a few places that python is good for this kind of thing, I know a little and I would like to know more. Is Python a good choice for this, and is there a good book or guide to learning how to use Python to replace shell scripting, AWK, sed and friends? [/INST] Any shell has several sets of features. The Essential Linux/Unix commands. All of these are available through the subprocess library. This isn't always the best first choice for doing all external commands. Look also at shutil for some commands that are separate Linux commands, but you could probably implement directly in your Python scripts. Another huge batch of Linux commands are in the os library; you can do these more simply in Python. And -- bonus! -- more quickly. Each separate Linux command in the shell (with a few exceptions) forks a subprocess. By using Python shutil and os modules, you don't fork a subprocess. The shell environment features. This includes stuff that sets a command's environment (current directory and environment variables and what-not). You can easily manage this from Python directly. The shell programming features. This is all the process status code checking, the various logic commands (if, while, for, etc.) the test command and all of it's relatives. The function definition stuff. This is all much, much easier in Python. This is one of the huge victories in getting rid of bash and doing it in Python. Interaction features. This includes command history and what-not. You don't need this for writing shell scripts. This is only for human interaction, and not for script-writing. The shell file management features. This includes redirection and pipelines. This is trickier. Much of this can be done with subprocess. But some things that are easy in the shell are unpleasant in Python. Specifically stuff like (a | b; c ) | something >result. This runs two processes in parallel (with output of a as input to b), followed by a third process. The output from that sequence is run in parallel with something and the output is collected into a file named result. That's just complex to express in any other language. Specific programs (awk, sed, grep, etc.) can often be rewritten as Python modules. Don't go overboard. Replace what you need and evolve your "grep" module. Don't start out writing a Python module that replaces "grep". The best thing is that you can do this in steps. Replace AWK and PERL with Python. Leave everything else alone. Look at replacing GREP with Python. This can be a bit more complex, but your version of GREP can be tailored to your processing needs. Look at replacing FIND with Python loops that use os.walk. This is a big win because you don't spawn as many processes. Look at replacing common shell logic (loops, decisions, etc.) with Python scripts. [INST] What do the python file extensions, .pyc .pyd .pyo stand for? What do these python file extensions mean? .pyc .pyd .pyo What are the differences between them and how are they generated from a *.py file? [/INST] .py: This is normally the input source code that you've written. .pyc: This is the compiled bytecode. If you import a module, python will build a *.pyc file that contains the bytecode to make importing it again later easier (and faster). .pyo: This is a *.pyc file that was created while optimizations (-O) was on. .pyd: This is basically a windows dll file. http://docs.python.org/faq/windows.html#is-a-pyd-file-the-same-as-a-dll Also for some further discussion on .pyc vs .pyo, take a look at: http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html (I've copied the important part below) When the Python interpreter is invoked with the -O flag, optimized code is generated and stored in ‘.pyo’ files. The optimizer currently doesn't help much; it only removes assert statements. When -O is used, all bytecode is optimized; .pyc files are ignored and .py files are compiled to optimized bytecode. Passing two -O flags to the Python interpreter (-OO) will cause the bytecode compiler to perform optimizations that could in some rare cases result in malfunctioning programs. Currently only __doc__ strings are removed from the bytecode, resulting in more compact ‘.pyo’ files. Since some programs may rely on having these available, you should only use this option if you know what you're doing. A program doesn't run any faster when it is read from a ‘.pyc’ or ‘.pyo’ file than when it is read from a ‘.py’ file; the only thing that's faster about ‘.pyc’ or ‘.pyo’ files is the speed with which they are loaded. When a script is run by giving its name on the command line, the bytecode for the script is never written to a ‘.pyc’ or ‘.pyo’ file. Thus, the startup time of a script may be reduced by moving most of its code to a module and having a small bootstrap script that imports that module. It is also possible to name a ‘.pyc’ or ‘.pyo’ file directly on the command line. [INST] Tabs versus spaces in Python programming I have always used tabs for indentation when I do Python programming. But then I came across a question here on SO where someone pointed out that most Python programmers use spaces instead of tabs to minimize editor-to-editor mistakes. How does that make a difference? Are there other reasons why one would use spaces instead of tabs for Python? Or is it simply not true? Should I switch my editor to insert spaces instead of tabs right away or keep on going like I used to? [/INST] Tired of chasing after indentation typos ( 8 spaces ? no, 7 oops 9 ... ) I switched my sources to 'tabs only'. 1 tab == 1 indent level, full stop The point is: if you want to display the indentation as 4, 8 or pi / 12 character width, just change the settings in your text editor, don't mess with the code :p (personally I use 4 char width tab... but some would prefer 3 or 8 space, or even use variable width fonts !!) [INST] What is a monkey patch? I am trying to understand, what is a monkey patch? Is that something like methods/operators overloading or delegating? Does it have anything common with these things? [/INST] No, it's not like any of those things. It's simply the dynamic replacement of attributes at runtime. For instance, consider a class that has a method get_data. This method does an external lookup (on a database or web API, for example), and various other methods in the class call it. However, in a unit test, you don't want to depend on the external data source - so you dynamically replace the get_data method with a stub that returns some fixed data. Because Python classes are mutable, and methods are just attributes of the class, you can do this as much as you like - and, in fact, you can even replace classes and functions in a module in exactly the same way. 9u[INST] C-like structures in Python Is there a way to conveniently define a C-like structure in Python? I'm tired of writing stuff like: class MyStruct(): def __init__(self, field1, field2, field3): self.field1 = field1 self.field2 = field2 self.field3 = field3 [/INST] Use a named tuple, which was added to the collections module in the standard library in Python 2.6. It's also possible to use Raymond Hettinger's named tuple recipe if you need to support Python 2.4. It's nice for your basic example, but also covers a bunch of edge cases you might run into later as well. Your fragment above would be written as: from collections import namedtuple MyStruct = namedtuple("MyStruct", "field1 field2 field3") The newly created type can be used like this: m = MyStruct("foo", "bar", "baz") Or you can use named arguments: m = MyStruct(field1 = "foo", field2 = "bar", field3 = "baz") [INST] Difference between __getattr__ vs __getattribute__ I am trying to understand when to use __getattr__ or __getattribute__. The documentation mentions __getattribute__ applies to new-style classes. What are new-style classes? [/INST] A key difference between __getattr__ and __getattribute__ is that __getattr__ is only invoked if the attribute wasn't found the usual ways. It's good for implementing a fallback for missing attributes, and is probably the one of two you want. __getattribute__ is invoked before looking at the actual attributes on the object, and so can be tricky to implement correctly. You can end up in infinite recursions very easily. New-style classes derive from object, old-style classes are those in Python 2.x with no explicit base class. But the distinction between old-style and new-style classes is not the important one when choosing between __getattr__ and __getattribute__. You almost certainly want __getattr__. [INST] Python: Find in list I have come across this delightful: item = someSortOfSelection() if item in myList: doMySpecialFunction(item) but sometimes it does not work with all my items, as if they weren't recognized in the list (when it's a list of string). is it the most 'pythonic' way of finding an item in a list: if x in l:? [/INST] As for your first question: that code is perfectly fine and should work if item equals one of the elements inside myList. Maybe you try to find a string that does not exactly match one of the items or maybe you are using a float value which suffers from inaccuracy. As for your second question: There's actually several possible ways if "finding" things in lists. Checking if something is inside This is the use case you describe: Checking whether something is inside a list or not. As you know, you can use the in operator for that: 3 in [1, 2, 3] # => True Filtering a collection That is, finding all elements in a sequence that meet a certain condition. You can use list comprehension or generator expressions for that: matches = [x for x in lst if fulfills_some_condition(x)] matches = (x for x in lst if x > 6) The latter will return a generator which you can imagine as a sort of lazy list that will only be built as soon as you iterate through it. By the way, the first one is exactly equivalent to matches = filter(fulfills_some_condition, lst) in Python 2. Here you can see higher-order functions at work. In Python 3, filter doesn't return a list, but a generator-like object. Finding the first occurrence If you only want the first thing that matches a condition (but you don't know what it is yet), it's fine to use a for loop (possibly using the else clause as well, which is not really well-known). You can also use next(x for x in lst if ...) which will return the first match or raise a StopIteration if none is found. Alternatively, you can use next((x for x in lst if ...), [default value]) Finding the location of an item For lists, there's also the index method that can sometimes be useful if you want to know where a certain element is in the list: [1,2,3].index(2) # => 1 [1,2,3].index(4) # => ValueError However, note that if you have duplicates, .index always returns the lowest index: [1,2,3,2].index(2) # => 1 If there are duplicates and you want all the indexes then you can use enumerate() instead: [i for i,x in enumerate([1,2,3,2]) if x==2] # => [1, 3] [INST] Chain-calling parent constructors in python Consider this - a base class A, class B inheriting from A, class C inheriting from B. What is a generic way to call a parent class constructor in a constructor? If this still sounds too vague, here's some code. class A(object): def __init__(self): print "Constructor A was called" class B(A): def __init__(self): super(B,self).__init__() print "Constructor B was called" class C(B): def __init__(self): super(C,self).__init__() print "Constructor C was called" c = C() This is how I do it now. But it still seems a bit too non-generic - you still must pass a correct type by hand. Now, I've tried using self.__class__ as a first argument to super(), but, obviously it doesn't work - if you put it in the constructor for C - fair enough, B's constructor gets called. If you do the same in B, "self" still points to an instance of C so you end up calling B's constructor again (this ends in an infinite recursion). There is no need to think about diamond inheritance for now, I am just interested in solving this specific problem. [/INST] The way you are doing it is indeed the recommended one (for Python 2.x). The issue of whether the class is passed explicitly to super is a matter of style rather than functionality. Passing the class to super fits in with Python's philosophy of "explicit is better than implicit". [INST] How do I sort a list of strings in Python? What is the best way of creating an alphabetically sorted list in Python? [/INST] Basic answer: mylist = ["b", "C", "A"] mylist.sort() This modifies your original list (i.e. sorts in-place). To get a sorted copy of the list, without changing the original, use the sorted() function: for x in sorted(mylist): print x However, the examples above are a bit naive, because they don't take locale into account, and perform a case-sensitive sorting. You can take advantage of the optional parameter key to specify custom sorting order (the alternative, using cmp, is a deprecated solution, as it has to be evaluated multiple times - key is only computed once per element). So, to sort according to the current locale, taking language-specific rules into account (cmp_to_key is a helper function from functools): sorted(mylist, key=cmp_to_key(locale.strcoll)) And finally, if you need, you can specify a custom locale for sorting: import locale locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') # vary depending on your lang/locale assert sorted((u'Ab', u'ad', u'aa'), key=cmp_to_key(locale.strcoll)) == [u'aa', u'Ab', u'ad'] Last note: you will see examples of case-insensitive sorting which use the lower() method - those are incorrect, because they work only for the ASCII subset of characters. Those two are wrong for any non-English data: # this is incorrect! mylist.sort(key=lambda x: x.lower()) # alternative notation, a bit faster, but still wrong mylist.sort(key=str.lower) [INST] How to convert strings into integers in Python? I have a tuple of tuples from a MySQL query like this: T1 = (('13', '17', '18', '21', '32'), ('07', '11', '13', '14', '28'), ('01', '05', '06', '08', '15', '16')) I'd like to convert all the string elements into integers and put it back nicely to list of lists this time: T2 = [[13, 17, 18, 21, 32], [7, 11, 13, 14, 28], [1, 5, 6, 8, 15, 16]] I tried to achieve it with eval but didn't get any decent result yet. [/INST] int() is the Python standard built-in function to convert a string into an integer value. You call it with a string containing a number as the argument, and it returns the number converted to an actual integer: print int("1") + 1 The above prints 2. If you know the structure of your list (that it simply contains lists, only one level), you could do this: T2 = [map(int, x) for x in T1] [INST] Python "extend" for a dictionary Which is the best way to extend a dictionary with another one? For instance: >>> a = { "a" : 1, "b" : 2 } >>> b = { "c" : 3, "d" : 4 } >>> a {'a': 1, 'b': 2} >>> b {'c': 3, 'd': 4} I'm looking for any operation to obtain this avoiding for loop: { "a" : 1, "b" : 2, "c" : 3, "d" : 4 } I wish to do something like: a.extend(b) # This does not work [/INST] a.update(b) Python Standard Library Documentation [INST] No module named MySQLdb I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. Can anyone help me to solve this issue? I am using it in Vista. [/INST] You need to use one of the following commands. Which one depends on what OS and software you have and use. easy_install mysql-python (mix os) pip install mysql-python (mix os) apt-get install python-mysqldb (Linux Ubuntu, ...) cd /usr/ports/databases/py-MySQLdb && make install clean (FreeBSD) yum install MySQL-python (Linux Fedora, CentOS ...) For Windows, see this answer: Install mysql-python (Windows) [INST] Convert list to tuple in Python I'm trying to convert a list to a tuple. When I google it, I find a lot of answers similar to: l = [4,5,6] tuple(l) But if I do that I get this error message: TypeError: 'tuple' object is not callable How can I fix this problem? [/INST] It should work fine. Don't use tuple, list or other special names as a variable name. It's probably what's causing your problem. >>> l = [4,5,6] >>> tuple(l) (4, 5, 6) [INST] How to calculate the angle between a line and the horizontal axis? In a programming language (Python, C#, etc) I need to determine how to calculate the angle between a line and the horizontal axis? I think an image describes best what I want: Given (P1x,P1y) and (P2x,P2y) what is the best way to calculate this angle? The origin is in the topleft and only the positive quadrant is used. [/INST] First find the difference between the start point and the end point. deltaY = P2_y - P1_y deltaX = P2_x - P1_x Then calculate the angle. angleInDegrees = arctan(deltaY / deltaX) * 180 / PI If your language includes an atan2 function it becomes the following instead: angleInDegrees = atan2(deltaY, deltaX) * 180 / PI An implementation in Python using radians (provided by Eric Leschinski, who edited my answer): from math import * def angle_trunc(a): while a < 0.0: a += pi * 2 return a def getAngleBetweenPoints(x_orig, y_orig, x_landmark, y_landmark): deltaY = y_landmark - y_orig deltaX = x_landmark - x_orig return angle_trunc(atan2(deltaY, deltaX)) angle = getAngleBetweenPoints(5, 2, 1,4) assert angle >= 0, "angle must be >= 0" angle = getAngleBetweenPoints(1, 1, 2, 1) assert angle == 0, "expecting angle to be 0" angle = getAngleBetweenPoints(2, 1, 1, 1) assert abs(pi - angle) <= 0.01, "expecting angle to be pi, it is: " + str(angle) angle = getAngleBetweenPoints(2, 1, 2, 3) assert abs(angle - pi/2) <= 0.01, "expecting angle to be pi/2, it is: " + str(angle) angle = getAngleBetweenPoints(2, 1, 2, 0) assert abs(angle - (pi+pi/2)) <= 0.01, "expecting angle to be pi+pi/2, it is: " + str(angle) angle = getAngleBetweenPoints(1, 1, 2, 2) assert abs(angle - (pi/4)) <= 0.01, "expecting angle to be pi/4, it is: " + str(angle) angle = getAngleBetweenPoints(-1, -1, -2, -2) assert abs(angle - (pi+pi/4)) <= 0.01, "expecting angle to be pi+pi/4, it is: " + str(angle) angle = getAngleBetweenPoints(-1, -1, -1, 2) assert abs(angle - (pi/2)) <= 0.01, "expecting angle to be pi/2, it is: " + str(angle) All tests pass. See https://en.wikipedia.org/wiki/Unit_circle [INST] Generator Expressions vs. List Comprehension When should you use generator expressions and when should you use list comprehensions in Python? # Generator expression (x*2 for x in range(256)) # List comprehension [x*2 for x in range(256)] [/INST] John's answer is good (that list comprehensions are better when you want to iterate over something multiple times). However, it's also worth noting that you should use a list if you want to use any of the list methods. For example, the following code won't work: def gen(): return (something for something in get_some_stuff()) print gen()[:2] # generators don't support indexing or slicing print [5,6] + gen() # generators can't be added to lists Basically, use a generator expression if all you're doing is iterating once. If you want to store and use the generated results, then you're probably better off with a list comprehension. Since performance is the most common reason to choose one over the other, my advice is to not worry about it and just pick one; if you find that your program is running too slowly, then and only then should you go back and worry about tuning your code. [INST] Cannot install Lxml on Mac os x 10.9 I want to install Lxml so I can then install Scrapy. When I updated my Mac today it wouldn't let me reinstall lxml, I get the following error: In file included from src/lxml/lxml.etree.c:314: /private/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found #include "libxml/xmlversion.h" ^ 1 error generated. error: command 'cc' failed with exit status 1 I have tried using brew to install libxml2 and libxslt, both installed fine but I still cannot install lxml. Last time I was installing I needed to enable the developer tools on Xcode but since its updated to Xcode 5 it doesnt give me that option anymore. Does anyone know what I need to do? [/INST] You should install or upgrade the commandline tool for xcode. Try this in a terminal: xcode-select --install [INST] What's the difference between a Python module and a Python package? What's the difference between a Python module and a Python package? See also: What's the difference between "package" and "module" (for other languages) [/INST] Any Python file is a module, its name being the file's base name without the .py extension. A package is a collection of Python modules: while a module is a single Python file, a package is a directory of Python modules containing an additional __init__.py file, to distinguish a package from a directory that just happens to contain a bunch of Python scripts. Packages can be nested to any depth, provided that the corresponding directories contain their own __init__.py file. The distinction between module and package seems to hold just at the file system level. When you import a module or a package, the corresponding object created by Python is always of type module. Note, however, when you import a package, only variables/functions/classes in the __init__.py file of that package are directly visible, not sub-packages or modules. As an example, consider the xml package in the Python standard library: its xml directory contains an __init__.py file and four sub-directories; the sub-directory etree contains an __init__.py file and, among others, an ElementTree.py file. See what happens when you try to interactively import package/modules: >>> import xml >>> type(xml) >>> xml.etree.ElementTree Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'etree' >>> import xml.etree >>> type(xml.etree) >>> xml.etree.ElementTree Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'ElementTree' >>> import xml.etree.ElementTree >>> type(xml.etree.ElementTree) >>> xml.etree.ElementTree.parse In Python there also are built-in modules, such as sys, that are written in C, but I don't think you meant to consider those in your question. [INST] Python, extract file name from path, no matter what the os/path format Which Python library can I use to extract filenames from paths, no matter what the operating system or path format could be? For example, I'd like all of these paths to return me c: a/b/c/ a/b/c \a\b\c \a\b\c\ a\b\c a/b/../../a/b/c/ a/b/../../a/b/c [/INST] Actually, there's a function that returns exactly what you want print os.path.basename(your_path) [INST] Writing a list to a file with Python Is this the cleanest way to write a list to a file, since writelines() doesn't insert newline characters? file.writelines(["%s\n" % item for item in list]) It seems like there would be a standard way... [/INST] EDIT Adding info from Thomas' comment Don't forget to open the file first thefile = open('test.txt', 'w') I'd use a loop: for item in thelist: thefile.write("%s\n" % item) or: for item in thelist: print>>thefile, item If you're keen on a single function call, at least remove the square brackets [] so that the strings to be printed get made one at a time (a genexp rather than a listcomp) -- no reason to take up all the memory required to materialize the whole list of strings. [INST] Python Print String To Text File I'm using Python to open a text document: text_file = open("Output.txt", "w") text_file.write("Purchase Amount: " 'TotalAmount') text_file.close() I want to enter the string called "TotalAmount" into the text document. Can someone please let me know how to do this? [/INST] text_file = open("Output.txt", "w") text_file.write("Purchase Amount: %s" % TotalAmount) text_file.close() If you use a context manager, the file is closed automatically for you with open("Output.txt", "w") as text_file: text_file.write("Purchase Amount: %s" % TotalAmount) If you're using Python2.6 or higher, it's preferred to use str.format() with open("Output.txt", "w") as text_file: text_file.write("Purchase Amount: {0}".format(TotalAmount)) For python2.7 and higher you can use {} instead of {0} In Python3, there is an optional file parameter to the print function with open("Output.txt", "w") as text_file: print("Purchase Amount: {}".format(TotalAmount), file=text_file) [INST] How to overcome "datetime.datetime not JSON serializable" in python? I have a basic dict as follows: sample = {} sample['title'] = "String" sample['somedate'] = somedatetimehere When I try to do jsonify(sample) I get: TypeError: datetime.datetime(2012, 8, 8, 21, 46, 24, 862000) is not JSON serializable What can I do such that my dictionary sample can overcome the error above? Note: Though it may not be relevant, the dictionaries are generated from the retrieval of records out of mongodb where when I print out str(sample['somedate']), the output is 2012-08-08 21:46:24.862000. [/INST] Building on other answers, a simple solution based on a specific serializer that just converts datetime.datetime objects to strings. from datetime import datetime def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, datetime): serial = obj.isoformat() return serial raise TypeError ("Type not serializable") As seen, the code just checks to find out if object is of class datetime.datetime, and then uses .isoformat() to produce a serialized version of it, according to ISO 8601 format, YYYY-MM-DDTHH:MM:SS (which is easily decoded by JavaScript). If more complex serialized representations are sought, other code could be used instead of str() (see other answers to this question for examples). The code ends by raising an exception, to deal with the case it is called with a non-serializable type which is not datetime. This json_serial function can be used as follows: from datetime import datetime from json import dumps print dumps(datetime.now(), default=json_serial) The details about how the default parameter to json.dumps works can be found in Section Basic Usage of the json module documentation. [INST] What is memoization and how can I use it in Python? I just started Python and I've got no idea what memoization is and how to use it. Also, may I have a simplified example? [/INST] Memoization effectively refers to remembering ("memoization" -> "memorandum" -> to be remembered) results of method calls based on the method inputs and then returning the remembered result rather than computing the result again. You can think of it as a cache for method results. For further details, see page 387 for the definition in Introduction To Algorithms (3e), Cormen et al. A simple example for computing factorials using memoization in Python would be something like this: factorial_memo = {} def factorial(k): if k < 2: return 1 if k not in factorial_memo: factorial_memo[k] = k * factorial(k-1) return factorial_memo[k] You can get more complicated and encapsulate the memoization process into a class class Memoize: def __init__(self, f): self.f = f self.memo = {} def __call__(self, *args): if not args in self.memo: self.memo[args] = self.f(*args) return self.memo[args] Then: def factorial(k): if k < 2: return 1 return k * factorial(k - 1) factorial = Memoize(factorial) [INST] Remove specific characters from a string in python I'm trying to remove specific characters from a string using python. This is the code I'm using right now. Unfortunately it appears to do nothing to the string. for char in line: if char in " ?.!/;:": line.replace(char,'') How do I do this properly? [/INST] Strings in Python are immutable (can't be changed). Because of this, the effect of line.replace(...) is just to create a new string, rather than changing the old one. You need to rebind (assign) it to line in order to have that variable take the new value, with those characters removed. Also, the way you are doing it is going to be kind of slow, relatively. It's also likely to be a bit confusing to experienced pythonators, who will see a doubly-nested structure and think for a moment that something more complicated is going on. Starting in Python 2.6 and newer Python 2.x versions *, you can instead use str.translate, (but read on for Python 3 differences): line = line.translate(None, '!@#$') or regular expression replacement with re.sub import re line = re.sub('[!@#$]', '', line) The characters enclosed in brackets constitute a character class. Any characters in line which are in that class are replaced with the second parameter to sub: an empty string. In Python 3, strings are Unicode. You'll have to translate a little differently. kevpie mentions this in a comment on one of the answers, and it's noted in the documentation for str.translate. When calling the translate method of a Unicode string, you cannot pass the second parameter that we used above. You also can't pass None as the first parameter, or even a translation table from string.maketrans. Instead, you pass a dictionary as the only parameter. This dictionary maps the ordinal values of characters (i.e. the result of calling ord on them) to the ordinal values of the characters which should replace them, or—usefully to us—None to indicate that they should be deleted. So to do the above dance with a Unicode string you would call something like translation_table = dict.fromkeys(map(ord, '!@#$'), None) unicode_line = unicode_line.translate(translation_table) Here dict.fromkeys and map are used to succinctly generate a dictionary containing {ord('!'): None, ord('@'): None, ...} Even simpler, as another answer puts it, create the dictionary in place: unicode_line = unicode_line.translate({ord(c): None for c in '!@#$'}) * for compatibility with earlier Pythons, you can create a "null" translation table to pass in place of None: import string line = line.translate(string.maketrans('', ''), '!@#$') Here string.maketrans is used to create a translation table, which is just a string containing the characters with ordinal values 0 to 255. [INST] How to empty a list in Python? It seems so "dirty" emptying a list in this way: while len(alist) > 0 : alist.pop() Does a clear way exist to do that? [/INST] This actually removes the contents from the list, not replaces the old label with a new empty list del lst[:] example: lst1 = [1, 2, 3] lst2 = lst1 del lst1[:] print(lst2) For the sake of completeness, slice assignment achieves the same effect: lst[:] = [] and can be used to shrink a part of the list while replacing a part at the same time (but is out of scope of the question). Note that doing lst = [] does not empty the list, just creates a new object and binds it to the variable lst, but the old list will still have the same elements, and effect will be apparent if it had other variable bindings. [INST] Why isn't Python very good for functional programming? I have always thought that functional programming can be done in Python. Thus, I was surprised that Python didn't get much of a mention in this question, and when it was mentioned, it normally wasn't very positive. However, not many reasons were given for this (lack of pattern matching and algebraic data types were mentioned). So my question is: why isn't Python very good for functional programming? Are there more reasons than its lack of pattern matching and algebraic data types? Or are these concepts so important to functional programming that a language that doesn't support them can only be classed as a second rate functional programming language? (Keep in mind that my experience with functional programming is quite limited.) [/INST] The question you reference asks which languages promote both OO and functional programming. Python does not promote functional programming even though it works fairly well. The best argument against functional programming in Python is that imperative/OO use cases are carefully considered by Guido, while functional programming use cases are not. When I write imperative Python, it's one of the prettiest languages I know. When I write functional Python, it becomes as ugly and unpleasant as your average language that doesn't have a BDFL. Which is not to say that it's bad, just that you have to work harder than you would if you switched to a language that promotes functional programming or switched to writing OO Python. Here are the functional things I miss in Python: Pattern matching Tail recursion Large library of list functions Functional dictionary class Automatic currying Concise way to compose functions Lazy lists Simple, powerful expression syntax (Python's simple block syntax prevents Guido from adding it) No pattern matching and no tail recursion mean your basic algorithms have to be written imperatively. Recursion is ugly and slow in Python. A small list library and no functional dictionaries mean that you have to write a lot of stuff yourself. No syntax for currying or composition means that point-free style is about as full of punctuation as explicitly passing arguments. Iterators instead of lazy lists means that you have to know whether you want efficiency or persistence, and to scatter calls to list around if you want persistence. (Iterators are use-once) Python's simple imperative syntax, along with its simple LL1 parser, mean that a better syntax for if-expressions and lambda-expressions is basically impossible. Guido likes it this way, and I think he's right. [INST] How to make a Python script standalone executable to run without ANY dependency? I'm building a Python application and don't want to force my clients to install Python and modules. I also want to make my application closed-source. So, is there a way to compile Python scripts to standalone executables? [/INST] You can use py2exe as already answered and use cython to convert your key .py files in .pyc, C compiled files, like .dll in Windows and .so in linux, much harder to revert than common .pyo and .pyc files (and also gain in performance!) [INST] What's the proper way to install pip, virtualenv, and distribute for Python? Short Question What is the proper way to install pip, virtualenv, and distribute? Background In my answer to SO question 4314376, I recommended using ez_setup so that you could then install pip and virtualenv as follows: curl -O http://peak.telecommunity.com/dist/ez_setup.py sudo python ez_setup.py sudo easy_install pip sudo pip install virtualenv I originally pulled these instructions from Jesse Noller's blog post So you want to use Python on the Mac?. I like the idea of keeping a clean global site-packages directory, so the only other packages I install there are virtualenvwrapper and distribute. (I recently added distribute to my toolbox because of this Python public service announcement. To install these two packages, I used: sudo pip install virtualenvwrapper curl -O http://python-distribute.org/distribute_setup.py sudo python distribute_setup.py No more setuptools and easy_install To really follow that Python public service announcement, on a fresh Python install, I would do the following: curl -O http://python-distribute.org/distribute_setup.py sudo python distribute_setup.py sudo easy_install pip sudo pip install virtualenv sudo pip install virtualenvwrapper Glyph's Rebuke In a comment to my answer to SO question 4314376, SO user Glyph stated: NO. NEVER EVER do sudo python setup.py install whatever. Write a ~/.pydistutils.cfg that puts your pip installation into ~/.local or something. Especially files named ez_setup.py tend to suck down newer versions of things like setuptools and easy_install, which can potentially break other things on your operating system. Back to the short question So Glyph's response leads me to my original question: What is the proper way to install pip, virtualenv, and distribute? [/INST] You can do this without installing anything into python itself. You don't need sudo or any privileges. You don't need to edit any files. Install virtualenv into a bootstrap virtual environment. Use the that virtual environment to create more. Since virtualenv ships with pip and distribute, you get everything from one install. Download virtualenv: http://pypi.python.org/pypi/virtualenv https://pypi.python.org/packages/source/v/virtualenv/virtualenv-12.0.7.tar.gz (or whatever is the latest version!) Unpack the source tarball Use the unpacked tarball to create a clean virtual environment. This virtual environment will be used to "bootstrap" others. All of your virtual environments will automatically contain pip and distribute. Using pip, install virtualenv into that bootstrap environment. Use that bootstrap environment to create more! Here is an example in bash: # Select current version of virtualenv: VERSION=12.0.7 # Name your first "bootstrap" environment: INITIAL_ENV=bootstrap # Set to whatever python interpreter you want for your first environment: PYTHON=$(which python) URL_BASE=https://pypi.python.org/packages/source/v/virtualenv # --- Real work starts here --- curl -O $URL_BASE/virtualenv-$VERSION.tar.gz tar xzf virtualenv-$VERSION.tar.gz # Create the first "bootstrap" environment. $PYTHON virtualenv-$VERSION/virtualenv.py $INITIAL_ENV # Don't need this anymore. rm -rf virtualenv-$VERSION # Install virtualenv into the environment. $INITIAL_ENV/bin/pip install virtualenv-$VERSION.tar.gz Now you can use your "bootstrap" environment to create more: # Create a second environment from the first: $INITIAL_ENV/bin/virtualenv py-env1 # Create more: $INITIAL_ENV/bin/virtualenv py-env2 Go nuts! Note This assumes you are not using a really old version of virtualenv. Old versions required the flags --no-site-packges (and depending on the version of Python, --distribute). Now you can create your bootstrap environment with just python virtualenv.py path-to-bootstrap or python3 virtualenv.py path-to-bootstrap. [INST] Split string into a list in Python I want my python function to split a sentence (input) and store each word in a list. The code that I've written so far splits the sentence, but does not store the words as a list. How do I do that? def split_line(text): # split the text words = text.split() # for each word in the line: for word in words: # print the word print(word) [/INST] Splits the string in text on delimiter: " ". words = text.split() Split the string in text on delimiter: ",". words = text.split(",") The words variable will be a list datatype and contain a list of words from text split on the delimiter. [INST] Does Python's time.time() return the local or UTC timestamp? Does time.time() in the Python time module return the system's time or the time in UTC? [/INST] The time.time() function returns the number of seconds since the epoch as seconds in UTC. Here is some sample output I ran on my computer, converting it to a string as well. Python 2.7.3 (default, Apr 24 2012, 00:00:54) [GCC 4.7.0 20120414 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> ts = time.time() >>> print ts 1355563265.81 >>> import datetime >>> st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S') >>> print st 2012-12-15 01:21:05 >>> The ts variable is the time returned in seconds. I then converted it to a string using the datetime library making it a string that is human readable. �n[INST] What is the python "with" statement designed for? I came across the Python with statement for the first time today. I've been using Python lightly for several months and didn't even know of its existence! Given its somewhat obscure status, I thought it would be worth asking: What is the Python with statement designed to be used for? What do you use it for? Are their any gotchas I need to be aware of, or common anti-patterns associated with its use? Any cases where it is better use try..finally than with? Why isn't it used more widely? Which standard library classes are compatible with it? [/INST] I believe this has already been answered by other users before me, so I only add it for the sake of completeness: the with statement simplifies exception handling by encapsulating common preparation and cleanup tasks in so-called context managers. More details can be found in PEP 343. For instance, the open statement is a context manager in itself, which lets you open a file, keep it open as long as the execution is in the context of the with statement where you used it, and close it as soon as you leave the context, no matter whether you have left it because of an exception or during regular control flow. The with statement can thus be used in ways similar to the RAII pattern in C++: some resource is acquired by the with statement and released when you leave the with context. Some examples are: opening files using with open(filename) as fp:, acquiring locks using with lock: (where lock is an instance of threading.Lock). You can also construct your own context managers using the contextmanager decorator from contextlib. For instance, I often use this when I have to change the current directory temporarily and then return to where I was: from contextlib import contextmanager import os @contextmanager def working_directory(path): current_dir = os.getcwd() os.chdir(path) try: yield finally: os.chdir(current_dir) with working_directory("data/stuff"): # do something within data/stuff # here I am back again in the original working directory Here's another example that temporarily redirects sys.stdin, sys.stdout and sys.stderr to some other file handle and restores them later: from contextlib import contextmanager import sys @contextmanager def redirected(**kwds): stream_names = ["stdin", "stdout", "stderr"] old_streams = {} try: for sname in stream_names: stream = kwds.get(sname, None) if stream is not None and stream != getattr(sys, sname): old_streams[sname] = getattr(sys, sname) setattr(sys, sname, stream) yield finally: for sname, stream in old_streams.iteritems(): setattr(sys, sname, stream) with redirected(stdout=open("/tmp/log.txt", "w")): # these print statements will go to /tmp/log.txt print "Test entry 1" print "Test entry 2" # back to the normal stdout print "Back to normal stdout again" And finally, another example that creates a temporary folder and cleans it up when leaving the context: from tempfile import mkdtemp from shutil import rmtree @contextmanager def temporary_dir(*args, **kwds): name = mkdtemp(*args, **kwds) try: yield name finally: shutil.rmtree(name) with temporary_dir() as dirname: # do whatever you want [INST] Getting "Error loading MySQLdb module: No module named MySQLdb" - have tried previously posted solutions This is a much discussed issue for OSX 10.6 users, but I haven't been able to find a solution that works. Here's my setup: Python 2.6.1 64bit Django 1.2.1 MySQL 5.1.47 osx10.6 64bit I create a virtualenvwrapper with --no-site-packages, then installed Django. When I activate the virtualenv and run python manage.py syncdb, I get this error: Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/core/management/__init__.py", line 257, in fetch_command klass = load_command_class(app_name, subcommand) File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/core/management/__init__.py", line 67, in load_command_class module = import_module('%s.management.commands.%s' % (app_name, name)) File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 7, in from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/core/management/sql.py", line 5, in from django.contrib.contenttypes import generic File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/contrib/contenttypes/generic.py", line 6, in from django.db import connection File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/db/__init__.py", line 75, in connection = connections[DEFAULT_DB_ALIAS] File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/db/utils.py", line 91, in __getitem__ backend = load_backend(db['ENGINE']) File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/db/utils.py", line 32, in load_backend return import_module('.base', backend_name) File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/Users/joerobinson/.virtualenvs/dj_tut/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 14, in raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb I've also installed the MySQL for Python adapter, but to no avail (maybe I installed it improperly?). Anyone dealt with this before? [/INST] I had the same error and pip install MySQL-python solved it for me. Alternate installs: If you don't have pip, easy_install MySQL-python should work. If your python is managed by a packaging system, you might have to use that system (e.g. sudo apt-get install ...) Below, Soli notes that if you receive the following error: EnvironmentError: mysql_config not found ... then you have a further system dependency issue. Solving this will vary from system to system, but for Debian-derived systems: sudo apt-get install python-mysqldb [INST] How do you convert a Python time.struct_time object into a datetime object? How do you convert a Python time.struct_time object into a datetime.datetime object? I have a library that provides the first one and a second library that wants the second one... [/INST] Use time.mktime() to convert the time tuple (in localtime) into seconds since the Epoch, then use datetime.fromtimestamp() to get the datetime object. from time import mktime from datetime import datetime dt = datetime.fromtimestamp(mktime(struct)) [INST] How do I use raw_input in Python 3 import sys print (sys.platform) print (2 ** 100) raw_input( ) I am using Python 3.1 and can't get the raw_input to "freeze" the dos pop-up. The book I'm reading is for 2.5 and I'm using 3.1 What should I do to fix this? [/INST] raw_input() was renamed to input() From http://docs.python.org/dev/py3k/whatsnew/3.0.html [INST] How to use 'super' in Python? Can someone explain to me the difference between doing: class Child(SomeBaseClass): def __init__(self): super(Child, self).__init__() and this: class Child(SomeBaseClass): def __init__(self): SomeBaseClass.__init__(self) I've seen super being used quite a lot in classes with only single inheritance. I can see why you'd use it in multiple inheritance but am unclear as to what the advantages are of using it in this kind of situation. [/INST] The benefits of super() in single-inheritance are minimal -- mostly, you don't have to hard-code the name of the base class into every method that uses its parent methods. However, it's almost impossible to use multiple-inheritance without super(). This includes common idioms like mixins, interfaces, abstract classes, etc. This extends to code that later extends yours. If somebody later wanted to write a class that extended Child and a mixin, their code would not work properly. [INST] Elegant ways to support equivalence ("equality") in Python classes When writing custom classes it is often important to allow equivalence by means of the == and != operators. In Python, this is made possible by implementing the __eq__ and __ne__ special methods, respectively. The easiest way I've found to do this is the following method: class Foo: def __init__(self, item): self.item = item def __eq__(self, other): if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ else: return False def __ne__(self, other): return not self.__eq__(other) Do you know of more elegant means of doing this? Do you know of any particular disadvantages to using the above method of comparing __dict__s? Note: A bit of clarification--when __eq__ and __ne__ are undefined, you'll find this behavior: >>> a = Foo(1) >>> b = Foo(1) >>> a is b False >>> a == b False That is, a == b evaluates to False because it really runs a is b, a test of identity (i.e., "Is a the same object as b?"). When __eq__ and __ne__ are defined, you'll find this behavior (which is the one we're after): >>> a = Foo(1) >>> b = Foo(1) >>> a is b False >>> a == b True [/INST] You need to be careful with inheritance: >>> class Foo: def __eq__(self, other): if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ else: return False >>> class Bar(Foo):pass >>> b = Bar() >>> f = Foo() >>> f == b True >>> b == f False Check types more strictly, like this: def __eq__(self, other): if type(other) is type(self): return self.__dict__ == other.__dict__ return False Besides that, your approach will work fine, that's what special methods are there for. [INST] Python: user input and commandline arguments How do I have a Python script that can accept user input (assuming this is possible) and how do I make it read in arguments if run from the command line? [/INST] var = raw_input("Please enter something: ") print "you entered", var [INST] Difference between Python's Generators and Iterators What is the difference between iterators and generators? Some examples for when you would use each case would be helpful. [/INST] iterator is a more general concept: any object whose class has a next method (__next__ in Python 3) and an __iter__ method that does return self. Every generator is an iterator, but not vice versa. A generator is built by calling a function that has one or more yield expressions (yield statements, in Python 2.5 and earlier), and is an object that meets the previous paragraph's definition of an iterator. You may want to use a custom iterator, rather than a generator, when you need a class with somewhat complex state-maintaining behavior, or want to expose other methods besides next (and __iter__ and __init__). Most often, a generator (sometimes, for sufficiently simple needs, a generator expression) is sufficient, and it's simpler to code because state maintenance (within reasonable limits) is basically "done for you" by the frame getting suspended and resumed. For example, a generator such as: def squares(start, stop): for i in xrange(start, stop): yield i * i generator = squares(a, b) or the equivalent generator expression (genexp) generator = (i*i for i in xrange(a, b)) would take more code to build as a custom iterator: class Squares(object): def __init__(self, start, stop): self.start = start self.stop = stop def __iter__(self): return self def next(self): if self.start >= self.stop: raise StopIteration current = self.start * self.start self.start += 1 return current iterator = Squares(a, b) But, of course, with class Squares you could easily offer extra methods, i.e. def current(self): return self.start if you have any actual need for such extra functionality in your application. [INST] Setting the correct encoding when piping stdout in Python When piping the output of a Python program, the Python interpreter gets confused about encoding and sets it to None. This means a program like this: # -*- coding: utf-8 -*- print u"åäö" will work fine when run normally, but fail with: UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 0: ordinal not in range(128) when used in a pipe sequence. What is the best way to make this work when piping? Can I just tell it to use whatever encoding the shell/filesystem/whatever is using? The suggestions I have seen thus far is to modify your site.py directly, or hardcoding the defaultencoding using this hack: # -*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding('utf-8') print u"åäö" Is there a better way to make piping work? [/INST] First, regarding this solution: # -*- coding: utf-8 -*- print u"åäö".encode('utf-8') It's not practical to explicitly print with a given encoding every time. That would be repetitive and error-prone. A better solution is to change sys.stdout at the start of your program, to encode with a selected encoding. Here is one solution I found on Python: How is sys.stdout.encoding chosen?, in particular a comment by "toka": import sys import codecs sys.stdout = codecs.getwriter('utf8')(sys.stdout) [INST] How do I determine if my python shell is executing in 32bit or 64bit mode on OS X? I need a way to tell what mode the shell is in from within the shell. I've tried looking at the platform module but it seems only to tell you about "about the bit architecture and the linkage format used for the executable": the binary is compiled as 64bit though (I'm running on OS X 10.6) so it seems to always report 64bit even though I'm using the methods described here to force 32bit mode). [/INST] UPDATED: One way is to look at sys.maxsize as documented here: $ python-32 -c 'import sys;print("%x" % sys.maxsize, sys.maxsize > 2**32)' ('7fffffff', False) $ python-64 -c 'import sys;print("%x" % sys.maxsize, sys.maxsize > 2**32)' ('7fffffffffffffff', True) sys.maxsize was introduced in Python 2.6. If you need a test for older systems, this slightly more complicated test should work on all Python 2 and 3 releases: $ python-32 -c 'import struct;print( 8 * struct.calcsize("P"))' 32 $ python-64 -c 'import struct;print( 8 * struct.calcsize("P"))' 64 BTW, you might be tempted to use platform.architecture() for this. Unfortunately, its results are not always reliable, particularly in the case of OS X universal binaries. $ arch -x86_64 /usr/bin/python2.6 -c 'import sys,platform; print platform.architecture()[0], sys.maxsize > 2**32' 64bit True $ arch -i386 /usr/bin/python2.6 -c 'import sys,platform; print platform.architecture()[0], sys.maxsize > 2**32' 64bit False [INST] python open built-in function: difference between modes a, a+, w, w+, and r+? In the python built-in open function, what is the exact difference between the modes w, a, w+, a+, and r+? In particular, the documentation implies that all of these will allow writing to the file, and says that it opens the files for "appending", "writing", and "updating" specifically, but does not define what these terms mean. [/INST] The opening modes are exactly the same that C fopen() std library function. The BSD fopen manpage defines them as follows: The argument mode points to a string beginning with one of the following sequences (Additional characters may follow these sequences.): ``r'' Open text file for reading. The stream is positioned at the beginning of the file. ``r+'' Open for reading and writing. The stream is positioned at the beginning of the file. ``w'' Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file. ``w+'' Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file. ``a'' Open for writing. The file is created if it does not exist. The stream is positioned at the end of the file. Subsequent writes to the file will always end up at the then current end of file, irrespective of any intervening fseek(3) or similar. ``a+'' Open for reading and writing. The file is created if it does not exist. The stream is positioned at the end of the file. Subse- quent writes to the file will always end up at the then current end of file, irrespective of any intervening fseek(3) or similar. [INST] In Matplotlib, what does the argument mean in fig.add_subplot(111)? Sometimes I come across code such as this: import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5] y = [1, 4, 9, 16, 25] fig = plt.figure() fig.add_subplot(111) plt.scatter(x, y) plt.show() Which produces: I've been reading the documentation like crazy but I can't find an explanation for the 111. sometimes I see a 212. What does the argument of fig.add_subplot() mean? [/INST] I think this would be best explained by the following picture: To initialize the above, one would type: import matplotlib.pyplot as plt fig = plt.figure() fig.add_subplot(221) #top left fig.add_subplot(222) #top right fig.add_subplot(223) #bottom left fig.add_subplot(224) #bottom right plt.show() EDIT: Some additional information The following combinations produce asymmetrical arrangements of subplots. subplot(2,2,[1 3]) subplot(2,2,2) subplot(2,2,4) You can also use the colon operator to specify multiple locations if they are in sequence. subplot(2,2,1:2) subplot(2,2,3) subplot(2,2,4) Reference here [INST] How to install python3 version of package via pip on Ubuntu? I have both python2.7 and python3.2 installed in Ubuntu 12.04. The symbolic link python links to python2.7. When I type: sudo pip install package-name It will default install python2 version of package-name. Some package supports both python2 and python3. How to install python3 version of package-name via pip? [/INST] Ubuntu 12.10+ and Fedora 13+ have a package called python3-pip which will install pip-3.2 (or pip-3.3, pip-3.4 or pip3 for newer versions) without needing this jumping through hoops. I came across this and fixed this without needing the likes of wget or virtualenvs (assuming Ubuntu 12.04): Install package python3-setuptools: run sudo aptitude install python3-setuptools, this will give you the command easy_install3. Install pip using Python 3's setuptools: run sudo easy_install3 pip, this will give you the command pip-3.2 like kev's solution. Install your PyPI packages: run sudo pip-3.2 install (installing python packages into your base system requires root, of course). … Profit! [INST] How to break out of multiple loops in Python? Given the following code (that doesn't work): while True: #snip: print out current state while True: ok = get_input("Is this ok? (y/n)") if ok == "y" or ok == "Y": break 2 #this doesn't work :( if ok == "n" or ok == "N": break #do more processing with menus and stuff Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied? Edit-FYI: get_input is a short function I wrote that supports showing a prompt and default values and all that fanciness and returns stdin.readline().strip() [/INST] My first instinct would be to refactor the nested loop into a function and use return to break out. [INST] Python list of lists, changes reflected across sublists unexpectedly I needed to create a list of lists in Python, so I typed the following: myList = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: myList[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it? [/INST] When you write [x]*3 you get, essentially, the list [x, x, x]. That is, a list with 3 references to the same x. When you then modify this single x it is visible via all three references to it. To fix it, you need to make sure that you create a new list at each position. One way to do it is [[1]*4 for n in range(3)] [INST] time.sleep -- sleeps thread or process? In Python for the *nix, does time.sleep() block the thread or the process? [/INST] It blocks the thread. If you look in Modules/timemodule.c in the Python source, you'll see that in the call to floatsleep(), the substantive part of the sleep operation is wrapped in a Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS block, allowing other threads to continue to execute while the current one sleeps. You can also test this with a simple python program: import time from threading import Thread class worker(Thread): def run(self): for x in xrange(0,11): print x time.sleep(1) class waiter(Thread): def run(self): for x in xrange(100,103): print x time.sleep(5) def run(): worker().start() waiter().start() Which will print: >>> thread_test.run() 0 100 >>> 1 2 3 4 5 101 6 7 8 9 10 102 [INST] Does Python have an ordered set? Python has an ordered dictionary, what about an ordered set? [/INST] There is an ordered set recipe for this which is referred to from the Python 2 Documentation. This runs on Py2.6 or later and 3.0 or later without any modifications. The interface is almost exactly the same as a normal set, except that initialisation should be done with a list. OrderedSet([1, 2, 3]) This is a MutableSet, so the signature for .union doesn't match that of set, but since it includes __or__ something similar can easily be added: @staticmethod def union(*sets): union = OrderedSet() union.union(*sets) return union def union(self, *sets): for set in sets: self |= set [INST] Short Description of Scoping Rules What exactly are the Python scoping rules? If I have some code: code1 class Foo: code2 def spam..... code3 for code4..: code5 x() Where is x found? Some possible choices include the list above: In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop Also there is the context during execution, when the function spam is passed somewhere else. And maybe lambda functions pass a bit differently? There must be a simple reference or algorithm somewhere. It's a confusing world for intermediate Python programmers. [/INST] Actually, a concise rule for Python Scope resolution, from Learning Python, 3rd. Ed.. (These rules are specific to variable names, not attributes. If you reference it without a period, these rules apply) LEGB Rule. L, Local — Names assigned in any way within a function (def or lambda)), and not declared global in that function. E, Enclosing function locals — Name in the local scope of any and all enclosing functions (def or lambda), from inner to outer. G, Global (module) — Names assigned at the top-level of a module file, or declared global in a def within the file. B, Built-in (Python) — Names preassigned in the built-in names module : open,range,SyntaxError,... So, in the case of code1 class Foo: code2 def spam..... code3 for code4..: code5 x() The for loop does not have its own namespace. In LEGB order, the scopes would be L : local, in the current def. E : Enclosed function, any enclosing functions (if def spam was in another def) G : Global. Were there any declared globally in the module? B : Any builtin x() in Python. [INST] Find all packages installed with easy_install/pip? Is there a way to find all Python PyPI packages that were installed with easy_install or pip? I mean, excluding everything that was/is installed with the distributions tools (in this case apt-get on Debian). [/INST] pip freeze will output a list of installed packages and their versions. It also allows you to write those packages to a file that can later be used to set up a new environment. http://www.pip-installer.org/en/latest/index.html#freezing-requirements [INST] How do I make python to wait for a pressed key I want my script to wait until the user presses any key. How do I do that? [/INST] One way to do this in Python 2, is to use raw_input(): raw_input("Press Enter to continue...") In python3 it's just input() �c[INST] What is the best way to remove accents in a Python unicode string? I have a Unicode string in Python, and I would like to remove all the accents (diacritics). I found on the Web an elegant way to do this in Java: convert the Unicode string to its long normalized form (with a separate character for letters and diacritics) remove all the characters whose Unicode type is "diacritic". Do I need to install a library such as pyICU or is this possible with just the python standard library? And what about python 3? Important note: I would like to avoid code with an explicit mapping from accented characters to their non-accented counterpart. [/INST] How about this: import unicodedata def strip_accents(s): return ''.join(c for c in unicodedata.normalize('NFD', s) if unicodedata.category(c) != 'Mn') This works on greek letters, too: >>> strip_accents(u"A \u00c0 \u0394 \u038E") u'A A \u0394 \u03a5' >>> The character category "Mn" stands for Nonspacing_Mark, which is similar to unicodedata.combining in MiniQuark's answer (I didn't think of unicodedata.combining, but it is probably the better solution, because it's more explicit). And keep in mind, these manipulations may significantly alter the meaning of the text. Accents, Umlauts etc. are not "decoration". [INST] How to find out the number of CPUs using python I want to know the number of CPUs on the local machine using Python. The result should be user/real as output by time(1) when called with an optimally scaling userspace-only program. [/INST] If you have python with a version >= 2.6 you can simply use import multiprocessing multiprocessing.cpu_count() http://docs.python.org/library/multiprocessing.html#multiprocessing.cpu_count [INST] What's the difference between eval, exec, and compile in Python? I've been looking at dynamic evaluation of Python code, and come across the eval() and compile() functions, and the exec statement. Can someone please explain the difference between eval and exec, and how the different modes of compile() fit in? [/INST] exec is not an expression: a statement in Python 2.x, and a function in Python 3.x. It compiles and immediately evaluates a statement or set of statement contained in a string. Example: exec('print(5)') # prints 5. # exec 'print 5' if you use Python 2.x, nor the exec neither the print is a function there exec('print(5)\nprint(6)') # prints 5{newline}6. exec('if True: print(6)') # prints 6. exec('5') # does nothing and returns nothing. eval is a built-in function (not a statement), which evaluates an expression and returns the value that expression produces. Example: x = eval('5') # x <- 5 x = eval('%d + 6' % x) # x <- 11 x = eval('abs(%d)' % -100) # x <- 100 x = eval('x = 5') # INVALID; assignment is not an expression. x = eval('if 1: x = 4') # INVALID; if is a statement, not an expression. compile is a lower level version of exec and eval. It does not execute or evaluate your statements or expressions, but returns a code object that can do it. The modes are as follows: compile(string, '', 'eval') returns the code object that would have been executed had you done eval(string). Note that you cannot use statements in this mode; only a (single) expression is valid. compile(string, '', 'exec') returns the code object that would have been executed had you done exec(string). You can use any number of statements here. compile(string, '', 'single') is like the exec mode, but it will ignore everything except for the first statement. Note that an if/else statement with its results is considered a single statement. [INST] How do I get my python program to sleep for 50 milliseconds? How do I get my python program to sleep for 50 milliseconds? [/INST] Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from time import sleep >>> sleep(0.05) >>> [INST] Fastest way to check if a value exist in a list I'm searching for the fastest way to know if a value exists in a list (a list with millions of values in it) and what its index is? I know all values in the list are unique like my example. My first methods I try is(3.8sec in my real code): a = [4,2,3,1,5,6] if a.count(7) == 1: b=a.index(7) "Do something with variable b" My second methods I try is (2x faster:1.9sec on my real code): a = [4,2,3,1,5,6] try: b=a.index(7) except ValueError: "Do nothing" Else: "Do something with variable b" Proposed methods from S.O. user (2.74sec on my real code): a = [4,2,3,1,5,6] if 7 in a: a.index(7) In my real code , first method take 3.81sec and the second methods take 1.88sec. It's a good improvement but: I'm a beginner with Python/scripting and I want to know if a fastest way exist to do the same things and save more process time? More specific explication for my application: In the API of blender a can access to a list of particles: particles = [1,2,3,4...etc.] From there , I can access to it's location: particles[x].location = [x,y,z] And I test for each particles if a neighbour exist by searching in the location of each particles like: if [x+1,y,z] in particles.location "find the identity of this neighbour particles in x:the index of the particles array" particles.index([x+1,y,z]) [/INST] 7 in a Clearest and fastest way to do it. You can also consider using a set, but constructing that set from your list may take more time than faster membership testing will save. The only way to be certain is to benchmark well. (this also depends on what operations you require) [INST] How to check Django version I have to use Python and Django for our application. So I have two versions of Python, 2.6 and 2.7. Now I have installed Django. I could run the sample application for testing Django succesfuly. But how do I make sure whether Django uses the 2.6 or 2.7 version and what version of modules Django uses? [/INST] Django 1.5 supports Python 2.6.5 and later. If you're under Linux and want to check the Python version you're using, run python -V from the command line. If you want to check the Django version, open a Python console and type import django django.VERSION [INST] Python urlencode querystring I am trying to urlencode this string before I submit. queryString = 'eventName=' + evt.fields["eventName"] + '&' + 'eventDescription=' + evt.fields["eventDescription"]; [/INST] Python 2 What you're looking for is urllib.quote_plus: >>> urllib.quote_plus('string_of_characters_like_these:$#@=?%^Q^$') 'string_of_characters_like_these%3A%24%23%40%3D%3F%25%5EQ%5E%24' Python 3 In Python 3, you the urllib package has been broken into smaller components. You'll use urllib.parse.quote_plus() (note the parse child module). [INST] Which exception should I raise on bad/illegal argument combinations in Python? I was wondering about the best practices for indicating invalid argument combinations in Python. I've come across a few situations where you have a function like so: def import_to_orm(name, save=False, recurse=False): """ :param name: Name of some external entity to import. :param save: Save the ORM object before returning. :param recurse: Attempt to import associated objects as well. Because you need the original object to have a key to relate to, save must be `True` for recurse to be `True`. :raise BadValueError: If `recurse and not save`. :return: The ORM object. """ pass The only annoyance with this is that every package has its own, usually slightly differing BadValueError. I know that in Java there exists java.lang.IllegalArgumentException -- is it well understood that everybody will be creating their own BadValueErrors in Python or is there another, preferred method? [/INST] I would just raise ValueError, unless you need a more specific exception.. def import_to_orm(name, save=False, recurse=False): if recurse and not save: raise ValueError("save must be True if recurse is True") There's really no point in doing class BadValueError(ValueError):pass - your custom class is identical in use to ValueError, so why not use that? [INST] What's the idiomatic syntax for prepending to a short python list? list.append() is the obvious choice for adding to the end of a list. Here's a reasonable explanation for the missing list.prepend(). Assuming my list is short and performance concerns are negligible, is list.insert(0, x) or list[0:0] = [x] idiomatic? [/INST] The s.insert(0, x) form is the most common. Whenever you see it though, it may be time to consider using a collections.deque instead of a list. [INST] Convert a list of characters into a string If I have a list of chars: a = ['a','b','c','d'] How do I convert it into a single string? a = 'abcd' [/INST] Use the join method of the empty string to join all of the strings together with the empty string in between, like so: >>> a = ['a', 'b', 'c', 'd'] >>> ''.join(a) 'abcd' [INST] How to print a class or objects of class using print()? I am learning the ropes in Python. When I try to print an object of class Foobar using the print() function, I get an output like this: <__main__.Foobar instance at 0x7ff2a18c> Is there a way I can set the printing behaviour (or the string representation) of a class and its objects? For instance, when I call print() on a class object, I would like to print its data members in a certain format. How to achieve this in Python? If you are familiar with C++ classes, the above can be achieved for the standard ostream by adding a friend ostream& operator << (ostream&, const Foobar&) method for the class. [/INST] >>> class Test: ... def __repr__(self): ... return "Test()" ... def __str__(self): ... return "member of Test" ... >>> t = Test() >>> t Test() >>> print t member of Test The __str__ method is what happens when you print it, and the __repr__ method is what happens when you use the repr() function (or when you look at it with the interactive prompt). If this isn't the most Pythonic method, I apologize, because I'm still learning too - but it works. If no __str__ method is given, Python will print the result of __repr__ instead. If you define __str__ but not __repr__, Python will use what you see above as the __repr__, but still use __str__ for printing. [INST] How do I run Python code from Sublime Text 2? I want to set up a complete Python IDE in Sublime Text 2. I want to know how to run the Python code from within the editor. Is it done using build system? How do I do it ? [/INST] Tools -> Build System -> (choose) Python then: To Run: Tools -> Build -or- Ctrl + B CMD + B (OSX) This would start your file in the console which should be at the bottom of the editor. To Stop: Ctrl + Break or Tools -> Cancel Build You can find out where your Break key is here: http://en.wikipedia.org/wiki/Break_key. Note: CTRL + C will NOT work. What to do when Ctrl + Break does not work: Go to: Preferences -> Key Bindings - User and paste the line below: {"keys": ["ctrl+shift+c"], "command": "exec", "args": {"kill": true} } Now, you can use ctrl+shift+c instead of CTRL+BREAK LX[INST] Is it worth using Python's re.compile? Is there any benefit in using compile for regular expressions in Python? h = re.compile('hello') h.match('hello world') vs re.match('hello', 'hello world') [/INST] I've had a lot of experience running a compiled regex 1000s of times versus compiling on-the-fly, and have not noticed any perceivable difference. Obviously, this is anecdotal, and certainly not a great argument against compiling, but I've found the difference to be negligible. EDIT: After a quick glance at the actual Python 2.5 library code, I see that Python internally compiles AND CACHES regexes whenever you use them anyway (including calls to re.match()), so you're really only changing WHEN the regex gets compiled, and shouldn't be saving much time at all - only the time it takes to check the cache (a key lookup on an internal dict type). From module re.py (comments are mine): def match(pattern, string, flags=0): return _compile(pattern, flags).match(string) def _compile(*key): # Does cache check at top of function cachekey = (type(key[0]),) + key p = _cache.get(cachekey) if p is not None: return p # ... # Does actual compilation on cache miss # ... # Caches compiled regex if len(_cache) >= _MAXCACHE: _cache.clear() _cache[cachekey] = p return p I still often pre-compile regular expressions, but only to bind them to a nice, reusable name, not for any expected performance gain. [INST] Maximum and Minimum values for ints I am looking for minimum and maximum values for integers in python. For eg., in Java, we have Integer.MIN_VALUE and Integer.MAX_VALUE. Is there something like this in python? [/INST] In Python 2, there's sys.maxint: >>> sys.maxint 9223372036854775807 And you can calculate the minimum value with -sys.maxint - 1 as seen here. Of course Python just switches from plain to long integers once you exceed this value. In Python 3 this value has no significance at all for integers. (However, a closely related value is still available as sys.maxsize, in case you're actually looking for the machine's word size.) [INST] Elegant Python function to convert CamelCase to snake_case? Example: >>> convert('CamelCase') 'camel_case' [/INST] This is pretty thorough: def convert(name): s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() Works with all these (and doesn't harm already-un-cameled versions): >>> convert('CamelCase') 'camel_case' >>> convert('CamelCamelCase') 'camel_camel_case' >>> convert('Camel2Camel2Case') 'camel2_camel2_case' >>> convert('getHTTPResponseCode') 'get_http_response_code' >>> convert('get2HTTPResponseCode') 'get2_http_response_code' >>> convert('HTTPResponseCode') 'http_response_code' >>> convert('HTTPResponseCodeXYZ') 'http_response_code_xyz' Or if you're going to call it a zillion times, you can pre-compile the regexes: first_cap_re = re.compile('(.)([A-Z][a-z]+)') all_cap_re = re.compile('([a-z0-9])([A-Z])') def convert(name): s1 = first_cap_re.sub(r'\1_\2', name) return all_cap_re.sub(r'\1_\2', s1).lower() Don't forget to import the regular expression module import re [INST] Check if a Python list item contains a string inside another string I have a list: my_list = ['abc-123', 'def-456', 'ghi-789', 'abc-456'] and want to search for items that contain the string 'abc'. How can I do that? if 'abc' in my_list: would check if 'abc' exists in the list but it is a part of 'abc-123' and 'abc-456', 'abc' does not exist on its own. So how can I get all items that contain 'abc' ? [/INST] If you only want to check for the presence of abc in any string in the list, you could try some_list = ['abc-123', 'def-456', 'ghi-789', 'abc-456'] if any("abc" in s for s in some_list): # whatever If you really want to get all the items containing abc, use matching = [s for s in some_list if "abc" in s] [INST] Python: about catching ANY exception How can I write a try/except block that catches all exceptions? [/INST] Apart from a bare except: clause (which as others have said you shouldn't use), you can simply catch Exception: import traceback import logging try: whatever() except Exception as e: logging.error(traceback.format_exc()) # Logs the error appropriately. You would normally only ever consider doing this at the outermost level of your code if for example you wanted to handle any otherwise uncaught exceptions before terminating. The advantage of except Exception over the bare except is that there are a few exceptions that it wont catch, most obviously KeyboardInterrupt and SystemExit: if you caught and swallowed those then you could make it hard for anyone to exit your script. [INST] How to save a Python interactive session? I find myself frequently using Python's interpreter to work with databases, files, etc -- basically a lot of manual formatting of semi-structured data. I don't properly save and clean up the useful bits as often as I would like. Is there a way to save my input into the shell (db connections, variable assignments, little for loops and bits of logic) -- some history of the interactive session? If I use something like script I get too much stdout noise. I don't really need to pickle all the objects -- though if there is a solution that does that, it would be OK. Ideally I would just be left with a script that ran as the one I created interactively, and I could just delete the bits I didn't need. Is there a package that does this, or a DIY approach? UPDATE: I am really amazed at the quality and usefulness of these packages. For those with a similar itch: IPython -- should have been using this for ages, kind of what I had in mind reinteract -- very impressive, I want to learn more about visualization and this seems like it will shine there. Sort of a gtk/gnome desktop app that renders graphs inline. Imagine a hybrid shell + graphing calculator + mini eclipse. Source distribution here: http://www.reinteract.org/trac/wiki/GettingIt . Built fine on Ubuntu, integrates into gnome desktop, Windows and Mac installers too. bpython -- extremely cool, lots of nice features, autocomplete(!), rewind, one keystroke save to file, indentation, well done. Python source distribution, pulled a couple of dependencies from sourceforge. I am converted, these really fill a need between interpreter and editor. [/INST] IPython is extremely useful if you like using interactive sessions. For example for your usecase there is the %save magic command, you just input %save my_useful_session 10-20 23 to save input lines 10 to 20 and 23 to my_useful_session.py. (to help with this, every line is prefixed by its number) Look at the videos on the documentation page to get a quick overview of the features. [INST] What exactly do "u" and "r" string flags do in Python, and what are raw string literals? While asking this question, I realized I didn't know much about raw strings. For somebody claiming to be a Django trainer, this sucks. I know what an encoding is, and I know what u alone does since I get what is Unicode. But what does r do exactly? What kind of string does it result in? And above all, what the heck does ur do? Finally, is there any reliable way to go back from a Unicode string to a simple raw string? Ah, and by the way, if your system and your text editor charset are set to UTF-8, does u actually do anything? [/INST] There's not really any "raw string"; there are raw string literals, which are exactly the string literals marked by a 'r' before the opening quote. A "raw string literal" is a slightly different syntax for a string literal, in which a backslash, \, is taken as meaning "just a backslash" (except when it comes right before a quote that would otherwise terminate the literal) -- no "escape sequences" to represent newlines, tabs, backspaces, form-feeds, and so on. In normal string literals, each backslash must be doubled up to avoid being taken as the start of an escape sequence. This syntax variant exists mostly because the syntax of regular expression patterns is heavy with backslashes (but never at the end, so the "except" clause above doesn't matter) and it looks a bit better when you avoid doubling up each of them -- that's all. It also gained some popularity to express native Windows file paths (with backslashes instead of regular slashes like on other platforms), but that's very rarely needed (since normal slashes mostly work fine on Windows too) and imperfect (due to the "except" clause above). r'...' is a byte string (in Python 2.*), ur'...' is a Unicode string (again, in Python 2.*), and any of the other three kinds of quoting also produces exactly the same types of strings (so for example r'...', r'''...''', r"...", r"""...""" are all byte strings, and so on). Not sure what you mean by "going back" - there is no intrinsically back and forward directions, because there's no raw string type, it's just an alternative syntax to express perfectly normal string objects, byte or unicode as they may be. And yes, in Python 2.*, u'...' is of course always distinct from just '...' -- the former is a unicode string, the latter is a byte string. What encoding the literal might be expressed in is a completely orthogonal issue. E.g., consider (Python 2.6): >>> sys.getsizeof('ciao') 28 >>> sys.getsizeof(u'ciao') 34 the Unicode object of course takes more memory space (very small difference for a very short string, obviously;-). [INST] What is the most "pythonic" way to iterate over a list in chunks? I have a Python script which takes as input a list of integers, which I need to work with four integers at a time. Unfortunately, I don't have control of the input, or I'd have it passed in as a list of four-element tuples. Currently, I'm iterating over it this way: for i in xrange(0, len(ints), 4): # dummy op for example code foo += ints[i] * ints[i + 1] + ints[i + 2] * ints[i + 3] It looks a lot like "C-think", though, which makes me suspect there's a more pythonic way of dealing with this situation. The list is discarded after iterating, so it needn't be preserved. Perhaps something like this would be better? while ints: foo += ints[0] * ints[1] + ints[2] * ints[3] ints[0:4] = [] Still doesn't quite "feel" right, though. :-/ Related question: How do you split a list into evenly sized chunks in Python? [/INST] def chunker(seq, size): return (seq[pos:pos + size] for pos in xrange(0, len(seq), size)) Simple. Easy. Fast. Works with any sequence: text = "I am a very, very helpful text" for group in chunker(text, 7): print repr(group), # 'I am a ' 'very, v' 'ery hel' 'pful te' 'xt' print '|'.join(chunker(text, 10)) # I am a ver|y, very he|lpful text animals = ['cat', 'dog', 'rabbit', 'duck', 'bird', 'cow', 'gnu', 'fish'] for group in chunker(animals, 3): print group # ['cat', 'dog', 'rabbit'] # ['duck', 'bird', 'cow'] # ['gnu', 'fish'] [INST] A Transpose/Unzip Function in Python (inverse of zip) I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item. For example: original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)] # and I want to become... result = (['a', 'b', 'c', 'd'], [1, 2, 3, 4]) Is there a builtin function that does that? [/INST] zip is its own inverse! Provided you use the special * operator. >>> zip(*[('a', 1), ('b', 2), ('c', 3), ('d', 4)]) [('a', 'b', 'c', 'd'), (1, 2, 3, 4)] The way this works is by calling zip with the arguments: zip(('a', 1), ('b', 2), ('c', 3), ('d', 4)) … except the arguments are passed to zip directly (after being converted to a tuple), so there's no need to worry about the number of arguments getting too big. [INST] IndentationError: unindent does not match any outer indentation level When I compile the Python code below, I get IndentationError: unindent does not match any outer indentation level import sys def Factorial(n): # Return factorial result = 0 for i in range (1,n): result = result * i print "factorial is ",result return result Why? [/INST] EDIT: Other posters are probably correct...there might be spaces mixed in with your tabs. Try doing a search&replace to replace all tabs with a few spaces. Try this: import sys def Factorial(n): # return factorial result = 1 for i in range (1,n): result = result * i print "factorial is ",result return result print Factorial(10) [INST] How to create a GUID/UUID in Python How do I create a GUID in Python that is platform independent? I hear there is a method using ActivePython on Windows but it's Windows only because it uses COM. Is there a method using plain Python? [/INST] If you're using Python 2.5 or later, the uuid module is already included with the Python standard distribution. Ex: >>> import uuid >>> uuid.uuid4() UUID('5361a11b-615c-42bf-9bdb-e2c3790ada14') [INST] Find which version of package is installed with pip Using pip, is it possible to figure out which version of a package is currently installed? I know about pip install XYZ --upgrade but I am wondering if there is anything like pip info XYZ. If not what would be the best way to tell what version I am currently using. [/INST] As of pip 1.3, there is a pip show command. $ pip show Jinja2 --- Name: Jinja2 Version: 2.7.3 Location: /path/to/virtualenv/lib/python2.7/site-packages Requires: markupsafe In older versions, pip freeze and grep should do the job nicely. $ pip freeze | grep Jinja2 Jinja2==2.7.3 [INST] Rename Files in Python I'm trying to rename some files in a directory using Python. Say I have a file called CHEESE_CHEESE_TYPE.*** and want to remove CHEESE_ so my resulting filename would be CHEESE_TYPE I'm trying to use the os.path.split but it's not working properly. I have also considered using string manipulations, but have not been successful with that either. [/INST] Do you want something like this? $ ls cheese_cheese_type.bar cheese_cheese_type.foo $ python >>> import os >>> for filename in os.listdir("."): ... if filename.startswith("cheese_"): ... os.rename(filename, filename[7:]) ... >>> $ ls cheese_type.bar cheese_type.foo [INST] No module named pkg_resources I'm deploying a Django app to a dev server and am hitting this error when i run pip install requirements.txt: Traceback (most recent call last): File "/var/www/mydir/virtualenvs/dev/bin/pip", line 5, in from pkg_resources import load_entry_point ImportError: No module named pkg_resources pkg_resources appears to be distributed with setuptools. Initially I thought this might not be installed to the python in the virtualenv so I installed setuptools (2.6, same version as Python) to the Python site-packages in the virtualenv with the following command sh setuptools-0.6c11-py2.6.egg --install-dir /var/www/mydir/virtualenvs/dev/lib/python2.6/site-packages EDIT This only happens inside the virtualenv. If I open a console outside the virtualenv then pkg_resources is present but I am still getting the same error. Any ideas as to why pkg_resources is not on the path? [/INST] I encountered the same ImportError today while trying to use pip. Somehow the setuptools package had been deleted in my Python environment. To fix the issue, run the setup script for setuptools: wget https://bootstrap.pypa.io/ez_setup.py -O - | python (or if you don't have wget installed (e.g. OS X), try curl https://bootstrap.pypa.io/ez_setup.py | python possibly with sudo prepended.) If you have any version of distribute, or any setuptools below 0.6, you will have to uninstall it first.* See Installation Instructions for further details. * If you already have a working distribute, upgrading it to the "compatibility wrapper" that switches you over to setuptools is easier. But if things are already broken, don't try that. [INST] Proper way to use **kwargs in Python What is the proper way to use **kwargs in Python when it comes to default values? kwargs returns a dictionary, but what is the best way to set default values, or is there one? Should I just access it as a dictionary? Use get function? class ExampleClass: def __init__(self, **kwargs): self.val = kwargs['val'] self.val2 = kwargs.get('val2') A simple question, but one that I can't find good resources on. People do it different ways in code that I've seen and it's hard to know what to use. [/INST] You can pass a default value to get() for keys that are not in the dictionary: self.val2 = kwargs.get('val2',"default value") However, if you plan on using a particular argument with a particular default value, why not use named arguments in the first place? def __init__(self, val2="default value", **kwargs): [INST] How do I correctly clean up a Python object? class Package: def __init__(self): self.files = [] # ... def __del__(self): for file in self.files: os.unlink(file) __del__(self) above fails with an AttributeError exception. I understand Python doesn't guarantee the existence of "global variables" (member data in this context?) when __del__() is invoked. If that is the case and this is the reason for the exception, how do I make sure the object destructs properly? [/INST] I'd recommend using Python's with statement for managing resources that need to be cleaned up. The problem with using an explicit close() statement is that you have to worry about people forgetting to call it at all or forgetting to place it in a finally block to prevent a resource leak when an exception occurs. To use the with statement, create a class with the following methods: def __enter__(self) def __exit__(self, exc_type, exc_value, traceback) In your example above, you'd use class Package: def __init__(self): self.files = [] def __enter__(self): return self # ... def __exit__(self, exc_type, exc_value, traceback): for file in self.files: os.unlink(file) Then, when someone wanted to use your class, they'd do the following: with Package() as package_obj: # use package_obj The variable package_obj will be an instance of type Package (it's the value returned by the __enter__ method). Its __exit__ method will automatically be called, regardless of whether or not an exception occurs. You could even take this approach a step further. In the example above, someone could still instantiate Package using its constructor without using the with clause. You don't want that to happen. You can fix this by creating a PackageResource class that defines the __enter__ and __exit__ methods. Then, the Package class would be defined strictly inside the __enter__ method and returned. That way, the caller never could instantiate the Package class without using a with statement: class PackageResource: def __enter__(self): class Package: ... self.package_obj = Package() return self.package_obj def __exit__(self, exc_type, exc_value, traceback): self.package_obj.cleanup() You'd use this as follows: with PackageResource() as package_obj: # use package_obj [INST] Creating a JSON response using Django and Python I'm trying to convert a server side Ajax response script into a Django HttpResponse, but apparently it's not working. This is the server-side script: /* RECEIVE VALUE */ $validateValue=$_POST['validateValue']; $validateId=$_POST['validateId']; $validateError=$_POST['validateError']; /* RETURN VALUE */ $arrayToJs = array(); $arrayToJs[0] = $validateId; $arrayToJs[1] = $validateError; if($validateValue =="Testuser"){ // Validate?? $arrayToJs[2] = "true"; // RETURN TRUE echo '{"jsonValidateReturn":'.json_encode($arrayToJs).'}'; // RETURN ARRAY WITH success } else{ for($x=0;$x<1000000;$x++){ if($x == 990000){ $arrayToJs[2] = "false"; echo '{"jsonValidateReturn":'.json_encode($arrayToJs).'}'; // RETURNS ARRAY WITH ERROR. } } } And this is the converted code def validate_user(request): if request.method == 'POST': vld_value = request.POST.get('validateValue') vld_id = request.POST.get('validateId') vld_error = request.POST.get('validateError') array_to_js = [vld_id, vld_error, False] if vld_value == "TestUser": array_to_js[2] = True x = simplejson.dumps(array_to_js) return HttpResponse(x) else: array_to_js[2] = False x = simplejson.dumps(array_to_js) error = 'Error' return render_to_response('index.html',{'error':error},context_instance=RequestContext(request)) return render_to_response('index.html',context_instance=RequestContext(request)) I'm using simplejson to encode the Python list (so it will return a JSON array). I couldn't figure out the problem yet. But I think that I did something wrong about the 'echo'. [/INST] I usually use a dictionary, not a list to return JSON content. import json from django.http import HttpResponse response_data = {} response_data['result'] = 'error' response_data['message'] = 'Some error message' Pre-Django 1.7 you'd return it like this: return HttpResponse(json.dumps(response_data), content_type="application/json") For Django 1.7+, use JsonResponse as shown in this SO answer like so : from django.http import JsonResponse return JsonResponse({'foo':'bar'}) [INST] Showing the stack trace from a running Python application I have this Python application that gets stuck from time to time and I can't find out where. Is there any way to signal Python interpreter to show you the exact code that's running? Some kind of on-the-fly stacktrace? Related questions: Print current call stack from a method in Python code Check what a running process is doing: print stack trace of an uninstrumented Python program [/INST] I have module I use for situations like this - where a process will be running for a long time but gets stuck sometimes for unknown and irreproducible reasons. Its a bit hacky, and only works on unix (requires signals): import code, traceback, signal def debug(sig, frame): """Interrupt running process, and provide a python prompt for interactive debugging.""" d={'_frame':frame} # Allow access to frame object. d.update(frame.f_globals) # Unless shadowed by global d.update(frame.f_locals) i = code.InteractiveConsole(d) message = "Signal received : entering python shell.\nTraceback:\n" message += ''.join(traceback.format_stack(frame)) i.interact(message) def listen(): signal.signal(signal.SIGUSR1, debug) # Register handler To use, just call the listen() function at some point when your program starts up (You could even stick it in site.py to have all python programs use it), and let it run. At any point, send the process a SIGUSR1 signal, using kill, or in python: os.kill(pid, signal.SIGUSR1) This will cause the program to break to a python console at the point it is currently at, showing you the stack trace, and letting you manipulate the variables. Use control-d (EOF) to continue running (though note that you will probably interrupt any I/O etc at the point you signal, so it isn't fully non-intrusive. I've another script that does the same thing, except it communicates with the running process through a pipe (to allow for debugging backgrounded processes etc). Its a bit large to post here, but I've added it as a python cookbook recipe. [INST] How do you express binary literals in Python? How do you express an integer as a binary number with Python literals? I was easily able to find the answer for hex: >>> 0x12AF 4783 >>> 0x100 256 and octal: >>> 01267 695 >>> 0100 64 How do you use literals to express binary in Python? Summary of Answers Python 2.5 and earlier: can express binary using int('01010101111',2) but not with a literal. Python 2.5 and earlier: there is no way to express binary literals. Python 2.6 beta: You can do like so: 0b1100111 or 0B1100111. Python 2.6 beta: will also allow 0o27 or 0O27 (second character is the letter O) to represent an octal. Python 3.0 beta: Same as 2.6, but will no longer allow the older 027 syntax for octals. [/INST] For reference—future Python possibilities: Starting with Python 2.6 you can express binary literals using the prefix 0b or 0B: >>> 0b101111 47 You can also use the new bin function to get the binary representation of a number: >>> bin(173) '0b10101101' Development version of the documentation: What's New in Python 2.6 ]E[INST] What is the purpose of the single underscore "_" variable in Python? What is the meaning of _ after for in this code? if tbh.bag: n = 0 for _ in tbh.bag.atom_set(): n += 1 [/INST] _ has 3 main conventional uses in Python: To hold the result of the last executed statement in an interactive interpreter session. This precedent was set by the standard CPython interpreter, and other interpreters have followed suit For translation lookup in i18n (imported from the corresponding C conventions, I believe), as in code like: raise forms.ValidationError(_("Please enter a correct username")) As a general purpose "throwaway" variable name to indicate that part of a function result is being deliberately ignored, as in code like: label, has_label, _ = text.partition(':') The latter two purposes can conflict, so it is necessary to avoid using _ as a throwaway variable in any code block that also uses it for i18n translation (many folks prefer a double-underscore, __, as their throwaway variable for exactly this reason). [INST] How to re import an updated package while in Python Interpreter? I often test my module in the Python Interpreter, and when I see an error, I quickly update the .py file. But how do I make it reflect on the Interpreter ? So, far I have been exiting and reentering the Interpreter because re importing the file again is not working for me. [/INST] "Reload is no longer a function in Python 3. Use imp.reload() instead" copied from comments Use the reload builtin function: https://docs.python.org/2/library/functions.html#reload When reload(module) is executed: Python modules’ code is recompiled and the module-level code reexecuted, defining a new set of objects which are bound to names in the module’s dictionary. The init function of extension modules is not called a second time. As with all other objects in Python the old objects are only reclaimed after their reference counts drop to zero. The names in the module namespace are updated to point to any new or changed objects. Other references to the old objects (such as names external to the module) are not rebound to refer to the new objects and must be updated in each namespace where they occur if that is desired. Example: # Make a simple function that prints "version 1" shell1$ echo 'def x(): print "version 1"' > mymodule.py # Run the module shell2$ python >>> import mymodule >>> mymodule.x() version 1 # Change mymodule to print "version 2" (without exiting the python REPL) shell2$ echo 'def x(): print "version 2"' > mymodule.py # Back in that same python session >>> reload(mymodule) >>> mymodule.x() version 2 [INST] How to sort (list/tuple) of lists/tuples? I have some data either in list contains lists, or list contains tuples. data = [[1,2,3], [4,5,6], [7,8,9]] data = [(1,2,3), (4,5,6), (7,8,9)] And I want to sort by the 2nd element in the subset. Meaning, sorting by 2,5,8 where 2 is from (1,2,3), 5 is from (4,5,6). What is the common way to do this? Should I store tuples or lists in my list? Since tuples are more inflexible. [/INST] sorted_by_second = sorted(data, key=lambda tup: tup[1]) or: data.sort(key=lambda tup: tup[1]) # sorts in place [INST] How to read large file, line by line in python I want to iterate over each line of an entire file. One way to do this is by reading the entire file, saving it to a list, then going over the line of interest. This method uses a lot of memory, so I am looking for an alternative. My code so far: for each_line in fileinput.input(input_file): do_something(each_line) for each_line_again in fileinput.input(input_file): do_something(each_line_again) Executing this code gives an error message: device active. Any suggestions? EDIT: The purpose is to calculate pair-wise string similarity, meaning for each line in file, I want to calculate the Levenshtein distance with every other line. [/INST] Nobody has given the correct, fully Pythonic way to read a file. It's the following: with open(...) as f: for line in f: The with statement handles opening and closing the file, including if an exception is raised in the inner block. The for line in f treats the file object f as an iterable, which automatically uses buffered IO and memory management so you don't have to worry about large files. There should be one -- and preferably only one -- obvious way to do it. [INST] Flatten (an irregular) list of lists in Python Yes, I know this subject has been covered before (here, here, here, here), but as far as I know, all solutions, except for one, fail on a list like this: L = [[[1, 2, 3], [4, 5]], 6] Where the desired output is [1, 2, 3, 4, 5, 6] Or perhaps even better, an iterator. The only solution I saw that works for an arbitrary nesting is found in this question: def flatten(x): result = [] for el in x: if hasattr(el, "__iter__") and not isinstance(el, basestring): result.extend(flatten(el)) else: result.append(el) return result flatten(L) Is this the best model? Did I overlook something? Any problems? [/INST] Using generator functions can make your example a little easier to read and probably boost the performance. Python 2 def flatten(l): for el in l: if isinstance(el, collections.Iterable) and not isinstance(el, basestring): for sub in flatten(el): yield sub else: yield el I used the Iterable ABC added in 2.6. Python 3 In Python 3, the basestring is no more, but you can use a tuple of str and bytes to get the same effect there. The yield from operator returns an item from a generator one at a time. This syntax for delegating to a subgenerator was added in 3.3 def flatten(l): for el in l: if isinstance(el, collections.Iterable) and not isinstance(el, (str, bytes)): yield from flatten(el) else: yield el [INST] How do I use Python's itertools.groupby()? I haven't been able to find an understandable explanation of how to actually use Python's itertools.groupby() function. What I'm trying to do is this: Take a list - in this case, the children of an objectified lxml element Divide it into groups based on some criteria Then later iterate over each of these groups separately. I've reviewed the documentation, and the examples, but I've had trouble trying to apply them beyond a simple list of numbers. So, how do I use of itertools.groupby()? Is there another technique I should be using? Pointers to good "prerequisite" reading would also be appreciated. [/INST] As Sebastjan said, you first have to sort your data. This is important. The part I didn't get is that in the example construction groups = [] uniquekeys = [] for k, g in groupby(data, keyfunc): groups.append(list(g)) # Store group iterator as a list uniquekeys.append(k) k is the current grouping key, and g is an iterator that you can use to iterate over the group defined by that grouping key. In other words, the groupby iterator itself returns iterators. Here's an example of that, using clearer variable names: from itertools import groupby things = [("animal", "bear"), ("animal", "duck"), ("plant", "cactus"), ("vehicle", "speed boat"), ("vehicle", "school bus")] for key, group in groupby(things, lambda x: x[0]): for thing in group: print "A %s is a %s." % (thing[1], key) print " " This will give you the output: A bear is a animal. A duck is a animal. A cactus is a plant. A speed boat is a vehicle. A school bus is a vehicle. In this example, things is a list of tuples where the first item in each tuple is the group the second item belongs to. The groupby() function takes two arguments: (1) the data to group and (2) the function to group it with. Here, lambda x: x[0] tells groupby() to use the first item in each tuple as the grouping key. In the above for statement, groupby returns three (key, group iterator) pairs - once for each unique key. You can use the returned iterator to iterate over each individual item in that group. Here's a slightly different example with the same data, using a list comprehension: for key, group in groupby(things, lambda x: x[0]): listOfThings = " and ".join([thing[1] for thing in group]) print key + "s: " + listOfThings + "." This will give you the output: animals: bear and duck. plants: cactus. vehicles: speed boat and school bus. [INST] Python: check if an object is a list or tuple (but not string) This is what I normally do in order to ascertain that the input is a list/tuple - but not a str. Because many times I stumbled upon bugs where a function passes a str object by mistake, and the target function does for x in lst assuming that lst is actually a list or tuple. assert isinstance(lst, (list, tuple)) My question is: is there a better way of achieving this? [/INST] I think assert not isinstance(lst, basestring) Is actually what you want, otherwise you'll miss out on a lot of things which act like lists, but aren't subclasses of list or tuple. [INST] Converting from a string to boolean in Python? Does anyone know how to do convert from a string to a boolean in Python? I found this link. But it doesn't look like a proper way to do it. I.e. using a built in functionality, etc. EDIT: The reason I asked this is because I learned int("string"), from here. I tried bool ("string") but always got True. [/INST] Really, you just compare the string to whatever you expect to accept as representing true, so you can do this: s == 'True' Or to checks against a whole bunch of values: s in ['true', '1', 't', 'y', 'yes', 'yeah', 'yup', 'certainly', 'uh-huh'] Be cautious when using the following: >>> bool("foo") True >>> bool("") False Empty strings evaluate to False, but everything else evaluates to True. So this should not be used for any kind of parsing purposes. [INST] Convert a Unicode string to a string in Python (containing extra symbols) How do you convert a Unicode string (containing extra characters like £ $, etc.) into a Python string? [/INST] title = u"Klüft skräms inför pÃ¥ fédéral électoral große" import unicodedata unicodedata.normalize('NFKD', title).encode('ascii','ignore') 'Kluft skrams infor pa federal electoral groe' [INST] Python Image Library fails with message "decoder JPEG not available" - PIL PIL does support JPEG in my system. Whenever I do an upload, my code is failing with: File "PIL/Image.py", line 375, in _getdecoder raise IOError("decoder %s not available" % decoder_name) IOError: decoder jpeg not available How can I resolve this? [/INST] libjpeg-dev is required to be able to process jpegs with pillow (or PIL), so you need to install it and then recompile pillow. It also seems that libjpeg8-dev is needed on Ubuntu 14.04 If you're still using PIL then you should really be using pillow these days though, so first pip uninstall PIL before following these instructions to switch, or if you have a good reason for sticking with PIL then replace "pillow" with "PIL" in the below). On Ubuntu: # install libjpeg-dev with apt sudo apt-get install libjpeg-dev # if you're on Ubuntu 14.04, also install this sudo apt-get install libjpeg8-dev # reinstall pillow pip install --no-cache-dir -I pillow If that doesn't work, try one of the below, depending on whether you are on 64bit or 32bit Ubuntu. For Ubuntu x64: sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib Or for Ubuntu 32bit: sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/ sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib/ sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/ Then reinstall pillow: pip install --no-cache-dir -I pillow (Edits to include feedback from comments. Thanks Charles Offenbacher for pointing out this differs for 32bit, and t-mart for suggesting use of --no-cache-dir). [INST] Dead simple argparse example wanted: 1 argument, 3 results The documentation for the argparse python module, while excellent I'm sure, is too much for my tiny beginner brain to grasp right now. Likewise for many questions here on the stack. I don't need to do math on the command line or meddle with formatting lines on the screen or change option characters. All I want to do is "if arg is A, do this, if B do that, if none of the above show help and quit". [/INST] Here's the way I do it with argparse (with multiple args): parser = argparse.ArgumentParser(description='Description of your program') parser.add_argument('-f','--foo', help='Description for foo argument', required=True) parser.add_argument('-b','--bar', help='Description for bar argument', required=True) args = vars(parser.parse_args()) args will be a dictionary containing the arguments: if args['foo'] == 'Hello': # code here if args['bar'] == 'World': # code here In your case simply add only one argument. g=[INST] Measure time elapsed in Python? What I want is to start counting time somewhere in my code and then get the passed time, to measure the time it took to execute few function. I think I'm using the timeit module wrong, but the docs are just confusing for me. import timeit start = timeit.timeit() print "hello" end = timeit.timeit() print end - start [/INST] If you just want to measure the elapsed wall-clock time between two points, you could use time.time(): import time start = time.time() print("hello") end = time.time() print(end - start) This gives the execution time in seconds. edit A better option might be to use time.clock (thanks @Amber): On Unix, return the current processor time as a floating point number expressed in seconds. The precision, and in fact the very definition of the meaning of “processor time”, depends on that of the C function of the same name, but in any case, this is the function to use for benchmarking Python or timing algorithms. On Windows, this function returns wall-clock seconds elapsed since the first call to this function, as a floating point number, based on the Win32 function QueryPerformanceCounter(). The resolution is typically better than one microsecond. [INST] How do I find the location of Python module sources? How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux? I'm trying to look for the source of the datetime module in particular, but I'm interested in a more general answer as well. [/INST] For a pure python module you can find the source by looking at themodule.__file__. The datetime module, however, is written in C, and therefore datetime.__file__ points to a .so file (there is no datetime.__file__ on Windows), and therefore, you can't see the source. If you download a python source tarball and extract it, the modules' code can be found in the Modules subdirectory. For example, if you want to find the datetime code for python 2.6, you can look at Python-2.6/Modules/datetimemodule.c You can also find the latest Mercurial version on the web at https://hg.python.org/cpython/file/tip/Modules/_datetimemodule.c [INST] How to move a file in Python I looked into the Python os interface, but was unable to locate a method to move a file. How would I do the equivalent of $ mv ... in Python? >>> source_files = '/PATH/TO/FOLDER/*' >>> destination_folder = 'PATH/TO/FOLDER' >>> # equivalent of $ mv source_files destination_folder [/INST] os.rename() or shutil.move() Both employ the same syntax: os.rename("path/to/current/file.foo", "path/to/new/desination/for/file.foo") shutil.move("path/to/current/file.foo", "path/to/new/destination/for/file.foo") Note that in both cases the directory in which the new file is being created must already exist, (but, on Windows, a file with that name must not or an exception will be raised). Note also, you must include the file name (file.foo) in both the source and destination arguments. If it is changed, the file will be renamed as well as moved. As has been noted in comments on other answers, shutil.move simply calls os.rename in most cases. However, if the destination is on a different disk than the source, it will instead copy and then delete the source file. [INST] Pretty printing XML in Python What is the best way (or even the various ways) to pretty print xml in Python? [/INST] import xml.dom.minidom xml = xml.dom.minidom.parse(xml_fname) # or xml.dom.minidom.parseString(xml_string) pretty_xml_as_string = xml.toprettyxml() [INST] How do I get the path and name of the file that is currently executing? I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process. For example, let's say I have three files. Using execfile: script_1.py calls script_2.py. In turn, script_2.py calls script_3.py. How can I get the file name and path of script_3.py, from code within script_3.py, without having to pass that information as arguments from script_2.py? (Executing os.getcwd() returns the original starting script's filepath not the current file's.) [/INST] __file__ as others have said. You may want to use: os.path.realpath(__file__) [INST] Get difference between two lists I have two lists in Python, like these: temp1 = ['One', 'Two', 'Three', 'Four'] temp2 = ['One', 'Two'] I need to create a third list with items from the first list which aren't present in the second one. From the example I have to get: temp3 = ['Three', 'Four'] Are there any fast ways without cycles and checking? [/INST] In [5]: list(set(temp1) - set(temp2)) Out[5]: ['Four', 'Three'] [INST] super() raises "TypeError: must be type, not classobj" for new-style class The following use of super() raises a TypeError: why? >>> from HTMLParser import HTMLParser >>> class TextParser(HTMLParser): ... def __init__(self): ... super(TextParser, self).__init__() ... self.all_data = [] ... >>> TextParser() (...) TypeError: must be type, not classobj There is a similar question on StackOverflow: python super() raises TypeError ! Why?, where the error is explained by the fact that the user class is not a new-style class. However, the class above is a new-style class, as it inherits from object: >>> isinstance(HTMLParser(), object) True What am I missing? How can I use super(), here? Using HTMLParser.__init__(self) instead of super(TextParser, self).__init__() would work, but I would like to understand the TypeError. PS: Joachim pointed out that being a new-style-class instance is not equivalent to being an object. I read the opposite many times, hence my confusion (example of new-style class instance test based on object instance test: http://stackoverflow.com/revisions/2655651/3). [/INST] Alright, it's the usual "super() cannot be used with an old-style class". However, the important point is that the correct test for "is this a new-style instance (i.e. object)?" is >>> class OldStyle: pass >>> instance = OldStyle() >>> issubclass(instance.__class__, object) False and not (as in the question): >>> isinstance(instance, object) True For classes, the correct "is this a new-style class" test is: >>> issubclass(OldStyle, object) # OldStyle is not a new-style class False >>> issubclass(int, object) # int is a new-style class True The crucial point is that with old-style classes, the class of an instance and its type are distinct. Here, OldStyle().__class__ is OldStyle, which does not inherit from object, while type(OldStyle()) is the instance type, which does inherit from object. Basically, an old-style class just creates objects of type instance (whereas a new-style class creates objects whose type is the class itself). This is probably why the instance OldStyle() is an object: its type() inherits from object (the fact that its class does not inherit from object does not count: old-style classes merely construct new objects of type instance). Partial reference: http://stackoverflow.com/a/9699961/42973. PS: The difference between a new-style class and an old-style one can also be seen with: >>> type(OldStyle) # OldStyle creates objects but is not itself a type classobj >>> isinstance(OldStyle, type) False >>> type(int) # A new-style class is a type type (old-style classes are not types, so they cannot be the type of their instances). <0[INST] "is" operator behaves unexpectedly with integers Why does the following behave unexpectedly in Python? >>> a = 256 >>> b = 256 >>> a is b True # This is an expected result >>> a = 257 >>> b = 257 >>> a is b False # What happened here? Why is this False? >>> 257 is 257 True # Yet the literal numbers compare properly I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100. Based on the above, I can hypothesize that Python is internally implemented such that "small" integers are stored in a different way than larger integers and the is operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not? [/INST] Take a look at this: >>> a = 256 >>> b = 256 >>> id(a) 9987148 >>> id(b) 9987148 >>> a = 257 >>> b = 257 >>> id(a) 11662816 >>> id(b) 11662828 EDIT: Here's what I found in the Python 2 documentation, "Plain Integer Objects" (It's the same for Python 3): The current implementation keeps an array of integer objects for all integers between -5 and 256, when you create an int in that range you actually just get back a reference to the existing object. So it should be possible to change the value of 1. I suspect the behaviour of Python in this case is undefined. :-) � [INST] Should I put #! (shebang) in Python scripts, and what form should it take? Should I put the shebang in my Python scripts? In what form? #!/usr/bin/env python or #!/usr/local/bin/python Are these equally portable? Which form is used most? Note: the tornado project uses the shebang. On the other hand the Django project doesn't. [/INST] The shebang line in any script determines the script's ability to be executed like an standalone executable without typing python beforehand in the terminal or when double clicking it in a file manager(when configured properly). It isn't necessary but generally put there so when someone sees the file opened in an editor, they immediately know what they're looking at. However, which shebang line you use IS important; Correct usage is: #!/usr/bin/env python #!/usr/bin/env python Usually defaults to python 2.7.latest, and the following defaults to 3.latest #!/usr/bin/env python3 DO NOT Use: #!/usr/local/bin/python "python may be installed at /usr/bin/python or /bin/python in those cases, the above #! will fail." --"#!/usr/bin/env python" vs "#!/usr/local/bin/python" [INST] What does functools.wraps do? In a comment on the answer to another question, someone said they weren't sure what functools.wraps was doing. So I'm asking this question so that there will be a record of it on StackOverflow for future reference: what does functools.wraps do, exactly? [/INST] When you use a decorator, you're replacing one function with another. In other words, if you have a decorator def logged(func): def with_logging(*args, **kwargs): print func.__name__ + " was called" return func(*args, **kwargs) return with_logging then when you say @logged def f(x): """does some math""" return x + x * x it's exactly the same as saying def f(x): """does some math""" return x + x * x f = logged(f) and your function f is replaced with the function with_logging. Unfortunately, this means that if you then say print f.__name__ it will print with_logging because that's the name of your new function. In fact, if you look at the docstring for f, it will be blank because with_logging has no docstring, and so the docstring you wrote won't be there anymore. Also, if you look at the pydoc result for that function, it won't be listed as taking one argument x; instead it'll be listed as taking *args and **kwargs because that's what with_logging takes. If using a decorator always meant losing this information about a function, it would be a serious problem. That's why we have functools.wraps. This takes a function used in a decorator and adds the functionality of copying over the function name, docstring, arguments list, etc. And since wraps is itself a decorator, the following code does the correct thing: from functools import wraps def logged(func): @wraps(func) def with_logging(*args, **kwargs): print func.__name__ + " was called" return func(*args, **kwargs) return with_logging @logged def f(x): """does some math""" return x + x * x print f.__name__ # prints 'f' print f.__doc__ # prints 'does some math' [INST] Why are there no ++ and --​ operators in Python? Why are there no ++ and -- operators in Python? [/INST] It's not because it doesn't make sense; it makes perfect sense to define "x++" as "x += 1, evaluating to the previous binding of x". If you want to know the original reason, you'll have to either wade through old Python mailing lists or ask somebody who was there (eg. Guido), but it's easy enough to justify after the fact: Simple increment and decrement aren't needed as much as in other languages. You don't write things like for(int i = 0; i < 10; ++i) in Python very often; instead you do things like for i in range(0, 10). Since it's not needed nearly as often, there's much less reason to give it its own special syntax; when you do need to increment, += is usually just fine. It's not a decision of whether it makes sense, or whether it can be done--it does, and it can. It's a question of whether the benefit is worth adding to the core syntax of the language. Remember, this is four operators--postinc, postdec, preinc, predec, and each of these would need to have its own class overloads; they all need to be specified, and tested; it would add opcodes to the language (implying a larger, and therefore slower, VM engine); every class that supports a logical increment would need to implement them (on top of += and -=). This is all redundant with += and -=, so it would become a net loss. [INST] How to check if type of a variable is string? Is there a way to check if the type of a variable in python is string.. like isinstance(x,int); for integer values? [/INST] In Python 2.x, you would do isinstance(s, basestring) basestring is the abstract superclass of str and unicode. It can be used to test whether an object is an instance of str or unicode. Equivalent code: isinstance(s, (str, unicode)) In Python 3.x, it would be isinstance(s, str) (basestring is not defined in Python 3.) [INST] What is the quickest way to HTTP GET in Python? What is the quickest way to HTTP GET in Python if I know the Content will be a string? I am searching the docs for a quick one-liner like: contents = url.get("http://example.com/foo/bar") But all I can find using Google are httplib and urllib - and I am unable to find a shortcut in those libraries. Does standard Python 2.5 have a shortcut in some form as above, or should I write a function url_get? I would prefer not to capture the output of shelling out to wget or curl. [/INST] Python 2.x: import urllib2 urllib2.urlopen("http://example.com/foo/bar").read() Python 3.x: import urllib.request urllib.request.urlopen("http://example.com/foo/bar").read() Documentation for urllib.request and read. How is that? [INST] How to capitalize the first letter of each word in a string (Python)? s = 'the brown fox' ...do something here... s should be : 'The Brown Fox' What's the easiest way to do this? [/INST] The .title() method of a string (either ASCII or Unicode is fine) does this: >>> "hello world".title() 'Hello World' >>> u"hello world".title() u'Hello World' However, look out for strings with embedded apostrophes, as noted in the docs. The algorithm uses a simple language-independent definition of a word as groups of consecutive letters. The definition works in many contexts but it means that apostrophes in contractions and possessives form word boundaries, which may not be the desired result: >>> "they're bill's friends from the UK".title() "They'Re Bill'S Friends From The Uk" [INST] Command Line Arguments In Python I am originally a C programmer. I have seen numerous tricks and "hacks" to read many different arguments. What are some of the ways Python programmers can do this? Related What’s the best way to grab/parse command line arguments passed to a Python script? Implementing a “[command] [action] [parameter]” style command-line interfaces? How can I process command line arguments in Python? How do I format positional argument help using Python’s optparse? [/INST] import sys print "\n".join(sys.argv) sys.argv is a list that contains all the arguments passed to the script on the command line. Basically, import sys print sys.argv[1:] [INST] Python reverse / invert a mapping Given a dictionary like so: my_map = { 'a': 1, 'b':2 } How can one invert this map to get: inv_map = { 1: 'a', 2: 'b' } EDITOR NOTE: map changed to my_map to avoid conflicts with the built-in function, map. Some comments may be affected below. [/INST] For Python 2.7.x inv_map = {v: k for k, v in my_map.iteritems()} For Python 3+: inv_map = {v: k for k, v in my_map.items()} [INST] How do I do a case insensitive string comparison in Python? What's the best way to do case insensitive string comparison in Python? I would like to encapsulate comparison of a regular strings to a repository string using in a very simple and pythonic way. I also would like to have ability to look up values in a dict hashed by strings using regular python strings. Much obliged for advice. [/INST] Assuming ASCII strings: string1 = 'Hello' string2 = 'hello' if string1.lower() == string2.lower(): print "The strings are the same (case insensitive)" else: print "The strings are not the same (case insensitive)" [INST] Python style: multiple-line conditions in IFs Sometimes I break long conditions in IFs to several lines. The most obvious way to do this is: if (cond1 == 'val1' and cond2 == 'val2' and cond3 == 'val3' and cond4 == 'val4'): do_something Isn't very very appealing visually, because the action blends with the conditions. However, it is the natural way using correct Python indentation of 4 spaces. For the moment I'm using: if ( cond1 == 'val1' and cond2 == 'val2' and cond3 == 'val3' and cond4 == 'val4'): do_something But this isn't very pretty. :-) Can you recommend an alternative way ? [/INST] You don't need to use 4 spaces on your second conditional line. Maybe use: if (cond1 == 'val1' and cond2 == 'val2' and cond3 == 'val3' and cond4 == 'val4'): do_something Also, don't forget the whitespace is more flexible than you might think: if ( cond1 == 'val1' and cond2 == 'val2' and cond3 == 'val3' and cond4 == 'val4' ): do_something if (cond1 == 'val1' and cond2 == 'val2' and cond3 == 'val3' and cond4 == 'val4'): do_something Both of those are fairly ugly though. Maybe lose the brackets (the Style Guide discourages this though)? if cond1 == 'val1' and cond2 == 'val2' and \ cond3 == 'val3' and cond4 == 'val4': do_something This at least gives you some differentiation. Or even: if cond1 == 'val1' and cond2 == 'val2' and \ cond3 == 'val3' and \ cond4 == 'val4': do_something I think I prefer: if cond1 == 'val1' and \ cond2 == 'val2' and \ cond3 == 'val3' and \ cond4 == 'val4': do_something Here's the Style Guide, which (since 2010) recommends using brackets. [INST] What is the common header format of Python files? I came across the following header format for Python source files in a document about Python coding guidelines: #!/usr/bin/env python """Foobar.py: Description of what foobar does.""" __author__ = "Barack Obama" __copyright__ = "Copyright 2009, Planet Earth" Is this the standard format of headers in the Python world? What other fields/information can I put in the header? Python gurus share your guidelines for good Python source headers :-) [/INST] Its all metadata for the Foobar module. The first one is the docstring of the module, that is already explained in Peter's answer. How do I organize my modules (source files)? (Archive) The first line of each file shoud be #!/usr/bin/env python. This makes it possible to run the file as a script invoking the interpreter implicitly, e.g. in a CGI context. Next should be the docstring with a description. If the description is long, the first line should be a short summary that makes sense on its own, separated from the rest by a newline. All code, including import statements, should follow the docstring. Otherwise, the docstring will not be recognized by the interpreter, and you will not have access to it in interactive sessions (i.e. through obj.__doc__) or when generating documentation with automated tools. Import built-in modules first, followed by third-party modules, followed by any changes to the path and your own modules. Especially, additions to the path and names of your modules are likely to change rapidly: keeping them in one place makes them easier to find. Next should be authorship information. This information should follow this format: __author__ = "Rob Knight, Gavin Huttley, and Peter Maxwell" __copyright__ = "Copyright 2007, The Cogent Project" __credits__ = ["Rob Knight", "Peter Maxwell", "Gavin Huttley", "Matthew Wakefield"] __license__ = "GPL" __version__ = "1.0.1" __maintainer__ = "Rob Knight" __email__ = "rob@spot.colorado.edu" __status__ = "Production" Status should typically be one of "Prototype", "Development", or "Production". __maintainer__ should be the person who will fix bugs and make improvements if imported. __credits__ differs from __author__ in that __credits__ includes people who reported bug fixes, made suggestions, etc. but did not actually write the code. Here you have more information, listing __author__, __authors__, __contact__, __copyright__, __license__, __deprecated__, __date__ and __version__ as recognized metadata. [INST] Calling C/C++ from python? What would be the quickest way to construct a python binding to a C or C++ library? (using windows if this matters) [/INST] I like ctypes a lot, swig always tended to give me problems. Also ctypes has the advantage that you don't need to satisfy any compile time dependency on python, and your binding will work on any python that has ctypes, not just the one it was compiled against. Suppose you have a simple C++ example class you want to talk to in a file called foo.cpp: #include class Foo{ public: void bar(){ std::cout << "Hello" << std::endl; } }; Since ctypes can only talk to C functions, you need to provide those declaring them as extern "C" extern "C" { Foo* Foo_new(){ return new Foo(); } void Foo_bar(Foo* foo){ foo->bar(); } } Next you have to compile this to a shared library g++ -c -fPIC foo.cpp -o foo.o g++ -shared -Wl,-soname,libfoo.so -o libfoo.so foo.o And finally you have to write your python wrapper (e.g. in fooWrapper.py) from ctypes import cdll lib = cdll.LoadLibrary('./libfoo.so') class Foo(object): def __init__(self): self.obj = lib.Foo_new() def bar(self): lib.Foo_bar(self.obj) Once you have that you can call it like f = Foo() f.bar() #and you will see "Hello" on the screen [INST] How to check what OS am I running on in Python? What do I need to look at to see if I'm on Windows, Unix, etc? [/INST] >>> import os >>> print os.name posix >>> import platform >>> platform.system() 'Linux' >>> platform.release() '2.6.22-15-generic' See: platform — Access to underlying platform’s identifying data [INST] How do I convert datetime to date (in Python)? How do I convert a datetime.datetime object (for example, the return value of datetime.datetime.now()) to a datetime.date object in Python? [/INST] Use the date() method: datetime.datetime.now().date() [INST] How to generate all permutations of a list in Python How do you generate all the permutations of a list in Python, independently of the type of elements in that list? For example: permutations([]) [] permutations([1]) [1] permutations([1, 2]) [1, 2] [2, 1] permutations([1, 2, 3]) [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1] EDIT: Eliben pointed to a solution that's similar to mine although simpler, so I'm choosing it as the accepted answer, although Python 2.6+ has a builtin solution in the itertools module: import itertools itertools.permutations([1, 2, 3]) [/INST] And in Python 2.6 onwards: import itertools itertools.permutations([1,2,3]) (returned as a generator. Use list(permutations(l)) to return as a list.) [INST] How do I determine the size of an object in Python? In C, we can find the size of an int, char, etc. I want to know how to get size of objects like a string, integer, etc. in Python. Related question: How many bytes per element are there in a Python list (tuple)? I am using an XML file which contains size fields that specify the size of value. I must parse this XML and do my coding. When I want to change the value of a particular field, I will check the size field of that value. Here I want to compare whether the new value that I'm gong to enter is of the same size as in XML. I need to check the size of new value. In case of a string I can say its the length. But in case of int, float, etc. I am confused. [/INST] Just use the sys.getsizeof function defined in the sys module. sys.getsizeof(object[, default]): Return the size of an object in bytes. The object can be any type of object. All built-in objects will return correct results, but this does not have to hold true for third-party extensions as it is implementation specific. The default argument allows to define a value which will be returned if the object type does not provide means to retrieve the size and would cause a TypeError. getsizeof calls the object’s __sizeof__ method and adds an additional garbage collector overhead if the object is managed by the garbage collector. Usage example, in python 3.0: >>> import sys >>> x = 2 >>> sys.getsizeof(x) 14 >>> sys.getsizeof(sys.getsizeof) 32 >>> sys.getsizeof('this') 38 >>> sys.getsizeof('this also') 48 If you are in python < 2.6 and don't have sys.getsizeof you can use this extensive module instead. Never used it though. [INST] Call a parent class's method from child class in Python? When creating a simple object hierarchy in Python, I'd like to be able to invoke methods of the parent class from a derived class. In Perl and Java, there is a keyword for this (super). In Perl, I might do this: package Foo; sub frotz { return "Bamf"; } package Bar; @ISA = qw(Foo); sub frotz { my $str = SUPER::frotz(); return uc($str); } In python, it appears that I have to name the parent class explicitly from the child. In the example above, I'd have to do something like Foo::frotz(). This doesn't seem right, since this behavior makes it hard to make deep hierarchies. If children need to know what class defined an inherited method, then all sorts of information pain is created. Is this an actual limitation in python, a gap in my understanding or both? [/INST] Yes, but only with new-style classes. Use the super() function: class Foo(Bar): def baz(self, arg): return super(Foo, self).baz(arg) [INST] Python - Intersection of two lists I know how to get an intersection of two flat lists: b1 = [1,2,3,4,5,9,11,15] b2 = [4,5,6,7,8] b3 = [val for val in b1 if val in b2] or def intersect(a, b): return list(set(a) & set(b)) print intersect(b1, b2) But when I have to find intersection for nested lists then my problems starts: c1 = [1, 6, 7, 10, 13, 28, 32, 41, 58, 63] c2 = [[13, 17, 18, 21, 32], [7, 11, 13, 14, 28], [1, 5, 6, 8, 15, 16]] In the end I would like to receive: c3 = [[13,32],[7,13,28],[1,6]] Can you guys give me a hand with this? Related Flattening a shallow list in python [/INST] You don't need to define intersection. It's already a first-class part of set. >>> b1 = [1,2,3,4,5,9,11,15] >>> b2 = [4,5,6,7,8] >>> set(b1).intersection(b2) set([4, 5]) [INST] How do I remove the first Item from a Python list? Possible Duplicate: good primer for python slice notation I have the list [0, 1, 2, 3, 4] I'd like to make it into [1, 2, 3, 4]. How do I go about this? [/INST] Python List list.pop(index) >>> l = [0, 1, 2, 3, 4] >>> l.pop(0) 0 >>> l [1, 2, 3, 4] del list[index] >>> l = [0, 1, 2, 3, 4] >>> del l[0] >>> l [1, 2, 3, 4] These both modify your original list. Others have suggested using slicing: Copies the list Can return a subset Also, if you are performing many pop(0), you should look at collections.deque from collections import deque >>> l = deque([0, 1, 2, 3, 4]) >>> l.popleft() 0 >>> l deque([1, 2, 3, 4]) Provides higher performance popping from left end of the list [INST] How can I iterate through two lists in parallel in Python? I have two iterables in Python, and I want to go over them in pairs: foo = (1, 2, 3) bar = (4, 5, 6) for (f, b) in some_iterator(foo, bar): print "f: ", f, "; b: ", b It should result in: f: 1; b: 4 f: 2; b: 5 f: 3; b: 6 One way to do it is to iterate over the indices: for i in xrange(len(foo)): print "f: ", foo[i], "; b: ", b[i] But that seems somewhat unpythonic to me. Is there a better way to do it? [/INST] for f, b in zip(foo, bar): print(f, b) zip stops when the shorter of foo or bar stops. In Python 2, zip returns a list of tuples. This is fine when foo and bar are not massive. If they are both massive then forming zip(foo,bar) is an unnecessarily massive temporary variable, and should be replaced by itertools.izip or itertools.izip_longest, which returns an iterator instead of a list. import itertools for f,b in itertools.izip(foo,bar): print(f,b) for f,b in itertools.izip_longest(foo,bar): print(f,b) izip stops when either foo or bar is exhausted. izip_longest stops when both foo and bar are exhausted. When the shorter iterator(s) are exhausted, izip_longest yields a tuple with None in the position corresponding to that iterator. You can also set a different fillvalue besides None if you wish. See here for the full story. In Python 3, zip returns an iterator of tuples, like itertools.izip in Python2. To get a list of tuples, use list(zip(foo, bar)). And to zip until both iterators are exhausted, you would use itertools.zip_longest. Note also that zip and its zip-like brethen can accept an arbitrary number of iterables as arguments. For example, for num, cheese, color in zip([1,2,3], ['manchego', 'stilton', 'brie'], ['red', 'blue', 'green']): print('{} {} {}'.format(num, color, cheese)) prints 1 red manchego 2 blue stilton 3 green brie [INST] What is a "slug" in Django? When I read Django code I often see in models what is called a "slug". I am not quite sure what this is, but I do know it has something to do with URLs. How and when is this slug-thing supposed to be used? (I have read its definition in this glossary.) [/INST] It's a way of generating a valid URL, generally using data already obtained. For instance, using the title of an article to generate a URL. I'd advise to generate the slug, using a function, given a title (or other piece of data), rather than setting it manually. An example: The 46 Year Old Virgin A silly comedy movie the-46-year-old-virgin Now let's pretend that we have a Django model such as: class Article(models.Model): title = models.CharField(max_length=100) content = models.TextField(max_length=1000) slug = models.SlugField(max_length=40) How would you reference this object with a URL, with a meaningful name? You could use Article.id so the URL would look like this: www.example.com/article/23 Or, you could reference the title like so: www.example.com/article/The 46 Year Old Virgin Problem is, spaces aren't valid in URLs, they need to be replaced by %20 which is ugly, making it the following: www.example.com/article/The%2046%20Year%20Old%20Virgin That's not solving our meaningful URL. Wouldn't this be better: www.example.com/article/the-46-year-old-virgin That's a slug. the-46-year-old-virgin. All letters are downcased and spaces are replaced by hyphens -. See the URL of this very webpage for an example! [INST] Does Python have “private” variables in classes? I'm coming from the Java world and reading Bruce Eckels' Python 3 Patterns, Recipes and Idioms. While reading about classes, it goes on to say that in Python there is no need to declare instance variables. You just use them in the constructor, and boom, they are there. So for example: class Simple: def __init__(self1, str): print("inside the simple constructor") self1.s = str def show(self1): print(self1.s) def showMsg (self, msg): print (msg + ':', self.show()) If that’s true, then any object of class Simple can just change the value of variable s outside of the class. For example: if __name__ == "__main__": x = Simple("constructor argument") x.s = "test15" # this changes the value x.show() x.showMsg("A message") In Java, we have been taught about public/private/protected variables. Those keywords make sense because at times you want variables in a class to which no one outside the class has access to. Why is that not required in Python? [/INST] It's cultural. In Python, you don't write to other classes' instance or class variables. In Java, nothing prevents you from doing the same if you really want to - after all, you can always edit the source of the class itself to achieve the same effect. Python drops that pretence of security and encourages programmers to be responsible. In practice, this works very nicely. If you want to emulate private variables for some reason, you can always use the __ prefix from PEP 8. Python mangles the names of variables like __foo so that they're not easily visible to code outside the class that contains them (although you can get around it if you're determined enough, just like you can get around Java's protections if you work at it). By the same convention, the _ prefix means stay away even if you're not technically prevented from doing so. You don't play around with another class's variables that look like __foo or _bar. [INST] What is the use of "assert" in Python? I have been reading some source code and in several places I have seen the usage of assert. What does it mean exactly? What is its usage? [/INST] The assert statement exists in almost every programming language. When you do... assert condition ... you're telling the program to test that condition, and trigger an error if the condition is false. In Python, it's roughly equivalent to this: if not condition: raise AssertionError() Try it in the Python shell: >>> assert True >>> assert False Traceback (most recent call last): File "", line 1, in AssertionError Assertions can include an optional message, and you can disable them when you're done debugging. See here for the relevant documentation. [INST] Multiprocessing vs Threading Python I am trying to understand the advantages of multiprocessing over threading. I know that multiprocessing gets around the Global Interpreter Lock, but what other advantages are there, and can threading not do the same thing? [/INST] Here are some pros/cons I came up with. Multiprocessing Pros Separate memory space Code is usually straightforward Takes advantage of multiple CPUs & cores Avoids GIL limitations for cPython Eliminates most needs for synchronization primitives unless if you use shared memory (instead, it's more of a communication model for IPC) Child processes are interruptible/killable Python multiprocessing module includes useful abstractions with an interface much like threading.Thread A must with cPython for CPU-bound processing Cons IPC a little more complicated with more overhead (communication model vs. shared memory/objects) Larger memory footprint Threading Pros Lightweight - low memory footprint Shared memory - makes access to state from another context easier Allows you to easily make responsive UIs cPython C extension modules that properly release the GIL will run in parallel Great option for I/O-bound applications Cons cPython - subject to the GIL Not interruptible/killable If not following a command queue/message pump model (using the Queue module), then manual use of synchronization primitives become a necessity (decisions are needed for the granularity of locking) Code is usually harder to understand and to get right - the potential for race conditions increases dramatically [INST] How to get full path of current file's directory in Python? I want to get the current file's directory path. I tried: >>> os.path.abspath(__file__) 'C:\\python27\\test.py' But how can I retrieve the directory's path? For example: 'C:\\python27\\' [/INST] If you mean the directory of the script being run: import os os.path.dirname(os.path.abspath(__file__)) If you mean the current working directory: import os os.getcwd() Note that before and after file is two underscores, not just one. [INST] What is a Python egg? I'm new to Python and am just trying to understand how its packages work. Presumably "eggs" are some sort of packaging mechanism, but what would be a quick overview of what role they play and maybe some information on why they're useful and how to create them? [/INST] Same concept as a .jar file in Java, it is a .zip file with some metadata files renamed .egg, for distributing code as bundles. Specifically: The Internal Structure of Python Eggs A "Python egg" is a logical structure embodying the release of a specific version of a Python project, comprising its code, resources, and metadata. There are multiple formats that can be used to physically encode a Python egg, and others can be developed. However, a key principle of Python eggs is that they should be discoverable and importable. That is, it should be possible for a Python application to easily and efficiently find out what eggs are present on a system, and to ensure that the desired eggs' contents are importable. The .egg format is well-suited to distribution and the easy uninstallation or upgrades of code, since the project is essentially self-contained within a single directory or file, unmingled with any other projects' code or resources. It also makes it possible to have multiple versions of a project simultaneously installed, such that individual programs can select the versions they wish to use. Note: Egg packaging has been superseded by Wheel packaging. [INST] Dynamic module import in Python I'm writing a Python application that takes as a command as an argument, for example: $ python myapp.py command1 I want the application to be extensible, that is, to be able to add new modules that implement new commands without having to change the main application source. The tree looks something like: myapp/ __init__.py commands/ __init__.py command1.py command2.py foo.py bar.py So I want the application to find the available command modules at runtime and execute the appropriate one. Currently this is implemented something like: command = sys.argv[1] try: command_module = __import__("myapp.commands.%s" % command, fromlist=["myapp.commands"]) except ImportError: # Display error message command_module.run() This works just fine, I'm just wondering if there is possibly a more idiomatic way to accomplish what we are doing with this code. Note that I specifically don't want to get in to using eggs or extension points. This is not an open-source project and I don't expect there to be "plugins". The point is to simplify the main application code and remove the need to modify it each time a new command module is added. [/INST] With Python older than 2.7/3.1, that's pretty much how you do it. For newer versions, see importlib.import_module for 2.7+ and for 3.1+. You can use exec if you want to as well. Note you can import a list of modules by doing this: >>> moduleNames = ['sys', 'os', 're', 'unittest'] >>> moduleNames ['sys', 'os', 're', 'unittest'] >>> modules = map(__import__, moduleNames) Ripped straight from Dive Into Python. [INST] Iterating over a string In C++, I could do: for (int i = 0; i < str.length(); ++i) std::cout << str[i] << std::endl; How do I iterate over a string in Python? [/INST] As Johannes pointed out, for c in "string": #do something with c You can iterate pretty much anything in python using the for loop construct, for example, open("file.txt") returns a file object (and opens the file), iterating over it iterates over lines in that file for line in open(filename): # do something with line If that seems like magic, well it kinda is, but the idea behind it is really simple. There's a simple iterator protocol that can be applied to any kind of object to make the for loop work on it. Simply implement an iterator that defines a next() method, and implement an __iter__ method on a class to make it iterable. (the __iter__ of course, should return an iterator object, that is, an object that defines next()) See official documentation [INST] Best way to strip punctuation from a string in Python It seems like there should be a simpler way than: import string s = "string. With. Punctuation?" # Sample string out = s.translate(string.maketrans("",""), string.punctuation) Is there? [/INST] From an efficiency perspective, you're not going to beat translate() - it's performing raw string operations in C with a lookup table - there's not much that will beat that but writing your own C code. If speed isn't a worry, another option though is: exclude = set(string.punctuation) s = ''.join(ch for ch in s if ch not in exclude) This is faster than s.replace with each char, but won't perform as well as non-pure python approaches such as regexes or string.translate, as you can see from the below timings. For this type of problem, doing it at as low a level as possible pays off. Timing code: import re, string, timeit s = "string. With. Punctuation" exclude = set(string.punctuation) table = string.maketrans("","") regex = re.compile('[%s]' % re.escape(string.punctuation)) def test_set(s): return ''.join(ch for ch in s if ch not in exclude) def test_re(s): # From Vinko's solution, with fix. return regex.sub('', s) def test_trans(s): return s.translate(table, string.punctuation) def test_repl(s): # From S.Lott's solution for c in string.punctuation: s=s.replace(c,"") return s print "sets :",timeit.Timer('f(s)', 'from __main__ import s,test_set as f').timeit(1000000) print "regex :",timeit.Timer('f(s)', 'from __main__ import s,test_re as f').timeit(1000000) print "translate :",timeit.Timer('f(s)', 'from __main__ import s,test_trans as f').timeit(1000000) print "replace :",timeit.Timer('f(s)', 'from __main__ import s,test_repl as f').timeit(1000000) This gives the following results: sets : 19.8566138744 regex : 6.86155414581 translate : 2.12455511093 replace : 28.4436721802 [INST] Python decimal range() step value Is there a way to step between 0 and 1 by 0.1? I thought I could do it like the following, but it failed: for i in range(0, 1, 0.1): print i Instead, it says that the step argument cannot be zero, which I did not expect. [/INST] You can also use the NumPy library (which isn't part of standard library but is relatively easy to obtain) which has the arange function: >>> import numpy as np >>> np.arange(0,1,0.1) array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]) as well as the linspace function which lets you have control over what happens at the endpoint (non-trivial for floating point numbers when things won't always divide into the correct number of "slices"): >>> np.linspace(0,1,11) array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. ]) >>> np.linspace(0,1,10,endpoint=False) array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]) [INST] How can I open multiple files using "with open" in Python? I want to change a couple of files at one time, iff I can write to all of them. I'm wondering if I somehow can combine the multiple open calls with the with statement: try: with open('a', 'w') as a and open('b', 'w') as b: do_something() except IOError as e: print 'Operation failed: %s' % e.strerror If that's not possible, what would an elegant solution to this problem look like? [/INST] As of Python 2.7 (or 3.1 respectively) you can write with open('a', 'w') as a, open('b', 'w') as b: do_something() In earlier versions of Python, you can sometimes use contextlib.nested() to nest context managers. This won't work as expected for opening multiples files, though -- see the linked documentation for details. [INST] How to print the full traceback without halting the program? I'm writing a program that parses 10 websites, locates data files, saves the files, and then parses them to make data that can be readily used in the NumPy library. There are tons of errors this file encounters through bad links, poorly formed XML, missing entries, and other things I've yet to categorize. I initially made this program to handle errors like this: try: do_stuff() except: pass But now I want to log errors: try: do_stuff() except Exception, err: print Exception, err Note this is printing to a log file for later review. This usually prints very useless data. What I want is to print the exact same lines printed when the error triggers without the try-except intercepting the exception, but I don't want it to halt my program since it is nested in a series of for loops that I would like to see to completion. [/INST] traceback.format_exc() or sys.exc_info() will yield more info if that's what you want. import traceback import sys try: do_stuff() except Exception: print(traceback.format_exc()) # or print(sys.exc_info()[0]) [INST] What is setup.py? Can anyone please explain, what is setup.py and how can it be configured or used? [/INST] setup.py is a python file, which usually tells you that the module/package you are about to install have been packaged and distributed with Distutils, which is the standard for distributing Python Modules. This allows you to easily install Python packages, often it's enough to write: python setup.py install and the module will install itself. http://docs.python.org/install/index.html [INST] Disable output buffering Is output buffering enabled by default in Python's interpreter for sys.stdout? If the answer is positive, what are all the ways to disable it? Suggestions so far: Use the -u command line switch Wrap sys.stdout in an object that flushes after every write Set PYTHONUNBUFFERED env var sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) Is there any other way to set some global flag in sys/sys.stdout programmatically during execution? [/INST] From Magnus Lycka answer on a mailing list: You can skip buffering for a whole python process using "python -u" (or#!/usr/bin/env python -u etc) or by setting the environment variable PYTHONUNBUFFERED. You could also replace sys.stdout with some other stream like wrapper which does a flush after every call. class Unbuffered(object): def __init__(self, stream): self.stream = stream def write(self, data): self.stream.write(data) self.stream.flush() def __getattr__(self, attr): return getattr(self.stream, attr) import sys sys.stdout = Unbuffered(sys.stdout) print 'Hello' [INST] How do you test that a Python function throws an exception? How does one write a unittest that fails only if a function doesn't throw an expected exception? [/INST] Use TestCase.assertRaises (or TestCase.failUnlessRaises) from the unittest module, for example: import mymod class MyTestCase(unittest.TestCase): def test1(self): self.assertRaises(SomeCoolException, mymod.myfunc) [INST] Python Create unix timestamp five minutes in the future I have to create an "Expires" value 5 minutes in the future, but I have to supply it in UNIX Timestamp format. I have this so far, but it seems like a hack. def expires(): '''return a UNIX style timestamp representing 5 minutes from now''' epoch = datetime.datetime(1970, 1, 1) seconds_in_a_day = 60 * 60 * 24 five_minutes = datetime.timedelta(seconds=5*60) five_minutes_from_now = datetime.datetime.now() + five_minutes since_epoch = five_minutes_from_now - epoch return since_epoch.days * seconds_in_a_day + since_epoch.seconds Is there a module or function that does the timestamp conversion for me? [/INST] Another way is to use calendar.timegm: future = datetime.datetime.utcnow() + datetime.timedelta(minutes=5) return calendar.timegm(future.timetuple()) It's also more portable than %s flag to strftime (which doesn't work on Windows). [INST] Where do the Python unit tests go? If you're writing a library, or an app, where do the unit test files go? It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirectory inside of the app root directory, because it makes it harder to import the modules that you'll be testing. Is there a best practice here? [/INST] For a file module.py, the unit test should normally be called test_module.py, following Pythonic naming conventions. There are several commonly accepted places to put test_module.py: In the same directory as module.py. In ../tests/test_module.py (at the same level as the code directory). In tests/test_module.py (one level under the code directory). I prefer #1 for its simplicity of finding the tests and importing them. Whatever build system you're using can easily be configured to run files starting with test_. Actually, the default unittest pattern used for test discovery is test*.py. [INST] Running unittest with typical test directory structure The very common directory structure for even a simple Python module seems to be to separate the unit tests into their own test directory: new_project/ antigravity/ antigravity.py test/ test_antigravity.py setup.py etc. for example see this Python project howto. My question is simply What's the usual way of actually running the tests? I suspect this is obvious to everyone except me, but you can't just run python test_antigravity.py from the test directory as its import antigravity will fail as the module is not on the path. I know I could modify PYTHONPATH and other search path related tricks, but I can't believe that's the simplest way - it's fine if you're the developer but not realistic to expect your users to use if they just want to check the tests are passing. The other alternative is just to copy the test file into the other directory, but it seems a bit dumb and misses the point of having them in a separate directory to start with. So, if you had just downloaded the source to my new project how would you run the unit tests? I'd prefer an answer that would let me say to my users: "To run the unit tests do X." [/INST] The best solution in my opinion is to use the unittest command line interface which will add the directory to the sys.path so you don't have to (done in the TestLoader class). For example for a directory structure like this: new_project ├── antigravity.py └── test_antigravity.py You can just run: $ cd new_project $ python -m unittest test_antigravity For a directory structure like yours: new_project ├── antigravity │   ├── __init__.py # make it a package │   └── antigravity.py └── test ├── __init__.py # also make test a package └── test_antigravity.py And in the test modules inside the test package, you can import the antigravity package and its modules as usual: # import the package import antigravity # import the antigravity module from antigravity import antigravity # or an object inside the antigravity module from antigravity.antigravity import my_object Running a single test module: To run a single test module, in this case test_antigravity.py: $ cd new_project $ python -m unittest test.test_antigravity Just reference the test module the same way you import it. Running a single test case or test method: Also you can run a single TestCase or a single test method: $ python -m unittest test.test_antigravity.GravityTestCase $ python -m unittest test.test_antigravity.GravityTestCase.test_method Running all tests: You can also use test discovery which will discover and run all the tests for you, they must be modules or packages named test*.py (can be changed with the -p, --pattern flag): $ cd new_project $ python -m unittest discover This will run all the test*.py modules inside the test package. [INST] How do I capture SIGINT in Python? I'm working on a python script that starts several processes and database connections. Every now and then I want to kill the script with a Ctrl+C signal, and I'd like to do some cleanup. In Perl I'd do this: $SIG{'INT'} = 'exit_gracefully'; sub exit_gracefully { print "Caught ^C \n"; exit (0); } How do I do the analogue of this in Python? [/INST] Register your handler with signal.signal like this: #!/usr/bin/env python import signal import sys def signal_handler(signal, frame): print('You pressed Ctrl+C!') sys.exit(0) signal.signal(signal.SIGINT, signal_handler) print('Press Ctrl+C') signal.pause() Code adapted from here. More documentation on signal can be found here. [INST] How do I write JSON data to a file in Python? I have JSON data stored in the variable data. I want to write this to a text file for testing so I don't have to grab the data from the server each time. Currently, I am trying this: obj = open('data.txt', 'wb') obj.write(data) obj.close And am receiving the error: TypeError: must be string or buffer, not dict How to fix this? [/INST] You forgot the actual JSON part - data is a dictionary and not yet JSON-encoded. Write it like this: import json with open('data.txt', 'w') as outfile: json.dump(data, outfile) Note: Works on both 3.x and 2.x . [INST] Importing files from different folder in Python I have the following folder structure. application/app/folder/file.py and I want to import some functions from file.py in another Python file which resides in application/app2/some_folder/some_file.py I've tried from application.app.folder.file import func_name and some other various attempts but so far I couldn't manage to import properly. How can I do this? [/INST] By default, you can't. When importing a file, Python only searches the current directory, the directory that the entry-point script is running from, and sys.path which includes locations such as the package installation directory (it's actually a little more complex than this, but this covers most cases). However, you can add to the Python path at runtime: # some_file.py import sys sys.path.insert(0, '/path/to/application/app/folder') import file [INST] What are the differences between json and simplejson Python modules? I have seen many projects using simplejson module instead of json module from the Standard Library. Also, there are many different simplejson modules. Why would use these alternatives, instead of the one in the Standard Library? [/INST] json is simplejson, added to the stdlib. But since json was added in 2.6, simplejson has the advantage of working on more Python versions (2.4+). simplejson is also updated more frequently than Python, so if you need (or want) the latest version, it's best to use simplejson itself, if possible. A good practice, in my opinion, is to use one or the other as a fallback. try: import simplejson as json except ImportError: import json [INST] Finding local IP addresses using Python's stdlib How can I find local IP addresses (i.e. 192.168.x.x or 10.0.x.x) in Python platform independently and using only the standard library? [/INST] I just found this but it seems a bit hackish, however they say tried it on *nix and I did on windows and it worked. import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("gmail.com",80)) print(s.getsockname()[0]) s.close() This assumes you have an internet access, and that there is no local proxy. [INST] Shuffling a list of objects in python I have a list of objects in Python and I want to shuffle them. I thought I could use the random.shuffle method, but this seems to fail when the list is of objects. Is there a method for shuffling object or another way around this? import random class a: foo = "bar" a1 = a() a2 = a() b = [a1,a2] print random.shuffle(b) This will fail. [/INST] random.shuffle should work. Here's an example, where the objects are lists: from random import shuffle x = [[i] for i in range(10)] shuffle(x) # print x gives [[9], [2], [7], [0], [4], [5], [3], [1], [8], [6]] # of course your results will vary Note that shuffle works in place, and returns None. [INST] How to print number with commas as thousands separators? I am trying to print an integer in Python 2.6.1 with commas as thousands separators. For example, I want to show the number 1234567 as 1,234,567. How would I go about doing this? I have seen many examples on Google, but I am looking for the simplest practical way. It does not need to be locale-specific to decide between periods and commas. I would prefer something as simple as reasonably possible. [/INST] I too, prefer the "simplest practical way". For >= 2.7: "{:,}".format(value) http://docs.python.org/library/string.html#format-specification-mini-language [INST] Best practice for Python Assert Is there a performance or code maintenance issue with using assert as part of the standard code instead of using it just for debugging purposes? Is assert x >= 0, 'x is less than zero' better or worse than if x < 0: raise Exception, 'x is less than zero' Also, is there any way to set a business rule like if x < 0 raise error that is always checked without the try/except/finally so, if at anytime throughout the code x is less than 0 an error is raised, like if you set assert x < 0 at the start of a function, anywhere within the function where x becomes less then 0 an exception is raised? [/INST] Asserts should be used to test conditions that should never happen. The purpose is to crash early in the case of a corrupt program state. Exceptions should be used for errors that can conceivably happen, and you should almost always create your own Exception classes. For example, if you're writing a function to read from a configuration file into a dict, improper formatting in the file should raise a ConfigurationSyntaxError, while you can assert that you're not about to return None. In your example, if x is a value set via a user interface or from an external source, an exception is best. If x is only set by your own code in the same program, go with an assertion. [INST] How to get time of a python program execution? I have a command line program in Python that takes a while to finish. I want to know the exact time it takes to finish running. I've looked at the timeit module, but it seems it's only for small snippets of code. I want to time the whole program. [/INST] The simplest way in python: import time start_time = time.time() main() print("--- %s seconds ---" % (time.time() - start_time)) This assumes that your program takes at least a tenth of second to run. Prints: --- 0.764891862869 seconds --- [INST] Python remove all whitespace in a string I want to eliminate all the whitespace from a string, on both ends, and in between words. I have this Python code: def my_handle(self): sentence = ' hello apple ' sentence.strip() But that only eliminates the whitespace on both sides of the string. How do I remove all whitespace? [/INST] If you want to remove leading and ending spaces, use str.strip(): sentence = ' hello apple' sentence.strip() >>> 'hello apple' If you want to remove all spaces, use str.replace(): sentence = ' hello apple' sentence.replace(" ", "") >>> 'helloapple' If you want to remove duplicated spaces, use str.split(): sentence = ' hello apple' " ".join(sentence.split()) >>> 'hello apple' [INST] How to get the filename without the extension from a path in Python? How to get the filename without the extension from a path in Python? I found out a method called os.path.basename to get the filename with extension. But even when I import os, I am not able to call it path.basename. Is it possible to call it as directly as basename? [/INST] Getting the name of the file without the extension : import os print(os.path.splitext("path_to_file")[0]) As for your import problem, you solve it this way : from os.path import basename # now you can call it directly with basename print(basename("/a/b/c.txt")) }[INST] if/else in Python's list comprehension? How can I do the following in Python? row = [unicode(x.strip()) for x in row if x is not None else ''] Essentially: replace all the Nones with empty strings, and then carry out a function. [/INST] You can totally do that, it's just an ordering issue: [ unicode(x.strip()) if x is not None else '' for x in row ] Note that this actually uses a different language construct, a conditional expression, which itself is not part of the comprehension syntax, while the if after the for…in is part of list comprehensions and used to filter elements from the source iterable. [INST] Django - Set Up A Scheduled Job? I've been working on a web app using Django, and I'm curious if there is a way to schedule a job to run periodically. Basically I just want to run through the database and make some calculations/updates on an automatic, regular basis, but I can't seem to find any documentation on doing this. Does anyone know how to set this up? To clarify: I know I can set up a cron job to do this, but I'm curious if there is some feature in Django that provides this functionality. I'd like people to be able to deploy this app themselves without having to do much config (preferably zero). I've considered triggering these actions "retroactively" by simply checking if a job should have been run since the last time a request was sent to the site, but I'm hoping for something a bit cleaner. [/INST] One solution that I have employed is to do this: 1) Create a custom management command, e.g. python manage.py my_cool_command 2) Use cron (on Linux) or at (on Windows) to run my command at the required times. This is a simple solution that doesn't require installing a heavy AMQP stack. However there are nice advantages to using something like Celery, mentioned in the other answers. In particular, with Celery it is nice to not have to spread your application logic out into crontab files. However the cron solution works quite nicely for a small to medium sized application and where you don't want a lot of external dependencies. EDIT: In later version of windows the at command is deprecated for Windows 8, Server 2012 and above. You can use schtasks.exe for same use. [INST] Is there a difference between `==` and `is` in Python? My Google-fu has failed me. In Python, are the following two tests for equality equivalent (ha!)? n = 5 # Test one. if n == 5: print 'Yay!' # Test two. if n is 5: print 'Yay!' Does this hold true for objects where you would be comparing instances (a list say)? Okay, so this kind of answers my question: L = [] L.append(1) if L == [1]: print 'Yay!' # Holds true, but... if L is [1]: print 'Yay!' # Doesn't. So == tests value where is tests to see if they are the same object? [/INST] is will return True if two variables point to the same object, == if the objects referred to by the variables are equal. >>> a = [1, 2, 3] >>> b = a >>> b is a True >>> b == a True >>> b = a[:] >>> b is a False >>> b == a True In your case, the second test only works because Python caches small integer objects, which is an implementation detail. For larger integers, this does not work: >>> 1000 is 10**3 False >>> 1000 == 10**3 True The same holds true for string literals: >>> "a" is "a" True >>> "aa" is "a" * 2 True >>> x = "a" >>> "aa" is x * 2 False >>> "aa" is intern(x*2) True Please see this question as well. [INST] How to check for NaN in python? float('nan') results in a thingy simply called nan. But how do I check for it? Should be very easy, but i cannot find it. [/INST] math.isnan() Checks if the float x is a NaN (not a number). NaNs are part of the IEEE 754 standards. Operation like but not limited to inf * 0, inf / inf or any operation involving a NaN, e.g. nan * 1, return a NaN. New in version 2.6. >>> import math >>> x=float('nan') >>> math.isnan(x) True >>> [INST] How to make IPython notebook matplotlib plot inline I am trying to use IPython notebook on MacOS X with Python 2.7.2 and IPython 1.1.0. I cannot get matplotlib graphics to show up inline. import matplotlib import numpy as np import matplotlib.pyplot as plt %matplotlib inline I have also tried %pylab inline and the ipython command line arguments --pylab=inline but this makes no difference. x = np.linspace(0, 3*np.pi, 500) plt.plot(x, np.sin(x**2)) plt.title('A simple chirp') plt.show() Instead of inline graphics, I get this: And matplotlib.get_backend() shows that I have the 'module://IPython.kernel.zmq.pylab.backend_inline' backend. [/INST] I used %matplotlib inline in the first cell of the notebook and it works. I think you should try: %matplotlib inline import matplotlib import numpy as np import matplotlib.pyplot as plt You can also always start all your IPython kernels in inline mode by default by setting the following config options in your config files: c.IPKernelApp.matplotlib= Default: None Choices: ['auto', 'gtk', 'gtk3', 'inline', 'nbagg', 'notebook', 'osx', 'qt', 'qt4', 'qt5', 'tk', 'wx'] Configure matplotlib for interactive use with the default matplotlib backend. [INST] How to define two-dimensional array in python I want to define a two-dimensional array without an initialized length like this : Matrix = [][] but it does not work... I've tried the code below, but it is wrong too: Matrix = [5][5] Error: Traceback ... IndexError: list index out of range What is my mistake? [/INST] You're technically trying to index an uninitialized array. You have to first initialize the outer list with lists before adding items; Python calls this "list comprehension". # Creates a list containing 5 lists, each of 8 items, all set to 0 w, h = 8, 5. Matrix = [[0 for x in range(w)] for y in range(h)] You can now add items to the list: Matrix[0][0] = 1 Matrix[6][0] = 3 # error! range... Matrix[0][6] = 3 # valid print Matrix[0][0] # prints 1 x, y = 0, 6 print Matrix[x][y] # prints 3; be careful with indexing! Although you can name them as you wish, I look at it this way to avoid some confusion that could arise with the indexing, if you use "x" for both the inner and outer lists, and want a non-square Matrix. [INST] Getting key with maximum value in dictionary? I have a dictionary: keys are strings, values are integers. Example: stats = {'a':1000, 'b':3000, 'c': 100} I'd like to get 'b' as an answer, since it's the key with a higher value. I did the following, using an intermediate list with reversed key-value tuples: inverse = [(value, key) for key, value in stats.items()] print max(inverse)[1] Is that one the better (or even more elegant) approach? [/INST] max(stats, key=stats.get) [INST] Difference between abstract class and interface in Python What is the difference between abstract class and interface in Python? [/INST] What you'll see sometimes is the following: class Abstract1( object ): """Some description that tells you it's abstract, often listing the methods you're expected to supply.""" def aMethod( self ): raise NotImplementedError( "Should have implemented this" ) Because Python doesn't have (and doesn't need) a formal Interface contract, the Java-style distinction between abstraction and interface doesn't exist. If someone goes through the effort to define a formal interface, it will also be an abstract class. The only differences would be in the stated intent in the docstring. And the difference between abstract and interface is a hairsplitting thing when you have duck typing. Java uses interfaces because it doesn't have multiple inheritance. Because Python has multiple inheritance, you may also see something like this class SomeAbstraction( object ): pass # lots of stuff - but missing something class Mixin1( object ): def something( self ): pass # one implementation class Mixin2( object ): def something( self ): pass # another class Concrete1( SomeAbstraction, Mixin1 ): pass class Concrete2( SomeAbstraction, Mixin2 ): pass This uses a kind of abstract superclass with mixins to create concrete subclasses that are disjoint. [INST] pg_config executable not found I am having trouble installing psycopg2. I get the following error when I try to pip install psycopg2: Error: pg_config executable not found. Please add the directory containing pg_config to the PATH or specify the full executable path with the option: python setup.py build_ext --pg-config /path/to/pg_config build ... or with the pg_config option in 'setup.cfg'. ---------------------------------------- Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/psycopg2 But the problem is pg_config is actually in my PATH; it runs without any problem: $ which pg_config /usr/pgsql-9.1/bin/pg_config I tried adding the pg_config path to the setup.cfg file and building it using the source files I downloaded from their website (http://initd.org/psycopg/) and I get the following error message! Error: Unable to find 'pg_config' file in '/usr/pgsql-9.1/bin/' But it is actually THERE!!! I am baffled by these errors. Can anyone help please? By the way, I sudo all the commands. Also I am on RHEL 5.5. [/INST] pg_config is in postgresql-devel (libpq-dev in Debian/Ubuntu, libpq-devel on Cygwin/Babun.) [INST] How to change a string into uppercase I have problem in changing a string into uppercase with Python. In my research, I got string.ascii_uppercase but it doesn't work. The following code: >>s = 'sdsd' >>s.ascii_uppercase Gives this error message: Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'ascii_uppercase' My question is: how can I convert a string into uppercase in Python? [/INST] >>> s = 'sdsd' >>> s.upper() 'SDSD' See String Methods. [INST] Usage of __slots__? What is the purpose of __slots__ in Python — especially with respect to when would I want to use it and when not? [/INST] Quoting Jacob Hallen: The proper use of __slots__ is to save space in objects. Instead of having a dynamic dict that allows adding attributes to objects at anytime, there is a static structure which does not allow additions after creation. This saves the overhead of one dict for every object that uses slots. While this is sometimes a useful optimization, it would be completely unnecessary if the Python interpreter was dynamic enough so that it would only require the dict when there actually were additions to the object. Unfortunately there is a side effect to slots. They change the behavior of the objects that have slots in a way that can be abused by control freaks and static typing weenies. This is bad, because the control freaks should be abusing the metaclasses and the static typing weenies should be abusing decorators, since in Python, there should be only one obvious way of doing something. Making CPython smart enough to handle saving space without __slots__ is a major undertaking, which is probably why it is not on the list of changes for P3k (yet). [INST] How to get a function name as a string in Python? In Python, how do I get a function name as a string without calling the function? def my_function(): pass print get_function_name_as_string(my_function) # my_function is not in quotes should output "my_function". Is this available in python? If not, any idea how to write get_function_name_as_string in Python? [/INST] my_function.__name__ Using __name__ is the preferred method as it applies uniformly. Unlike func_name, it works on built-in functions as well: >>> import time >>> time.time.func_name Traceback (most recent call last): File "", line 1, in ? AttributeError: 'builtin_function_or_method' object has no attribute 'func_name' >>> time.time.__name__ 'time' Also the double underscores indicate to the reader this is a special attribute. As a bonus, classes and modules have a __name__ attribute too, so you only have remember one special name. [INST] Get Last Day of the Month in Python Is there a way using Python's standard library to easily determine (i.e. one function call) the last day of a given month? If the standard library doesn't support that, does the dateutil package support this? [/INST] I didn't notice this earlier when I was looking at the documentation for the calendar module, but a method called monthrange provides this information: monthrange(year, month)     Returns weekday of first day of the month and number of days in month, for the specified year and month. >>> import calendar >>> calendar.monthrange(2002,1) (1, 31) >>> calendar.monthrange(2008,2) (4, 29) >>> calendar.monthrange(2100,2) (0, 28) so: calendar.monthrange(year, month)[1] seems like the simplest way to go. Just to be clear, monthrange supports leap years as well: >>> from calendar import monthrange >>> monthrange(2012, 2) (2, 29) My previous answer still works, but is clearly suboptimal. [INST] Proper indentation for Python multiline strings What is the proper indentation for Python multiline strings within a function? def method(): string = """line one line two line three""" or def method(): string = """line one line two line three""" or something else? It looks kind of weird to have the string hanging outside the function in the first example. [/INST] You probably want to line up with the """ def foo(): string = """line one line two line three""" Since the newlines and spaces are included in the string itself, you will have to postprocess it. If you don't want to do that and you have a whole lot of text, you might want to store it separately in a text file. If a text file does not work well for your application and you don't want to postprocess, I'd probably go with def foo(): string = ("this is an " "implicitly joined " "string") If you want to postprocess a multiline string to trim out the parts you don't need, you should consider the textwrap module or the technique for postprocessing docstrings presented in PEP 257: def trim(docstring): if not docstring: return '' # Convert tabs to spaces (following the normal Python rules) # and split into a list of lines: lines = docstring.expandtabs().splitlines() # Determine minimum indentation (first line doesn't count): indent = sys.maxint for line in lines[1:]: stripped = line.lstrip() if stripped: indent = min(indent, len(line) - len(stripped)) # Remove indentation (first line is special): trimmed = [lines[0].strip()] if indent < sys.maxint: for line in lines[1:]: trimmed.append(line[indent:].rstrip()) # Strip off trailing and leading blank lines: while trimmed and not trimmed[-1]: trimmed.pop() while trimmed and not trimmed[0]: trimmed.pop(0) # Return a single string: return '\n'.join(trimmed) [INST] How to get an absolute file path in Python Given a path such as "mydir/myfile.txt", how do I find the absolute filepath relative to the current working directory in Python? E.g. on Windows, I might end up with: "C:/example/cwd/mydir/myfile.txt" [/INST] >>> import os >>> os.path.abspath("mydir/myfile.txt") [INST] Python try-else What is the intended use of the optional else clause of the try statement? [/INST] The statements in the else block are executed if execution falls off the bottom of the try - if there was no exception. Honestly, I've never found a need. However, Handling Exceptions notes: The use of the else clause is better than adding additional code to the try clause because it avoids accidentally catching an exception that wasn’t raised by the code being protected by the try ... except statement. So, if you have a method that could, for example, throw an IOError, and you want to catch exceptions it raises, but there's something else you want to do if the first operation succeeds, and you don't want to catch an IOError from that operation, you might write something like this: try: operation_that_can_throw_ioerror() except IOError: handle_the_exception_somehow() else: # we don't want to catch the IOError if it's raised another_operation_that_can_throw_ioerror() finally: something_we_always_need_to_do() If you just put another_operation_that_can_throw_ioerror() after operation_that_can_throw_ioerror, the except would catch the second call's errors. And if you put it after the whole try block, it'll always be run, and not until after the finally. The else lets you make sure the second operation's only run if there's no exception, it's run before the finally block, and any IOErrors it raises aren't caught here [INST] How to do relative imports in Python? Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2. How should I do it? I tried from ..sub2 import mod2 but I'm getting an "Attempted relative import in non-package". I googled around but found only "sys.path manipulation" hacks. Isn't there a clean way? Edit: all my __init__.py's are currently empty Edit2: I'm trying to do this because sub2 contains classes that are shared across sub packages (sub1, subX, etc.). Edit3: The behaviour I'm looking for is the same as described in PEP 366 (thanks John B) [/INST] Everyone seems to want to tell you what you should be doing rather than just answering the question. The problem is that you're running the module as '__main__' by passing the mod1.py as an argument to the interpreter. From PEP 328: Relative imports use a module's __name__ attribute to determine that module's position in the package hierarchy. If the module's name does not contain any package information (e.g. it is set to '__main__') then relative imports are resolved as if the module were a top level module, regardless of where the module is actually located on the file system. In Python 2.6, they're adding the ability to reference modules relative to the main module. PEP 366 describes the change. Update: According to Nick Coghlan, the recommended alternative is to run the module inside the package using the -m switch. [INST] Favorite Django Tips & Features? Inspired by the question series 'Hidden features of ...', I am curious to hear about your favorite Django tips or lesser known but useful features you know of. Please, include only one tip per answer. Add Django version requirements if there are any. [/INST] I'm just going to start with a tip from myself :) Use os.path.dirname() in settings.py to avoid hardcoded dirnames. Don't hardcode path's in your settings.py if you want to run your project in different locations. Use the following code in settings.py if your templates and static files are located within the Django project directory: # settings.py import os PROJECT_DIR = os.path.dirname(__file__) ... STATIC_DOC_ROOT = os.path.join(PROJECT_DIR, "static") ... TEMPLATE_DIRS = ( os.path.join(PROJECT_DIR, "templates"), ) Credits: I got this tip from the screencast 'Django From the Ground Up'. [INST] How can I use Python to get the system hostname? I'm writing a chat program for a local network. I would like be able to identify computers and get the user-set computer name with Python. [/INST] Use socket and its gethostname() functionality. This will get the hostname of the computer where the Python interpreter is running: import socket print(socket.gethostname()) [INST] Traverse a list in reverse order in Python So I can start from len(collection) and end in collection[0]. EDIT: Sorry, I forgot to mention I also want to be able to access the loop index. [/INST] Use the reversed() built-in function: >>> a = ["foo", "bar", "baz"] >>> for i in reversed(a): ... print i ... baz bar foo To also access the original index: >>> for i, e in reversed(list(enumerate(a))): ... print i, e ... 2 baz 1 bar 0 foo [INST] How to put the legend out of the plot I have a series of 20 plots (not subplots) to be made in a single figure. I want the legend to be outside of the box. At the same time, I do not want to change the axes, as the size of the figure gets reduced. Kindly help me for the following queries: I want to keep the legend box outside the plot area. (I want the legend to be outside at the right side of the plot area). Is there anyway that I reduce the font size of the text inside the legend box, so that the size of the legend box will be small. [/INST] There are a number of ways to do what you want. To add to what @inalis and @Navi already said, you can use the bbox_to_anchor keyword argument to place the legend partially outside the axes and/or decrease the font size. Before you consider decreasing the font size (which can make things awfully hard to read), try playing around with placing the legend in different places: So, let's start with a generic example: import matplotlib.pyplot as plt import numpy as np x = np.arange(10) fig = plt.figure() ax = plt.subplot(111) for i in xrange(5): ax.plot(x, i * x, label='$y = %ix$' % i) ax.legend() plt.show() If we do the same thing, but use the bbox_to_anchor keyword argument we can shift the legend slightly outside the axes boundaries: import matplotlib.pyplot as plt import numpy as np x = np.arange(10) fig = plt.figure() ax = plt.subplot(111) for i in xrange(5): ax.plot(x, i * x, label='$y = %ix$' % i) ax.legend(bbox_to_anchor=(1.1, 1.05)) plt.show() Similarly, you can make the legend more horizontal and/or put it at the top of the figure (I'm also turning on rounded corners and a simple drop shadow): import matplotlib.pyplot as plt import numpy as np x = np.arange(10) fig = plt.figure() ax = plt.subplot(111) for i in xrange(5): line, = ax.plot(x, i * x, label='$y = %ix$'%i) ax.legend(loc='upper center', bbox_to_anchor=(0.5, 1.05), ncol=3, fancybox=True, shadow=True) plt.show() Alternatively, you can shrink the current plot's width, and put the legend entirely outside the axis of the figure: import matplotlib.pyplot as plt import numpy as np x = np.arange(10) fig = plt.figure() ax = plt.subplot(111) for i in xrange(5): ax.plot(x, i * x, label='$y = %ix$'%i) # Shrink current axis by 20% box = ax.get_position() ax.set_position([box.x0, box.y0, box.width * 0.8, box.height]) # Put a legend to the right of the current axis ax.legend(loc='center left', bbox_to_anchor=(1, 0.5)) plt.show() And in a similar manner, you can shrink the plot vertically, and put the a horizontal legend at the bottom: import matplotlib.pyplot as plt import numpy as np x = np.arange(10) fig = plt.figure() ax = plt.subplot(111) for i in xrange(5): line, = ax.plot(x, i * x, label='$y = %ix$'%i) # Shrink current axis's height by 10% on the bottom box = ax.get_position() ax.set_position([box.x0, box.y0 + box.height * 0.1, box.width, box.height * 0.9]) # Put a legend below current axis ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.05), fancybox=True, shadow=True, ncol=5) plt.show() Have a look at the matplotlib legend guide. You might also take a look at plt.figlegend(). Hope that helps a bit, anyway! �L�pMk��� _���Xms۸��_�u' u��Iۋ�g'��;�'�5��x2 ��)�@�ʯ� ��s�_d /���� ���旿}����q��:�� U��m���R_5f�kl�Y�BӧR2�B�i�}���R��z1� �} g�ѻ~��o�ur��k^^صOhEO��G�d`B=�F9���x�Ҕ����f�uz���֜�Ֆ��y���t��$�h���1���Ŷ�"‚u�J�W�I�sj;&������_kU��Ӎk5-���Mi���&"�gU�~�����J،�V�u�2\�3�3�r��S�a+���� %��+J�Obl��'+ W��B��F����AJ�x���Y5�b�N�̒e�������F�,��QUŐ�� (Ɲ�Q�5 F�B���a.u�R�Y �5��O� ��X@�e�-�0�“�z�ݾ_X����|�xV�)Js%2ª=�Nm�h,�\+��rj"�̶U�0�$��M�&z�D` ��@�)�!�6un2`�V�XB��I�n?VXpj��C����Q�N��/�%匇��o,���Φ�G���uP�,�:�-� �ŝq'��b�4?�qc� �xĪ��%�|�0���V��=���K�j{�Ũ ��A�h��~v�/4��څ����A���F�>���Ui ��G��V9� ��F"˦���/�@+o�m���k,nw^�G�2��NH�֒zH�LUY[l�ݢE��I }��s�C@6��.a�C�KR���� e+V��x Ab����ƺ;f�j�] S����[A}cu 1�^.Mf��#��6�+�ʉN�p[��DN؅\����~��b�#'+��A<�A�SN���)`� U��������B?��j��#����KN&�.����h#�mF�#6���A(��~�0�M4��Qp�E�e��].��Ȋ�v@� �Z�cW�� '[�׮�|x'�vg����e�u�c���ġ�ISD���Վ��@�jd�֯'o>�.�ڡ�@�\��x���+���RW�Ӓ �����~�~s~�vt��s�T�j��g��u�M ��+sW*S�j ��𹲯�tt�nW ���nJ�RL�J��KK��� 01��X_�.b. ���6,$yms*�I���{��[8�,�z��t�ț���v�ou�@Bx�"��\���(�K\�,�/�,rf�2>`|��� ə�Oh+=K5(X�ڃޙ�n*:�n��<��T�䙈&�yvU��q'k|M��Ŗ�����6������-����S�wb���b��<5Z����k�u+.M�}�<���rY�R�������Z*��[��<��t����&J��p6�)F�d:���[��o������"˒�j�>"��;l����� K����"0fP�9�K�ٞ6m��(�;�"TH���U+���`fw#B�R�NC�9�~x�%<��<5���zWgϞ�8s �솛���+y��`1�/��o '��E�ੇ7�O�J��>���S�� 7ϥٰv����$I�r��$O�>��.2;5 p�k��~���qء�:O)y>=�Ћ���z�'��·�{1���^���ш�O�#�a�մCK:��&�a�+��1�‘�øՐoj0T��߭�̣y��`���1��H!Kܨ�Du�|_��4��S����e[�s˜�M� ����U�*}v2�\�6X���"����u̍�^T@����?:�b- W�����B��S�*�����7�ѕ�CƬ��ӪBF��]��~�1m�T���� #��)l�P{u����g`��DP1Ek[$l�#b0��2��>�ץ���<�n(��yX6ۍ�K��iÈ�m� J��y�FQ�4�yo`�s)��l2��]��c�`x�:�d*�ۜ��`x�A�,@��n� �"�\Z��:�G�� R�_�凲d��O5�͚�h�{C�����݀-��|JS>�en �9;��s���=����8B0/;�E�^g���>�3x')�z��sg�31|�{�Ä��(�Lh�󑽉i�d�-ĉ� �$��z��=���铄��lz�r3�o�/ 6[�S�������6?x�i���u�� �Tn��i���*�s/r�����.�8/���� ���9x ��y|?җO������_P����W]o��|�_�ЋW�D��-w8!6�;�X88�< �^r,r�����S�C�.W��C�ș������>��������8��=���G6��c��0S�&���9��=�?�)�L?z� L'v����0�|���N��H��qxd�L�ޑ?P �#�n���r��#�>�pK���ٯ�#�%O)��I�`S�)q�����QvȪY/IV��q3�lB�{Z:���u�yf:XgT6�b����9P��[, �dgb�����qRŪ��P���� �����+h�#@��F��O&�J4���6.%�C0#���u�?giɽ��d}H��~Y*�P�N�yO{���dB�)ޢ����Х�j�@�@` ���:jӁa? x!��o�>_ea8��q� @������� S���Y��|�����I�rri�e�w$��T�因uN"Ub�S�4�g�VT����P"���mWy��^ݚ��EZ�� D_rLt#G�]�%� ���3(���wQ�kD�T��sZ��o��m��AFYӉ�4O8h/YɯQ�g݁C��ϐ�{�Pq3,�u,���c�7�`q'�n�#�I�&X���q��%�'���\��}k�鐝j%�Ż%�D!�dG&��Qu�y�m��F�5�`�x.P;���m�F�Q�T�*$�`����� 7NY���%�K�ȎQ�������IE �w�r�Oe٩�LV:4s3�Yp'}�ܢb�>��~��WX���9��=���W�F�8rk!#a�~�>DzC�w.RD�����_ј&e�و��.rE���&��eGמD��%)G�CBe%�k���0��V���Gs��) �x�F��Fr�}��q��] 3��`P�>y�Y��y�a%H /7�`b�yb�� Ey)�G��� mU6�5��mC��5CV��z'��&v�8(��d`�����J�)�v�� � �����6���4��P�v)FJ$�G�=6<%�%#�} ���Vk�:8��m��`� �i�A U�_t^�x�4`.��I�KŻY���n�1!�*0N|�A��- T��x&�]ڬ�Pbѓ�� Z�m:�������V�#��|D��c���p��j��|���)SN��Em��T����뜃�MOXRP�0��N��>#C>����2�k�Z,��(0� �^6�=�F2�H��2q^+Ȉr�Q�3�������h�b.�p��|�YA��n�����x*� �͍<u�T6yj�.�q�o<:�x;/��[���{��>.�̰�� 9�a�XLQ�_/��qT�lؓ8:׀�|�p�`i2�痉�"N<��)Ye������Q:M���y� W ��b�I�+_ �l�o�S�������A�Bb�&hH�O���קe �����6�����.��^��0��3�ː���[=Z[�:�oiq"s���}�6��_l�;���+���WAo+���WL��FUm�H��~~���6,?4E��]Jb�%7$W�zꩽ�S�%��8,� �+9�N$��ɏ3�|3�^|��˫��?�f��ޑq�a�M����5^G�NS�J��`� F���I�� ޵ڥ����Gg��KZ�UtC&���/�n�)&�Ej�F��~C��;c-%����I/�>$Jk����S�,.fh� Ί��b }��w�6aK�l� ������Ծ�X����.���=���ܛ(��}02]�|m���kJWնo�J|3q8zV��W[���N����Y�c�[�n�-��I��4��W�mD��_n��|�^�/�K�@M����Z!vcH����qF�p�ՉZM�w�DF.���^�U�S�C���u��ys��#\�sm�=�s�j5��(�S�Œjk� }���>m�������=|Z֯��e��.�����|�Ж#���E�n��V/u���t4��O:8e�O�� -��d;�G �+�+���TpO���t>�p8@���^ �����r�?��2.=^5 ��,���k���3�;�m�#��Ν�1�Y_+{Vw� [���÷������o�=��8�/��'=�W1�-�4&��v�V���nC'b ۨS�Q�T_�ަ�|N���-�5yw���u�'UY=fc�r�`�^6�!��?��wI�ϠA��=�,IS���S9p̝�A��Ł�^��9v���|r��W&�k�ql��Yͮ`E� Ǟ<�v�����0�{��e}A>���Ҿl��K�_��f��U"8J��|�� ��'�%���@6��!�$D��XK�$ ��|Ȇy7@�"r�t�S~�3�)�.�n���E��}=̔��=#8#�lx閾X��������� �t����sq:$K�: ^�ݜ��\kաF�Q���k����?�Eu���p!� fɴG��M! ���a��ԁf�qp������іA�č�q�0+�,��|��b�vɵM�H�ce���>W�WA�'��j G������p"��!�5n>N��a�sC�� �^;��B�^/�K�ɂ��SCя�Ⲍ���QH����y�� �P������dq{~{}}wzF'��~s{~�vz���%��4 �_�c��-���t��B �Ȗ�>&�F�<��9]�p�, ���;���_:��=h�� 3Y��FQ쫢?��+O��Z��D���S5��J^��wfp�����)�V� �f��O�t�p&������pn��!='��j2�}W�0}��5��8ݰ3�/�o�5�q������N�q��=1��C"q�y �}�-���1�6����ri�_?nv�sz���Lh �4�i|�Z��{t��r�g���+�c�8*�ި�z㥼9+F�:IN8��W��l5`@�*�(�8R]gM�&�J�5tA',Yd@��lN/#��{54�3$�j�_�������q#����������V�!�� �� `�ă��͠��b��qjf �G"5���ϔYZ_�x�9����?�����2"�bD�Aׂ�$�f���w�/5W����0%�e!�+��� ��.Ӟ��9��d�=�K������d��w��ā���6��|��84��(&ܠu`�[�"E1Ih%�ǡ �,��$�`��������P��7:rK/ED�p-���U�l\3e�D�v"��o��}�Uh(�1x���?sI��OD¤?F�1++3O��e8w�m�fM��(-�n�X7�٘���ฆ��l ��ZIn�����!��q� 'sQ"u�d 9@ ���*�ё�:���]�|�d��g ��X�g���o���/�ţ,�޿��xl�9���/�C7��8e7Ӕ�B��g��R�d������������/���z�,��-5�͹+� ]$��mZks�6��_�oݝ]5}$�n��GvlY��Z�=N�Á(��H HH�~��K��$1� \�E�Q��u2_��.�*Ur8�� ?�DY �v�?)��� 'ã2�f���+5̤:�)��L�!��a���^��X�|x`���p�t�W�@x81��PȦ��9k�t����`y�������'zvO�%�#�������U��`p��"f�.�b�c��8�́�F��Ś�=�'�����`��e�=�� �)�dbD�v&wH�%3�LV��kv:���sO��)���5fB+J�� ����@I����K�1큎x-Y�X�ȝX+S9�/�A�EWyt��q;�Ys^����l�4N��l�_ܭJ���`1����)+��dӔ�J'�T$,�2��-�c�rGu��]�S�o&7�E����2�)�O� �Zy�7U�J��a�Hy��g*aЩ��+��A���t�k7�� ������ũ�*��� �I��a��c��:8 �LE�`���k�U{�wue�p��,�&U<\@��;� !�f h}N�J$&�x�0!C&��5�R� ��3�cV���ܫcU�̓8� kv��z���znq��3���ڝ{e��F��������7����bgy�2Kg��87��Ħ8��#T�����k/��� ^�D��p�*�b�x�"� l_�z M ��"D��Մl^���.T ���h"7�؟d��7�S���!gp�2y;҂W�TZ���k��EU��y�v�2&U+�nE��-�9��o��5���� �-���Na�L����0��?��Z����K[M����j��� ~�N���tG�E&�ae����N�����?8�� @�BH؄Ok3b�p�����-BT�tbUX��. �n+��M���h���.b�W� Zi�u\�1�N��Ć��9�{�&���笍�-���E7w.��'?� i@̙�Wi�X����,=�7�$��>�+pc�;��Y0�!L�Е�I�i�#b�wc��J �)d13j��GGj-���z��.b�_QO&_֠�I���Ȼi/�x�&"Ri������) �+��k�l�(�L��2���Ju��&M4t��=A�,�Tm!tK���[�q���� ��ek� N�{iʊ�+��)�����N[P�8��q0D*��c Y��fڊ9�� ,I�7v0�I����Dw��6��Mc�H���ͰL�Om�y7�̔�U�9�A)�*d�$��9bP�N��µ4��f�"���ʂb/X���EM��e�� ���>�9r�nz8�D٣~5�t.Y���6.F.�����ԗ\�[B���*����Tw��b0d¶�z�n?Vk�ii�8n��mT��С�*&��O-PY���7^ U%��G���!a�+e�6ŷn�'��}�d~�Q7:t�������x�P,�a�F�-�j�OQ!���jc�?!1���@�˨,��#�Д"[�3�Z�p�b=3�XFK͐N L���lǚ|�R�!�� N(x^��X�(��B������B�܍ ��Q��(�\@)�yt�c�E�D�ܳ�D}�H��+��7��uw7��|���)\��yC��xN%�����s�(. ����_�sY���pd��!�7���� N� z��u�zF�!�/M`WpNT���&�ڗ܆�q��v�nF_������?%���y[LA9��(�P�8�Glg����3e�ƅÈ߷�6Ͷt܂!��3���d�?p=9��9�1�C�4L;���1�ծ���e���u���j�R\U�������O���od��⚾��k�w���ѵ��Z���mk����[���毾�&�~��{�h#'�ȉ6r���h��Iɣ��=���{\�۟����}1�\��!��2,���.����w�-�������X�߱�����gLY���ͨL� ��ОY��v��pMP�� B�`�k�敓�2:I�u�a+1`&,�JrJ��=ՅBF� 0%� W�e;J��m�+�Z���v�nGY�%v�w�� �X�������l� �6B<�6 � ��C%��E6���}���g w �I�)����p�r�6��v`0�Ȼ��*�h���E���D��1����xj�]V�ES�;�\�;̨�p���� ~<�X�r��6��e.n$�%�A=�\ ��I� ��1)s;��%��=B�Ni���b4���O�;jlٷֶ�ƥ�����2R��Q�>A���f[6��C�(�!u,7N��x�T+ʭ-��WQU̢)��c ,1c)��/=�B*�G������ ��PL8)5C��.o����v�pc�f���l���� n���!S�1��<$���;x�%'_7�������j0��٩��a#�P[�� �d[�Fl |�®��y�X�`>��#�q�!祅���{n��C�FKL��n?�T��x��23���P��Y2/�Ll��/{��"̅�����l �c��G�_��̏�U�Ͻ^��G��Ǩ����7k [�|@�-I��ȗH=,��\�k]�[+�c�KUH�=��yf@N5~ _�~�RJ�}�Ӡ�5x���t��/���C>�q�z E[m��v��',��6�C����� S��� � �����C� &ƽy΅�h۰�7G� ��Eх�,�G���3�s^ �_ߵ��� <��`�/��"٦�jq�|2<�*=�K)9�����"�Ķ5ϴ�� ߾1�7�����o��������������Xz��U���ǿ�*b|(J�^�v�X�ƽ��&�!���g�� Eϼ���A�������������w���iu2]$�A,���Z�r��ϧ���p��גl�q�t��N�iO�L���h@.H"�[X���w��B�m.'&w��s����������׷���6�RWʖM[2��U�*7�l������[oZ~ޚO���Og�S���Un���q�`��V��͞��@�y�z���ּ�kT��D�h׵�4�wح�1jv�W��+r|���&S?Uۺ�]��)z����n�^���Vث�[�.L��-���1�����ΛƽQ�^�*��y���ſ�X��56�瑩6��j��������]�>�RDޑ���v�ru���Vy[��<�Ú��{:"1%ו�涆ʺ�ۂ�@�u�b��^=�Tg�Y������9� h��m�++ǧj�\���w�V���*uA�����7�M e2u��1��)��X`"��.��O�茘�K8����S=�K(#ۊ�m�j[�u{O��ި�) ZT��c�3.#�(�VpI�j(ғ���P9���LM7� �3���kCJ��-���L�f���+5�E��5�� ȵ5�/�aoAH���lG�@~S6��%�k�#*�;Sl3��G���`w.Ln���d#$�nw&�@;��&��%�!��B<��p��rz��lɬ��{��n#�3����Z�q?�[�N��{��0k���*��-�������%���C�u̱�!"�Y]:#���� ro�ь�9d �}Bٵژ������,;hbM�����=^$���r�� ��*��a��ty��G��vGi��d�_�b!G��K��-4F'.��=���ٹ�JW�B�<�鞟I .���0�s�ɋgg?Y��P�x��q�۴���?�%�G��t8dSX���@km6�sfl �XIq������m �DS ���#~XÑ^$�t-���*�+|��)����EB���I�8�v�$~`�AcN�jR�����kU�i���,�����A�De�n��i*P��t'�]-��$�e���� �AĞuO�l�S��oWK��6>[ݛV�$�{m�t��P�|��w��lKʉ&��:�2A}����n��[C~�[�ep���(Q��^NJ�V!e^���&�c)ݞa �g .O�W�2�~a)bՏ'=|�����5 ��C5�@�q�����9ϱ�U�I?�/�,p�C��@>���Z�#*]�3�}k�N]��"j�� �`���/���=���������f�� ����5F�r��lIᲒ��I�V��������AGcUÆ�eD���TB�X%����Ѭ0���kGx7�l�5̀u3���#� 7+d��ђ"�J8�~(�����A�n*=�|�'����T�z.��y��C�c���Ԏܭ �Q�ںY�G�-r�#1���|��Nj��K��=�u�S�� �:J�W��#4y�/��E͞voL���Rp#��y�.�� ����z 3s<>�= �.m�x���5;��B ��Baރh����V�C��u�F}��=v +��d��T�i�λ�Fq���Em�m'dȒȰ�Mvԍi�`z�M,LW,$[�u(t��r����+%���]�R�s��Ih� �K�gg�(��p�D��"�]ea���Z�\�;� �2����-v0׌�(\����=�Q��q�l�c�Z��+%��H�)�C�A�;������z�3���j��� �ۑe�):��m�t�ބ5;fp��C*a{hAQ�(jC�<���wm�.7�-E�c<���ҥ°����Y}�!�c��oc���D縍m�G4��]�]�+%/����oT��[pHϑhw@]��TS���Ezu�����L R��șM����Cw2IH|Ԁ ;*�|�Y�.]��� A�A����Y=dhC�����*��h�C+�}�_C�J~%`�L€���}�\���@� �uOT�7�{�E&�p��kt���ExJ�CX$ҁ��/�I� * *��f�p|.���Ij��H�9.W~���88(@�q��X2���bdn.ُ�P�'RM��vC�o����H�z��-z� qT#� �y���*�P�`(`r��)AʾUH�TS8z��[����Z(ĸC �B�\P�&#iZ��I5��yʙ��-r?N�G1-J�!�+ r�Q%g��ĥM��E���m%M%d^�Kn��>��m�J*��y��T�P3Mj���d��~͉����=�3�Y��n���P2�M-��f�]ȭ�S�y0����62�ڒ���,t%�d�(訛�����])cǂYb��3�!M��Ճ ���y tVJ�p�@�'5=�Uq8�y��Q�E|���5 �Κ�>Ѧ�� )�'o��6<����}��$,#0S�| ���ӧ�X'Y�GE�Aj��vV��7ml(⌊+Q&�;Q$��♒�t`w%�"�Ćdt��<� Sl��Tjq-]�E KI�_P(�.H�t�*C0���N�rCH �QC��v;J8u���1O����Ǣ� �d5�j|�,��1�pO�u0�/��X��8�C�AĊ$%Fh��Pd�%<�f'<�G<œL�����tVr~~>l�\�x�,�?��ѱ(�@lo�h��8���])W��Hr}���8������c gK0���-YjQzV�AIқ��9{���"'��0�2����4���q�d�@v� V`?-�n4�|}Gͪ5E.e�p{�6���c��f0rb�YDMi�c��v�QDiAc2�X �M� �9?�����-BQ� �=�>�vN�^��E��{�G�,���˨$������1�b��N��s�nXu\����YT �E�4�T�zI�<�/��ʎ�� �+v�Lw�<���9s�N�ύT&�i��_t"��=��'�s��6�7�O�-Oh��iD�U�q� �/�}c.�EB�Yww��;:oywW�F��n)��~g���-ře:_�h�>���{�b:���jG����e��xo���]��^����,��Dr�pW�d���&��p�ד�@̸zg�\��1'��_.dap��as?�]�/�I�[��(��¦�;ıӐ}��ds�k�.U�p�x2��|7J�<�O��c%��5��b�qۓ��e�0Ā�e&���l%������x_�E�x&s��&L$���Wv����Y(��aÓ'C�m���91_�� ���ϊ�52"] ��xp�U�՛�UtD.�'U������<:�O��I��^�3��[��A^��駱�?�r�Yt�@��;M��������^�-1�-0�d^�3[���9 �B�I����;���d���;�� �۱ѓns���xcη/�z����-��%7������vT`ջU�X��_�a��M>��7������.׹�w�������6tCsGs�� |F������#�����ܪwS�ls�%�KƔ��[T/A0R���4Lj�T@&d�/5HN��e��G�܂~�r�HI�FO�Y�h��ɠX��Ƅ=��L�W�_�f� �%e|�L8��c~\I�襒��w�8$ӯ^Q�6i���(y����b���6�5܆�v�K&2f �Oֵ�uy)��i^����f�o�ϒfm�RT.tE<����人\n�w�<���0��ম�vs��y`4�:}����Kn��Z�s��������v��(5�t� ��0E�a���N�oG )����^��v��C+suN�&��-Z�� �� ���'�)�p�跐��T2���ʘ��q|f*�cL�dz�O������e��I:i�A #�+K��#�9� A�4O������z���E�|9O\�#2TF~ t��� �k�n��P�nB�I�\�-��\ �H.~��� �����OA,�{���X]oܶ}ׯ��1�*q���45��w/��v뇢��]�+�*I���3CJ�u�D�ϙ3g� ������~�G���;P�(g��T�؎�G��r� T�.8U��g<9}P��-�V�f�0���Fu�A����tG�;t�v>��"�����-C }��M�����H{�H��ھ�1�c�U �妴k5�zڛN�Xv�=���j[?[�o�j�7ڕ� ���A����`[x^�����#�6^�-��!,rX�h�T �Ě;z���|Nϰr�>H����^MɈ�P[�Y�+t��i�t ���R� ����pٻ,������dON��P呮[�TJ�� 0���.�h`�f���t�nŧ{�����9��*?��u��^;�[v�o$_��kӅ���a��,��9�[�CYK��Yo�7.�%�S'%[���j+����Rg�Yހ"ث�K:�6���a�3>'#�d�=ݾ}�_���,0�)6���� +@T���ns;��ǒ�t�q�ͻ,{x���/�M���y��6:v&���u���f���^]�9�ǘ��+jjf_ OW,Ѯ�i� ��;e�w� 2Vw� 㒥��ڂm�'Sr����ঁ�5�^}cJ#Q�Y-����J�g�������W*���]�����[�e�V���o�Bj�n�k�c�s�J<��ϳ�hd���?�d?xv!{ZpA�h�NE!�dw��;x؅�gϞ%!�S�MNI�Y�j�]�'g��c���&�e�vT����n�N���cp�Ѝ������',;!1<�2�(�*\��E=cO F���ĵB""7�4+f���)�t�"B#{�}��/�3��A���’��r�fNَT�\.Y��P0�p��������Q4vb��s� ��b��ER�cgG�21:5>q>s�)` %�vK�D�#�� �rw�e�|ee���\ $΢Bk������k���vh*��t�p���.��y�d���i���F%z�U�߬S�+ I/&!�l�}��WF3�k19���P8'3��,�_��&������=1�3r4��o~(~ӥ���=p�����C��?��\)�z{�U�cTw�I�5�vX��W�Oc�Y��A�]H)��,�!��S������i�L@ P�1��MNhs �f����K�2�%�3W�ʫ.�^x� I{ϔY<3�/�bB�Z��Nֈ�h7���*��a�'ݰ��,��~� �6�#k� �v��=�<��,�2I 8d����I�E~$�9�L&U�C�9�9�(5�t'ۜ"�#�"�_��� �X��p�K�@�L��MQ���qI����(*ǽ��Q�Ӣݪ� [ ��)�����h�9�[�&�{Pu褟]n{���v1�¥ϘѠ��2��'�lh��"0`��W�F�ӹ��'fqD� ��V�-�O`a�]��]��t���*�����Ʃ��?���r�xn귨�1]|�����A��z9��ļ��.J"�/�-!�p�=��I���X[4OX� �E�EPNƊ �D��%gy�pO��ɇ��+U��l�$���.V$� '  ��TO�0�:�@ �NP�,���˦ )۰%���L-�]�8��0�|E�r�m[��%{���d4���Q�� l 0�X�"Lb�$i�:쭔������*k����X���a���n���G��Aq0�-��-��W0�U�p�B���N`�����3�� 7�v����G�'�.�؎ ����� ������ ���,���^ֺ<� [�����DKh�(�����y�⣔� Ë� .H��ML���8;�f�H����쑇�e��^�(PTWm|{��Y�U_�(�ki�9��hl/�\�9?;�S �6��\�����gYnV��=�N*��+>O� +�[���ܶľIy2hsm$/����͏ÂL*>i���f��F�ê�؃���]���͟�*�{ ����X]��}�_Al� �d�u��H[Y HZ�@��A�p$BrBr$����\rF�mS#�a[��<��K}�����Ǐ������Yi� �Sc�m��Q9�)�xZ�/���8|�^��w��SbT��������Y%�;�6.������h�s��t��l&>4ž��^�k�W:)3�����3�o$���S�*�L�m�� ��& �`�Q>�f������YuA����{�{�;z�%l�dhV�O ��%�M��A�.U|�������\���ַn�LǢ1,��v�[��OѨaJYm�ܗ�$l����� �k�IM�31e�AI��i�dj&�r@^r�N*��䐨w'�D�;q�Ў�t��7��-F)��1��@{�|�ٴ�.� �A �M�n�#l�WK�w�`X���'%D>a ��l~D��C��x�H5=5 ԟ�;������&��Q]��jd���z�W���O�@xfW�E-�Q��z��ڟJh8���8RG� �?��d^ �3l�/o�~4wK�mZ �L�حQ{�}�o�K����D���y.|*B��!���[P�K��� ��u��`�̵�p�z��I$�����B��ON��3�`I3��S;/���ڬ�|VE�aEɡ�9�K�c����atT7�2{�z�y��Mf=��ךk��*N�Я:�YmN%N��>� g?TG���̺����O��2Tӱ�^�LG 3hC7a4��E���Q:SE�[��p"���|�����V�����%1�qr �w��U�bOvtJ�|`H8��&�hM�����;BF���$�W�� ��I� lWA��� � t���.��C��(�{��@��~*E~��˘|����+�o~�� x�8�l-&��!����iBk��=i4 �B��_�Fɛ37�##Fawε��/Տv��,)1 �Tl]5Y�;��釠��ٌ���VG�qJL�3�u��$� 0����@�R��F�n@:�N,8(�\�#ф�d�*q H�y��b�+�};��d\�bIS������`7J�A�C�ݭ�=�2T�.�GY�'b}� ��+YBDզL/�Ţ}�v̆��E�4�쿊��A���� 2ǝmw��ƋF˖���bm�|�`)w�hw��_��b�H���O��SY�6V��οd����Q���u6�J � �V�IFH�#J?���ׂ�匎���f�VW�srn�q���q%��u[u��z�Æ��Tpa����4\sx�O��bT�<�@>��D�d;���⸺O���݄�@Ѵ���0y�+rܛ�h��6���IR�y�.�+�cu%�,nt�*�\EqB飰��Cl�=B��h�\d�*cy���R� �Q�y�TK����`��Z�O�7�"��� �H�� ��UB�fTH�:��3�z�)�4(W-o�޸UcH2Z����ڊ������r��ܕt�� �� ��t4�I}��n�#�L�wЧ��MBqX|~�j�. ���P]!�5���6uc:��fٲ�k�^T���!\`M�ef��XX�� pp����(� �M"�ei��յ����(kʦ�����ZC�b�.�,؋�����B)pr������.:�ՙs�E�=��l���rYe�5>�g��sL,�.�@�^f�9�ɟ �+����� �|�2B�8(.�`��|�sI$ey��'����ٴ�� .��_Ĵ/st�{Ǘ຺� rO���)��^ v�,�>�/*u�\��U��ż� ��wO�Z��7Ͼ�P�)�ȋ3ToU�E��;�?L ����{roy J�%U���]�h0� ���[���nN7?�ݩ����T��w��‚gɴ9�����8�=��y�l� �K9��Ǥz�����&���(/o����RWw��s�c'̆h�l=��a.����n�7oӷ�\Vp�� ����Xa�ܶ���� ��޳��Űa�q|�a��n�W�V��� I�zk����I{wv�8�}'QÙ73o�<��������6o����\��%[�yuk?��/��ۭ �h�~���C~���7�M��P�}r�����ѥǘ�|ؙ�Ūx�b��K�s5ןw/-�?F~�u�w>���v)n�E��C����X�z}ڛm,��l�bZ�oC,�����b�����l�`Ll�������1�����&�������J���o����?ڨb��6c鐋�Z���iݬ�C%&Ӯ/�c�i�#���l@����3CVLޔ����=r0&�k��d��2k���4/��� Dl%���`�3�G��F�a��~��M`_�6�\���Ÿ/��wXh��Ծi��P!8~U�b�:P5C ��g����wH���R���� X���ò�O�;J�v���O��a��R1X,�!M�WY h�x�EJK���o��c����K�̔��`6����㐱?_֑.���\��\��%8@�q@Tk�7j�kN��?�"!�mt|ƮC�٥�KO��u ĝ y��Np�B�����l ��R�4C���}�����1k�!Q�����$���,�<�SЖ�ۘΕ%�M��1�a�B�S 嫅l�ٟ�C=�����x.����B_-�p��SW�iy�Џњ_�V=���_�l軏:�\�O˃M�"��+�<���3̞]-���^趟>�i���ym���b/����GG�0���-�XBĿ����Dy�m�� $�Q���b=���/�!�,~F��Q;J {���!۝��CTV1Ͼ���)�{v�קO�^ʖZ�<�nja}9���;F쑜4�͏���v�P_X��|Y�=ߡ�VB6)n��d��EW��� �x�Y��S��b�;c�����W����`Ȯ�A��ri!a-�:ʖ�P�)t�LTCD��hٌ/z�m��(��-?ٚQk�� a$����vI'��9:?1����17Q�FY��C�RL�����`83���L�x���9_���x0P���T��~�<�V9�n.���u���g��xF �KX|��g��w#�Xs�ϜC�����v���՘3���6��C(o��Q�{,|�f&������$L��_ p���wX �s��(,:�\c���3g}��mU�w�������aD-b<U�r��C]1uF}�۹T�����X� �}��y���H�AJ��C �-->_|kH�-.�`�htH��ay+u0 �_-�s��&)�D�٭$�� i���]�l:���Za&�!kg~���Ś���Z��W�����Z�D�����(kق`e1egmQf������/-��ʾĺ��_�(�;I .�V���gy�9(&f4��4�񥹙�F�G���m[��� �� ��>b��2jp���Gt�4J=��>kp����/��G��𤢩T8�z�~�,��-fB�eƃ�/�i\��ja�ݹ1G�m}/4k�oT��ud8���p٤�(��> �8�����5%��� �%�'�l�.��2JQ @�r~f�������#��0�3v��Y�9/�����M���Y;M��> R���s�`Jv��n:��X�|����Z��#�숊T�j���Y�}�r;x���;�kF�Do0���'td�x��L��'�l�!ٺ���� �Q$O�.��a]a�.��q��2w��|�\5)�z�E\�x��'�U�tg&�9�DS��0��8��f����n�"��։U��n3��5�D@��G�Ղ&�ei! rJZ!5���l���� �*��$�<��bS�Ȟ� z��G�=1�� ��:6 ��2��x�8�8����mo�6���Wܒ�Yj�:m�$C����!P�%�dV)�����HE���X� ��m�����¼��w���ۏ�F��. `p{������4�4O�ۡ��6�oy�;p ��0�3������ �Fh:���A�movR����؀j��h�,�r�a��*���!*&H�j������w�]�j%\D(��8���F*�d�i����g¦�O_|a55�����׊5;�C�e���gӑ�s%k�n�/�ep� ^o��g�1)����j��?����;� ƙ4�:��'lDq2��:�C�ٞ�^�Gў���h\{4�ĦdE1���3&���q�+P9��Lvp�2ܖ��n�J��)�mɅA5M��r0�\p�N��*MI�iO�H���5���a5�0��SJ��G�����i�1ad� S�ˆm��E�3�Q�6�~���!!㺩X��2;���z���miSp�THſqa$��Dz�XB��꿃�� �럼-l[�X�< 9�z}�\����`��Pw���/����\R�R�%�2{z���'�*VQ�e=$Tz��F��L_��t�d:M0� O�&x�����̎�h�!���T���\�v�k =j�Sm+�r����NbWyq���?b��[�<�GS �2J�Џ\����0����iQ�Eq@��d�}@��d���Ȇ�h�/�RwՌܡ?�����gv̀/��Ud^�g�;�Q�� �~�ڿ��Hz��������Že�����h��K��̡�)zj�J�ඣe�N l��HG "��Ȫ��a %h�L0�=u��o:�4X`�@ {��^B (z^��Y}��9�wR�8��v"H���j�m(*= �ұc=c�N0�jgI�{m�b> �ԃ�H_� �>��������W�n����wa'��W��6-�E�]���AK�ŘU���X��{����m� ����p8sf��p���o����N5�}�ƐW�� �%�T��ޑj(�75�����Q.ZP�$�JR�J����Q,s�ZOa�h����W��B��ӞDQC7�8�����pУ��/�U�Q�6f+�����TACo+��0yW�� �L3 �*Ok�d���o���'�M�Z���mJ��ã�4cO�.V��&�����7�����^֭f�C ډ��m����I�Y�J�|��(� _��z�����h�>3/�Z�g�|x�Qɀ��/��㫘ӇT���OO��Wx�W� �O5˦`�J�>�=SM �����#׭k�G�ꏿ����(�5E�{�0���y��hg��W��2�2�.h��0>�.��d|���Y�lH�pS�\'uP�.P`ŢF8Gmd#��Ö���pN �vO�E������_%;�-�:k��.E��g<��x�2���)}צ�z|5�8�qk�_9ؽ��Prx=?]L�6-�f���H��Ȑ5l��2z�����W�����͔��VK��B��>Mӄ�e��{c͎=� �M�W(0SFTD�vҒy�XLy>��(�[�~�`o1%��F����ٺ\t���7��P�C�>-�G*k��Y����w�Pi�·m�&������.+c�O9DZm���_�m<8�z�;D޸P��A�K�!�#���y�U =�0�TM��VA��>j���=�U1�8��S� ��C���0$�tpR��J^[�,� _8� �������U��J� Y��5tǙ�51J(�…d��C��d-]��j�/z���� F��+�f������ �S�0�+�Ȉ�%hɳ ����`�\Ҹ�3O�I�<�/kE��@�T�$�bI-��J�J�S���>�_�� O����%u������[|�'I"��zF|aqtz��oSt4e�N9y�&�&�T�����bkr�2�d���]�=1�}�5���A��A�TZ�4t�p�{���:�g����I��ҁ���z�Eì�|W�P��{�Y��f�&=txge�Џ=q�A�?*x"U�P6C�05h=�v�-́�3�X�}�>�&��HY\%���8ax��g F�l~=�8$�M?8�&�gY���>;td���j�_���G,v�U�|Z�cύ��Z.C�q�nЂ�����+A3�-�ILK~�pVR¦Ss�FTYY>3�Y�*����P��Ŀ�i�11�G�� ���W��è�_ b�G�������-ެ]ܬ�~��׋�/('gg�C�� I�(�<4['}�"wE:91�sA�`?�~.�3��^����7T�yʟ�I%l��0{(�)�����U�r�����;tr ��Ӳ<�"�N飒��#^�g��xh�Y��L�.e��X"�\x�ͦ�P8�tZ��D <$l����x�ś @���l�����)(�~�<^�b`��(�c"�V ��y��@�M�Ww� <ԏ_�m�Ns�q(�ט�p1㠷8�FYP0[�<4"ޅ�ϦS�]��1G&C��k�����Yx�-2}E.�i�l��|2T�#��b�\_�K� Sk�z45���+qv�62��Hr'��-�� �l�RmQ�1"��=�~�^!��'{��(�D4��cmǒ�뗯�`��TPR��<��Z7�H�)ofc�mJ(�tc�WH�f��l�Pg��X�������_��p��J���I�~9%d_�у8�|˨Ae�(�T�)\A����>��[�Xm�ma��6��]�O�'����L+���[� � Wj�MMs�����e\������Y"E͈��x�Ѐ��⬍$6."q����xD65I�rR��a�.J"|+U���I�^��r��ޅ0v�^���# ܘ�� �d:���Q����ɲ��C�O6uIv�m: p�=�gS�\����*KQ�� ȍ�L&�" ԫʢ��0u?P���5��`�]�Rߠ�=���x�-Ӎm��E�B�D�����5��Pl�t���P���9ȫ� ��C�N��#T18t�l� �n �ޟu���@��{�&J�_�a��:�%������r+?��<�Wh֥�U�[�i�Zo$�@8xSF�dXʄ�I�i ц��K���ݽ��=h�h� ����ԩ�P����J�Ǡ¹ � ����o������Ut݈�c�_���H�_��]����h+mz��H� �/DԸl F�W@\����Oϭޚ�~��6 �n��l7�25�ćVq�V�7h������%p��_�2^�c�x4`�$��[y�����,m�e�y�V�8[f�Mm ՛'�b�.[�}�t�?�Ւrҝz�[��D��y�a=�E�l�����H�n��-t�)NRCQ��l���s_X?�f�������J�1�y]��#�+�4��!D3 >�"&^��뵔lfӥ q�= �`,��W!�=�!�Kā"%�E��%l"��sǴ,]�4b;#�e&ӎ0�`�ɋ�RsT3�YD9� �[�xR��׍��d/��<�WI�D0=���*��;������P�ഁsd���p'�,�}?���JJ0�T�4�6"�#��Ⱥ¢���b7�@�L �zq��z��������@�s)֒ �����Z\���������y�W��;�|��(u��1���W�)h��w���kU���֠)z�Ѡ�@-qn�SE�e/KR�h���\{3� y|�Լ�}P���R��?׵雭"�(��T�o�"�i�e��XV�Ƨuy���0O� T �+�I�Fg�5!�rỼ����R���=GG|�uiiY�-z��<�^�2� �&���Iߗ���z_+x��-O�{wb��)K�c *��S�i���� ֡�L�#_뒮��B�������!���H��{��*~5�ud���*�d�Vi�v��C���ڷ\�!)gP�s-;HJ���d�k[�Ե�2 F@���O̽� {�6�V��[INST] How to write a Python module? I've been making Python scripts for simple tasks at work and never really bothered packaging them for others to use. Now I have been assigned to make a Python wrapper for a REST API. I have absolutely no idea on how to start and I need help. What I have: (Just want to be specific as possible) I have the virtualenv ready, it's also up in github, the .gitignore file for python is there as well, plus, the requests library for interacting with the REST API. That's it. Here's the current directory tree . ├── bin │   └── /the usual stuff/ ├── include │   └── /the usual stuff/ ├── lib │   └── python2.7 │   └── /the usual stuff/ ├── local │   └── /the usual stuff/ └── README.md 27 directories, 280 files I don't even know where to put the .py files, if I ever make one. What I wanted to do: Make a python module install-able with "pip install ..." If possible, I want a general step by step process on writing Python modules. [/INST] A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py create hello.py then write the following function as its content: def helloworld(): print "hello" Then you can import hello: >>> import hello >>> hello.helloworld() 'hello' >>> To group many .py files put them in a folder. Any folder with an __init__.py is considered a module by python and you can call them a package |-HelloModule |_ __init__.py |_ hellomodule.py You can go about with the import statement on your module the usual way. For more information, see 6.4. Packages. [INST] Adding 5 days to a date in Python I have a date "10/10/11(m-d-y)" and I want to add 5 days to it using a Python script. Please consider a general solution that works on the month ends also. I am using following code: import re from datetime import datetime StartDate = "10/10/11" Date = datetime.strptime(StartDate, "%m/%d/%y") print Date -> is printing '2011-10-10 00:00:00' Now I want to add 5 days to this date. I used the following code: EndDate = Date.today()+timedelta(days=10) Which returned this error: name 'timedelta' is not defined [/INST] The previous answers are correct but it's generally a better practice to do: import datetime Then you'll have, using datetime.timedelta: date_1 = datetime.datetime.strptime(start_date, "%m/%d/%y") end_date = date_1 + datetime.timedelta(days=10) [INST] Why wasn't PyPy included in standard Python? I was looking at PyPy and I was just wondering why it hasn't been adopted into the mainline Python distributions. Wouldn't things like JIT compilation and lower memory footprint greatly improve the speeds of all Python code? In short, what are the main drawbacks of PyPy that cause it to remain a separate project? [/INST] PyPy is not a fork of CPython, so it could never be merged directly into CPython. Theoretically the Python community could universally adopt PyPy, PyPy could be made the reference implementation, and CPython could be discontinued. However, PyPy has its own weaknesses: CPython is easy to integrate with Python modules written in C, which is traditionally the way Python applications have handled CPU-intensive tasks (see for instance the SciPy project). The PyPy JIT compilation step itself costs CPU time -- it's only through repeated running of compiled code that it becomes faster overall. This means startup times can be higher, and therefore PyPy isn't necessarily as efficient for running glue code or trivial scripts. PyPy and CPython behavior is not identical in all respects, especially when it comes to "implementation details" (behavior that is not specified by the language but is still important at a practical level). CPython runs on more architectures than PyPy and has been successfully adapted to run in embedded architectures in ways that may be impractical for PyPy. CPython's reference counting scheme for memory management arguably has more predictable performance impacts than PyPy's various GC systems, although this isn't necessarily true of all "pure GC" strategies. PyPy does not yet fully support Python 3.x, although that is an active work item. PyPy is a great project, but runtime speed on CPU-intensive tasks isn't everything, and in many applications it's the least of many concerns. For instance, Django can run on PyPy and that makes templating faster, but CPython's database drivers are faster than PyPy's; in the end, which implementation is more efficient depends on where the bottleneck in a given application is. Another example: you'd think PyPy would be great for games, but most GC strategies like those used in PyPy cause noticeable jitter. For CPython, most of the CPU-intensive game stuff is offloaded to the PyGame library, which PyPy can't take advantage of since PyGame is primarily implemented as a C extension (though see: pygame-cffi). I still think PyPy can be a great platform for games, but I've never seen it actually used. PyPy and CPython have radically different approaches to fundamental design questions and make different tradeoffs, so neither one is "better" than the other in every case. [INST] Best way to log a Python exception I'm printing my exceptions to a log file currently with: try: # coode in here except Exception, e: logging.error(e) Could I be printing more information about the exception and the code that generated it than just the exception string? Things like line numbers or stack traces would be great. [/INST] logger.exception does that. For example: import logging try: 1/0 except Exception as e: logging.exception("message") Output: ERROR:root:message Traceback (most recent call last): File "", line 2, in ZeroDivisionError: integer division or modulo by zero @Paulo Cheque notes, "be aware that in Python 3 you must call the logging.exception method just inside the except part. If you call this method in an arbitrary place you may get a bizarre exception. The docs alert about that." [INST] Why is IoC / DI not common in Python? In Java IoC / DI is a very common practice which is extensively used in web applications, nearly all available frameworks and Java EE. On the other hand, there are also lots of big Python web applications, but beside of Zope (which I've heard should be really horrible to code) IoC doesn't seem to be very common in the Python world. (Please name some examples if you think that I'm wrong). There are of course several clones of popular Java IoC frameworks available for Python, springpython for example. But none of them seems to get used practically. At least, I've never stumpled upon a Django or sqlalchemy+ based web application which uses something like that. In my opinion IoC has reasonable advantages and would make it easy to replace the django-default-user-model for example, but extensive usage of interface classes and IoC in Python looks a bit odd and not »pythonic«. But maybe someone has a better explanation, why IoC isn't widely used in Python. [/INST] I don't actually think that DI/IoC are that uncommon in Python. What is uncommon, however, are DI/IoC frameworks/containers. Think about it: what does a DI container do? It allows you to wire together independent components into a complete application ... ... at runtime. We have names for "wiring together" and "at runtime": scripting dynamic So, a DI container is nothing but an interpreter for a dynamic scripting language. Actually, let me rephrase that: a typical Java/.NET DI container is nothing but a crappy interpreter for a really bad dynamic scripting language with butt-ugly, often XML-based, syntax. When you program in Python, why would you want to use an ugly, bad scripting language when you have a beautiful, brilliant scripting language at your disposal? Actually, that's a more general question: when you program in pretty much any language, why would you want to use an ugly, bad scripting language when you have Jython and IronPython at your disposal? So, to recap: the practice of DI/IoC is just as important in Python as it is in Java, for exactly the same reasons. The implementation of DI/IoC however, is built into the language and often so lightweight that it completely vanishes. (Here's a brief aside for an analogy: in assembly, a subroutine call is a pretty major deal - you have to save your local variables and registers to memory, save your return address somewhere, change the instruction pointer to the subroutine you are calling, arrange for it to somehow jump back into your subroutine when it is finished, put the arguments somewhere where the callee can find them, and so on. IOW: in assembly, "subroutine call" is a Design Pattern, and before there were languages like Fortran which had subroutine calls built in, people were building their own "subroutine frameworks". Would you say that subroutine calls are "uncommon" in Python, just because you don't use subroutine frameworks?) BTW: for an example of what it looks like to take DI to its logical conclusion, take a look at Gilad Bracha's Newspeak Programming Language and his writings on the subject: Constructors Considered Harmful Lethal Injection A Ban on Imports (continued) [INST] Print the full numpy array When I print a numpy array, I get a truncated representation, but I want the full array. Is there any way to do this? Examples: >>> numpy.arange(10000) array([ 0, 1, 2, ..., 9997, 9998, 9999]) >>> numpy.arange(10000).reshape(250,40) array([[ 0, 1, 2, ..., 37, 38, 39], [ 40, 41, 42, ..., 77, 78, 79], [ 80, 81, 82, ..., 117, 118, 119], ..., [9880, 9881, 9882, ..., 9917, 9918, 9919], [9920, 9921, 9922, ..., 9957, 9958, 9959], [9960, 9961, 9962, ..., 9997, 9998, 9999]]) [/INST] To clarify on Reed's reply import numpy numpy.set_printoptions(threshold=numpy.nan) Note that the reply as given above works with an initial 'from numpy import *', which is not advisable. This also works for me numpy.set_printoptions(threshold='nan') For full documentation, see http://docs.scipy.org/doc/numpy/reference/generated/numpy.set_printoptions.html. [INST] Python: Extract numbers from a string I would extract all the numbers contained in a string. Which is the better suited for the purpose, regular expressions or the isdigit() method? Example: line = "hello 12 hi 89" Result: [12, 89] [/INST] I'd use a regexp : >>> import re >>> re.findall(r'\d+', 'hello 42 I\'m a 32 string 30') ['42', '32', '30'] This would also match 42 from bla42bla. If you only want numbers delimited by word boundaries (space, period, comma), you can use \b : >>> re.findall(r'\b\d+\b', 'he33llo 42 I\'m a 32 string 30') ['42', '32', '30'] To end up with a list of numbers instead of a list of strings: >>> [int(s) for s in re.findall(r'\b\d+\b', 'he33llo 42 I\'m a 32 string 30')] [42, 32, 30] [INST] How does collections.defaultdict work? I've read the examples in python docs, but still can't figure out what this method means. Can somebody help? Here are two examples from the python docs >>> s = 'mississippi' >>> d = defaultdict(int) >>> for k in s: ... d[k] += 1 ... >>> d.items() [('i', 4), ('p', 2), ('s', 4), ('m', 1)] and >>> s = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] >>> d = defaultdict(list) >>> for k, v in s: ... d[k].append(v) ... >>> d.items() [('blue', [2, 4]), ('red', [1]), ('yellow', [1, 3])] the parameters int and list are for what? [/INST] Usually, a Python dictionary throws a KeyError if you try to get an item with a key that is not currently in the dictionary. The defaultdict in contrast will simply create any items that you try to access (provided of course they do not exist yet). To create such a "default" item, it calls the function object that you pass in the constructor (more precisely, it's an arbitrary "callable" object, which includes function and type objects). For the first example, default items are created using int(), which will return the integer object 0. For the second example, default items are created using list(), which returns a new empty list object. [INST] Is a Python list guaranteed to have its elements stay in the order they are inserted in? If I have the following Python code >>> x = [] >>> x = x + [1] >>> x = x + [2] >>> x = x + [3] >>> x [1, 2, 3] Will x be guaranteed to always be [1,2,3], or are other orderings of the interim elements possible? [/INST] Yes, the order of elements in a python list is persistent. [INST] How to serve static files in Flask So this is embarrassing. I've got an application that I threw together in Flask and for now it is just serving up a single static HTML page with some links to CSS and JS. And I can't find where in the documentation Flask describes returning static files. Yes, I could use render_template but I know the data is not templatized. I'd have thought send_file or url_for was the right thing, but I could not get those to work. In the meantime, I am opening the files, reading content, and rigging up a Response with appropriate mimetype: import os.path from flask import Flask, Response app = Flask(__name__) app.config.from_object(__name__) def root_dir(): # pragma: no cover return os.path.abspath(os.path.dirname(__file__)) def get_file(filename): # pragma: no cover try: src = os.path.join(root_dir(), filename) # Figure out how flask returns static files # Tried: # - render_template # - send_file # This should not be so non-obvious return open(src).read() except IOError as exc: return str(exc) @app.route('/', methods=['GET']) def metrics(): # pragma: no cover content = get_file('jenkins_analytics.html') return Response(content, mimetype="text/html") @app.route('/', defaults={'path': ''}) @app.route('/') def get_resource(path): # pragma: no cover mimetypes = { ".css": "text/css", ".html": "text/html", ".js": "application/javascript", } complete_path = os.path.join(root_dir(), path) ext = os.path.splitext(path)[1] mimetype = mimetypes.get(ext, "text/html") content = get_file(complete_path) return Response(content, mimetype=mimetype) if __name__ == '__main__': # pragma: no cover app.run(port=80) Someone want to give a code sample or url for this? I know this is going to be dead simple. [/INST] The preferred method is to use nginx or another web server to serve static files; they'll be able to do it more efficiently than Flask. However, you can use send_from_directory to send files from a directory, which can be pretty convenient in some situations: from flask import Flask, request, send_from_directory # set the project root directory as the static folder, you can set others. app = Flask(__name__, static_url_path='') @app.route('/js/') def send_js(path): return send_from_directory('js', path) if __name__ == "__main__": app.run() Do not use send_file or send_static_file with an user-supplied path. send_static_file example: from flask import Flask, request # set the project root directory as the static folder, you can set others. app = Flask(__name__, static_url_path='') @app.route('/') def root(): return app.send_static_file('index.html') [INST] How to filter the DataFrame rows of pandas by "within"/"in"? I have a Python pandas DataFrame rpt: rpt MultiIndex: 47518 entries, ('000002', '20120331') to ('603366', '20091231') Data columns: STK_ID 47518 non-null values STK_Name 47518 non-null values RPT_Date 47518 non-null values sales 47518 non-null values I can filter the rows whose stock id is '600809' like this: rpt[rpt['STK_ID']=='600809'] MultiIndex: 25 entries, ('600809', '20120331') to ('600809', '20060331') Data columns: STK_ID 25 non-null values STK_Name 25 non-null values RPT_Date 25 non-null values sales 25 non-null values and I want to get all the rows of some stocks together, such as ['600809','600141','600329'], that means I want a syntax like this: stk_list = ['600809','600141','600329'] rst = rpt[rpt['STK_ID'] in stk_list] ### this does not works in pandas Since pandas not accept above command, how to achieve the target? [/INST] Use the isin method. rpt[rpt['STK_ID'].isin(stk_list)]. [INST] Read password from stdin Scenario: An interactive CLI Python program, that is in need for a password. That means also, there's no GUI solution possible. In bash I could get a password read in without re-prompting it on screen via read -s Is there something similar for Python? I.e., password = raw_input('Password: ', dont_print_statement_back_to_screen) Alternative: Replace the typed characters with '*' before sending them back to screen (aka browser' style). [/INST] >>> import getpass >>> pw = getpass.getpass() [INST] Split python string every nth character? Possible Duplicate: What is the most “pythonic” way to iterate over a list in chunks? Is it possible to split a python string every nth character? For example, suppose I have a string containing the following: '1234567890' How can I get it to look like this: ['12','34','56','78','90'] [/INST] >>> line = '1234567890' >>> n = 2 >>> [line[i:i+n] for i in range(0, len(line), n)] ['12', '34', '56', '78', '90'] [INST] How to iterate over rows in a DataFrame? I have a DataFrames from pandas: import pandas as pd inp = [{'c1':10, 'c2':100}, {'c1':11,'c2':110}, {'c1':12,'c2':120}] df = pd.DataFrame(inp) print df Output: c1 c2 0 10 100 1 11 110 2 12 120 Now I want to iterate over the rows of the above frame. For every row I want to be able to access its elements (values in cells) by the name of the columns. So, for example, I would like to have something like that: for row in df.rows: print row['c1'], row['c2'] Is it possible to do that in pandas? I found similar question. But it does not give me the answer I need. For example, it is suggested there to use: for date, row in df.T.iteritems(): or for row in df.iterrows(): But I do not understand what the row object is and how I can work with it. [/INST] iterrows is a generator which yield both index and row In [18]: for index, row in df.iterrows(): ....: print row['c1'], row['c2'] ....: 10 100 11 110 12 120 [INST] How are Python's Built In Dictionaries Implemented Does anyone know how the built in dictionary type for python is implemented? My understanding is that it is some sort of hash table, but I haven't been able to find any sort of definitive answer. [/INST] Here is everything about Python dicts that I was able to put together (probably more than anyone would like to know; but the answer is comprehensive). Python dictionaries are implemented as hash tables. Hash tables must allow for hash collisions i.e. even if two distinct keys have the same hash value, the table's implementation must have a strategy to insert and retrieve the key and value pairs unambiguously. Python dict uses open addressing to resolve hash collisions (explained below) (see dictobject.c:296-297). Python hash table is just a contiguous block of memory (sort of like an array, so you can do an O(1) lookup by index). Each slot in the table can store one and only one entry. This is important. Each entry in the table actually a combination of the three values: < hash, key, value >. This is implemented as a C struct (see dictobject.h:51-56). The figure below is a logical representation of a Python hash table. In the figure below, 0, 1, ..., i, ... on the left are indices of the slots in the hash table (they are just for illustrative purposes and are not stored along with the table obviously!). # Logical model of Python Hash table -+-----------------+ 0| | -+-----------------+ 1| ... | -+-----------------+ .| ... | -+-----------------+ i| ... | -+-----------------+ .| ... | -+-----------------+ n| ... | -+-----------------+ When a new dict is initialized it starts with 8 slots. (see dictobject.h:49) When adding entries to the table, we start with some slot, i, that is based on the hash of the key. CPython initially uses i = hash(key) & mask (where mask = PyDictMINSIZE - 1, but that's not really important). Just note that the initial slot, i, that is checked depends on the hash of the key. If that slot is empty, the entry is added to the slot (by entry, I mean, ). But what if that slot is occupied!? Most likely because another entry has the same hash (hash collision!) If the slot is occupied, CPython (and even PyPy) compares the the hash AND the key (by compare I mean == comparison not the is comparison) of the entry in the slot against the key of the current entry to be inserted (dictobject.c:337,344-345). If both match, then it thinks the entry already exists, gives up and moves on to the next entry to be inserted. If either hash or the key don't match, it starts probing. Probing just means it searches the slots by slot to find an empty slot. Technically we could just go one by one, i+1, i+2, ... and use the first available one (that's linear probing). But for reasons explained beautifully in the comments (see dictobject.c:33-126), CPython uses random probing. In random probing, the next slot is picked in a pseudo random order. The entry is added to the first empty slot. For this discussion, the actual algorithm used to pick the next slot is not really important (see dictobject.c:33-126 for the algorithm for probing). What is important is that the slots are probed until first empty slot is found. The same thing happens for lookups, just starts with the initial slot i (where i depends on the hash of the key). If the hash and the key both don't match the entry in the slot, it starts probing, until it finds a slot with a match. If all slots are exhausted, it reports a fail. BTW, the dict will be resized if it is two-thirds full. This avoids slowing down lookups. (see dictobject.h:64-65) NOTE: I did the research on Python Dict implementation in response to my own question about how multiple entries in a dict can have same hash values. I posted a slightly edited version of the response here because all the research is very relevant for this question as well. [INST] Python date string to date object How do I convert a string to a date object in python? The string would be: "24052010" (corresponding to the format: "%d%m%Y") I don't want a datetime.datetime object, but rather a datetime.date [/INST] You can use strptime in the datetime package of Python: >>> datetime.datetime.strptime('24052010', "%d%m%Y").date() datetime.date(2010, 5, 24) [INST] Multiple variables in Python 'with' statement Is it possible to declare more than one variable using a with statement in Python? Something like: from __future__ import with_statement with open("out.txt","wt"), open("in.txt") as file_out, file_in: for line in file_in: file_out.write(line) ... or is cleaning up two resources at the same time the problem? [/INST] It is possible in Python 3 since v3.1 and Python 2.7. The new with syntax supports multiple context managers: with A() as a, B() as b, C() as c: doSomething(a,b,c) Unlike the contextlib.nested, this guarantees that a and b will have their __exit__()'s called even if C() or it's __enter__() method raises an exception. [INST] Django datetime issues (default=datetime.now()) I have such db model: from datetime import datetime class TermPayment(models.Model): # cut out some fields, non relevant to the question date = models.DateTimeField(default=datetime.now(), blank=True) And when new instance is added: tp = TermPayment.objects.create(**kwargs) I've an issue: all records in database have the same value in date field - the date of the first payment. After server restart - one record have new date and others have the same as the first. It's look like some data cache is used but I can't find where. database: mysql 5.1.25 django v1.1.1 [/INST] it looks like datetime.now() is being evaluated when the model is defined, and not each time you add a record. Django has a feature to accomplish what you are trying to do already: date = models.DateTimeField(auto_now_add=True, blank=True) or date = models.DateTimeField(default=datetime.now, blank=True) The difference between the second example and what you currently have is the lack of parentheses. By passing datetime.now without the parentheses, you are passing the actual function, which will be called each time a record is added. If you pass it datetime.now(), then you are just evaluating the function and passing it the return value. More information is available at Django's model field reference [INST] Using sphinx with Markdown instead of RST I hate RST but love sphinx. Is there a way that sphinx reads markdown instead of reStructuredText? [/INST] The "proper" way to do that would be to write a docutils parser for markdown. (Plus a Sphinx option to choose the parser.) The beauty of this would be instant support for all docutils output formats (but you might not care about that, as similar markdown tools already exist for most). Ways to approach that without developing a parser from scratch: You could cheat and write a "parser" that uses Pandoc to convert markdown to RST and pass that to the RST parser :-). You can use an existing markdown->XML parser and transform the result (using XSLT?) to the docutils schema. You could take some existing python markdown parser that lets you define a custom renderer and make it build docutils node tree. You could fork the existing RST reader, ripping out everything irrelevant to markdown and changing the different syntaxes (this comparison might help)... EDIT: I don't recommend this route unless you're prepared to heavily test it. Markdown already has too many subtly different dialects and this will likely result in yet-another-one... UPDATE: https://github.com/sgenoud/remarkdown is a markdown reader for docutils. It didn't take any of the above shortcuts but uses a Parsley PEG grammar inspired by peg-markdown. Doesn't yet support directives. UPDATE: https://github.com/rtfd/recommonmark and is another docutils reader, natively supported on ReadTheDocs. Derived from remarkdown but uses the CommonMark-py parser. Doesn't support directives, but can convert more or less natural Markdown syntaxes to appropriate structures e.g. list of links to a toctree. For other needs, an ```eval_rst fenced block lets you embed any rST directive. In all cases, you'll need to invent extensions of Markdown to represent Sphinx directives and roles. While you may not need all of them, some like .. toctree:: are essential. This I think is the hardest part. reStructuredText before the Sphinx extensions was already richer than markdown. Even heavily extended markdown, such as pandoc's, is mostly a subset of rST feature set. That's a lot of ground to cover! Implementation-wise, the easiest thing is adding a generic construct to express any docutils role/directive. The obvious candidates for syntax inspiration are: Attribute syntax, which pandoc and some other implementations already allow on many inline and block constructs. For example `foo`{.method} -> `foo`:method:. HTML/XML. From foo to the kludgiest approach of just inserting docutils internal XML! Some kind of YAML for directives? But such a generic mapping will not be the most markdown-ish solution... Currently most active places to discuss markdown extensions are https://groups.google.com/forum/#!topic/pandoc-discuss, https://github.com/scholmd/scholmd/ This also means you can't just reuse a markdown parser without extending it somehow. Pandoc again lives up to its reputation as the swiss army knife of document conversion by supporting custom filtes. (In fact, if I were to approach this I'd try to build a generic bridge between docutils readers/transformers/writers and pandoc readers/filters/writers. It's more than you need but the payoff would be much wider than just sphinx/markdown.) Alternative crazy idea: instead of extending markdown to handle Sphinx, extend reStructuredText to support (mostly) a superset of markdown! The beauty is you'll be able to use any Sphinx features as-is, yet be able to write most content in markdown. There is already considerable syntax overlap; most notably link syntax is incompatible. I think if you add support to RST for markdown links, and ###-style headers, and change default `backticks` role to literal, and maybe change indented blocks to mean literal (RST supports > ... for quotations nowdays), you'll get something usable that supports most markdown. �][INST] How do I convert local time to UTC in Python? How do I convert a datetime string in local time to a string in UTC time? I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future. Clarification: For example, if I have 2008-09-17 14:02:00 in my local timezone (+10), I'd like to generate a string with the equivalent UTC time: 2008-09-17 04:02:00. Also, from http://lucumr.pocoo.org/2011/7/15/eppur-si-muove/, note that in general this isn't possible as with DST and other issues there is no unique conversion from local time to UTC time. [/INST] First, parse the string into a naive datetime object. This is an instance of datetime.datetime with no attached timezone information. See documentation for datetime.strptime for information on parsing the date string. Use the pytz module, which comes with a full list of time zones + UTC. Figure out what the local timezone is, construct a timezone object from it, and manipulate and attach it to the naive datetime. Finally, use datetime.astimezone() method to convert the datetime to UTC. Source code, using local timezone "America/Los_Angeles", for the string "2001-2-3 10:11:12": import pytz, datetime local = pytz.timezone ("America/Los_Angeles") naive = datetime.datetime.strptime ("2001-2-3 10:11:12", "%Y-%m-%d %H:%M:%S") local_dt = local.localize(naive, is_dst=None) utc_dt = local_dt.astimezone (pytz.utc) From there, you can use the strftime() method to format the UTC datetime as needed: utc_dt.strftime ("%Y-%m-%d %H:%M:%S") oV[INST] How to check version of python modules? I just installed the python modules: construct and statlib with setuptools like this: # Install setuptools to be able to download the following sudo apt-get install python-setuptools # Install statlib for lightweight statistical tools sudo easy_install statlib # Install construct for packing/unpacking binary data sudo easy_install construct I want to be able to (programmatically) check their versions. Is there an equivalent to python --version I can run from the command line? My python version is 2.7.3. [/INST] I suggest using pip in place of easy_install. With pip, you can list all installed packages and their versions with pip freeze For an individual module, you can try __version__ attribute, however there are modules without it: $ pip freeze | grep lxml lxml==2.3 $ python -c "import lxml; print lxml.__version__" Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute '__version__' Last, as you run your command with sudo prefix, I guess you're installing to global python environment. Strongly advise to take look into python virtual environment managers, for example virtualenvwrapper [INST] how to get row count of pandas dataframe? I'm trying to get the number of rows of dataframe df with Pandas, and here is my code Method 1: total_rows = df.count print total_rows +1 Method 2: total_rows = df['First_columnn_label'].count print total_rows +1 both the code snippets give me this error: TypeError: unsupported operand type(s) for +: 'instancemethod' and 'int' I'd be grateful for any suggestions what I'm doing wrong. EDIT: According to the answer given by root the best (the fastest) way to check df length is to call: len(df.index) [/INST] You can use the .shape property or just len(DataFrame.index) as there are notable performance differences: In [1]: import numpy as np In [2]: import pandas as pd In [3]: df = pd.DataFrame(np.arange(9).reshape(3,3)) In [4]: df Out[4]: 0 1 2 0 0 1 2 1 3 4 5 2 6 7 8 In [5]: df.shape Out[5]: (3, 3) In [6]: timeit df.shape 1000000 loops, best of 3: 1.17 us per loop In [7]: timeit df[0].count() 10000 loops, best of 3: 56 us per loop In [8]: len(df.index) Out[8]: 3 In [9]: timeit len(df.index) 1000000 loops, best of 3: 381 ns per loop EDIT: As @Dan Allen noted in the comments len(df.index) and df[0].count() are not interchangeable as count excludes NaNs, [INST] numpy: access an array by column Suppose I have: test = numpy.array([[1, 2], [3, 4], [5, 6]]) test[i] gets me ith line of the array (eg [1, 2]). How can I access the ith column? (eg [1, 3, 5]). Also, would this be an expensive operation? [/INST] >>> test[:,0] array([1, 3, 5]) Similarly, >>> test[1,:] array([3, 4]) lets you access rows. This is covered in Section 1.4 (Indexing) of the NumPy reference. This is quick, at least in my experience. It's certainly much quicker than accessing each element in a loop. [INST] Django: Why do some model fields clash with each other? I want to create an object that contains 2 links to Users. For example: class GameClaim(models.Model): target = models.ForeignKey(User) claimer = models.ForeignKey(User) isAccepted = models.BooleanField() but I am getting the following errors when running the server: Accessor for field 'target' clashes with related field 'User.gameclaim_set'. Add a related_name argument to the definition for 'target'. Accessor for field 'claimer' clashes with related field 'User.gameclaim_set'. Add a related_name argument to the definition for 'claimer'. Can you please explain why I am getting the errors and how to fix them? [/INST] You have two foreign keys to User. Django automatically creates a reverse relation from User back to GameClaim, which is usually gameclaim_set. However, because you have two FKs, you would have two gameclaim_set attributes, which is obviously impossible. So you need to tell Django what name to use for the reverse relation. Use the related_name attribute in the FK definition. e.g. class GameClaim(models.Model): target = models.ForeignKey(User, related_name='gameclaim_targets') claimer = models.ForeignKey(User, related_name='gameclaim_users') isAccepted = models.BooleanField() [INST] Reimport a module in python while interactive I know it can be done, but I never remember how. How can you reimport a module in python? The scenario is as follows: I import a module interactively and tinker with it, but then I face an error. I fix the error in the .py file and then I want to reimport the fixed module without quitting python. How can I do it ? [/INST] This should work: reload(my.module) From the Python docs Reload a previously imported module. The argument must be a module object, so it must have been successfully imported before. This is useful if you have edited the module source file using an external editor and want to try out the new version without leaving the Python interpreter. [INST] Python __str__ versus __unicode__ Is there a python convention for when you should implement __str__() versus __unicode__(). I've seen classes override __unicode__() more frequently than __str__() but it doesn't appear to be consistent. Are there specific rules when it is better to implement one versus the other? Is it necessary/good practice to implement both? [/INST] __str__() is the old method -- it returns bytes. __unicode__() is the new, preferred method -- it returns characters. The names are a bit confusing, but in 2.x we're stuck with them for compatibility reasons. Generally, you should put all your string formatting in __unicode__(), and create a stub __str__() method: def __str__(self): return unicode(self).encode('utf-8') In 3.0, str contains characters, so the same methods are named __bytes__() and __str__(). These behave as expected. [INST] Sending HTML email using Python How can I send the HTML content in an email using Python? I can send simple text. [/INST] From Python v2.6.2 documentation - 19.1.11. email: Examples: Here’s an example of how to create an HTML message with an alternative plain text version: #! /usr/bin/python import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText # me == my email address # you == recipient's email address me = "my@email.com" you = "your@email.com" # Create message container - the correct MIME type is multipart/alternative. msg = MIMEMultipart('alternative') msg['Subject'] = "Link" msg['From'] = me msg['To'] = you # Create the body of the message (a plain-text and an HTML version). text = "Hi!\nHow are you?\nHere is the link you wanted:\nhttp://www.python.org" html = """\

Hi!
How are you?
Here is the link you wanted.

""" # Record the MIME types of both parts - text/plain and text/html. part1 = MIMEText(text, 'plain') part2 = MIMEText(html, 'html') # Attach parts into message container. # According to RFC 2046, the last part of a multipart message, in this case # the HTML message, is best and preferred. msg.attach(part1) msg.attach(part2) # Send the message via local SMTP server. s = smtplib.SMTP('localhost') # sendmail function takes 3 arguments: sender's address, recipient's address # and message to send - here it is sent as one string. s.sendmail(me, you, msg.as_string()) s.quit()
[INST] Why does the floating-point value of 4*0.1 look nice in Python 3 but 3*0.1 doesn't? I know that most decimals don't have an exact floating point representation (Is floating point math broken?). But I don't see why 4*0.1 is printed nicely as 0.4, but 3*0.1 isn't, when both values actually have ugly decimal representations: >>> 3*0.1 0.30000000000000004 >>> 4*0.1 0.4 >>> from decimal import Decimal >>> Decimal(3*0.1) Decimal('0.3000000000000000444089209850062616169452667236328125') >>> Decimal(4*0.1) Decimal('0.40000000000000002220446049250313080847263336181640625') [/INST] The simple answer is because 3*0.1 != 0.3 due to quantization (roundoff) error (whereas 4*0.1 == 0.4 because multiplying by a power of two is usually an "exact" operation). You can use the .hex method in Python to view the internal representation of a number (basically, the exact binary floating point value, rather than the base-10 approximation). This can help to explain what's going on under the hood. >>> (0.1).hex() '0x1.999999999999ap-4' >>> (0.3).hex() '0x1.3333333333333p-2' >>> (0.1*3).hex() '0x1.3333333333334p-2' >>> (0.4).hex() '0x1.999999999999ap-2' >>> (0.1*4).hex() '0x1.999999999999ap-2' 0.1 is 0x1.999999999999a times 2^-4. The "a" at the end means the digit 10 - in other words, 0.1 in binary floating point is very slightly larger than the "exact" value of 0.1 (because the final 0x0.99 is rounded up to 0x0.a). When you multiply this by 4, a power of two, the exponent shifts up (from 2^-4 to 2^-2) but the number is otherwise unchanged, so 4*0.1 == 0.4. However, when you multiply by 3, the little tiny difference between 0x0.99 and 0x0.a0 (0x0.07) magnifies into a 0x0.15 error, which shows up as a one-digit error in the last position. This causes 0.1*3 to be very slightly larger than the rounded value of 0.3. Python 3's float repr is designed to be round-trippable, that is, the value shown should be exactly convertible into the original value. Therefore, it cannot display 0.3 and 0.1*3 exactly the same way, or the two different numbers would end up the same after round-tripping. Consequently, Python 3's repr engine chooses to display one with a slight apparent error. [INST] How to install pip with Python 3? I want to install pip. It should support Python 3, but it requires setuptools, which is available only for Python 2. How can I install pip with Python 3? [/INST] I was able to install pip for python 3 on Ubuntu just by running sudo apt-get install python3-pip. [INST] pip: dealing with multiple Python versions? Is there any way to make pip play well with multiple versions of Python? For example, I want to use pip to explicitly install things to either my site 2.5 installation or my site 2.6 installation. For example, with easy_install, I use easy_install-2.{5,6}. And, yes — I know about virtualenv, and no — it's not a solution to this particular problem. [/INST] Since version 0.8, Pip supports pip-{version}. You can use it the same as easy_install-{version}: $ pip-2.5 install myfoopackage $ pip-2.6 install otherpackage $ pip-2.7 install mybarpackage EDIT: pip changed its schema to use pipVERSION instead of pip-VERSION in version 1.5. You should use the following if you have pip >= 1.5: $ pip2.6 install otherpackage $ pip2.7 install mybarpackage Check https://github.com/pypa/pip/pull/1053 for more details References: https://github.com/pypa/pip/issues/200 http://www.pip-installer.org/docs/pip/en/0.8.3/news.html#id4 [INST] What is the best way to implement nested dictionaries in Python? I have a data structure which essentially amounts to a nested dictionary. Let's say it looks like this: {'new jersey': {'mercer county': {'plumbers': 3, 'programmers': 81}, 'middlesex county': {'programmers': 81, 'salesmen': 62}}, 'new york': {'queens county': {'plumbers': 9, 'salesmen': 36}}} Now, maintaining and creating this is pretty painful; every time I have a new state/county/profession I have to create the lower layer dictionaries via obnoxious try/catch blocks. Moreover, I have to create annoying nested iterators if I want to go over all the values. I could also use tuples as keys, like such: {('new jersey', 'mercer county', 'plumbers'): 3, ('new jersey', 'mercer county', 'programmers'): 81, ('new jersey', 'middlesex county', 'programmers'): 81, ('new jersey', 'middlesex county', 'salesmen'): 62, ('new york', 'queens county', 'plumbers'): 9, ('new york', 'queens county', 'salesmen'): 36} This makes iterating over the values very simple and natural, but it is more syntactically painful to do things like aggregations and looking at subsets of the dictionary (e.g. if I just want to go state-by-state). Basically, sometimes I want to think of a nested dictionary as a flat dictionary, and sometimes I want to think of it indeed as a complex hierarchy. I could wrap this all in a class, but it seems like someone might have done this already. Alternatively, it seems like there might be some really elegant syntactical constructions to do this. How could I do this better? Addendum: I'm aware of setdefault() but it doesn't really make for clean syntax. Also, each sub-dictionary you create still needs to have setdefault() manually set. [/INST] class AutoVivification(dict): """Implementation of perl's autovivification feature.""" def __getitem__(self, item): try: return dict.__getitem__(self, item) except KeyError: value = self[item] = type(self)() return value Testing: a = AutoVivification() a[1][2][3] = 4 a[1][3][3] = 5 a[1][2]['test'] = 6 print a Output: {1: {2: {'test': 6, 3: 4}, 3: {3: 5}}} [INST] What exactly are Python's iterator, iterable, and iteration protocols? What are the most basic definitions of "iterable", "iterator" and "iteration" in Python? I've read multiple definitions but their exact meaning still won't sink in. Can someone please help me with the basic idea? [/INST] Iteration is a general term for taking each item of something, one after another. Any time you use a loop, explicit or implicit, to go over a group of items, that is iteration. In Python, iterable and iterator have specific meanings. An iterable is an object that has an __iter__ method which returns an iterator, or which defines a __getitem__ method that can take sequential indexes starting from zero (and raises an IndexError when the indexes are no longer valid). So an iterable is an object that you can get an iterator from. An iterator is an object with a next (Python 2) or __next__ (Python 3) method. Whenever you use a for loop, or map, or a list comprehension, etc. in Python, the next method is called automatically to get each item from the iterator, thus going through the process of iteration. A good place to start learning would be the iterators section of the tutorial and the iterator types section of the standard types page. After you understand the basics, try the iterators section of the Functional Programming HOWTO. [INST] Split by comma and strip whitespace in Python I have some python code that splits on comma, but doesn't strip the whitespace: >>> string = "blah, lots , of , spaces, here " >>> mylist = string.split(',') >>> print mylist ['blah', ' lots ', ' of ', ' spaces', ' here '] I would rather end up with whitespace removed like this: ['blah', 'lots', 'of', 'spaces', 'here'] I am aware that I could loop through the list and strip() each item but, as this is Python, I'm guessing there's a quicker, easier and more elegant way of doing it. [/INST] Use list comprehension -- simpler, and just as easy to read as a for loop. my_string = "blah, lots , of , spaces, here " [x.strip() for x in my_string.split(',')] See: Python docs on List Comprehension A good 2 second explanation of list comprehension. [INST] How to uninstall Python 2.7 on a Mac OS X 10.6.4? I want to completely remove Python 2.7 from my Mac OS X 10.6.4. I managed to remove the entry from the PATH variable by reverting my .bash_profile. But I also want to remove all directories, files, symlinks, and entries that got installed by the Python 2.7 install package. I've got the install package from http://www.python.org/. What directories/files/configuration file entries do I need to remove? Is there a list somewhere? [/INST] The complete list is documented here. Basically, all you need to do is the following: Remove the Python 2.7 framework sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7 Remove the Python 2.7 applications directory sudo rm -rf "/Applications/Python 2.7" Remove the symbolic links in /usr/local/bin that point to this Python version see ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' and then run the following command to remove all the links: cd /usr/local/bin/ ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm If necessary, edit your shell profile file(s) to remove adding /Library/Frameworks/Python.framework/Versions/2.7 to your PATH environment file. Depending on which shell you use, any of the following files may have been modified: ~/.bash_login, ~/.bash_profile, ~/.cshrc, ~/.profile, ~/.tcshrc, and/or ~/.zprofile. [INST] How to write inline if statement for print? I need to print some stuff only when a boolean variable is set to True. So, after looking at this, I tried with a simple example: >>> a = 100 >>> b = True >>> print a if b File "", line 1 print a if b ^ SyntaxError: invalid syntax Same thing if I write print a if b==True. What am I missing here? [/INST] Python does not have a trailing if statement. There are two kinds of if in Python: if statement: if condition: statement if condition: block if expression (introduced in Python 2.5) expression_if_true if condition else expression_if_false And note, that both print a and b = a are statements. Only the a part is an expression. So if you write print a if b else 0 it means print (a if b else 0) and similarly when you write x = a if b else 0 it means x = (a if b else 0) Now what would it print/assign if there was no else clause? The print/assignment is still there. And note, that if you don't want it to be there, you can always write the regular if statement on a single line, though it's less readable and there is really no reason to avoid the two-line variant. [INST] Why use Python's os module methods instead of executing shell commands directly? I am trying to understand what is the motivation behind using Python's library functions for executing OS-specific tasks such as creating files/directories, changing file attributes, etc. instead of just executing those commands via os.system() or subprocess.call()? For example, why would I want to use os.chmod instead of doing os.system("chmod...")? I understand that it is more "pythonic" to use Python's available library methods as much as possible instead of just executing shell commands directly. But, is there any other motivation behind doing this from a functionality point of view? I am only talking about executing simple one-line shell commands here. When we need more control over the execution of the task, I understand that using subprocess module makes more sense, for example. [/INST] It's faster, os.system and subprocess.call create new processes which is unnecessary for something this simple. In fact, os.system and subprocess.call with the shell argument usually create at least two new processes: the first one being the shell, and the second one being the command that you're running (if it's not a shell built-in like test). Some commands are useless in a separate process. For example, if you run os.spawn("cd dir/"), it will change the current working directory of the child process, but not of the Python process. You need to use os.chdir for that. You don't have to worry about special characters interpreted by the shell. os.chmod(path, mode) will work no matter what the filename is, whereas os.spawn("chmod 777 " + path) will fail horribly if the filename is something like ; rm -rf ~. (Note that you can work around this if you use subprocess.call without the shell argument.) You don't have to worry about filenames that begin with a dash. os.chmod("--quiet", mode) will change the permissions of the file named --quiet, but os.spawn("chmod 777 --quiet") will fail, as --quiet is interpreted as an argument. This is true even for subprocess.call(["chmod", "777", "--quiet"]). You have fewer cross-platform and cross-shell concerns, as Python's standard library is supposed to deal with that for you. Does your system have chmod command? Is it installed? Does it support the parameters that you expect it to support? The os module will try to be as cross-platform as possible and documents when that it's not possible. If the command you're running has output that you care about, you need to parse it, which is trickier than it sounds, as you may forget about corner-cases (filenames with spaces, tabs and newlines in them), even when you don't care about portability. [INST] DatabaseError: current transaction is aborted, commands ignored until end of transaction block I got a lot of errors with the message : "DatabaseError: current transaction is aborted, commands ignored until end of transaction block" after changed from python-psycopg to python-psycopg2 as Django project's database engine. The code remains the same, just dont know where those errors are from. [/INST] To get rid of the error, roll back the last (erroneous) transaction after you've fixed your code: from django.db import transaction transaction.rollback() You can use try-except to prevent the error from occurring: from django.db import transaction, DatabaseError try: a.save() except DatabaseError: transaction.rollback() Refer : Django documentation [INST] How to get current CPU and RAM usage in Python? What's your preferred way of getting current system status (current CPU, RAM, free disk space, etc.) in Python? Bonus points for *nix and Windows platforms. There seems to be a few possible ways of extracting that from my search: Using a library such as PSI (that currently seems not actively developed and not supported on multiple platform) or something like pystatgrab (again no activity since 2007 it seems and no support for Windows). Using platform specific code such as using a os.popen("ps") or similar for the *nix systems and MEMORYSTATUS in ctypes.windll.kernel32 (see this recipe on ActiveState) for the Windows platform. One could put a Python class together with all those code snippets. It's not that those methods are bad but is there already a well-supported, multi-platform way of doing the same thing? [/INST] The psutil library will give you some system information (CPU / Memory usage) on a variety of platforms: psutil is a module providing an interface for retrieving information on running processes and system utilization (CPU, memory) in a portable way by using Python, implementing many functionalities offered by tools like ps, top and Windows task manager. It currently supports Linux, Windows, OSX, Sun Solaris, FreeBSD, OpenBSD and NetBSD, both 32-bit and 64-bit architectures, with Python versions from 2.6 to 3.5 (users of Python 2.4 and 2.5 may use 2.1.3 version). [INST] Can "list_display" in a Django ModelAdmin display attributes of ForeignKey fields? I have a Person model that has a foreign key relationship to Book. Book has a number of fields, but I'm most concerned about "author" (a standard CharField). With that being said, in my PersonAdmin model, I'd like to display "book.author" using "list_display". I've tried all of the obvious methods for doing so (see below), but nothing seems to work. Any suggestions? class PersonAdmin(admin.ModelAdmin): list_display = ['book.author',] [/INST] As another option, you can do look ups like: class UserAdmin(admin.ModelAdmin): list_display = (..., 'get_author') def get_author(self, obj): return obj.book.author get_author.short_description = 'Author' get_author.admin_order_field = 'book__author' [INST] How can the euclidean distance be calculated with numpy? I have two points in 3D: (xa, ya, za) (xb, yb, zb) And I want to calculate the distance: dist = sqrt((xa-xb)^2 + (ya-yb)^2 + (za-zb)^2) What's the best way to do this with Numpy, or with Python in general? I have: a = numpy.array((xa ,ya, za)) b = numpy.array((xb, yb, zb)) [/INST] Use numpy.linalg.norm: dist = numpy.linalg.norm(a-b) [INST] Python: defaultdict of defaultdict? Is there a way to have a defaultdict(defaultdict(int)) in order to make the following code work? for x in stuff: d[x.a][x.b] += x.c_int d needs to be built ad-hoc, depending on x.a and x.b elements. I could use: for x in stuff: d[x.a,x.b] += x.c_int but then I wouldn't be able to use: d.keys() d[x.a].keys() [/INST] Yes like this: defaultdict(lambda : defaultdict(int)) [INST] How to get console window width in python Is there a way in python to programmatically determine the width of the console? I mean the number of characters that fits in one line without wrapping, not the pixel width of the window. Edit Looking for a solution that works on Linux [/INST] import os rows, columns = os.popen('stty size', 'r').read().split() uses the 'stty size' command which according to a thread on the python mailing list is reasonably universal on linux. It opens the 'stty size' command as a file, 'reads' from it, and uses a simple string split to separate the coordinates. Unlike the os.environ["COLUMNS"] value (which I can't access in spite of using bash as my standard shell) the data will also be up-to-date whereas I believe the os.environ["COLUMNS"] value would only be valid for the time of the launch of the python interpreter (suppose the user resized the window since then). [INST] Printing Python version in output How can I print version number for the current Python installation in the output? [/INST] Try import sys print(sys.version) This prints the full version information string. If you only want the python version number, then Bastien Léonard's solution is the best. You might want to examine the full string and see if you need it or portions of it. [INST] How do I remove a substring from the end of a string in Python? I have the following code: url = 'abcdc.com' print(url.strip('.com')) I expected: abcdc I got: abcd Now I do url.rsplit('.com', 1) Is there a better way? [/INST] You could do this: url = 'abcdc.com' if url.endswith('.com'): url = url[:-4] Or using regular expressions: import re url = 'abcdc.com' url = re.sub('\.com$', '', url) [INST] Which version of Python do I have installed? I have to run a Python script on a Windows server. How can I know which version of Python I have, and does it even really matter? I was thinking of updating to latest version of Python. [/INST] python -V http://docs.python.org/using/cmdline.html#generic-options --version may also work (introduced in version 2.5) [INST] What is __future__ in Python used for and how/when to use it, and how it works People including me know there is something in Python called __future__ and it appears in quite a few modules I read. And the dull people like me don't know why it's there, and how/when to use it , even after reading the Python's __future__ doc. So any explains with examples to demonstrate it? I have got a few answers quickly, which look all correct, in terms of the basic usage. However and also for further understanding how __future__ works: I just realized one key thing that was confusing me when I tried to understand it, that is, how a current python release include something that will be released in future release? and how can a program using a new feature in a future python release be compiled successfully by the current python release? So, I guess now that, the current release has already packaged some potential features that will be included in future releases - is this right? but the features are available only by __future__, that is because it doesn't become standard yet - am I right? [/INST] With it, you can slowly be accustomed to incompatible changes or to such ones introducing new keywords. E.g., for using context managers, you had to do from __future__ import with_statement in 2.5, as the with keyword was new and shouldn't be used as variable names any longer. In order to be able to use a program which uses variables named with, the above import statement is needed. Another example is from __future__ import division print 8/7 # prints 1.1428571428571428 print 8//7 # prints 1 Without the __future__ stuff, both print statements would print 1. The internal difference is that without that import, / is mapped to the __div__() method, while with it, __truediv__() is used. (In any case, // calls __floordiv__().) A propos print: print becomes a function in 3.x, losing its special property as a keyword. So it is the other way round. >>> print >>> from __future__ import print_function >>> print >>> [INST] How to get a complete list of object's methods and attributes? dir(re.compile(pattern)) does not return pattern as one of the lists's elements. Namely it returns: ['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub', 'subn'] According to the manual, it is supposed to contain the object's attributes' names, the names of its class's attributes, and recursively of the attributes of its class's base classes. It says also that The list is not necessarily complete. Is there a way to get the complete list? I always assumed that dir returns a complete list but apparently it does not... Also: is there a way to list only attributes? Or only methods? Edit: this is actually a bug in python -> supposedly it is fixed in the 3.0 branch (and perhaps also in 2.6) [/INST] For the complete list of attributes, the short answer is: no. The problem is that the attributes are actually defined as the arguments accepted by the getattr built-in function. As the user can reimplement __getattr__, suddenly allowing any kind of attribute, there is no possible generic way to generate that list. The dir function returns the keys in the __dict__ attribute, i.e. all the attributes accessible if the __getattr__ method is not reimplemented. For the second question, it does not really make sense. Actually, methods are callable attributes, nothing more. You could though filter callable attributes, and, using the inspect module determine the class methods, methods or functions. [INST] How do I remove/delete a virtualenv? I created an environment with the following command: virtualenv venv --distribute I cannot remove it with the following command: rmvirtualenv venv I do an lson my current directory and I still see venv The only way I can remove it seems to be: sudo rm -rf venv Note that the environment is not active. I'm running Ubuntu 11.10. Any ideas? I've tried rebooting my system to no avail. [/INST] That's it! There is no command for deleting your virtual environment. Simply deactivate it and rid your application of its artifacts by recursively removing it. [INST] How do I filter ForeignKey choices in a Django ModelForm? Say I have the following in my models.py: class Company(models.Model): name = ... class Rate(models.Model): company = models.ForeignKey(Company) name = ... class Client(models.Model): name = ... company = models.ForeignKey(Company) base_rate = models.ForeignKey(Rate) I.e. there are multiple Companies, each having a range of Rates and Clients. Each Client should have a base Rate that is chosen from it's parent Company's Rates, not another Company's Rates. When creating a form for adding a Client, I would like to remove the Company choices (as that has already been selected via an "Add Client" button on the Company page) and limit the Rate choices to that Company as well. How do I go about this in Django 1.0? My current forms.py file is just boilerplate at the moment: from models import * from django.forms import ModelForm class ClientForm(ModelForm): class Meta: model = Client And the views.py is also basic: from django.shortcuts import render_to_response, get_object_or_404 from models import * from forms import * def addclient(request, company_id): the_company = get_object_or_404(Company, id=company_id) if request.POST: form = ClientForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect(the_company.get_clients_url()) else: form = ClientForm() return render_to_response('addclient.html', {'form': form, 'the_company':the_company}) In Django 0.96 I was able to hack this in by doing something like the following before rendering the template: manipulator.fields[0].choices = [(r.id,r.name) for r in Rate.objects.filter(company_id=the_company.id)] ForeignKey.limit_choices_to seems promising but I don't know how to pass in the_company.id and I'm not clear if that will work outside the Admin interface anyway. Thanks. (This seems like a pretty basic request but if I should redesign something I'm open to suggestions.) [/INST] ForeignKey is represented by django.forms.ModelChoiceField, which is a ChoiceField whose choices are a model QuerySet. See the reference for ModelChoiceField. So, provide a QuerySet to the field's queryset attribute. Depends on how your form is built. If you build an explicit form, you'll have fields named directly. form.rate.queryset = Rate.objects.filter(company_id=the_company.id) If you take the default ModelForm object, form.fields["rate"].queryset = ... This is done explicitly in the view. No hacking around. [INST] Creating a new dict in Python I want to build a dictionary in Python. However, all the examples that I see are instantiating a dictionary from a list, etc . .. How do I create a new empty dictionary in Python? [/INST] Call dict with no parameters new_dict = dict() or simply write new_dict = {} [INST] What is the ellipsis [...] in a Python list? I was playing around in python. I used the following code in IDLE p = [1, 2] p[1:1] = [p] print p The output was [1, [...], 2] What is this […]? Interestingly I could now use this as a list of list of list upto infinity i.e. p[1][1][1].... I could write the above as long as I wanted and it would still work. EDIT: How is it represented in memory? What's its use? Examples of some cases where it is useful would be helpful. Any link to official documentation would be really useful. [/INST] This is what your code created It's a list where the first and last elements are pointing to two numbers (1 and 2) and where the middle element is pointing to the list itself. In Common Lisp when printing circular structures is enabled such an object would be printed as #1=#(1 #1# 2) meaning that there is an object (labelled 1 with #1=) that is a vector with three elements, the second being the object itself (back-referenced with #1#). In Python instead you just get the information that the structure is circular with [...]. In this specific case the description is not ambiguous (it's backward pointing to a list but there is only one list so it must be that one). In other cases may be however ambiguous... for example in [1, [2, [...], 3]] the backward reference could either to the outer or to the inner list. These two different structures printed in the same way can be created with x = [1, [2, 3]] x[1][1:1] = [x[1]] y = [1, [2, 3]] y[1][1:1] = [y] print x, y and they would be in memory as [INST] Python argparse: How to insert newline in the help text? I'm using argparse in Python 2.7 for parsing input options. One of my options is a multiple choice. I want to make a list in its help text, e.g. from argparse import ArgumentParser parser = ArgumentParser(description='test') parser.add_argument('-g', choices=['a', 'b', 'g', 'd', 'e'], default='a', help="Some option, where\n" " a = alpha\n" " b = beta\n" " g = gamma\n" " d = delta\n" " e = epsilon") parser.parse_args() However, argparse strips all newlines and consecutive spaces. The result looks like ~/Downloads:52$ python2.7 x.py -h usage: x.py [-h] [-g {a,b,g,d,e}] test optional arguments: -h, --help show this help message and exit -g {a,b,g,d,e} Some option, where a = alpha b = beta g = gamma d = delta e = epsilon How to insert newlines in the help text? [/INST] Try using RawTextHelpFormatter: from argparse import RawTextHelpFormatter parser = ArgumentParser(description='test', formatter_class=RawTextHelpFormatter) [INST] How to add to the pythonpath in windows 7? I have a directory which hosts all of my Django apps (C:\My_Projects). I want to add this directory to my pythonpath so I can call the apps directly. I have tried adding C:\My_Projects\; to my Path variable from the Windows GUI (My Computer > Properties > Advanced System Settings > Environment Variables). But it still doesn't read the coltrane module and generates this error: Error: No module named coltrane [/INST] You know what has worked for me really well on windows. My Computer > Properties > Advanced System Settings > Environment Variables > Then under system variables I create a new Variable called PythonPath. In this variable I have C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\other-foolder-on-the-path This is the best way that has worked for me which I hadn't found in any of the docs offered. EDIT: For those who are not able to get it, Please add C:\Python27; along with it. Else it will never work. [INST] How to percent-encode URL parameters in Python? If I do url = "http://example.com?p=" + urllib.quote(query) It doesn't encode / to %2F (breaks OAuth normalization) It doesn't handle Unicode (it throws an exception) Is there a better library? [/INST] From the docs: urllib.quote(string[, safe]) Replace special characters in string using the %xx escape. Letters, digits, and the characters '_.-' are never quoted. By default, this function is intended for quoting the path section of the URL.The optional safe parameter specifies additional characters that should not be quoted — its default value is '/' That means passing '' for safe will solve your first issue: >>> urllib.quote('/test') '/test' >>> urllib.quote('/test', safe='') '%2Ftest' About the second issue, there is a bug report about it here. Apparently it was fixed in python 3. You can workaround it by encoding as utf8 like this: >>> query = urllib.quote(u"Müller".encode('utf8')) >>> print urllib.unquote(query).decode('utf8') Müller By the way have a look at urlencode [INST] parsing boolean values with argparse I would like to use argparse to parse boolean command-line arguments written as "--foo True" or "--foo False". For example: my_program --my_boolean_flag False However, the following test code does not do what I would like: import argparse parser = argparse.ArgumentParser(description="My parser") parser.add_argument("--my_bool", type=bool) cmd_line = ["--my_bool", "False"] parsed_args = parser.parse(cmd_line) Sadly, parsed_args.my_bool evaluates to True. This is the case even when I change cmd_line to be ["--my_bool", ""], which is surprising, since bool("") evalutates to False. How can I get argparse to parse "False", "F", and their lower-case variants to be False? [/INST] I think a more canonical way to do this is via: command --feature and command --no-feature argparse supports this version nicely: parser.add_argument('--feature', dest='feature', action='store_true') parser.add_argument('--no-feature', dest='feature', action='store_false') parser.set_defaults(feature=True) Of course, if you really want the --arg version, you could pass ast.literal_eval as the "type", or a user defined function ... def t_or_f(arg): ua = str(arg).upper() if 'TRUE'.startswith(ua): return True elif 'FALSE'.startswith(ua): return False else: pass #error condition maybe? /R 2H[INST] What is an alternative to execfile in Python 3.0? It seems they canceled in Python 3.0 all the easy way to quickly load a script file - both execfile() and reload(). Is there an obvious alternative I'm missing? [/INST] You are just supposed to read the file and exec the code yourself. 2to3 current replaces execfile("somefile.py", global_vars, local_vars) as with open("somefile.py") as f: code = compile(f.read(), "somefile.py", 'exec') exec(code, global_vars, local_vars) (The compile call isn't strictly needed, but it associates the filename with the code object making debugging a little easier.) See: http://docs.python.org/release/2.7.3/library/functions.html#execfile http://docs.python.org/release/3.2.3/library/functions.html#compile http://docs.python.org/release/3.2.3/library/functions.html#exec [INST] How to retrieve an element from a set without removing it? Suppose the following: >>>s = set([1, 2, 3]) How do I get a value (any value) out of s without doing s.pop()? I want to leave the item in the set until I am sure I can remove it - something I can only be sure of after an asynchronous call to another host. Quick and dirty: >>>elem = s.pop() >>>s.add(elem) But do you know of a better way? Ideally in constant time. [/INST] Two options that don't require copying the whole set: for e in s: break # e is now an element from s Or... e = next(iter(s)) But in general, sets don't support indexing or slicing. [INST] Numpy array dimensions I'm currently trying to learn Numpy and Python. Given the following array: import numpy as N a = N.array([[1,2],[1,2]]) Is there a function that returns the dimensions of a (e.g.a is a 2 by 2 array)? size() returns 4 and that doesn't help very much. [/INST] It is .shape: ndarray.shape Tuple of array dimensions. Thus: >>> a.shape (2, 2) [INST] Print a list in reverse order with range()? How can you produce the following list with range() in Python? [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] [/INST] Use the 'range' built-in function. The signature is range(start, stop, step). This produces a sequence that yields numbers, starting with start, and ending if stop has been reached, excluding stop. >>> range(9,-1,-1) [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] >>> range(-2, 6, 2) [-2, 0, 2, 4] In Python 3, this produces a non-list range object, which functions effectively like a read-only list (but uses way less memory, particularly for large ranges). [INST] Compiled vs. Interpreted Languages I'm trying to get a better understanding of the difference. I've found a lot of explanations online, but they tend towards the abstract differences rather than the practical implications. Most of my programming experiences has been with CPython (dynamic, interpreted), and Java (static, compiled). However, I understand that there are other kinds of interpreted and compiled languages. Aside from the fact that executable files can be distributed from programs written in compiled languages, are there any advantages/disadvantages to each type? Oftentimes, I hear people arguing that interpreted languages can be used interactively, but I believe that compiled languages can have interactive implementations as well, correct? [/INST] A compiled language is one where the program, once compiled, is expressed in the instructions of the target machine. For example, an addition "+" operation in your source code could be translated directly to the "ADD" instruction in machine code. An interpreted language is one where the instructions are not directly executed by the target machine, but instead read and executed by some other program (which normally is written in the language of the native machine). For example, the same "+" operation would be recognised by the interpreter at run time, which would then call its own "add(a,b)" function with the appropriate arguments, which would then execute the machine code "ADD" instruction. You can do anything that you can do in an interpreted language in a compiled language and vice-versa - they are both Turing complete. Both however have advantages and disadvantages for implementation and use. I'm going to completely generalise (purists forgive me!) but, roughly, here are the advantages of compiled languages: Faster performance by directly using the native code of the target machine Opportunity to apply quite powerful optimisations during the compile stage And here are the advantages of interpreted languages: Easier to implement (writing good compilers is very hard!!) No need to run a compilation stage: can execute code directly "on the fly" Can be more convenient for dynamic languages Note that modern techniques such as bytecode compilation add some extra complexity - what happens here is that the compiler targets a "virtual machine" which is not the same as the underlying hardware. These virtual machine instructions can then be compiled again at a later stage to get native code (e.g. as done by the Java JVM JIT compiler). [INST] Having Django serve downloadable files I want users on the site to be able to download files whose paths are obscured so they cannot be directly downloaded. For instance, I'd like the URL to be something like this, "http://example.com/download/?f=somefile.txt And on the server, I know that all downloadable files reside in a folder "/home/user/files/". Is there a way to make Django serve that file for download as opposed to trying to find a URL and View to display it? [/INST] For the "best of both worlds" you could combine S.Lott's solution with the xsendfile module: django generates the path to the file (or the file itself), but the actual file serving is handled by Apache/Lighttpd. Once you've set up mod_xsendfile, integrating with your view takes a few lines of code: from django.utils.encoding import smart_str response = HttpResponse(mimetype='application/force-download') # mimetype is replaced by content_type for django 1.7 response['Content-Disposition'] = 'attachment; filename=%s' % smart_str(file_name) response['X-Sendfile'] = smart_str(path_to_file) # It's usually a good idea to set the 'Content-Length' header too. # You can also set any other required headers: Cache-Control, etc. return response Of course, this will only work if you have control over your server, or your hosting company has mod_xsendfile already set up. [INST] Convert list of dictionaries to Dataframe I have a list of dictionaries like this: [{'points': 50, 'time': '5:00', 'year': 2010}, {'points': 25, 'time': '6:00', 'month': "february"}, {'points':90, 'time': '9:00', 'month': 'january'}, {'points_h1':20, 'month': 'june'}] and I want to turn this into a pandas DataFrame like this: month points points_h1 time year 0 NaN 50 NaN 5:00 2010 1 february 25 NaN 6:00 NaN 2 january 90 NaN 9:00 NaN 3 june NaN 20 NaN NaN Note: Order of the columns does not matter. Ultimately, the goal is to write this to a text file and this seems like the best solution I could find. How can I turn the list of dictionaries into a panda DataFrame as shown above? [/INST] Supposing d is your list of dicts, simply: pd.DataFrame(d) [INST] Pretty-printing of numpy.array I'm curious, whether there is any way to print formatted numpy.arrays, e.g., in the way similar to this: x = 1.23456 print '%.3f' % x If I want to print the numpy.array of floats, it prints several decimals, often in 'scientific' format, which is rather hard to read even for low-dimensional arrays. However, numpy.array apparently has to be printed as a string, i.e., with %s. Is there any solution for this purpose? [/INST] You can use set_printoptions to set the precision of the output: import numpy as np x=np.random.random(10) print(x) # [ 0.07837821 0.48002108 0.41274116 0.82993414 0.77610352 0.1023732 # 0.51303098 0.4617183 0.33487207 0.71162095] np.set_printoptions(precision=3) print(x) # [ 0.078 0.48 0.413 0.83 0.776 0.102 0.513 0.462 0.335 0.712] And suppress suppresses the use of scientific notation for small numbers: y=np.array([1.5e-10,1.5,1500]) print(y) # [ 1.500e-10 1.500e+00 1.500e+03] np.set_printoptions(suppress=True) print(y) # [ 0. 1.5 1500. ] See the docs for set_printoptions for other options. To apply print options locally, you could use a contextmanager: import numpy as np import contextlib @contextlib.contextmanager def printoptions(*args, **kwargs): original = np.get_printoptions() np.set_printoptions(*args, **kwargs) yield np.set_printoptions(**original) For example, inside the with-suite precision=3 and suppress=True are set: x = np.random.random(10) with printoptions(precision=3, suppress=True): print(x) # [ 0.073 0.461 0.689 0.754 0.624 0.901 0.049 0.582 0.557 0.348] But outside the with-suite the print options are back to default settings: print(x) # [ 0.07334334 0.46132615 0.68935231 0.75379645 0.62424021 0.90115836 # 0.04879837 0.58207504 0.55694118 0.34768638] To prevent zeros from being stripped from the end of floats: np.set_printoptions now has a formatter parameter which allows you to specify a format function for each type. np.set_printoptions(formatter={'float': '{: 0.3f}'.format}) print(x) which prints [ 0.078 0.480 0.413 0.830 0.776 0.102 0.513 0.462 0.335 0.712] instead of [ 0.078 0.48 0.413 0.83 0.776 0.102 0.513 0.462 0.335 0.712] [INST] Getting a map() to return a list in Python 3.x I'm trying to map a list into hex, and then use the list elsewhere. In python 2.6, this was easy: A: Python 2.6: >>> map(chr, [66, 53, 0, 94]) ['B', '5', '\x00', '^'] However, on Python 3.1, the above returns a map object. B: Python 3.1: >>> map(chr, [66, 53, 0, 94]) How do I retrieve the mapped list (as in A above) on Python 3.x? Alternatively, is there a better way of doing this? My initial list object has around 45 items and id like to convert them to hex. [/INST] Do this: list(map(chr,[66,53,0,94])) In Python 3+, many processes that iterate over iterables return iterators themselves. In most cases, this ends up saving memory, and should make things go faster. If all you're going to do is iterate over this list eventually, there's no need to even convert it to a list, because you can still iterate over the map object like so: # Prints "ABCD" for ch in map(chr,[65,66,67,68]): print(ch) [INST] Store output of subprocess.Popen call in a string I'm trying to make a system call in Python and store the output to a string that I can manipulate in the Python program. #!/usr/bin/python import subprocess p2 = subprocess.Popen("ntpq -p") I've tried a few things including some of the suggestions here: Retrieving the output of subprocess.call() but without any luck. [/INST] In Python 2.7 or Python 3 Instead of making a Popen object directly, you can use the subprocess.check_output() function to store output of a command in a string: from subprocess import check_output out = check_output(["ntpq", "-p"]) In Python 2.4-2.6 Use the communicate method. import subprocess p = subprocess.Popen(["ntpq", "-p"], stdout=subprocess.PIPE) out, err = p.communicate() out is what you want. Important note about the other answers Note how I passed in the command. The "ntpq -p" example brings up another matter. Since Popen does not involke the shell, you would use a list of the command and options—["ntpq", "-p"]. [INST] How to comment out a block of Python code in Vim I was wondering if there was any key mapping in Vim to allow me to indent certain lines of code (whether those lines have been selected in visual mode, or n lines above/below current cursor position). So basically something that converts the following def my_fun(x, y): return x + y to #def my_fun(x, y): # return x + y I am okay with using either # or """ for commenting out the relevant lines. Ideally, I would also like the same keymapping to uncomment the lines if the given lines have been commented out. [/INST] Step 1: Go to the the first column of the first line you want to comment. Step 2: Press: Ctrl+v and select the lines you want to comment: Step 3: Shift-I#space (Enter Insert-at-left mode, type chars to insert. The selection will disappear, but all lines within it will be modified after Step 4.) Step 4: Esc [INST] How do I execute a string containing Python code in Python? How do I execute a string containing Python code in Python? [/INST] For statements, use exec(string) (Python 2/3) or exec string (Python 2): >>> mycode = 'print "hello world"' >>> exec(mycode) Hello world When you need the value of an expression, use eval(string): >>> x = eval("2+2") >>> x 4 However, the first step should be to ask yourself if you really need to. Executing code should generally be the position of last resort: It's slow, ugly and dangerous if it can contain user-entered code. You should always look at alternatives first, such as higher order functions, to see if these can better meet your needs. [INST] How to exit from Python without traceback? I would like to know how to I exit from Python without having an traceback dump on the output. I still want want to be able to return an error code but I do not want to display the traceback log. I want to be able to exit using exit(number) without trace but in case of an Exception (not an exit) I want the trace. [/INST] You are presumably encountering an exception and the program is exiting because of this (with a traceback). The first thing to do therefore is to catch that exception, before exiting cleanly (maybe with a message, example given). Try something like this in your main routine: import sys, traceback def main(): try: do main program stuff here .... except KeyboardInterrupt: print "Shutdown requested...exiting" except Exception: traceback.print_exc(file=sys.stdout) sys.exit(0) if __name__ == "__main__": main() [INST] Get MD5 hash of big files in Python I have used hashlib (which replaces md5 in Python 2.6/3.0) and it worked fine if I opened a file and put its content in hashlib.md5() function. The problem is with very big files that their sizes could exceed RAM size. How to get the MD5 hash of a file without loading the whole file to memory? [/INST] You need to read the file in chunks of suitable size: def md5_for_file(f, block_size=2**20): md5 = hashlib.md5() while True: data = f.read(block_size) if not data: break md5.update(data) return md5.digest() NOTE: Make sure you open your file with the 'rb' to the open - otherwise you will get the wrong result. So to do the whole lot in one method - use something like: def generate_file_md5(rootdir, filename, blocksize=2**20): m = hashlib.md5() with open( os.path.join(rootdir, filename) , "rb" ) as f: while True: buf = f.read(blocksize) if not buf: break m.update( buf ) return m.hexdigest() The update above was based on the comments provided by Frerich Raabe - and I tested this and found it to be correct on my Python 2.7.2 windows installation I cross-checked the results using the 'jacksum' tool. jacksum -a md5 http://www.jonelo.de/java/jacksum/ [INST] check if all elements in a list are identical I need the following function: Input: a list Output: True if all elements in the input list evaluate as equal to each other using the standard equality operator; False otherwise. Performance: of course, I prefer not to incur any unnecessary overhead. I feel it would be best to: iterate through the list compare adjacent elements and AND all the resulting Boolean values But I'm not sure what's the most Pythonic way to do that. EDIT: Thank you for all the great answers. I rated up several, and it was really hard to choose between @KennyTM and @Ivo van der Wijk solutions. The lack of short-circuit feature only hurts on a long input (over ~50 elements) that have unequal elements early on. If this occurs often enough (how often depends on how long the lists might be), the short-circuit is required. The best short-circuit algorithm seems to be @KennyTM checkEqual1. It pays, however, a significant cost for this: up to 20x in performance nearly-identical lists up to 2.5x in performance on short lists If the long inputs with early unequal elements don't happen (or happen sufficiently rarely), short-circuit isn't required. Then, by far the fastest is @Ivo van der Wijk solution. [/INST] General method: def checkEqual1(iterator): iterator = iter(iterator) try: first = next(iterator) except StopIteration: return True return all(first == rest for rest in iterator) One-liner: def checkEqual2(iterator): return len(set(iterator)) <= 1 Also one-liner: def checkEqual3(lst): return lst[1:] == lst[:-1] The difference between the 3 versions are that: In checkEqual2 the content must be hashable. checkEqual1 and checkEqual2 can use any iterators, but checkEqual3 must take a sequence input, typically concrete containers like a list or tuple. checkEqual1 stops as soon as a difference is found. Since checkEqual1 contains more Python code, it is less efficient when many of the items are equal in the beginning. Since checkEqual2 and checkEqual3 always perform O(N) copying operations, they will take longer if most of your input will return False. checkEqual2 and checkEqual3 can't be easily changed to adopt to compare a is b instead of a == b. timeit result, for Python 2.7 and (only s1, s4, s7, s9 should return True) s1 = [1] * 5000 s2 = [1] * 4999 + [2] s3 = [2] + [1]*4999 s4 = [set([9])] * 5000 s5 = [set([9])] * 4999 + [set([10])] s6 = [set([10])] + [set([9])] * 4999 s7 = [1,1] s8 = [1,2] s9 = [] we get | checkEqual1 | checkEqual2 | checkEqual3 | checkEqualIvo | checkEqual6502 | |-----|-------------|-------------|--------------|---------------|----------------| | s1 | 1.19 msec | 348 usec | 183 usec | 51.6 usec | 121 usec | | s2 | 1.17 msec | 376 usec | 185 usec | 50.9 usec | 118 usec | | s3 | 4.17 usec | 348 usec | 120 usec | 264 usec | 61.3 usec | | | | | | | | | s4 | 1.73 msec | | 182 usec | 50.5 usec | 121 usec | | s5 | 1.71 msec | | 181 usec | 50.6 usec | 125 usec | | s6 | 4.29 usec | | 122 usec | 423 usec | 61.1 usec | | | | | | | | | s7 | 3.1 usec | 1.4 usec | 1.24 usec | 0.932 usec | 1.92 usec | | s8 | 4.07 usec | 1.54 usec | 1.28 usec | 0.997 usec | 1.79 usec | | s9 | 5.91 usec | 1.25 usec | 0.749 usec | 0.407 usec | 0.386 usec | Note: # http://stackoverflow.com/q/3844948/ def checkEqualIvo(lst): return not lst or lst.count(lst[0]) == len(lst) # http://stackoverflow.com/q/3844931/ def checkEqual6502(lst): return not lst or [lst[0]]*len(lst) == lst [INST] Lazy Method for Reading Big File in Python? I have a very big file 4GB and when I try to read it my computer hangs. So I want to read it piece by piece and after processing each piece store the processed piece into another file and read next piece. Is there any method to yield these pieces ? I would love to have a lazy method. [/INST] To write a lazy function, just use yield: def read_in_chunks(file_object, chunk_size=1024): """Lazy function (generator) to read a file piece by piece. Default chunk size: 1k.""" while True: data = file_object.read(chunk_size) if not data: break yield data f = open('really_big_file.dat') for piece in read_in_chunks(f): process_data(piece) Another option would be to use iter and a helper function: f = open('really_big_file.dat') def read1k(): return f.read(1024) for piece in iter(read1k, ''): process_data(piece) If the file is line-based, the file object is already a lazy generator of lines: for line in open('really_big_file.dat'): process_data(line) [INST] Why aren't python nested functions called closures? I have seen and used nested functions in Python, and they match the definition of a closure. So why are they called nested functions instead of closures? Are nested functions not closures because they are not used by the external world? UPDATE: I was reading about closures and it got me thinking about this concept with respect to Python. I searched and found the article mentioned by someone in a comment below, but I couldn't completely understand the explanation in that article, so that is why I am asking this question. [/INST] A closure occurs when a function has access to a local variable from an enclosing scope that has finished its execution. def make_printer(msg): def printer(): print msg return printer printer = make_printer('Foo!') printer() When make_printer is called, a new frame is put on the stack with the compiled code for the printer function as a constant and the value of msg as a local. It then creates and returns the function. Because the function printer references the msg variable, it is kept alive after the make_printer function has returned. So, if your nested functions don't access variables that are local to enclosing scopes, do so when they are executed outside of that scope, then they are not closures. Here's an example of a nested function which is not a closure. def make_printer(msg): def printer(msg=msg): print msg return printer printer = make_printer("Foo!") printer() #Output: Foo! Here, we are binding the value to the default value of a parameter. This occurs when the function printer is created and so no reference to the value of msg external to printer needs to be maintained after make_printer returns. msg is just a normal local variable of the function printer in this context. [INST] How do I create a slug in Django? I am trying to create a SlugField in Django. I created this simple model: from django.db import models class Test(models.Model): q = models.CharField(max_length=30) s = models.SlugField() I then do this: >>> from mysite.books.models import Test >>> t=Test(q="aa a a a", s="b b b b") >>> t.s 'b b b b' >>> t.save() >>> t.s 'b b b b' >>> I was expecting b-b-b-b [/INST] You will need to use the slugify function. >>> from django.template.defaultfilters import slugify >>> slugify("b b b b") u'b-b-b-b' >>> You can call slugify automatically by overriding the save method: class test(models.Model): q = models.CharField(max_length=30) s = models.SlugField() def save(self, *args, **kwargs): self.s = slugify(self.q) super(test, self).save(*args, **kwargs) Be aware that the above will cause your URL to change when the q field is edited, which can cause broken links. It may be preferable to generate the slug only once when you create a new object: class test(models.Model): q = models.CharField(max_length=30) s = models.SlugField() def save(self, *args, **kwargs): if not self.id: # Newly created object, so set slug self.s = slugify(self.q) super(test, self).save(*args, **kwargs) [INST] Python read a single character from the user Is there a way of reading one single character from the user input? For instance, they press one key at the terminal and it is returned (sort of like getch()). I know there's a function in Windows for it, but I'd like something that is cross-platform. [/INST] Here's a link to a site that says how you can read a single character in Windows, Linux and OSX: http://code.activestate.com/recipes/134892/ class _Getch: """Gets a single character from standard input. Does not echo to the screen.""" def __init__(self): try: self.impl = _GetchWindows() except ImportError: self.impl = _GetchUnix() def __call__(self): return self.impl() class _GetchUnix: def __init__(self): import tty, sys def __call__(self): import sys, tty, termios fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) try: tty.setraw(sys.stdin.fileno()) ch = sys.stdin.read(1) finally: termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) return ch class _GetchWindows: def __init__(self): import msvcrt def __call__(self): import msvcrt return msvcrt.getch() getch = _Getch() [INST] ImportError: Cannot import name X I have four different files named: main, vector, entity, and physics. I will not post all the code, mostly just the imports, because I think that's where the error is. But if you want, I can post more. Main: import time from entity import Ent from vector import Vect #the rest just creates an entity and prints the result of movement Entity: from vector import Vect from physics import Physics class Ent: #holds vector information and id def tick(self, dt): #this is where physics changes the velocity and position vectors Vector: from math import * class Vect: #holds i, j, k, and does vector math Physics: from entity import Ent class Physics: #physics class gets an entity and does physics calculations on it. I then run from main.py and I get the following error: Traceback (most recent call last): File "main.py", line 2, in from entity import Ent File ".../entity.py", line 5, in from physics import Physics File ".../physics.py", line 2, in from entity import Ent ImportError: cannot import name Ent I am very new to python, but have worked with C++ for a long time. I am guessing that the cause is from importing entity twice, once in main, and later in physics, but I don't know a workaround. Anyone help? [/INST] You have circular dependent imports. physics.py is imported from entity before class Ent is defined and physics tries to import entity that is already initializing. Remove the depency to physics from entity module. [INST] What can you use Python generator functions for? I'm starting to learn Python and I've come across generator functions, those that have a yield statement in them. I want to know what types of problems that these functions are really good at solving. [/INST] Generators give you lazy evaluation. You use them by iterating over them, either explicitly with 'for' or implicitly by passing it to any function or construct that iterates. You can think of generators as returning multiple items, as if they return a list, but instead of returning them all at once they return them one-by-one, and the generator function is paused until the next item is requested. Generators are good for calculating large sets of results (in particular calculations involving loops themselves) where you don't know if you are going to need all results, or where you don't want to allocate the memory for all results at the same time. Or for situations where the generator uses another generator, or consumes some other resource, and it's more convenient if that happened as late as possible. Another use for generators (that is really the same) is to replace callbacks with iteration. In some situations you want a function to do a lot of work and occasionally report back to the caller. Traditionally you'd use a callback function for this. You pass this callback to the work-function and it would periodically call this callback. The generator approach is that the work-function (now a generator) knows nothing about the callback, and merely yields whenever it wants to report something. The caller, instead of writing a separate callback and passing that to the work-function, does all the reporting work in a little 'for' loop around the generator. For example, say you wrote a 'filesystem search' program. You could perform the search in its entirety, collect the results and then display them one at a time. All of the results would have to be collected before you showed the first, and all of the results would be in memory at the same time. Or you could display the results while you find them, which would be more memory efficient and much friendlier towards the user. The latter could be done by passing the result-printing function to the filesystem-search function, or it could be done by just making the search function a generator and iterating over the result. If you want to see an example of the latter two approaches, see os.path.walk() (the old filesystem-walking function with callback) and os.walk() (the new filesystem-walking generator.) Of course, if you really wanted to collect all results in a list, the generator approach is trivial to convert to the big-list approach: big_list = list(the_generator) [INST] Python, Matplotlib, subplot: How to set the axis range? How can I set the y axis range of the second subplot to e.g. [0,1000] ? The FFT plot of my data (a column in a text file) results in a (inf.?) spike so that the actual data is not visible. pylab.ylim([0,1000]) has no effect, unfortunately. This is the whole script: # based on http://www.swharden.com/blog/2009-01-21-signal-filtering-with-python/ import numpy, scipy, pylab, random xs = [] rawsignal = [] with open("test.dat", 'r') as f: for line in f: if line[0] != '#' and len(line) > 0: xs.append( int( line.split()[0] ) ) rawsignal.append( int( line.split()[1] ) ) h, w = 3, 1 pylab.figure(figsize=(12,9)) pylab.subplots_adjust(hspace=.7) pylab.subplot(h,w,1) pylab.title("Signal") pylab.plot(xs,rawsignal) pylab.subplot(h,w,2) pylab.title("FFT") fft = scipy.fft(rawsignal) #~ pylab.axis([None,None,0,1000]) pylab.ylim([0,1000]) pylab.plot(abs(fft)) pylab.savefig("SIG.png",dpi=200) pylab.show() Other improvements are also appreciated! [/INST] As found in http://www.mofeel.net/582-comp-soft-sys-matlab/54166.aspx pylab.ylim([0,1000]) Note: The command has to be executed after the plot! [INST] How do I get user IP address in django? How do I get user's IP in django? I have a view like this: # Create your views from django.contrib.gis.utils import GeoIP from django.template import RequestContext from django.shortcuts import render_to_response def home(request): g = GeoIP() client_ip = request.META['REMOTE_ADDR'] lat,long = g.lat_lon(client_ip) return render_to_response('home_page_tmp.html',locals()) But I get this error: KeyError at /mypage/ 'REMOTE_ADDR' Request Method: GET Request URL: http://mywebsite.com/mypage/ Django Version: 1.2.4 Exception Type: KeyError Exception Value: 'REMOTE_ADDR' Exception Location: /mysite/homepage/views.py in home, line 9 Python Executable: /usr/bin/python Python Version: 2.6.6 Python Path: ['/mysite', '/usr/local/lib/python2.6/dist-packages/flup-1.0.2-py2.6.egg', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6'] Server time: Sun, 2 Jan 2011 20:42:50 -0600 [/INST] def get_client_ip(request): x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR') if x_forwarded_for: ip = x_forwarded_for.split(',')[0] else: ip = request.META.get('REMOTE_ADDR') return ip Make sure you have reverse proxy (if any) configured correctly (e.g. mod_rpaf installed for Apache). Note: the above uses the first item in X-Forwarded-For, but you might want to use the last item (e.g., in the case of Heroku: Get client's real IP address on Heroku) get_client_ip = lambda req: req.META.get('HTTP_X_FORWARDED_FOR') if req.META.get('HTTP_X_FORWARDED_FOR') else ip = request.META.get('REMOTE_ADDR') And then just pass the request as argument to it; get_client_ip(request) [INST] How to drop rows of Pandas dataframe whose value of certain column is NaN I have a df : >>> df STK_ID EPS cash STK_ID RPT_Date 601166 20111231 601166 NaN NaN 600036 20111231 600036 NaN 12 600016 20111231 600016 4.3 NaN 601009 20111231 601009 NaN NaN 601939 20111231 601939 2.5 NaN 000001 20111231 000001 NaN NaN Then I just want the records whose EPS is not NaN, that is, df.drop(....) will return the dataframe as below: STK_ID EPS cash STK_ID RPT_Date 600016 20111231 600016 4.3 NaN 601939 20111231 601939 2.5 NaN How to do that ? [/INST] This question is already resolved, but... ...also consider the solution suggested by Wouter in his original comment. The ability to handle missing data, including dropna(), is built into pandas explicitly. Aside from potentially improved performance over doing it manually, these functions also come with a variety of options which may be useful. In [24]: df = pd.DataFrame(np.random.randn(10,3)) In [25]: df.ix[::2,0] = np.nan; df.ix[::4,1] = np.nan; df.ix[::3,2] = np.nan; In [26]: df Out[26]: 0 1 2 0 NaN NaN NaN 1 2.677677 -1.466923 -0.750366 2 NaN 0.798002 -0.906038 3 0.672201 0.964789 NaN 4 NaN NaN 0.050742 5 -1.250970 0.030561 -2.678622 6 NaN 1.036043 NaN 7 0.049896 -0.308003 0.823295 8 NaN NaN 0.637482 9 -0.310130 0.078891 NaN In [27]: df.dropna() #drop all rows that have any NaN values Out[27]: 0 1 2 1 2.677677 -1.466923 -0.750366 5 -1.250970 0.030561 -2.678622 7 0.049896 -0.308003 0.823295 In [28]: df.dropna(how='all') #drop only if ALL columns are NaN Out[28]: 0 1 2 1 2.677677 -1.466923 -0.750366 2 NaN 0.798002 -0.906038 3 0.672201 0.964789 NaN 4 NaN NaN 0.050742 5 -1.250970 0.030561 -2.678622 6 NaN 1.036043 NaN 7 0.049896 -0.308003 0.823295 8 NaN NaN 0.637482 9 -0.310130 0.078891 NaN In [29]: df.dropna(thresh=2) #Drop row if it does not have at least two values that are **not** NaN Out[29]: 0 1 2 1 2.677677 -1.466923 -0.750366 2 NaN 0.798002 -0.906038 3 0.672201 0.964789 NaN 5 -1.250970 0.030561 -2.678622 7 0.049896 -0.308003 0.823295 9 -0.310130 0.078891 NaN In [30]: df.dropna(subset=[1]) #Drop only if NaN in specific column (as asked in the question) Out[30]: 0 1 2 1 2.677677 -1.466923 -0.750366 2 NaN 0.798002 -0.906038 3 0.672201 0.964789 NaN 5 -1.250970 0.030561 -2.678622 6 NaN 1.036043 NaN 7 0.049896 -0.308003 0.823295 9 -0.310130 0.078891 NaN There are also other options (See docs at http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.dropna.html), including dropping columns instead of rows. Pretty handy! [INST] Python mysqldb: Library not loaded: libmysqlclient.18.dylib I just compiled and installed mysqldb for python 2.7 on my mac os 10.6. I created a simple test file that imports import MySQLdb as mysql Firstly, this command is red underlined and the info tells me "Unresolved import". Then I tried to run the following simple python code import MySQLdb as mysql def main(): conn = mysql.connect( charset="utf8", use_unicode=True, host="localhost",user="root", passwd="",db="" ) if __name__ == '__main__'(): main() When executing it I get the following error message Traceback (most recent call last): File "/path/to/project/Python/src/cvdv/TestMySQLdb.py", line 4, in import MySQLdb as mysql File "build/bdist.macosx-10.6-intel/egg/MySQLdb/__init__.py", line 19, in \namespace cvdv File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 7, in File "build/bdist.macosx-10.6-intel/egg/_mysql.py", line 6, in __bootstrap__ ImportError: dlopen(/Users/toom/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/toom/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-intel.egg-tmp/_mysql.so Reason: image not found What might be the solution to my problem? EDIT: Actually I found out that the library lies in /usr/local/mysql/lib. So I need to tell my pydev eclipse version where to find it. Where do I set this? [/INST] I solved the problem by creating a symbolic link to the library. I.e. The actual library resides in /usr/local/mysql/lib And then I created a symbolic link in /usr/lib Using the command: sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib so that I have the following mapping: ls -l libmysqlclient.18.dylib lrwxr-xr-x 1 root wheel 44 16 Jul 14:01 libmysqlclient.18.dylib -> /usr/local/mysql/lib/libmysqlclient.18.dylib That was it. After that everything worked fine. EDIT: Notice, to do this in El Capitan mac os release, you need disable SIP. Here is hint how do it in final release: http://apple.stackexchange.com/a/208481/90910 . [INST] Why is there no GIL in the Java Virtual Machine? Why does Python need one so bad? I'm hoping someone can provide some insight as to what's fundamentally different about the Java Virtual Machine that allows it to implement threads nicely without the need for a Global Interpreter Lock (GIL), while Python necessitates such an evil. [/INST] Python (the language) doesn't need a GIL (which is why it can perfectly be implemented on JVM [Jython] and .NET [IronPython], and those implementations multithread freely). CPython (the popular implementation) has always used a GIL for ease of coding (esp. the coding of the garbage collection mechanisms) and of integration of non-thread-safe C-coded libraries (there used to be a ton of those around;-). The Unladen Swallow project, among other ambitious goals, does plan a GIL-free virtual machine for Python -- to quote that site, "In addition, we intend to remove the GIL and fix the state of multithreading in Python. We believe this is possible through the implementation of a more sophisticated GC system, something like IBM's Recycler (Bacon et al, 2001)." @[INST] How do I avoid the "self.x = x; self.y = y; self.z = z" pattern in __init__? I see patterns like def __init__(self, x, y, z): ... self.x = x self.y = y self.z = z ... quite frequently, often with a lot more parameters. Is there a good way to avoid this type of tedious repetitiveness? Should I inherit from namedtuple? [/INST] EDIT It seems that several people are concerned about presenting this solution, so I will provide a very clear disclaimer. You should not use this solution. I only provide it as information, so you know that the language is capable of this. The rest of the answer is just showing language capabilities, not endorsing using them in this way. ORIGINAL ANSWER There isn't really anything wrong with explicitly copying parameters into attributes. If you have too many parameters in the ctor, it is sometimes considered a code smell and maybe you should group these params into a fewer objects. Other times, it is necessary and there is nothing wrong with it. Anyway, doing it explicitly is the way to go. However, since you are asking HOW it can be done (and not whether it should be done), then one solution is this: class A: def __init__(self, **kwargs): for key in kwargs: setattr(self, key, kwargs[key]) a = A(l=1, d=2) a.l # will return 1 a.d # will return 2 [INST] Finding what methods an object has Given a Python object of any kind, is there an easy way to get a list of all methods that this object has? Or, if this is not possible, is there at least an easy way to check if it has a particular method other than simply checking if an error occurs when the method is called? [/INST] It appears you can use this code, replacing 'object' with the object you're interested in:- [method for method in dir(object) if callable(getattr(object, method))] I discovered it at this site, hopefully that should provide some further detail! [INST] How do I set the figure title and axes labels font size in Matplotlib? I am creating a figure in Matplotlib like this: from matplotlib import pyplot as plt fig = plt.figure() plt.plot(data) fig.suptitle('test title') plt.xlabel('xlabel') plt.ylabel('ylabel') fig.savefig('test.jpg') I want to specify font sizes for the figure title and the axis labels. I need all three to be different font sizes, so setting a global font size (mpl.rcParams['font.size']=x) is not what I want. How do I set font sizes for the figure title and the axis labels individually? [/INST] Functions dealing with text like label, title, etc. accept parameters same as matplotlib.text.Text. For the font size you can use size/fontsize: from matplotlib import pyplot as plt fig = plt.figure() plt.plot(data) fig.suptitle('test title', fontsize=20) plt.xlabel('xlabel', fontsize=18) plt.ylabel('ylabel', fontsize=16) fig.savefig('test.jpg') For globally setting title and label sizes, mpl.rcParams contains axes.titlesize and axes.labelsize. (From the page): axes.titlesize : large # fontsize of the axes title axes.labelsize : medium # fontsize of the x any y labels (As far as I can see, there is no way to set x and y label sizes separately.) And I see that axes.titlesize does not affect suptitle. I guess, you need to set that manually. [INST] Turn a string into a valid filename in Python I have a string that I want to use as a filename, so I want to remove all characters that wouldn't be allowed in filenames, using Python. I'd rather be strict than otherwise, so let's say I want to retain only letters, digits, and a small set of other characters like "_-.() ". What's the most elegant solution? The filename needs to be valid on multiple operating systems (Windows, Linux and Mac OS) - it's an MP3 file in my library with the song title as the filename, and is shared and backed up between 3 machines. [/INST] You can look at the Django framework for how they create a "slug" from arbitrary text. A slug is URL- and filename- friendly. Their template/defaultfilters.py (at around line 183) defines a function, slugify, that's probably the gold standard for this kind of thing. Essentially, their code is the following. def slugify(value): """ Normalizes string, converts to lowercase, removes non-alpha characters, and converts spaces to hyphens. """ import unicodedata value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore') value = unicode(re.sub('[^\w\s-]', '', value).strip().lower()) value = unicode(re.sub('[-\s]+', '-', value)) There's more, but I left it out, since it doesn't address slugification, but escaping. [INST] Implement touch using Python? touch is a Unix utility that sets the modification and access times of files to the current time of day. If the file doesn't exist, it is created with default permissions. How would you implement it as a Python function? Try to be cross platform and complete. (Current Google results for "python touch file" are not that great, but point to os.utime.) [/INST] This tries to be a little more race-free than the other solutions. (The with keyword is new in Python 2.5.) import os def touch(fname, times=None): with open(fname, 'a'): os.utime(fname, times) Roughly equivalent to this. import os def touch(fname, times=None): fhandle = open(fname, 'a') try: os.utime(fname, times) finally: fhandle.close() Now, to really make it race-free, you need to use futimes and change the timestamp of the open filehandle, instead of opening the file and then changing the timestamp on the filename (which may have been renamed). Unfortunately, Python doesn't seem to provide a way to call futimes without going through ctypes or similar... EDIT As noted by Nate Parsons, Python 3.3 will add specifying a file descriptor (when os.supports_fd) to functions such as os.utime, which will use the futimes syscall instead of the utimes syscall under the hood. In other words: import os def touch(fname, mode=0o666, dir_fd=None, **kwargs): flags = os.O_CREAT | os.O_APPEND with os.fdopen(os.open(fname, flags=flags, mode=mode, dir_fd=dir_fd)) as f: os.utime(f.fileno() if os.utime in os.supports_fd else fname, dir_fd=None if os.supports_fd else dir_fd, **kwargs) [INST] What are the differences between numpy arrays and matrices? Which one should I use? What are the advantages and disadvantages of each? From what I've seen, either one can work as a replacement for the other if need be, so should I bother using both or should I stick to just one of them? Will the style of the program influence my choice? I am doing some machine learning using numpy, so there are indeed lots of matrices, but also lots of vectors (arrays). [/INST] Numpy matrices are strictly 2-dimensional, while numpy arrays (ndarrays) are N-dimensional. Matrix objects are a subclass of ndarray, so they inherit all the attributes and methods of ndarrays. The main advantage of numpy matrices is that they provide a convenient notation for matrix multiplication: if a and b are matrices, then a*b is their matrix product. import numpy as np a=np.mat('4 3; 2 1') b=np.mat('1 2; 3 4') print(a) # [[4 3] # [2 1]] print(b) # [[1 2] # [3 4]] print(a*b) # [[13 20] # [ 5 8]] Both matrix objects and ndarrays have .T to return the transpose, but matrix objects also have .H for the conjugate transpose, and .I for the inverse. In contrast, numpy arrays consistently abide by the rule that operations are applied element-wise. Thus, if a and b are numpy arrays, then a*b is the array formed by multiplying the components element-wise: c=np.array([[4, 3], [2, 1]]) d=np.array([[1, 2], [3, 4]]) print(c*d) # [[4 6] # [6 4]] To obtain the result of matrix multiplication, you use np.dot : print(np.dot(c,d)) # [[13 20] # [ 5 8]] The ** operator also behaves differently: print(a**2) # [[22 15] # [10 7]] print(c**2) # [[16 9] # [ 4 1]] Since a is a matrix, a**2 returns the matrix product a*a. Since c is an ndarray, c**2 returns an ndarray with each component squared element-wise. There are other technical differences between matrix objects and ndarrays (having to do with np.ravel, item selection and sequence behavior). The main advantage of numpy arrays is that they are more general than 2-dimensional matrices. What happens when you want a 3-dimensional array? Then you have to use an ndarray, not a matrix object. Thus, learning to use matrix objects is more work -- you have to learn matrix object operations, and ndarray operations. Writing a program that uses both matrices and arrays makes your life difficult because you have to keep track of what type of object your variables are, lest multiplication return something you don't expect. In contrast, if you stick solely with ndarrays, then you can do everything matrix objects can do, and more, except with slightly different functions/notation. If you are willing to give up the visual appeal of numpy matrix product notation, then I think numpy arrays are definitely the way to go. PS. Of course, you really don't have to choose one at the expense of the other, since np.asmatrix and np.asarray allow you to convert one to the other (as long as the array is 2-dimensional). [INST] Why compile Python code? Why would you compile a Python script? You can run them directly from the .py file and it works fine, so is there a performance advantage or something? I also notice that some files in my application get compiled into .pyc while others do not, why is this? [/INST] It's compiled to bytecode which can be used much, much, much faster. The reason some files aren't compiled is that the main script, which you invoke with python main.py is recompiled every time you run the script. All imported scripts will be compiled and stored on the disk. Important addition by Ben Blank: It's worth noting that while running a compiled script has a faster startup time (as it doesn't need to be compiled), it doesn't run any faster. [INST] How to read csv into record array in numpy? I wonder if there is a direct way to import the contents of a csv file into a record array, much in the way that R's read.table(), read.delim(), and read.csv() family imports data to R's data frame? Or is the best way to use csv.reader() and then apply something like numpy.core.records.fromrecords()? [/INST] You can use Numpy's genfromtxt() method to do so, by setting the delimiter kwarg to a comma. from numpy import genfromtxt my_data = genfromtxt('my_file.csv', delimiter=',') More information on the function can be found at its respective documentation. [INST] When is "i += x" different from "i = i + x" in Python? I was told that += can have different effects than the standard notation of i = i +. Is there a case in which i += 1 would be different from i = i + 1? [/INST] This depends entirely on the object i. += calls the __iadd__ method (if it exists -- falling back on __add__ if it doesn't exist) whereas + calls the __add__ method1. From an API perspective, __iadd__ is supposed to be used for modifying mutable objects in place (returning the object which was mutated) whereas __add__ should return a new instance of something. For immutable objects, both methods return a new instance, but __iadd__ will put the new instance in the current namespace with the same name that the old instance had. This is why i = 1 i += 1 seems to increment i. In reality, you get a new integer and assign it "on top of" i -- losing one reference to the old integer. In this case, i += 1 is exactly the same as i = i + 1. But, with most mutable objects, it's a different story: As a concrete example: a = [1, 2, 3] b = a b += [1, 2, 3] print a #[1, 2, 3, 1, 2, 3] print b #[1, 2, 3, 1, 2, 3] compared to: a = [1, 2, 3] b = a b = b + [1, 2, 3] print a #[1, 2, 3] print b #[1, 2, 3, 1, 2, 3] notice how in the first example, since b and a reference the same object, when I use += on b, it actually changes b (and a sees that change too -- After all, it's referencing the same list). In the second case however, when I do b = b + [1, 2, 3], this takes the list that b is referencing and concatenates it with a new list [1, 2, 3]. It then stores the concatenated list in the current namespace as b -- With no regard for what b was the line before. 1In the expression x + y, if x.__add__ isn't implemented or if x.__add__(y) returns NotImplemented and x and y have different types, then x + y tries to call y.__radd__(x). So, in the case where you have foo_instance += bar_instance if Foo doesn't implement __add__ or __iadd__ then the result here is the same as foo_instance = bar_instance.__radd__(bar_instance,foo_instance) [INST] Python pip install fails: invalid command egg_info I find that recently often when I try to install a Python package using pip, I get the error(s) below. I found a reference online that one has to use "python2 setup.py install" from the download directory, and indeed find that this will then work if I manually find and download the package (from pypi). But, I don't know where pip is downloading packages to, and/or why it is failing in this manner. I tried to do a pip upgrade, but it also failed in a similar manner, with a bunch of "Unknown distribution option" errors (entry_points, zip_safe, test_suite, tests_require)! pip 1.0.1 ActivePython 2.7 Trying to use ActiveState's pypm fails, because they have a smaller library base, and it doesn't include these packages. C:\test>pip install requests-oauth Downloading/unpacking requests-oauth Downloading requests-oauth-0.4.1.tar.gz Running setup.py egg_info for package requests-oauth E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'zip_safe' warnings.warn(msg) E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: -c --help [cmd1 cmd2 ...] or: -c --help-commands or: -c cmd --help error: invalid command 'egg_info' Complete output from command python setup.py egg_info: E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'zip_safe' warnings.warn(msg) E:\Plang\ActivePython\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: -c --help [cmd1 cmd2 ...] or: -c --help-commands or: -c cmd --help error: invalid command 'egg_info' [/INST] Install distribute, which comes with egg_info. Should be as simple as pip install Distribute. Distribute has been merged into Setuptools as of version 0.7. If you are using a version <=0.6, upgrade using pip install --upgrade setuptools or easy_install -U setuptools. [INST] What is the easiest way to remove all packages installed by pip? I'm trying to fix up one of my virtualenvs - I'd like to reset all of the installed libraries back to the ones that match production. Is there a quick and easy way to do this with pip? [/INST] I've found this snippet as an alternative solution. It's a more graceful removal of libraries than remaking the virtualenv: pip freeze | xargs pip uninstall -y In case you have packages installed via VCS, you need to exclude those lines and remove the packages manually (elevated from the comments below): pip freeze | grep -v "^-e" | xargs pip uninstall -y [INST] How can I convert a character to a integer in Python, and viceversa? I want to get, given a character, its ASCII value. For example, for the character a, I want to get 97, and vice versa. [/INST] Use chr() and ord(): >>> chr(97) 'a' >>> ord('a') 97 [INST] How to use timeit module I understand the concept of what timeit does but I am not sure how to implement it in my code. How can I compare two functions, say insertion_sort and tim_sort, with timeit? [/INST] If you want to use timeit in an interactive Python session, there are two convenient options: Use the IPython shell. It features the convenient %timeit special function: In [1]: def f(x): ...: return x*x ...: In [2]: %timeit for x in range(100): f(x) 100000 loops, best of 3: 20.3 us per loop In a standard Python interpreter, you can access functions and other names you defined earlier during the interactive session by importing them from __main__ in the setup statement: >>> def f(x): ... return x * x ... >>> import timeit >>> timeit.repeat("for x in range(100): f(x)", "from __main__ import f", number=100000) [2.0640320777893066, 2.0876040458679199, 2.0520210266113281] [INST] How do I get list of methods in a Python class? I want to iterate through the methods in a class, or handle class or instance objects differently based on the methods present. How do I get a list of class methods? Also see: How can I list the methods in a Python 2.5 module? Looping over a Python / IronPython Object Methods Finding the methods an object has How do I look inside a Python object? How Do I Perform Introspection on an Object in Python 2.x? How to get a complete list of object’s methods and attributes? Finding out which functions are available from a class instance in python? [/INST] An example (listing the methods of the optparse.OptionParser class): >>> from optparse import OptionParser >>> import inspect >>> inspect.getmembers(OptionParser, predicate=inspect.ismethod) [([('__init__', ), ... ('add_option', ), ('add_option_group', ), ('add_options', ), ('check_values', ), ('destroy', ), ('disable_interspersed_args', ), ('enable_interspersed_args', ), ('error', ), ('exit', ), ('expand_prog_name', ), ... ] Notice that getmembers returns a list of 2-tuples. The first item is the name of the member, the second item is the value. You can also pass an instance to getmembers: >>> parser = OptionParser() >>> inspect.getmembers(parser, predicate=inspect.ismethod) ... [INST] Pandas: change data type of columns I want to convert a table, represented as a list of lists, into a Pandas DataFrame. As an extremely simplified example: a = [['a', '1.2', '4.2'], ['b', '70', '0.03'], ['x', '5', '0']] df = pd.DataFrame(a) What is the best way to convert the columns to the appropriate types, in this case columns 2 and 3 into floats? Is there a way to specify the types while converting to DataFrame? Or is it better to create the DataFrame first and then loop through the columns to change the type for each column? Ideally I would like to do this in a dynamic way because there can be hundreds of columns and I don't want to specify exactly which columns are of which type. All I can guarantee is that each columns contains values of the same type. [/INST] How about this? a = [['a', '1.2', '4.2'], ['b', '70', '0.03'], ['x', '5', '0']] df = pd.DataFrame(a, columns=['one', 'two', 'three']) df Out[16]: one two three 0 a 1.2 4.2 1 b 70 0.03 2 x 5 0 df.dtypes Out[17]: one object two object three object df[['two', 'three']] = df[['two', 'three']].astype(float) df.dtypes Out[19]: one object two float64 three float64 [INST] How to query as GROUP BY in django? I query a model, Members.objects.all() and it returns say Eric, Salesman, X-Shop Freddie, Manager, X2-Shop Teddy, Salesman, X2-Shop Sean, Manager, X2-Shop What i want is, to know the best Django way to fire a group_by query to my db, as like, Members.objects.all().group_by('designation') Which doesn't work of course. I know we can do some tricks on "django/db/models/query.py", but i am just curious to know how to do it without patching. [/INST] If you mean to do aggregation and are using Django 1.1 (currently in alpha 1), you can use the new aggregation features of the ORM: from django.db.models import Count Members.objects.values('designation').annotate(dcount=Count('designation')) This results in a query similar to SELECT designation, COUNT(designation) AS dcount FROM members GROUP BY designation and the output would be of the form [{'designation': 'Salesman', 'dcount': 2}, {'designation': 'Manager', 'dcount': 2}] [INST] Return None if Dictionary key is not available I need a way to get a dictionary value if its key exists, or simply return None, if it does not. However, Python returns a key_error if you search for a key that does not exist. I know that I can check for the key, but I am looking for something more explicit. Is there a way to just return None if the key does not exist ? [/INST] You can use get() value = d.get(key) which will return None if key is not in d. You can also provide a different default value that will be returned instead of None: value = d.get(key, "empty") [INST] Does Python SciPy need BLAS? numpy.distutils.system_info.BlasNotFoundError: Blas (http://www.netlib.org/blas/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [blas]) or by setting the BLAS environment variable. Which tar do I need to download off this site? I've tried the fortrans, but I keep getting this error (after setting the environment variable obviously). [/INST] If you need to use the latest versions of SciPy rather than the packaged version, without going through the hassle of building BLAS and LAPACK, you can follow the below procedure. Install linear algebra libraries from repository (for Ubuntu), sudo apt-get install gfortran libopenblas-dev liblapack-dev Then install SciPy, (after downloading the SciPy source): python setup.py install or pip install scipy As the case may be. [INST] Check if a given key already exists in a dictionary and increment it Given a dictionary, how can I find out if a given key in that dictionary has already been set to a non-None value? I.e., I want to do this: my_dict = {} if (my_dict[key] != None): my_dict[key] = 1 else: my_dict[key] += 1 I.e., I want to increment the value if there's already one there, or set it to 1 otherwise. [/INST] You are looking for collections.defaultdict (available for Python 2.5+). This from collections import defaultdict my_dict = defaultdict(int) my_dict[key] += 1 will do what you want. For regular Python dicts, if there is no value for a given key, you will not get None when accessing the dict -- a KeyError will be raised. So if you want to use a regular dict, instead of your code you would use if key in my_dict: my_dict[key] += 1 else: my_dict[key] = 1 [INST] How to change the font size on a matplotlib plot How does one change the font size for all elements (ticks, labels, title) on a matplotlib plot? I know how to change the tick label sizes, this is done with: import matplotlib matplotlib.rc('xtick', labelsize=20) matplotlib.rc('ytick', labelsize=20) But how does one change the rest? [/INST] From the matplotlib documentation, font = {'family' : 'normal', 'weight' : 'bold', 'size' : 22} matplotlib.rc('font', **font) This sets the font of all items to the font specified by the kwargs object, font. Alternatively, you could also use the rcParams update method as suggested in this answer: matplotlib.rcParams.update({'font.size': 22}) You can find a full list of available properties on the Customizing matplotlib page. [INST] How can I convert a datetime object to milliseconds since epoch (unix time) in Python? I have a Python datetime object that I want to convert to unix time, or seconds/milliseconds since the 1970 epoch. How do I do this? [/INST] It appears to me that the simplest way to do this is import datetime epoch = datetime.datetime.utcfromtimestamp(0) def unix_time_millis(dt): return (dt - epoch).total_seconds() * 1000.0 [INST] Split a string by spaces -- preserving quoted substrings -- in Python I have a string which is like this: this is "a test" I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is: ['this','is','a test'] PS. I know you are going to ask "what happens if there are quotes within the quotes, well, in my application, that will never happen. [/INST] You want split, from the shlex module. >>> import shlex >>> shlex.split('this is "a test"') ['this', 'is', 'a test'] This should do exactly what you want. [INST] Finding the average of a list I have to find the average of a list in Python. This is my code so far l = [15, 18, 2, 36, 12, 78, 5, 6, 9] print reduce(lambda x, y: x + y, l) I've got it so it adds together the values in the list, but I don't know how to make it divide into them? [/INST] l = [15, 18, 2, 36, 12, 78, 5, 6, 9] sum(l) / float(len(l)) [INST] Is there a short contains function for lists? I see people are using any to gather another list to see if an item exists in a list, but is there a quick way to just do?: if list.contains(myItem): # do something [/INST] You can use this syntax: if myItem in list: # do something Also, inverse operator: if myItem not in list: # do something It's work fine for lists, tuples, sets and dicts (check keys). Note that this is an O(n) operation in lists and tuples, but an O(1) operation in sets and dicts. [INST] Expanding tuples into arguments Is there a way to expand a Python tuple into a function - as actual parameters? For example, here expand() does the magic: tuple = (1, "foo", "bar") def myfun(number, str1, str2): return (number * 2, str1 + str2, str2 + str1) myfun(expand(tuple)) # (2, "foobar", "barfoo") I know one could define myfun as myfun((a, b, c)), but of course there may be legacy code. Thanks [/INST] myfun(*tuple) does exactly what you request. Side issue: don't use as your identifiers builtin type names such as tuple, list, file, set, and so forth -- it's horrible practice and it will come back and byte you when you least expect it, so just get into the habit of actively avoiding hiding builtin names with your own identifiers. [INST] How to use Xpath in Python? What is the library? Is there a full implementation? How is the library used? Where is its website? [/INST] libxml2 has a number of advantages: Compliance to the spec Active development and a community participation Speed. This is really a python wrapper around a C implementation. Ubiquity. The libxml2 library is pervasive and thus well tested. Downsides include: Compliance to the spec. It's strict. Things like default namespace handling are easier in other libraries. Use of native code. This can be a pain depending on your how your application is distributed / deployed. RPMs are available that ease some of this pain. Manual resource handling. Note in the sample below the calls to freeDoc() and xpathFreeContext(). This is not very Pythonic. If you are doing simple path selection, stick with ElementTree ( which is included in Python 2.5 ). If you need full spec compliance or raw speed and can cope with the distribution of native code, go with libxml2. Sample of libxml2 XPath Use import libxml2 doc = libxml2.parseFile("tst.xml") ctxt = doc.xpathNewContext() res = ctxt.xpathEval("//*") if len(res) != 2: print "xpath query: wrong node set size" sys.exit(1) if res[0].name != "doc" or res[1].name != "foo": print "xpath query: wrong node set value" sys.exit(1) doc.freeDoc() ctxt.xpathFreeContext() Sample of ElementTree XPath Use from elementtree.ElementTree import ElementTree mydoc = ElementTree(file='tst.xml') for e in mydoc.findall('/foo/bar'): print e.get('title').text [INST] Web scraping with Python I'd like to grab daily sunrise/sunset times from a web site. Is it possible to scrape web content with Python? what are the modules used? Is there any tutorial available? [/INST] Use urllib2 in combination with the brilliant BeautifulSoup library: import urllib2 from BeautifulSoup import BeautifulSoup # or if you're using BeautifulSoup4: # from bs4 import BeautifulSoup soup = BeautifulSoup(urllib2.urlopen('http://example.com').read()) for row in soup('table', {'class': 'spad'})[0].tbody('tr'): tds = row('td') print tds[0].string, tds[1].string # will print date and sunrise Q8[INST] Permanently add a directory to PYTHONPATH Whenever I use sys.path.append, the new directory will be added. However, once I close python, the list will revert to the previous (default?) values. How do I permanently add a directory to PYTHONPATH? [/INST] If you're using bash (on a Mac or GNU/Linux distro), add this to your ~/.bashrc export PYTHONPATH="${PYTHONPATH}:/my/other/path" [INST] When is del useful in python? I can't really think of any reason why python needs the del keyword (and most languages seem to not have a similar keyword). For instance, rather than deleting a variable, one could just assign None to it. And when deleting from a dictionary, a del method could be added. Is there any reason to keep del in python, or is it a vestige of Python's pre-garbage collection days? [/INST] Firstly, you can del other things besides local variables del list_item[4] del dictionary["alpha"] Both of which should be clearly useful. Secondly, using del on a local variable makes the intent clearer. Compare: del foo to foo = None I know in the case of del foo that the intent is to remove the variable from scope. It's not clear that foo = None is doing that. If somebody just assigned foo = None I might think it was dead code. But I instantly know what somebody who codes del foo was trying to do. [INST] listing all functions in a python module I have a python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it. I want to call the doc function on each one. In ruby I can do something like ClassName.methods to get a list of all the methods available on that class. Is there something similar in python? eg. something like: from somemodule import foo print foo.methods # or whatever is the correct method to call [/INST] You can use dir(module) to see all available methods/attributes. Also check out PyDocs. [INST] Django gives Bad Request (400) when DEBUG = False I am new to django-1.6. When I run the django server with DEBUG = True, it's running perfectly. But when I change DEBUG to False in the settings file, then the server stopped and it gives the following error on the command prompt: CommandError: You must set settings.ALLOWED_HOSTS if DEBUG is False. After I changed ALLOWED_HOSTS to ["http://127.0.0.1:8000",], in the browser I get the error: Bad Request (400) Is it possible to run Django without debug mode? [/INST] The ALLOWED_HOSTS list should contain fully qualified host names, not urls. Leave out the port and the protocol. If you are using 127.0.0.1, I would add localhost to the list too: ALLOWED_HOSTS = ['127.0.0.1', 'localhost'] You could also use * to match any host: ALLOWED_HOSTS = ['*'] Quoting the documentation: Values in this list can be fully qualified names (e.g. 'www.example.com'), in which case they will be matched against the request’s Host header exactly (case-insensitive, not including port). A value beginning with a period can be used as a subdomain wildcard: '.example.com' will match example.com, www.example.com, and any other subdomain of example.com. A value of '*' will match anything; in this case you are responsible to provide your own validation of the Host header (perhaps in a middleware; if so this middleware must be listed first in MIDDLEWARE_CLASSES). Bold emphasis mine. The status 400 response you get is due to a SuspiciousOperation exception being raised when your host header doesn't match any values in that list. [INST] What is the difference between an expression and a statement in Python? In Python, what is the difference between expressions and statements? [/INST] Expressions only contain identifiers, literals and operators, where operators include arithmetic and boolean operators, the function call operator () the subscription operator [] and similar, and can be reduced to some kind of "value", which can be any Python object. Examples: 3 + 5 map(lambda x: x*x, range(10)) [a.x for a in some_iterable] yield 7 Statements (see 1, 2), on the other hand, are everything that can make up a line (or several lines) of Python code. Note that expressions are statements as well. Examples: # all the above expressions print 42 if x: do_y() return a = 7 [INST] Is it possible to run a Python script as a service in Windows? If possible, how? I am sketching the architecture for a set of programs that share various interrelated objects stored in a database. I want one of the programs to act as a service which provides a higher level interface for operations on these objects, and the other programs to access the objects through that service. I am currently aiming for Python and the Django framework as the technologies to implement that service with. I'm pretty sure I figure how to demonize the Python program in Linux. However, it is an optional spec item that the system should support Windows. I have little experience with Windows programming and no experience at all with Windows services. Is it possible to run a Python programs as a Windows service (i. e. run it automatically without user login)? I won't necessarily have to implement this part, but I need a rough idea how it would be done in order to decide whether to design along these lines. Edit: Thanks for all the answers so far, they are quite comprehensive. I would like to know one more thing: How is Windows aware of my service? Can I manage it with the native Windows utilities? Basically, what is the equivalent of putting a start/stop script in /etc/init.d? [/INST] Yes you can. I do it using the pythoncom libraries that come included with ActivePython or can be installed with pywin32 (Python for Windows extensions). This is a basic skeleton for a simple service: import win32serviceutil import win32service import win32event import servicemanager import socket class AppServerSvc (win32serviceutil.ServiceFramework): _svc_name_ = "TestService" _svc_display_name_ = "Test Service" def __init__(self,args): win32serviceutil.ServiceFramework.__init__(self,args) self.hWaitStop = win32event.CreateEvent(None,0,0,None) socket.setdefaulttimeout(60) def SvcStop(self): self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) win32event.SetEvent(self.hWaitStop) def SvcDoRun(self): servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE, servicemanager.PYS_SERVICE_STARTED, (self._svc_name_,'')) self.main() def main(self): pass if __name__ == '__main__': win32serviceutil.HandleCommandLine(AppServerSvc) Your code would go in the main() method, usually with some kind of infinite loop that might be interrumped by checking a flag, that you set in the SvcStop method [INST] Text Progress Bar in the Console Is there a good way to do the following? I wrote a simple console app to upload and download files from an FTP server using the ftplib. Each time some data chunks are downloaded, I want to update a text progress bar, even if it's just a number. But I don't want to erase all the text that's been printed to the console. (Doing a "clear" and then printing the updated percentage.) [/INST] Writing '\r' will move the cursor back to the beginning of the line. This displays a percentage counter: import time import sys for i in range(100): time.sleep(1) sys.stdout.write("\r%d%%" % i) sys.stdout.flush() [INST] Passing a dictionary to a function in python as keyword parameters I'd like to call a function in python using a dictionary. Here is some code: d = dict(param='test') def f(param): print param f(d) This prints {'param': 'test'} but I'd like it to just print test. I'd like it to work similarly for more parameters: d = dict(p1=1, p2=2) def f2(p1,p2): print p1, p2 f2(d) Is this possible? [/INST] Figured it out for myself in the end. It is simple, I was just missing the ** operator to unpack the dictionary So my example becomes: d = dict(p1=1, p2=2) def f2(p1,p2): print p1, p2 f2(**d) [INST] How can I selectively escape percent (%) in Python strings? I have the following code test = "have it break." selectiveEscape = "Print percent % in sentence and not %s" % test print(selectiveEscape) I would like to get the output: Print percent % in sentence and not have it break. What actually happens: selectiveEscape = "Use percent % in sentence and not %s" % test TypeError: %d format: a number is required, not str [/INST] >>> test = "have it break." >>> selectiveEscape = "Print percent %% in sentence and not %s" % test >>> print selectiveEscape Print percent % in sentence and not have it break. [INST] How do you round UP a number in Python? This problem is killing me. How does one roundup a number UP in Python? I tried round(number) but it round the number down. Example: round(2.3) = 2.0 and not 3, what I would like The I tried int(number + .5) but it round the number down again! Example: int(2.3 + .5) = 2 Then I tried round(number + .5) but it won't work in edge cases. Example: WAIT! THIS WORKED! Please advise. [/INST] The ceil (ceiling) function: import math print math.ceil(4.2) [INST] Does Python support short-circuiting? Does Python support short-circuiting in boolean expressions? [/INST] Yep, both and and or operators short-circuit -- see the docs. [INST] Python Dictionary Comprehension Is it possible to create a dictionary comprehension in Python (for the keys)? Without list comprehensions, you can use something like this: l = [] for n in range(1, 11): l.append(n) We can shorten this to a list comprehension: l = [n for n in range(1, 11)]. However, say I want to set a dictionary's keys to the same value. I can do: d = {} for n in range(1, 11): d[n] = True # same value for each I've tried this: d = {} d[i for i in range(1, 11)] = True However, I get a SyntaxError on the for. In addition (I don't need this part, but just wondering), can you set a dictionary's keys to a bunch of different values, like this: d = {} for n in range(1, 11): d[n] = n Is this possible with a dictionary comprehension? d = {} d[i for i in range(1, 11)] = [x for x in range(1, 11)] This also raises a SyntaxError on the for. [/INST] There are dictionary comprehensions in Python 2.7+, but they don't work quite the way you're trying. Like a list comprehension, they create a new dictionary; you can't use them to add keys to an existing dictionary. Also, you have to specify the keys and values, although of course you can specify a dummy value if you like. >>> d = {n: n**2 for n in range(5)} >>> print d {0: 0, 1: 1, 2: 4, 3: 9, 4: 16} If you want to set them all to True: >>> d = {n: True for n in range(5)} >>> print d {0: True, 1: True, 2: True, 3: True, 4: True} What you seem to be asking for is a way to set multiple keys at once on an existing dictionary. There's no direct shortcut for that. You can either loop like you already showed, or you could use a dictionary comprehension to create a new dict with the new values, and then do oldDict.update(newDict) to merge the new values into the old dict. [INST] Is there any way to do HTTP PUT in python I need to upload some data to a server using HTTP PUT in python. From my brief reading of the urllib2 docs, it only does HTTP POST. Is there any way to do an HTTP PUT in python? [/INST] I've used a variety of python HTTP libs in the past, and I've settled on 'Requests' as my favourite. Existing libs had pretty useable interfaces, but code can end up being a few lines too long for simple operations. A basic PUT in requests looks like: payload = {'username': 'bob', 'email': 'bob@bob.com'} >>> r = requests.put("http://somedomain.org/endpoint", data=payload) You can then check the response status code with: r.status_code or the response with: r.content Requests has a lot synactic sugar and shortcuts that'll make your life easier. [INST] Strip HTML from strings in Python from mechanize import Browser br = Browser() br.open('http://somewebpage') html = br.response().readlines() for line in html: print line When printing a line in an HTML file, I'm trying to find a way to only show the contents of each HTML element and not the formatting itself. If it finds 'some text', it will only print 'some text', 'hello' prints 'hello', etc. How would one go about doing this? [/INST] I always used this function to strip HTML tags, as it requires only the Python stdlib: On Python 2 from HTMLParser import HTMLParser class MLStripper(HTMLParser): def __init__(self): self.reset() self.fed = [] def handle_data(self, d): self.fed.append(d) def get_data(self): return ''.join(self.fed) def strip_tags(html): s = MLStripper() s.feed(html) return s.get_data() For Python 3 from html.parser import HTMLParser class MLStripper(HTMLParser): def __init__(self): self.reset() self.strict = False self.convert_charrefs= True self.fed = [] def handle_data(self, d): self.fed.append(d) def get_data(self): return ''.join(self.fed) def strip_tags(html): s = MLStripper() s.feed(html) return s.get_data() Note: this works only for 3.1. For 3.2 or above, you need to call the parent class's init function. See Using HTMLParser in Python 3.2 [INST] Python and pip, list all versions of a package that's available? Given the name of a Python (2.X) package that can be installed with pip and virtualenv, is there any way to find out a list of all the possible versions of it that pip could install? Right now it's trial and error. I'm trying to install a version for a third party library, but the newest version is too new, there were backwards incompatible changes made. So I'd like to somehow have a list of all the versions that pip knows about, so that I can test them. [/INST] Without actually having to download or install any additional packages you can use the syntax for specifying a particular version while not actually specifying any version, and the available versions will be printed: $ pip install pylibmc== Collecting pylibmc== Could not find a version that satisfies the requirement pylibmc== (from v ersions: 0.2, 0.3, 0.4, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.5, 0.6.1, 0.6, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7, 0.8.1, 0.8.2, 0.8, 0.9.1, 0.9.2, 0.9, 1.0-alpha, 1.0-beta, 1.0, 1.1.1, 1.1, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0) No matching distribution found for pylibmc== update: I had changed my answer to have nothing after the ==, this however doesn't work for older versions of pip (those of you should probably update pip) add any string after the == that is not likely to be an install candidate: pip install pylibmc==blork [INST] Remove all occurrences of a value from a Python list In Python remove() will remove the first occurrence of value in a list. How to remove all occurrences of a value from a list, without sorting the list? This is what I have in mind. >>> x = [1, 2, 3, 4, 2, 2, 3] >>> def remove_values_from_list(the_list, val): while val in the_list: the_list.remove(val) >>> remove_values_from_list(x, 2) >>> x [1, 3, 4, 3] [/INST] Functional approach: 2.x >>> x = [1,2,3,2,2,2,3,4] >>> filter(lambda a: a != 2, x) [1, 3, 3, 4] 3.x >>> list(filter((2).__ne__, x)) [1, 3, 3, 4] [INST] Checking whether a string starts with XXXX I would like to know how to check whether a string starts with "hello" in Python. In Bash I usually do: if [[ "$string" =~ ^hello ]]; then do something here fi How do I achieve the same in Python? [/INST] aString = "hello world" aString.startswith("hello") [INST] Find all occurrences of a substring in Python Python has string.find() and string.rfind() to get the index of a substring in string. I wonder, maybe there is something like string.find_all() which can return all founded indexes (not only first from beginning or first from end)? For example: string = "test test test test" print string.find('test') # 0 print string.rfind('test') # 15 #that's the goal print string.find_all('test') # [0,5,10,15] [/INST] There is no simple built-in string function that does what you're looking for, but you could use the more powerful regular expressions: >>> [m.start() for m in re.finditer('test', 'test test test test')] [0, 5, 10, 15] If you want to find overlapping matches, lookahead will do that: >>> [m.start() for m in re.finditer('(?=tt)', 'ttt')] [0, 1] If you want a reverse find-all without overlaps, you can combine positive and negative lookahead into an expression like this: >>> search = 'tt' >>> [m.start() for m in re.finditer('(?=%s)(?!.{1,%d}%s)' % (search, len(search)-1, search), 'ttt')] [1] re.finditer returns a generator, so you could change the [] in the above to () to get a generator instead of a list which will be more efficient if you're only iterating through the results once. [INST] Select rows from a DataFrame based on values in a column in pandas How to select rows from a DataFrame based on values in some column in pandas? In SQL I would use: select * from table where colume_name = some_value. I tried to look at pandas documentation but did not immediately find the answer. [/INST] To select rows whose column value equals a scalar, some_value, use ==: df.loc[df['column_name'] == some_value] To select rows whose column value is in an iterable, some_values, use isin: df.loc[df['column_name'].isin(some_values)] To select rows whose column value does not equal some_value, use !=: df.loc[df['column_name'] != some_value] isin returns a boolean Series, so to select rows whose value is not in some_values, negate the boolean Series using ~: df.loc[~df['column_name'].isin(some_values)] For example, import pandas as pd import numpy as np df = pd.DataFrame({'A': 'foo bar foo bar foo bar foo foo'.split(), 'B': 'one one two three two two one three'.split(), 'C': np.arange(8), 'D': np.arange(8) * 2}) print(df) # A B C D # 0 foo one 0 0 # 1 bar one 1 2 # 2 foo two 2 4 # 3 bar three 3 6 # 4 foo two 4 8 # 5 bar two 5 10 # 6 foo one 6 12 # 7 foo three 7 14 print(df.loc[df['A'] == 'foo']) yields A B C D 0 foo one 0 0 2 foo two 2 4 4 foo two 4 8 6 foo one 6 12 7 foo three 7 14 If you have multiple values you want to include, put them in a list (or more generally, any iterable) and use isin: print(df.loc[df['B'].isin(['one','three'])]) yields A B C D 0 foo one 0 0 1 bar one 1 2 3 bar three 3 6 6 foo one 6 12 7 foo three 7 14 Note, however, that if you wish to do this many times, it is more efficient to make an index first, and then use df.loc: df = df.set_index(['B']) print(df.loc['one']) yields A C D B one foo 0 0 one bar 1 2 one foo 6 12 or, to include multiple values from the index use df.index.isin: df.loc[df.index.isin(['one','two'])] yields A C D B one foo 0 0 one bar 1 2 two foo 2 4 two foo 4 8 two bar 5 10 one foo 6 12 [INST] Post JSON using Python Requests I need to POST a JSON from a client to a server. I'm using Python 2.7.1 and simplejson. The client is using Requests. The server is CherryPy. I can GET a hard-coded JSON from the server (code not shown), but when I try to POST a JSON to the server, I get "400 Bad Request". Here is my client code: data = {'sender': 'Alice', 'receiver': 'Bob', 'message': 'We did it!'} data_json = simplejson.dumps(data) payload = {'json_payload': data_json} r = requests.post("http://localhost:8080", data=payload) Here is the server code. class Root(object): def __init__(self, content): self.content = content print self.content # this works exposed = True def GET(self): cherrypy.response.headers['Content-Type'] = 'application/json' return simplejson.dumps(self.content) def POST(self): self.content = simplejson.loads(cherrypy.request.body.read()) Any ideas? [/INST] It turns out I was missing the header information. The following works: url = "http://localhost:8080" data = {'sender': 'Alice', 'receiver': 'Bob', 'message': 'We did it!'} headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} r = requests.post(url, data=json.dumps(data), headers=headers) [INST] How can I compare two lists in python and return matches I want to take two lists and find the values that appear in both. a = [1, 2, 3, 4, 5] b = [9, 8, 7, 6, 5] returnMatches(a, b) would return [5], for instance. [/INST] Not the most efficient one, but by far the most obvious way to do it is: >>> a = [1, 2, 3, 4, 5] >>> b = [9, 8, 7, 6, 5] >>> set(a) & set(b) {5} if order is significant you can do it with list comprehensions like this: >>> [i for i, j in zip(a, b) if i == j] [5] (only works for equal-sized lists, which order-significance implies). [INST] How to change the order of DataFrame columns? I have the following DataFrame (df): import numpy as np import pandas as pd df = pd.DataFrame(np.random.rand(10, 5)) I add more column(s) by assignment: df['mean'] = df.mean(1) How can I move the column mean to the front, i.e. set it as first column leaving the order of the other columns untouched? [/INST] One easy way would be to reassign the dataframe with a list of the columns, rearranged as needed. This is what you have now: In [6]: df Out[6]: 0 1 2 3 4 mean 0 0.445598 0.173835 0.343415 0.682252 0.582616 0.445543 1 0.881592 0.696942 0.702232 0.696724 0.373551 0.670208 2 0.662527 0.955193 0.131016 0.609548 0.804694 0.632596 3 0.260919 0.783467 0.593433 0.033426 0.512019 0.436653 4 0.131842 0.799367 0.182828 0.683330 0.019485 0.363371 5 0.498784 0.873495 0.383811 0.699289 0.480447 0.587165 6 0.388771 0.395757 0.745237 0.628406 0.784473 0.588529 7 0.147986 0.459451 0.310961 0.706435 0.100914 0.345149 8 0.394947 0.863494 0.585030 0.565944 0.356561 0.553195 9 0.689260 0.865243 0.136481 0.386582 0.730399 0.561593 In [7]: cols = df.columns.tolist() In [8]: cols Out[8]: [0L, 1L, 2L, 3L, 4L, 'mean'] Rearrange cols in any way you want. This is how I moved the last element to the first position: In [12]: cols = cols[-1:] + cols[:-1] In [13]: cols Out[13]: ['mean', 0L, 1L, 2L, 3L, 4L] Then reorder the dataframe like this: In [16]: df = df[cols] # OR df = df.ix[:, cols] In [17]: df Out[17]: mean 0 1 2 3 4 0 0.445543 0.445598 0.173835 0.343415 0.682252 0.582616 1 0.670208 0.881592 0.696942 0.702232 0.696724 0.373551 2 0.632596 0.662527 0.955193 0.131016 0.609548 0.804694 3 0.436653 0.260919 0.783467 0.593433 0.033426 0.512019 4 0.363371 0.131842 0.799367 0.182828 0.683330 0.019485 5 0.587165 0.498784 0.873495 0.383811 0.699289 0.480447 6 0.588529 0.388771 0.395757 0.745237 0.628406 0.784473 7 0.345149 0.147986 0.459451 0.310961 0.706435 0.100914 8 0.553195 0.394947 0.863494 0.585030 0.565944 0.356561 9 0.561593 0.689260 0.865243 0.136481 0.386582 0.730399 [INST] Python - The difference between sys.stdout.write and print Are there situations in which sys.stdout.write() is preferable to print? (Examples: better performance; code that makes more sense) [/INST] print is just a thin wrapper that formats the inputs (space between args and newline at the end) and calls the write function of a given object. By default this object is sys.stdout, but you can pass a file for example: print >> open('file.txt', 'w'), 'Hello', 'World', 2+3 In Python 3.x, print becomes a function, but it is still possible to pass something else than sys.stdout. See http://docs.python.org/library/functions.html. In Python 2.6+, print is still a statement, but it can be used as a function with from __future__ import print_function Update: There is a little difference between the print function and the print statement (and more generally between a function and a statement) pointed by Bakuriu in comments. In case of error when evaluating arguments: print "something", 1/0, "other" #prints only something because 1/0 raise an Exception print("something", 1/0, "other") #doesn't print anything. The func is not called [INST] Is there a reason Python strings don't have a string length method? I know that python has a len() function that is used to determine the size of a string, but I was wondering why its not a method of the string object. Update Ok, I realized I was embarrassingly mistaken. __len__() is actually a method of a string object. It just seems weird to see object oriented code in Python using the len function on string objects. Furthermore, it's also weird to see __len__ as the name instead of just len. [/INST] Strings do have a length method: __len__() The protocol in Python is to implement this method on objects which have a length and use the built-in len() function, which calls it for you, similar to the way you would implement __iter__() and use the built-in iter() function (or have the method called behind the scenes for you) on objects which are iterable. See Emulating container types for more information. Here's a good read on the subject of protocols in Python: Python and the Principle of Least Astonishment [INST] How do I keep Python print from adding newlines or spaces? In python, if I say print 'h' I get the letter h and a newline. If I say print 'h', I get the letter h and no newline. If I say print 'h', print 'm', I get the letter h, a space, and the letter m. How can I prevent Python from printing the space? The print statements are different iterations of the same loop so I can't just use the + operator. [/INST] Just a comment. In Python 3, you will use print('h', end='') to suppress the endline terminator, and print('a', 'b', 'c', sep='') to suppress the whitespace separator between items. [INST] How to clear python interpreter console? Like most Python developers, I typically keep a console window open with the Python interpreter running to test commands, dir() stuff, help() stuff, etc. Like any console, after a while the visible backlog of past commands and prints gets to be cluttered, and sometimes confusing when re-running the same command several times. I'm wondering if, and how, to clear the Python interpreter console. I've heard about doing a system call and either calling cls on Windows or clear on Linux, but I was hoping there was something I could command the interpreter itself to do. Note: I'm running on Windows, so Ctrl+L doesn't work. [/INST] As you mentioned, you can do a system call: >>> import os >>> clear = lambda: os.system('cls') >>> clear() I am not sure of any other way in Windows. [INST] Most pythonic way to delete a file which may not exist I want to delete the file filename if it exists. Is it proper to say if os.path.exists(filename): os.remove(filename) Is there a better way? A one-line way? [/INST] A more pythonic way would be: try: os.remove(filename) except OSError: pass Although this takes even more lines and looks very ugly, it avoids the unnecessary call to os.path.exists() and follows the python convention of overusing exceptions. It may be worthwhile to write a function to do this for you: import os, errno def silentremove(filename): try: os.remove(filename) except OSError as e: # this would be "except OSError, e:" before Python 2.6 if e.errno != errno.ENOENT: # errno.ENOENT = no such file or directory raise # re-raise exception if a different error occured [INST] Python unittest - opposite of assertRaises? I want to write a test to establish that an Exception is not raised in a given circumstance. It's straightforward to test if an Exception is raised ... sInvalidPath=AlwaysSuppliesAnInvalidPath() self.assertRaises(PathIsNotAValidOne, MyObject, sInvalidPath) ... but how can you do the opposite. Something like this i what I'm after ... sValidPath=AlwaysSuppliesAValidPath() self.assertNotRaises(PathIsNotAValidOne, MyObject, sValidPath) [/INST] try: myFunc() except ExceptionType: self.fail("myFunc() raised ExceptionType unexpectedly!") [INST] Best way to convert string to bytes in Python 3? There appears to be two different ways to convert a string to bytes, as seen in the answers to TypeError: 'str' does not support the buffer interface Which of these methods would be better or more Pythonic? Or is it just a matter of personal preference? b = bytes(mystring, 'utf-8') b = mystring.encode('utf-8') [/INST] If you look at the docs for bytes, it points you to bytearray: bytearray([source[, encoding[, errors]]]) Return a new array of bytes. The bytearray type is a mutable sequence of integers in the range 0 <= x < 256. It has most of the usual methods of mutable sequences, described in Mutable Sequence Types, as well as most methods that the bytes type has, see Bytes and Byte Array Methods. The optional source parameter can be used to initialize the array in a few different ways: If it is a string, you must also give the encoding (and optionally, errors) parameters; bytearray() then converts the string to bytes using str.encode(). If it is an integer, the array will have that size and will be initialized with null bytes. If it is an object conforming to the buffer interface, a read-only buffer of the object will be used to initialize the bytes array. If it is an iterable, it must be an iterable of integers in the range 0 <= x < 256, which are used as the initial contents of the array. Without an argument, an array of size 0 is created. So bytes can do much more than just encode a string. It's Pythonic that it would allow you to call the constructor with any type of source parameter that makes sense. For encoding a string, I think that some_string.encode(encoding) is more Pythonic than using the constructor, because it is the most self documenting -- "take this string and encode it with this encoding" is clearer than bytes(some_string, encoding) -- there is no explicit verb when you use the constructor. Edit: I checked the Python source. If you pass a unicode string to bytes using CPython, it calls PyUnicode_AsEncodedString, which is the implementation of encode; so you're just skipping a level of indirection if you call encode yourself. Also, see Serdalis' comment -- unicode_string.encode(encoding) is also more Pythonic because its inverse is byte_string.decode(encoding) and symmetry is nice. [INST] What is a "callable" in Python? Now that it's clear what a metaclass is, there is an associated concept that I use all the time without knowing what it really means. I suppose everybody made once a mistake with parenthesis, resulting in an "object is not callable" exception. What's more, using __init__ and __new__ lead to wonder what this bloody __call__ can be used for. Could you give me some explanations, including examples with the magic method ? [/INST] A callable is anything that can be called. The built-in callable (PyCallable_Check in objects.c) checks if the argument is either: an instance of a class with a __call__ method or is of a type that has a non null tp_call (c struct) member which indicates callability otherwise (such as in functions, methods etc.) The method named __call__ is (according to the documentation) Called when the instance is ''called'' as a function Example class Foo: def __call__(self): print 'called' foo_instance = Foo() foo_instance() #this is calling the __call__ method [INST] Search and replace a line in a file in Python I want to loop over the contents of a text file and do a search and replace on some lines and write the result back to the file. I could first load the whole file in memory and then write it back, but that probably is not the best way to do it. What is the best way to do this, within the following code? f = open(file) for line in f: if line.contains('foo'): newline = line.replace('foo', 'bar') # how to write this newline back to the file [/INST] The shortest way would probably be to use the fileinput module. For example, the following adds line numbers to a file, in-place: import fileinput for line in fileinput.input("test.txt", inplace=True): print "%d: %s" % (fileinput.filelineno(), line), What happens here is: The original file is moved to a backup file The standard output is redirected to the original file within the loop Thus any print statements write back into the original file fileinput has more bells and whistles. For example, it can be used to automatically operate on all files in sys.args[1:], without your having to iterate over them explicitly. Starting with Python 3.2 it also provides a convenient context manager for use in a with statement. While fileinput is great for throwaway scripts, I would be wary of using it in real code because admittedly it's not very readable or familiar. In real (production) code it's worthwhile to spend just a few more lines of code to make the process explicit and thus make the code readable. There are two options: The file is not overly large, and you can just read it wholly to memory. Then close the file, reopen it in writing mode and write the modified contents back. The file is too large to be stored in memory; you can move it over to a temporary file and open that, reading it line by line, writing back into the original file. Note that this requires twice the storage. [INST] Python try...except comma vs 'as' in except What is the difference between ',' and 'as' in except statements, eg: try: pass except Exception, exception: pass and: try: pass except Exception as exception: pass Is the second syntax legal in 2.6? It works in CPython 2.6 on Windows but the 2.5 interpreter in cygwin complains that it is invalid. If they are both valid in 2.6 which should I use? [/INST] The definitive document is PEP-3110: Catching Exceptions Summary: In Python 3.x, using as is required. In Python 2.6+, use the as syntax, since it is far less ambiguous and forward compatible with Python 3.x. In Python 2.5 and earlier, use the comma version, since as isn't supported. [INST] How can I get a list of all classes within current module in Python? I've seen plenty of examples of people extracting all of the classes from a module, usually something like: # foo.py class Foo: pass # test.py import inspect import foo for name, obj in inspect.getmembers(foo): if inspect.isclass(obj): print obj Awesome. But I can't find out how to get all of the classes from the current module. # foo.py import inspect class Foo: pass def print_classes(): for name, obj in inspect.getmembers(???): # what do I do here? if inspect.isclass(obj): print obj # test.py import foo foo.print_classes() This is probably something really obvious, but I haven't been able to find anything. Can anyone help me out? [/INST] Try this: import sys current_module = sys.modules[__name__] In your context: import sys, inspect def print_classes(): for name, obj in inspect.getmembers(sys.modules[__name__]): if inspect.isclass(obj): print(obj) And even better: clsmembers = inspect.getmembers(sys.modules[__name__], inspect.isclass) Because inspect.getmembers() takes a predicate. [INST] Read .mat files in Python Does anyone have successful experience reading binary Matlab .mat files in Python? (I've seen that scipy has alleged support for reading .mat files, but I'm unsuccessful with it. I installed scipy version 0.7.0, and I can't find the loadmat() method) [/INST] Silly me. Forgot to import io... import scipy.io mat = scipy.io.loadmat('file.mat') [INST] SSL InsecurePlatform error when using Requests package Im using Python 2.7.3 and Requests. I installed Requests via pip. I believe it's the latest version. I'm running on Debian Wheezy. I've used Requests lots of times in the past and never faced this issue, but it seems that when making https requests with Requests I get an InsecurePlatform exception. The error mentions urllib3, but I don't have that installed. I did install it to check if it resolved the error, but it didn't. /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3 /util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest /security.html#insecureplatformwarning. Any ideas as to why I'm getting this? I've checked the docs, as specified in the error message, but the docs are saying to import urllib3 and either disable the warning, or provide a certificate. [/INST] Use the somewhat hidden security feature: pip install 'requests[security]' or pip install pyOpenSSL ndg-httpsclient pyasn1 Both commands install following extra packages: pyOpenSSL ndg-httpsclient pyasn1 Please note that this is not required for python-2.7.9+. If pip install fails with errors, check whether you have required development packages for libffi, libssl and python installed in your system using distribution's package manager: Debian/Ubuntu - python-dev libffi-dev libssl-dev packages. Fedora - openssl-devel python-devel libffi-devel packages. Distro list above is incomplete. Workaround (see the original answer by @TomDotTom): In case you cannot install some of the required development packages, there's also an option to disable that warning: import requests.packages.urllib3 requests.packages.urllib3.disable_warnings() [INST] Get list from pandas DataFrame column headers I want to get a list of the column headers from a pandas DataFrame. The DataFrame will come from user input so I won't know how many columns there will be or what they will be called. For example, if I'm given a DataFrame like this: >>> my_dataframe y gdp cap 0 1 2 5 1 2 3 9 2 8 7 2 3 3 4 7 4 6 7 7 5 4 8 3 6 8 2 8 7 9 9 10 8 6 6 4 9 10 10 7 I would want to get a list like this: >>> header_list [y, gdp, cap] [/INST] You can get the values as a list by doing: list(my_dataframe.columns.values) [INST] Delete Folder Contents in Python How can I delete the contents of a local folder in Python? The current project is for Windows but I would like to see *nix also. [/INST] Updated to only delete files and to used the os.path.join() method suggested in the comments. If you also want to remove subdirectories, uncomment the elif statement. import os, shutil folder = '/path/to/folder' for the_file in os.listdir(folder): file_path = os.path.join(folder, the_file) try: if os.path.isfile(file_path): os.unlink(file_path) #elif os.path.isdir(file_path): shutil.rmtree(file_path) except Exception as e: print(e) [INST] How can I create a directly-executable cross-platform GUI app using Python? Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux. The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the right direction please? [/INST] First you will need some GUI library with Python bindings and then (if you want) some program that will convert your python scripts into standalone executables. Cross-platform GUI libraries with Python bindings (Windows, Linux, Mac) Of course, there are many, but the most popular that I've seen in wild are: Tkinter - based on Tk GUI toolkit (de-facto standard GUI library for python, free for commercial projects) WxPython - based on WxWidgets (very popular, free for commercial projects) PyQt - based on Qt (also very popular and more stable than WxWidgets but costly license for commercial projects) Complete list is at http://wiki.python.org/moin/GuiProgramming Single executable (Windows) py2exe - Probably the most popular out there (PyInstaller is also gaining in popularity) Single executable (Linux) Freeze - works the same way like py2exe but targets Linux platform Single executable (Mac) py2app - again, works like py2exe but targets Mac OS [INST] How do I update pip itself from inside my virtual environment? I'm able to update pip-managed packages, but how do I update pip itself? According to pip --version, I currently have pip 1.1 installed in my virtualenv and I want to update to the latest version. What's the command for that? Do I need to use distribute or is there a native pip or virtualenv command? I've already tried pip update and pip update pip with no success. [/INST] pip is just a PyPI package like any other; you could use it to upgrade itself the same way you would upgrade any package: pip install --upgrade pip On Windows the recommended command is: python -m pip install --upgrade pip [INST] Python String and Integer concatenation I want to create string using integer appended to it, in a for loop. Like this: for i in range [1,10]: string="string"+i But it returns an error: TypeError: unsupported operand type(s) for +: 'int' and 'str' What's the best way to concatenate the String and Integer? [/INST] for i in range (1,10): string="string"+str(i) To get string0, string1 ..... string10, you could do like >>> ["string"+str(i) for i in range(11)] ['string0', 'string1', 'string2', 'string3', 'string4', 'string5', 'string6', 'string7', 'string8', 'string9', 'string10'] [INST] How to set environment variables in Python I need to set some environment variables in the python script and I want all the other scripts that are called from python (shell scripts) which will be child process to see the environment variables set. The value is a number. If I do os.environ["DEBUSSY"] = 1, it complains saying that 1 has to be string. I also want to know how to read the environment variables in python (in the later part of the script) once I set it. [/INST] Environment variables must be strings, so use os.environ["DEBUSSY"] = "1" to set the variable DEBUSSY to the string 1. To access this variable later, simply use print os.environ["DEBUSSY"] Child processes automatically inherit the environment of the parent process -- no special action on your part is required. [INST] Iterating through a range of dates in Python I have the following code to do this, but how can I do it better? Right now I think it's better than nested loops, but it starts to get Perl-one-linerish when you have a generator in a list comprehension. day_count = (end_date - start_date).days + 1 for single_date in [d for d in (start_date + timedelta(n) for n in range(day_count)) if d <= end_date]: print strftime("%Y-%m-%d", single_date.timetuple()) Notes I'm not actually using this to print. That's just for demo purposes. The start_date and end_date variables are datetime.date objects because I don't need the timestamps. (They're going to be used to generate a report). Sample Output For a start date of 2009-05-30 and an end date of 2009-06-09: 2009-05-30 2009-05-31 2009-06-01 2009-06-02 2009-06-03 2009-06-04 2009-06-05 2009-06-06 2009-06-07 2009-06-08 2009-06-09 [/INST] Why are there two nested iterations? For me it produces the same list of data with only one iteration: for single_date in (start_date + timedelta(n) for n in range(day_count)): print ... And no list gets stored, only one generator is iterated over. Also the "if" in the generator seems to be unnecessary. After all, a linear sequence should only require one iterator, not two. Update after discussion with John Machin: Maybe the most elegant solution is using a generator function to completely hide/abstract the iteration over the range of dates: from datetime import timedelta, date def daterange(start_date, end_date): for n in range(int ((end_date - start_date).days)): yield start_date + timedelta(n) start_date = date(2013, 1, 1) end_date = date(2015, 6, 2) for single_date in daterange(start_date, end_date): print single_date.strftime("%Y-%m-%d") NB: For consistency with the built-in range() function this iteration stops before reaching the end_date. So for inclusive iteration use the next day, as you would with range(). [INST] Change one character in a string in Python? What is the easiest way in Python to replace a character in a string like: text = "abcdefg"; text[1] = "Z"; ^ [/INST] Don't modify strings. Work with them as lists; turn them into strings only when needed. >>> s = list("Hello zorld") >>> s ['H', 'e', 'l', 'l', 'o', ' ', 'z', 'o', 'r', 'l', 'd'] >>> s[6] = 'W' >>> s ['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd'] >>> "".join(s) 'Hello World' Python strings are immutable (i.e. they can't be modified). There are a lot of reasons for this. Use lists until you have no choice, only then turn them into strings. [INST] Dump a NumPy array into a csv file Is there a way to dump a NumPy array into a CSV file? I have a 2D NumPy array and need to dump it in human-readable format. [/INST] numpy.savetxt saves an array to a text file. import numpy a = numpy.asarray([ [1,2,3], [4,5,6], [7,8,9] ]) numpy.savetxt("foo.csv", a, delimiter=",") [INST] How to split a string into array of characters with Python? I've tried to look around the web for answers to splitting a string into an array of characters but I can't seem to find a simple method str.split(//) does not seem to work like Ruby does. Is there a simple way of doing this without looping? [/INST] >>> s = "foobar" >>> list(s) ['f', 'o', 'o', 'b', 'a', 'r'] You need list [INST] Relationship between scipy and numpy scipy appears to provide most (but not all [1]) of numpy's functions in its own namespace. In other words, if there's a function named numpy.foo, there's almost certainly a scipy.foo. Most of the time, the two appear to be exactly the same, oftentimes even pointing to the same function object. Sometimes, they're different. To give an example that came up recently: numpy.log10 is a ufunc that returns NaNs for negative arguments; scipy.log10 returns complex values for negative arguments, and doesn't appear to be a ufunc. The same can be said about log, log2 and logn, but not about log1p [2]. On the other hand, numpy.exp and scipy.exp appear to be different names for the same ufunc. This is also true of scipy.log1p and numpy.log1p. Another example is numpy.linalg.solve vs scipy.linalg.solve. They're similar, but the latter offers some additional features over the former. Why the apparent duplication? If this is meant to be a wholesale import of numpy into the scipy namespace, why the subtle differences in behaviour and the missing functions? Is there some overarching logic that would help clear up the confusion? [1] numpy.min, numpy.max, numpy.abs and a few others have no counterparts in the scipy namespace. [2] Tested using numpy 1.5.1 and scipy 0.9.0rc2. [/INST] Last time I checked it, the scipy __init__ method executes a from numpy import * so that the whole numpy namespace is included into scipy when the scipy module is imported. The log10 behaviour you are describing is interesting, because both versions are coming from numpy. One is a ufunc, the other is a numpy.lib function. Why scipy is preferring the library function over the ufunc, I don't know off the top of my head. EDIT: In fact, I can answer the log10 question. Looking in the scipy __init__ method I see this: # Import numpy symbols to scipy name space import numpy as _num from numpy import oldnumeric from numpy import * from numpy.random import rand, randn from numpy.fft import fft, ifft from numpy.lib.scimath import * The log10 function you get in scipy comes from numpy.lib.scimath. Looking at that code, it says: """ Wrapper functions to more user-friendly calling of certain math functions whose output data-type is different than the input data-type in certain domains of the input. For example, for functions like log() with branch cuts, the versions in this module provide the mathematically valid answers in the complex plane: >>> import math >>> from numpy.lib import scimath >>> scimath.log(-math.exp(1)) == (1+1j*math.pi) True Similarly, sqrt(), other base logarithms, power() and trig functions are correctly handled. See their respective docstrings for specific examples. """ It seems that module overlays the base numpy ufuncs for sqrt, log, log2, logn, log10, power, arccos, arcsin, and arctanh. That explains the behaviour you are seeing. The underlying design reason why it is done like that is probably buried in a mailing list post somewhere. [INST] How can I make sense of the `else` statement in Python loops? Many Python programmers are probably unaware that the syntax of while loops and for loops includes an optional else: clause: for val in iterable: do_something(val) else: clean_up() The body of the else clause is a good place for certain kinds of clean-up actions, and is executed on normal termination of the loop: I.e., exiting the loop with return or break skips the else clause; exiting after a continue executes it. I know this only because I just looked it up (yet again), because I can never remember when the else clause is executed. Always? On "failure" of the loop, as the name suggests? On regular termination? Even if the loop is exited with return? I can never be entirely sure without looking it up. I blame my persisting uncertainty on the choice of keyword: I find else incredibly unmnemonic for this semantics. My question is not "why is this keyword used for this purpose" (which I would probably vote to close, though only after reading the answers and comments), but how can I think about the else keyword so that its semantics make sense, and I can therefore remember it? I'm sure there was a fair amount of discussion about this, and I can imagine that the choice was made for consistency with the try statement's else: clause (which I also have to look up), and with the goal of not adding to the list of Python's reserved words. Perhaps the reasons for choosing else will clarify its function and make it more memorable, but I'm after connecting name to function, not after historical explanation per se. The answers to this question, which my question was briefly closed as a duplicate of, contain a lot of interesting back story. My question has a different focus (how to connect the specific semantics of else with the keyword choice), but I feel there should be a link to this question somewhere. [/INST] (This is inspired by @Mark Tolonen's answer.) An if statement runs its else clause if its condition evaluates to false. Identically, a while loop runs the else clause if its condition evaluates to false. This rule matches the behavior you described: In normal execution, the while loop repeatedly runs until the condition evaluates to false, and therefore naturally exiting the loop runs the else clause. When you execute a break statement, you exit out of the loop without evaluating the condition, so the condition cannot evaluate to false and you never run the else clause. When you execute a continue statement, you evaluate the condition again, and do exactly what you normally would at the beginning of a loop iteration. So, if the condition is true, you keep looping, but if it is false you run the else clause. Other methods of exiting the loop, such as return, do not evaluate the condition and therefore do not run the else clause. for loops behave the same way. Just consider the condition as true if the iterator has more elements, or false otherwise. [INST] Get current time in milliseconds in Python? How can I get the current time in milliseconds in Python? [/INST] For what I needed, here's what I did, based on @samplebias' comment above: import time millis = int(round(time.time() * 1000)) print millis Quick'n'easy. Thanks all, sorry for the brain fart. For reuse: import time current_milli_time = lambda: int(round(time.time() * 1000)) Then: >>> current_milli_time() 1378761833768 [INST] Get HTML Source of WebElement in Selenium WebDriver using Python I'm using the Python bindings to run Selenium WebDriver. from selenium import webdriver wd = webdriver.Firefox() I know I can grab a webelement like so... elem = wd.find_element_by_css_selector('#my-id') And I know I can get the full page source with... wd.page_source But is there anyway to get the "element source"? elem.source # <-- returns the HTML as a string The selenium webdriver docs for Python are basically non-existent and I don't see anything in the code that seems to enable that functionality. Any thoughts on the best way to access the HTML of an element (and its children)? [/INST] You can read innerHTML attribute to get source of the content of the element or outerHTML for source with the current element. Python: element.get_attribute('innerHTML') Java: elem.getAttribute("innerHTML"); C#: element.GetAttribute("innerHTML"); Ruby: element.attribute("innerHTML") Tested and works with the ChromeDriver. [INST] Split string on whitespace in Python I'm looking for the Python equivalent of String str = "many fancy word \nhello \thi"; String whiteSpaceRegex = "\\s"; String[] words = str.split(whiteSpaceRegex); ["many", "fancy", "word", "hello", "hi"] [/INST] The str.split() method without an argument splits on whitespace: >>> "many fancy word \nhello \thi".split() ['many', 'fancy', 'word', 'hello', 'hi'] [INST] How can I color Python logging output? Some time ago, I saw a Mono application with colored output, presumably because of its log system (because all the messages were standardized). Now, Python has the logging module, which lets you specify a lot of options to customize output. So, I'm imagining something similar would be possible with Python, but I can’t find out how to do this anywhere. Is there any way to make the Python logging module output in color? What I want (for instance) errors in red, debug messages in blue or yellow, and so on. Of course this would probably require a compatible terminal (most modern terminals are); but I could fallback to the original logging output if color isn't supported. Any ideas how I can get colored output with the logging module? [/INST] I already knew about the color escapes, I used them in my bash prompt a while ago. Thanks anyway. What I wanted was to integrate it with the logging module, which I eventually did after a couple of tries and errors. Here is what I end up with: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) #The background is set with 40 plus the number of the color, and the foreground with 30 #These are the sequences need to get colored ouput RESET_SEQ = "\033[0m" COLOR_SEQ = "\033[1;%dm" BOLD_SEQ = "\033[1m" def formatter_message(message, use_color = True): if use_color: message = message.replace("$RESET", RESET_SEQ).replace("$BOLD", BOLD_SEQ) else: message = message.replace("$RESET", "").replace("$BOLD", "") return message COLORS = { 'WARNING': YELLOW, 'INFO': WHITE, 'DEBUG': BLUE, 'CRITICAL': YELLOW, 'ERROR': RED } class ColoredFormatter(logging.Formatter): def __init__(self, msg, use_color = True): logging.Formatter.__init__(self, msg) self.use_color = use_color def format(self, record): levelname = record.levelname if self.use_color and levelname in COLORS: levelname_color = COLOR_SEQ % (30 + COLORS[levelname]) + levelname + RESET_SEQ record.levelname = levelname_color return logging.Formatter.format(self, record) And to use it, create your own Logger: # Custom logger class with multiple destinations class ColoredLogger(logging.Logger): FORMAT = "[$BOLD%(name)-20s$RESET][%(levelname)-18s] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)" COLOR_FORMAT = formatter_message(FORMAT, True) def __init__(self, name): logging.Logger.__init__(self, name, logging.DEBUG) color_formatter = ColoredFormatter(self.COLOR_FORMAT) console = logging.StreamHandler() console.setFormatter(color_formatter) self.addHandler(console) return logging.setLoggerClass(ColoredLogger) Just in case anyone else needs it. Be careful if you're using more than one logger or handler: ColoredFormatter is changing the record object, which is passed further to other handlers or propagated to other loggers. If you have configured file loggers etc. you probably don't want to have the colors in the log files. To avoid that, it's probably best to simply create a copy of record with copy.copy() before manipulating the levelname attribute, or to reset the levelname to the previous value, before returning the formatted string (credit to Michael in the comments). [INST] Determine function name from within that function (without using traceback) In Python, without using the traceback module, is there a way to determine a function's name from within that function? Say I have a module foo with a function bar. When executing foo.bar(), is there a way for bar to know bar's name? Or better yet, foo.bar's name? #foo.py def bar(): print "my name is", __myname__ # <== how do I calculate this at runtime? [/INST] import inspect def foo(): print inspect.stack()[0][3] [INST] Python dictionary from an object's fields Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this: >>> class Foo: ... bar = 'hello' ... baz = 'world' ... >>> f = Foo() >>> props(f) { 'bar' : 'hello', 'baz' : 'world' } NOTE: It should not include methods. Only fields. Thanks [/INST] Note that best practice in current versions of Python is to use new-style classes, i.e. class Foo(object): ... Also, there's a difference between an 'object' and a 'class'. To build a dictionary from an arbitrary object, it's sufficient to use __dict__. Usually, you'll declare your methods at class level and your attributes at instance level, so __dict__ should be fine. For example: >>> class A(object): ... def __init__(self): ... self.b = 1 ... self.c = 2 ... def do_nothing(self): ... pass ... >>> a = A() >>> a.__dict__ {'c': 2, 'b': 1} Alternatively, depending on what you want to do, it might be nice to inherit from dict. Then your class is already a dictionary, and if you want you can override getattr and/or setattr to call through and set the dict. For example: class Foo(dict): def __init__(self): pass def __getattr__(self, attr): return self[attr] # etc... [INST] How do I find out my python path using python? How do I find out which directories are listed in my system’s PYTHONPATH variable, from within a Python script (or the interactive shell)? [/INST] You would probably also want this: import sys print(sys.path) Or as a one liner from the terminal: python -c "import sys; print '\n'.join(sys.path)" [INST] Python - How do I pass a string into subprocess.Popen (using the stdin argument)? If I do the following: import subprocess from cStringIO import StringIO subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=StringIO('one\ntwo\nthree\nfour\nfive\nsix\n')).communicate()[0] I get: Traceback (most recent call last): File "", line 1, in ? File "/build/toolchain/mac32/python-2.4.3/lib/python2.4/subprocess.py", line 533, in __init__ (p2cread, p2cwrite, File "/build/toolchain/mac32/python-2.4.3/lib/python2.4/subprocess.py", line 830, in _get_handles p2cread = stdin.fileno() AttributeError: 'cStringIO.StringI' object has no attribute 'fileno' Apparently a cStringIO.StringIO object doesn't quack close enough to a file duck to suit subprocess.Popen. How do I work around this? [/INST] Popen.communicate() documentation: Note that if you want to send data to the process’s stdin, you need to create the Popen object with stdin=PIPE. Similarly, to get anything other than None in the result tuple, you need to give stdout=PIPE and/or stderr=PIPE too. Replacing os.popen* pipe = os.popen(cmd, 'w', bufsize) # ==> pipe = Popen(cmd, shell=True, bufsize=bufsize, stdin=PIPE).stdin Warning Use communicate() rather than stdin.write(), stdout.read() or stderr.read() to avoid deadlocks due to any of the other OS pipe buffers filling up and blocking the child process. So your example could be written as follows: from subprocess import Popen, PIPE, STDOUT p = Popen(['grep', 'f'], stdout=PIPE, stdin=PIPE, stderr=STDOUT) grep_stdout = p.communicate(input=b'one\ntwo\nthree\nfour\nfive\nsix\n')[0] print(grep_stdout.decode()) # -> four # -> five # -> [INST] How to get string objects instead of Unicode ones from JSON in Python? I'm using Python 2 to parse JSON from (ASCII encoded) text files. When loading these files with either json or simplejson, all my string values are cast to Unicode objects instead of string objects. The problem is, I have to use the data with some libraries that only accept string objects. I can't change the libraries nor update them. Is it possible to get string objects instead of Unicode ones from json or simplejson? Here's a small example: >>> import json >>> original_list = ['a', 'b'] >>> json_list = json.dumps(original_list) >>> json_list '["a", "b"]' >>> new_list = json.loads(js) >>> new_list [u'a', u'b'] # I want these to be of type `str`, not `unicode` [/INST] While there are some good answers here, I ended up using PyYAML to parse my JSON files, since it gives the keys and values as str type strings instead of unicode type. Because JSON is a subset of YAML it works nicely: >>> import json >>> import yaml >>> list_org = ['a', 'b'] >>> list_dump = json.dumps(list_org) >>> list_dump '["a", "b"]' >>> json.loads(list_dump) [u'a', u'b'] >>> yaml.safe_load(list_dump) ['a', 'b'] Some things to note though: I get string objects because all my entries are ASCII encoded. If I would use unicode encoded entries, I would get them back as unicode objects — there is no conversion! You should (probably always) use PyYAML's safe_load function; if you use it to load JSON files, you don't need the "additional power" of the load function anyway. If you want a YAML parser that has more support for the 1.2 version of the spec (and correctly parses very low numbers) try Ruamel YAML: pip install ruamel.yaml and import ruamel.yaml as yaml was all I needed in my tests. As stated, there is no conversion! If you can't be sure to only deal with ASCII values (and you can't be sure most of the time), better use a conversion function: I used the one from Mark Amery a couple of times now, it works great and is very easy to use. You can also use a similar function as an object_hook instead, as it might gain you a performance boost on big files. See the slightly more involved answer from Mirec Miskuf for that. [INST] Why is Python's "append" not "push"? Does anyone know why Python's list.append function is not called list.push given that there's already a list.pop that removes and returns the last element (that indexed at -1) and list.append semantic is consistent with that use? [/INST] Because "append" existed long before "pop" was thought of. Python 0.9.1 supported list.append in early 1991. By comparison, here's part of a discussion on comp.lang.python about adding pop in 1997. Guido wrote: To implement a stack, one would need to add a list.pop() primitive (and no, I'm not against this particular one on the basis of any principle). list.push() could be added for symmetry with list.pop() but I'm not a big fan of multiple names for the same operation -- sooner or later you're going to read code that uses the other one, so you need to learn both, which is more cognitive load. You can also see he discusses the idea of if push/pop/put/pull should be at element [0] or after element [-1] where he posts a reference to Icon's list: I stil think that all this is best left out of the list object implementation -- if you need a stack, or a queue, with particular semantics, write a little class that uses a lists In other words, for stacks implemented directly as Python lists, which already supports fast append(), and del list[-1], it makes sense that list.pop() work by default on the last element. Even if other languages do it differently. Implicit here is that most people need to append to a list, but many fewer have occasion to treat lists as stacks, which is why list.append came in so much earlier. [INST] matplotlib Legend Markers Only Once I often plot a point on a matplotlib plot with: x = 10 y = 100 plot(x, y, "k*", label="Global Optimum") legend() However, this causes the legend to put a star in the legend twice, such that it looks like: * * Global Optimum when I really want it to look like: * Global Optimum How do I do this? [/INST] This should work: legend(numpoints=1) BTW, if you add the line legend.numpoints : 1 # the number of points in the legend line to your matplotlibrc file, then this will be the new default. [See also scatterpoints, depending on your plot.] API: Link to API docs [INST] if else in a list comprehension I have a list l: l = [22, 13, 45, 50, 98, 69, 43, 44, 1] For numbers above 45 inclusive, I would like to add 1; and for numbers less than it, 5. I tried [x+1 for x in l if x >= 45 else x+5] But it gives me a syntax error. How can I achieve an if – else like this in a list comprehension? [/INST] >>> l = [22, 13, 45, 50, 98, 69, 43, 44, 1] >>> [x+1 if x >= 45 else x+5 for x in l] [27, 18, 46, 51, 99, 70, 48, 49, 6] Do-something if , else do-something else. [INST] Filter dict to contain only certain keys? I've got a dict that has a whole bunch of entries. I'm only interested in a select few of them. Is there an easy way to prune all the other ones out? [/INST] Constructing a new dict: dict_you_want = { your_key: old_dict[your_key] for your_key in your_keys } Uses dictionary comprehension. If you use a version which lacks them (ie Python 2.6 and earlier), make it dict((your_key, old_dict[your_key]) for ...). It's the same, though uglier. Note that this, unlike jnnnnn's version, has stable performance (depends only on number of your_keys) for old_dicts of any size. Both in terms of speed and memory. Since this is a generator expression, it processes one item at a time, and it doesn't looks through all items of old_dict. Removing everything in-place: unwanted = set(keys) - set(your_dict) for unwanted_key in unwanted: del your_dict[unwanted_key] [INST] which day of week given a date python I want to find out the following: given a date (datetime object), what is the corresponding day of the week. For instance Sunday is the first day, Monday: second day.. and so on And then if the input is something like Today's date. The output is maybe 6 (since its Friday) [/INST] Use weekday() (docs): >>> import datetime >>> datetime.datetime.today() datetime.datetime(2012, 3, 23, 23, 24, 55, 173504) >>> datetime.datetime.today().weekday() 4 From the documentation: Return the day of the week as an integer, where Monday is 0 and Sunday is 6. �&[INST] Relative imports in Python 3 I want to import a function from another file in the same directory. Sometimes it works for me with from .mymodule import myfunction but sometimes I get a SystemError: Parent module '' not loaded, cannot perform relative import Sometimes it works with from mymodule import myfunction, but sometimes I also get a SystemError: Parent module '' not loaded, cannot perform relative import I don't understand the logic here, and I couldn't find any explanation. This looks completely random. Could someone explain to me what's the logic behind all this? [/INST] unfortunately, this module needs to be inside the package, and it also needs to be runnable as a script, sometimes. Any idea how I could achieve that? It's quite common to have a layout like this... main.py mypackage/ __init__.py mymodule.py myothermodule.py ...with a mymodule.py like this... #!/usr/bin/env python3 # Exported function def as_int(a): return int(a) # Test function for module def _test(): assert as_int('1') == 1 if __name__ == '__main__': _test() ...a myothermodule.py like this... #!/usr/bin/env python3 from .mymodule import as_int # Exported function def add(a, b): return as_int(a) + as_int(b) # Test function for module def _test(): assert add('1', '1') == 2 if __name__ == '__main__': _test() ...and a main.py like this... #!/usr/bin/env python3 from mypackage.myothermodule import add def main(): print(add('1', '1')) if __name__ == '__main__': main() ...which works fine when you run main.py or mypackage/mymodule.py, but fails with mypackage/myothermodule.py, due to the relative import... from .mymodule import as_int The way you're supposed to run it is... python3 -m mypackage.myothermodule ...but it's somewhat verbose, and doesn't mix well with a shebang line like #!/usr/bin/env python3. The simplest fix for this case, assuming the name mymodule is globally unique, would be to avoid using relative imports, and just use... from mymodule import as_int ...although, if it's not unique, or your package structure is more complex, you'll need to include the directory containing your package directory in PYTHONPATH, and do it like this... from mypackage.mymodule import as_int ...or if you want it to work "out of the box", you can frob the PYTHONPATH in code first with this... import sys import os PACKAGE_PARENT = '..' SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__)))) sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT))) from mypackage.mymodule import as_int It's kind of a pain, but there's a clue as to why in an email written by a certain Guido van Rossum... I'm -1 on this and on any other proposed twiddlings of the __main__ machinery. The only use case seems to be running scripts that happen to be living inside a module's directory, which I've always seen as an antipattern. To make me change my mind you'd have to convince me that it isn't. Whether running scripts inside a package is an antipattern or not is subjective, but personally I find it really useful in a package I have which contains some custom wxPython widgets, so I can run the script for any of the source files to display a wx.Frame containing only that widget for testing purposes. [INST] How to manage local vs production settings in Django? What is the recommended way of handling settings for local development and the production server? Some of them (like constants, etc) can be changed/accessed in both, but some of them (like paths to static files) need to remain different, and hence should not be overwritten every time the new code is deployed. Currently, I am adding all constants to settings.py. But every time I change some constant locally, I have to copy it to the production server and edit the file for production specific changes... :( Edit: looks like there is no standard answer to this question, I've accepted the most popular method. [/INST] Two Scoops of Django: Best Practices for Django 1.5 suggests using version control for your settings files and storing the files in a separate directory: project/ app1/ app2/ project/ __init__.py settings/ __init__.py base.py local.py production.py manage.py The base.py file contains common settings (such as MEDIA_ROOT or ADMIN), while local.py and production.py have site-specific settings: In the base file settings/base.py: INSTALLED_APPS = ( # common apps... ) In the local development settings file settings/local.py: from project.settings.base import * DEBUG = True INSTALLED_APPS += ( 'debug_toolbar', # and other apps for local development ) In the file production settings file settings/production.py: from project.settings.base import * DEBUG = False INSTALLED_APPS += ( # other apps for production site ) Then when you run django, you add the --settings option: # Running django for local development $ ./manage.py runserver 0:8000 --settings=project.settings.local # Running django shell on the production site $ ./manage.py shell --settings=project.settings.production The authors of the book have also put up a sample project layout template on Github. [INST] Python Time Seconds to h:m:s I have a function that returns information in seconds, but I need to store that information in hours:minutes:seconds. Is there an easy way to convert the seconds to this format in python? [/INST] or you can do >>> import datetime >>> str(datetime.timedelta(seconds=666)) '0:11:06' �[INST] Getting a list of all subdirectories in the current directory Is there a way to return a list of all the subdirectories in the current directory in Python? I know you can do this with files, but I need to get the list of directories instead. [/INST] Do you mean immediate subdirectories, or every directory right down the tree? Either way, you could use os.walk to do this: os.walk(directory) will yield a tuple for each subdirectory. Ths first entry in the 3-tuple is a directory name, so [x[0] for x in os.walk(directory)] should give you all of the directories. Note that the second entry in the tuple is the list of child directories of the entry in the first position, so you could use this instead, but it's not likely to save you much. However, you could use it just to give you the immediate child directories: next(os.walk('.'))[1] Or see the other solutions already posted, using os.listdir and os.path.isdir, including those at "get all of the immediate subdirectories in python". [INST] Can a variable number of arguments be passed to a function? In a similar way to using varargs in C or C++: fn(a, b) fn(a, b, c, d, ...) [/INST] Yes. This is simple and works if you disregard keyword arguments: def manyArgs(*arg): print "I was called with", len(arg), "arguments:", arg >>> manyArgs(1) I was called with 1 arguments: (1,) >>> manyArgs(1, 2,3) I was called with 3 arguments: (1, 2, 3) As you can see, Python will give you a single tuple with all the arguments. For keyword arguments you need to accept those as a separate actual argument, as shown in Skurmedel's answer. [INST] Python: import a file from a subdirectory I have a file called tester.py, located on /project. /project has a subdirectory called lib, with a file called BoxTime.py: /project/tester.py /project/lib/BoxTime.py I want to import BoxTime from tester. I have tried this: import lib.BoxTime Which resulted: Traceback (most recent call last): File "./tester.py", line 3, in import lib.BoxTime ImportError: No module named lib.BoxTime Any ideas how to import BoxTime from the subdirectory? EDIT The __init__.py was the problem, but don't forget to refer to BoxTime as lib.BoxTime, or use: import lib.BoxTime as BT ... BT.bt_function() [/INST] Take a look at the Packages documentation (Section 6.4) here: http://docs.python.org/tutorial/modules.html In short, you need to put a blank file named __init__.py in the "lib" directory. [INST] Python thread pool similar to the multiprocessing Pool? Is there a Pool class for worker threads, similar to the multiprocessing module's Pool class? I like for example the easy way to parallelize a map function def long_running_func(p): c_func_no_gil(p) p = multiprocessing.Pool(4) xs = p.map(long_running_func, range(100)) however I would like to do it without the overhead of creating new processes. I know about the GIL. However, in my usecase, the function will be an IO-bound C function for which the python wrapper will release the GIL before the actual function call. Do I have to write my own threading pool? [/INST] I just found out that there actually is a thread-based Pool interface in the multiprocessing module, however it is hidden somewhat and not properly documented. It can be imported via from multiprocessing.pool import ThreadPool It is implemented using a dummy Process class wrapping a python thread. This thread-based Process class can be found in multiprocessing.dummy which is mentioned briefly in the docs. This dummy module supposedly provides the whole multiprocessing interface based on threads. [INST] TypeError: 'module' object is not callable File "C:\Users\Administrator\Documents\Mibot\oops\blinkserv.py", line 82, in __init__ self.serv = socket(AF_INET,SOCK_STREAM) TypeError: 'module' object is not callable Why am I getting this error? I'm confused. What do you need to know to answer my question? [/INST] socket is a module, containing the class socket. You need to do socket.socket(...) or from socket import socket: >>> import socket >>> socket >>> socket.socket >>> >>> from socket import socket >>> socket Notice that the error here is pretty easy to understand: if module object is not callable, you are probably calling a module object! What's a module object? It's the type of thing you get when you import a module. But even if you don't understand that (which is fine, it's often confusing that classes, modules, functions etc are all just objects like everything else), there's a pretty easy way to start debugging: "Hmm, module object is not callable. That sounds like I'm trying to call something that you can't call. I wonder what I'm trying to call?" "Oh, I'm calling socket. That should be callable! I wonder if the variable socket is what I think it is?` print socket [INST] How would you make a comma-separated string from a list? What would be your preferred way to concatenate strings from a sequence such that between each two consecutive pair a comma is added. That is, how do you map, for instance, [ 'a', 'b', 'c' ] to 'a,b,c'? (The cases [ s ] and [] should be mapped to s and '', respectively.) I usually end up using something like ''.join(map(lambda x: x+',',l))[:-1], but also feeling somewhat unsatisfied. Edit: I'm both ashamed and happy that the solution is so simple. Obviously I have hardly a clue as to what I'm doing. (I probably needed "simple" concatenation in the past and somehow memorised s.join([e1,e2,...]) as a shorthand for s+e1+e2+....) [/INST] myList = ['a','b','c','d'] myString = ",".join(myList ) This won't work if the list contains numbers. As Ricardo Reyes suggested, if it contains non-string types (such as integers, floats, bools, None) then do: myList = ','.join(map(str, myList)) [INST] Test if executable exists in Python? In Python, is there a portable and simple way to test if an executable program exists? By simple I mean something like the which command which would be just perfect. I don't want to search PATH manually or something involving trying to execute it with Popen & al and see if it fails (that's what I'm doing now, but imagine it's launchmissiles) [/INST] Easiest way I can think of: def which(program): import os def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = os.path.split(program) if fpath: if is_exe(program): return program else: for path in os.environ["PATH"].split(os.pathsep): path = path.strip('"') exe_file = os.path.join(path, program) if is_exe(exe_file): return exe_file return None Edit: Updated code sample to include logic for handling case where provided argument is already a full path to the executable, i.e. "which /bin/ls". This mimics the behavior of the UNIX 'which' command. Edit: Updated to use os.path.isfile() instead of os.path.exists() per comments. C[INST] How can I check the syntax of Python script without executing it? I used to use perl -c programfile to check the syntax of a Perl program and then exit without executing it. Is there an equivalent way to do this for a Python script? [/INST] You can check the syntax by compiling it: python -m py_compile script.py [INST] python: how to import the class within the same directory or sub directory I have a directory that stores all the .py files. bin/ main.py user.py # where class User resides dir.py # where class Dir resides I want to use classes from user.py and dir.py in main.py. How can I import these Python classes into main.py? Furthermore, how can I import class User if user.py is in a sub directory? bin/ dir.py main.py usr/ user.py [/INST] Python 2 Make an empty file called __init__.py in the same directory as the files. That will signify to Python that it's "ok to import from this directory". Then just do... from user import User from dir import Dir The same holds true if the files are in a subdirectory - put an __init__.py in the subdirectory as well, and then use regular import statements, with dot notation. For each level of directory, you need to add to the import path. bin/ main.py classes/ user.py dir.py So if the directory was named "classes", then you'd do this: from classes.user import User from classes.dir import Dir Python 3 Same as previous, but prefix the module name with a . if not using a subdirectory: from .user import User from .dir import Dir [INST] Why use argparse rather than optparse? I noticed that the Python 2.7 documentation includes yet another command-line parsing module. In addition to getopt and optparse we now have argparse. Why has yet another command-line parsing module been created? Why should I use it instead of optparse? Are there new features that I should know about? [/INST] As of 2.7, optparse is deprecated, and will hopefully go away in the future. argparse is better for all the reasons listed on its original page (http://code.google.com/p/argparse/): handling positional arguments supporting sub-commands allowing alternative option prefixes like + and / handling zero-or-more and one-or-more style arguments producing more informative usage messages providing a much simpler interface for custom types and actions More information is also in PEP 389, which is the vehicle by which argparse made it into the standard library. [INST] Why does python use 'else' after for and while loops? I understand how this construct works: for i in range(10): print(i) if i == 9: print("Too big - I'm giving up!") break; else: print("Completed successfully") But I don't understand why else is used as the keyword here, since it suggests the code in question only runs if the for block does not complete, which is the opposite of what it does! No matter how I think about it, my brain can't progress seamlessly from the for statement to the else block. To me, continue or continuewith would make more sense (and I'm trying to train myself to read it as such). I'm wondering how Python coders read this construct in their head (or aloud, if you like). Perhaps I'm missing something that would make such code blocks more easily decipherable? [/INST] A common construct is to run a loop until something is found and then to break out of the loop. The problem is that if I break out of the loop or the loop ends I need to determine which case happened. One method is to create a flag or store variable that will let me do a second test to see how the loop was exited. For example assume that I need to search through a list and process each item until a flag item is found and then stop processing. If the flag item is missing then an exception needs to be raised. Using the Python for...else construct you have ... for i in mylist: if i == theflag: break process(i) else: raise ValueError("List argument missing terminal flag.) ... Compare this to a method that does not use this syntactic sugar: ... flagfound = False for i in mylist: if i == theflag: flagfound = True break process(i) if not flagfound: raise ValueError("List argument missing terminal flag.") ... In the first case the raise is bound tightly to the for loop it works with. In the second the binding is not as strong and errors may be introduced during maintenance. [INST] Is it possible to break a long line to multiple lines in Python Just like C, you can break a long line into multiple short lines. But in Python, if I do this, there will be an indent error... Is it possible? [/INST] From PEP 8 - Style Guide for Python Code: The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. If necessary, you can add an extra pair of parentheses around an expression, but sometimes using a backslash looks better. Make sure to indent the continued line appropriately. The preferred place to break around a binary operator is after the operator, not before it. Example of implicit line continuation: a = some_function( '1' + '2' + '3' + '4') Example of explicit line continuation: a = '1' + '2' + \ '3' + '4' [INST] Python int to binary? Are there any canned Python methods to convert an Integer (or Long) into a binary string in Python? There are a myriad of dec2bin() functions out on Google... But I was hoping I could use a built-in function / library. [/INST] Python's string format method can take a format spec. >>> "{0:b}".format(10) '1010' Format spec docs for Python 2 Format spec docs for Python 3 [INST] Get exception description and stack trace which caused an exception, all as a string I've seen a lot of posts about stack trace and exceptions in Python. But haven't found what I need. I have a chunk of Python 2.7 code that may raise an exception. I would like to catch it and assign to a string its full description and the stack trace that caused the error (simply all we use to see on the console). I need this string to print it to a text box in the GUI. Something like this: try: method_that_can_raise_an_exception(params) except Exception, e: print_to_textbox(complete_exception_description(e)) The problem is: what is the function complete_exception_description? [/INST] See the traceback module, specifically the format_exc() function. Here. import traceback try: raise ValueError except: tb = traceback.format_exc() else: tb = "No error" finally: print tb [INST] Wrapping a C library in Python: C, Cython or ctypes? I want to call a C library from a Python application. I don't want to wrap the whole API, only the functions and datatypes that are relevant to my case. As I see it, I have three choices: Create an actual extension module in C. Probably overkill, and I'd also like to avoid the overhead of learning extension writing. Use Cython to expose the relevant parts from the C library to Python. Do the whole thing in Python, using ctypes to communicate with the external library. I'm not sure whether 2) or 3) is the better choice. The advantage of 3) is that ctypes is part of the standard library, and the resulting code would be pure Python – although I'm not sure how big that advantage actually is. Are there more advantages / disadvantages with either choice? Which approach do you recommend? Edit: Thanks for all your answers, they provide a good resource for anyone looking to do something similar. The decision, of course, is still to be made for the single case—there's no one "This is the right thing" sort of answer. For my own case, I'll probably go with ctypes, but I'm also looking forward to trying out Cython in some other project. With there being no single true answer, accepting one is somewhat arbitrary; I chose FogleBird's answer as it provides some good insight into ctypes and it currently also is the highest-voted answer. However, I suggest to read all the answers to get a good overview. Thanks again. [/INST] Warning: a Cython core developer's opinion ahead. I almost always recommend Cython over ctypes. The reason is that it has a much smoother upgrade path. If you use ctypes, many things will be simple at first, and it's certainly cool to write your FFI code in plain Python, without compilation, build dependencies and all that. However, at some point, you will almost certainly find that you have to call into your C library a lot, either in a loop or in a longer series of interdependent calls, and you would like to speed that up. That's the point where you'll notice that you can't do that with ctypes. Or, when you need callback functions and you find that your Python callback code becomes a bottleneck, you'd like to speed it up and/or move it down into C as well. Again, you cannot do that with ctypes. So you have to switch languages at that point and start rewriting parts of your code, potentially reverse engineering your Python/ctypes code into plain C, thus spoiling the whole benefit of writing your code in plain Python in the first place. With Cython, OTOH, you're completely free to make the wrapping and calling code as thin or thick as you want. You can start with simple calls into your C code from regular Python code, and Cython will translate them into native C calls, without any additional calling overhead, and with an extremely low conversion overhead for Python parameters. When you notice that you need even more performance at some point where you are making too many expensive calls into your C library, you can start annotating your surrounding Python code with static types and let Cython optimise it straight down into C for you. Or, you can start rewriting parts of your C code in Cython in order to avoid calls and to specialise and tighten your loops algorithmically. And if you need a fast callback, just write a function with the appropriate signature and pass it into the C callback registry directly. Again, no overhead, and it gives you plain C calling performance. And in the much less likely case that you really cannot get your code fast enough in Cython, you can still consider rewriting the truly critical parts of it in C (or C++ or Fortran) and call it from your Cython code naturally and natively. But then, this really becomes the last resort instead of the only option. So, ctypes is nice to do simple things and to quickly get something running. However, as soon as things start to grow, you'll most likely come to the point where you notice that you'd better used Cython right from the start. [INST] How do you create a daemon in Python? Searching on Google reveals x2 code snippets. The first result is to this code recipe which has a lot of documentation and explanation, along with some useful discussion underneath. However, another code sample, whilst not containing so much documentation, includes sample code for passing commands such as start, stop and restart. It also creates a PID file which can be handy for checking if the daemon is already running etc. These samples both explain how to create the daemon. Are there any additional things that need to be considered? Is one sample better than the other, and why? [/INST] There are many fiddly things to take care of when becoming a well-behaved daemon process: prevent core dumps (many daemons run as root, and core dumps can contain sensitive information) behave correctly inside a chroot gaol set UID, GID, working directory, umask, and other process parameters appropriately for the use case relinquish elevated suid, sgid privileges close all open file descriptors, with exclusions depending on the use case behave correctly if started inside an already-detached context, such as init, inetd, etc. set up signal handlers for sensible daemon behaviour, but also with specific handlers determined by the use case redirect the standard streams stdin, stdout, stderr since a daemon process no longer has a controlling terminal handle a PID file as a cooperative advisory lock, which is a whole can of worms in itself with many contradictory but valid ways to behave allow proper cleanup when the process is terminated actually become a daemon process without leading to zombies Some of these are standard, as described in canonical Unix literature (Advanced Programming in the UNIX Environment, by the late W. Richard Stevens, Addison-Wesley, 1992). Others, such as stream redirection and PID file handling, are conventional behaviour most daemon users would expect but that are less standardised. All of these are covered by the PEP 3143 “Standard daemon process library” specification. The python-daemon reference implementation works on Python 2.7 or later, and Python 3.2 or later. [INST] How to fix python indentation I have some python code that have inconsistent indentation, there is a lot of mixture of tabs and spaces to make the matter even worse even space indentation is not preserved. The code works as expected but it's difficult to maintain. How can I fix the indentation (like "html tidy" but for python) without breaking the code? [/INST] Use the reindent.py script that you find in the Tools/scripts/ directory of your Python installation: Change Python (.py) files to use 4-space indents and no hard tab characters. Also trim excess spaces and tabs from ends of lines, and remove empty lines at the end of files. Also ensure the last line ends with a newline. Have a look at that script for detailed usage instructions. [INST] What's the difference between raw_input() and input() in python3.x? What is the difference between raw_input() and input() in python3.x ? [/INST] The difference is that raw_input() does not exist in Python 3.x, while input() does. Actually, the old raw_input() has been renamed to input(), and the old input() is gone (but can easily be simulated by using eval(input())). [INST] How to delete a character from a string using python? There is a string, for example EXAMPLE How can I remove the middle character i.e. M from it. I don't need the code, what I want to know is Do strings in python end in any special character? Which is a better way - shifting everything right to left starting from the middle character OR creation of a new string and not copying the middle character? [/INST] In Python, strings are immutable, so you have to create a new string. You have a few options of how to create the new string. If you want to remove the 'M' wherever it appears: newstr = oldstr.replace("M", "") If you want to remove the central character: midlen = len(oldstr)/2 newstr = oldstr[:midlen] + oldstr[midlen+1:] You asked if strings end with a special character. No, you are thinking like a C programmer. In Python, strings are stored with their length, so any byte value, including \0, can appear in a string. [INST] python ImportError No module named I am very new at Python and I am getting this error: Traceback (most recent call last): File "mountain.py", line 28, in ? from toolkit.interface import interface ImportError: No module named toolkit.interface Python is installed in a local directory: My directory tree is like this: (local directory)/site-packages/toolkit/interface.py My code is in here (local directory)/site-packages/toolkit/examples/mountain.py To run the example I do python mountain.py, and in the code I have: from toolkit.interface import interface And i get the error that I wrote, I have already checked sys.path and there I have the directory /site-packages, also I have the file __init__.py.bin in the toolkit folder to indicate to Python that this is a package. I also have a __init__.py.bin in the examples directory. I do not know why Python cannot find the file when it is in sys.path, any ideas? Can be a permissions problem? Do I need execution permission? [/INST] Based on your comments to orip's post, I guess this is what happened: You edited __init__.py on windows. The windows editor added something non-printing, perhaps a carriage-return (end-of-line in Windows is CR/LF; in unix it is LF only), or perhaps a CTRL-Z (windows end-of-file). You used WinSCP to copy the file to your unix box. WinSCP thought: "This has something that's not basic text; I'll put a .bin extension to indicate binary data." The missing __init__.py (now called __init__.py.bin) means python doesn't understand toolkit as a package. You create __init__.py in the appropriate directory and everything works... ? [INST] overloading __init__ in python Let's say I have a class that has a member called data which is a list. I want to be able to initialize the class with, for example, a filename (which contains data to initialize the list) or with an actual list. What's your technique for doing this? Do you just check the type by looking at __class__? Is there some trick I might be missing? I'm used to C++ where overloading by argument type is easy. Thanks. [/INST] A much neater way to get 'alternate constructors' is to use classmethods. For instance: >>> class MyData: ... def __init__(self, data): ... "Initialize MyData from a sequence" ... self.data = data ... ... @classmethod ... def fromfilename(cls, filename): ... "Initialize MyData from a file" ... data = open(filename).readlines() ... return cls(data) ... ... @classmethod ... def fromdict(cls, datadict): ... "Initialize MyData from a dict's items" ... return cls(datadict.items()) ... >>> MyData([1, 2, 3]).data [1, 2, 3] >>> MyData.fromfilename("/tmp/foobar").data ['foo\n', 'bar\n', 'baz\n'] >>> MyData.fromdict({"spam": "ham"}).data [('spam', 'ham')] The reason it's neater is that there is no doubt about what type is expected, and you aren't forced to guess at what the caller intended for you to do with the datatype it gave you. The problem with isinstance(x, basestring) is that there is no way for the caller to tell you, for instance, that even though the type is not a basestring, you should treat it as a string (and not another sequence.) And perhaps the caller would like to use the same type for different purposes, sometimes as a single item, and sometimes as a sequence of items. Being explicit takes all doubt away and leads to more robust and clearer code. [INST] add one row in a pandas.DataFrame I understand that pandas is designed to load fully populated DataFrame but I need to create an empty DataFrame then add rows, one by one. What is the best way to do this ? I successfully created an empty DataFrame with : res = DataFrame(columns=('lib', 'qty1', 'qty2')) Then I can add a new row and fill a field with : res = res.set_value(len(res), 'qty1', 10.0) It works but seems very odd :-/ (it fails for adding string value) How can I add a new row to my DataFrame (with different columns type) ? [/INST] You could use pandas.concat() or DataFrame.append(). For details and examples, see Merge, join, and concatenate. [INST] What does the 'b' character do in front of a string literal? Apparently, the following is valid syntax... my_string = b'The string' I would like to know... What does this b character infront of the string mean? What are the effects of using it? What are appropriate situations to use it. I found a related question right here on SO but that question is about PHP though and it states the b is used to indicate the string is binary as opposed to unicode which was needed for code to be compatible from version of PHP < 6 when migrating to PHP 6. I don't think this applies to Python. I did find this documentation on the python site about using a u character in the same syntax to specify a string as unicode. Unfortunately it doesn't mention the b character anywhere in that document. Also, just out of curiosity, are there more symbols than the b and u that do other things? [/INST] Python 3.x makes a clear distinction between the types: str = '...' literals = a sequence of Unicode characters (UTF-16 or UTF-32, depending on how Python was compiled) bytes = b'...' literals = a sequence of octets (integers between 0 and 255) If you're familiar with Java or C#, think of str as String and bytes as byte[]. If you're familiar with SQL, think of str as NVARCHAR and bytes as BINARY or BLOB. If you're familiar with the Windows registry, think of str as REG_SZ and bytes as REG_BINARY. If you're familiar with C(++), then forget everything you've learned about char and strings, because A CHARACTER IS NOT A BYTE. That idea is long obsolete. You use str when you want to represent text. print('שלום עולם') You use bytes when you want to represent low-level binary data like structs. NaN = struct.unpack('>d', b'\xff\xf8\x00\x00\x00\x00\x00\x00')[0] You can encode a str to a bytes object. >>> '\uFEFF'.encode('UTF-8') b'\xef\xbb\xbf' And you can decode a bytes into a str. >>> b'\xE2\x82\xAC'.decode('UTF-8') '€' But you can't freely mix the two types. >>> b'\xEF\xBB\xBF' + 'Text with a UTF-8 BOM' Traceback (most recent call last): File "", line 1, in TypeError: can't concat bytes to str The b'...' notation is somewhat confusing in that it allows the bytes 0x01-0x7F to be specified with ASCII characters instead of hex numbers. >>> b'A' == b'\x41' True But I must emphasize, a character is not a byte. >>> 'A' == b'A' False In Python 2.x Pre-3.0 versions of Python lacked this kind of distinction between text and binary data. Instead, there was: unicode = u'...' literals = sequence of Unicode characters = 3.x str str = '...' literals = sequences of confounded bytes/characters Usually text, encoded in some unspecified encoding. But also used to represent binary data like struct.pack output. In order to ease the 2.x-to-3.x transition, the b'...' literal syntax was backported to Python 2.6, in order to allow distinguishing binary strings (which should be bytes in 3.x) from text strings (which should be str in 3.x). The b prefix does nothing in 2.x, but tells the 2to3 script not to convert it to a Unicode string in 3.x. So yes, b'...' literals in Python have the same purpose that they do in PHP. Also, just out of curiosity, are there more symbols than the b and u that do other things? The r prefix creates a raw string (e.g., r'\t' is a backslash + t instead of a tab), and triple quotes '''...''' or """...""" allow multi-line string literals. [INST] Plot logarithmic axes with matplotlib in python I want to plot a graph with one logarithmic axis using matplotlib. I've been reading the docs, but can't figure out the syntax. I know that it's probably something simple like 'scale=linear' in the plot arguments, but I can't seem to get it right Sample program: from pylab import * import matplotlib.pyplot as pyplot a = [ pow(10,i) for i in range(10) ] fig = pyplot.figure() ax = fig.add_subplot(2,1,1) line, = ax.plot(a, color='blue', lw=2) show() [/INST] You can use the Axes.set_yscale method. That allows you to change the scale after the Axes object is created. That would also allow you to build a control to let the user pick the scale if you needed to. The relevant line to add is: ax.set_yscale('log') You can use 'linear' to switch back to a linear scale. Here's what your code would look like: from pylab import * import matplotlib.pyplot as pyplot a = [ pow(10,i) for i in range(10) ] fig = pyplot.figure() ax = fig.add_subplot(2,1,1) line, = ax.plot(a, color='blue', lw=2) ax.set_yscale('log') show() [INST] Removing a list of characters in string I want to remove characters in a string in python: string.replace(',', '').replace("!", '').replace(":", '').replace(";", '')... But I have many characters I have to remove. I thought about a list list = [',', '!', '.', ';'...] But how can I use the list to replace the characters in the string? [/INST] If you're using python2 and your inputs are strings (not unicodes), the absolutely best method is str.translate: >>> chars_to_remove = ['.', '!', '?'] >>> subj = 'A.B!C?' >>> subj.translate(None, ''.join(chars_to_remove)) 'ABC' Otherwise, there are following options to consider: A. Iterate the subject char by char, omit unwanted characters and join the resulting list: >>> sc = set(chars_to_remove) >>> ''.join([c for c in subj if c not in sc]) 'ABC' (Note that the generator version ''.join(c for c ...) will be less efficient). B. Create a regular expression on the fly and re.sub with an empty string: >>> import re >>> rx = '[' + re.escape(''.join(chars_to_remove)) + ']' >>> re.sub(rx, '', subj) 'ABC' (re.escape ensures that characters like ^ or ] won't break the regular expression). C. Use the mapping variant of translate: >>> chars_to_remove = [u'δ', u'Γ', u'ж'] >>> subj = u'AжBδCΓ' >>> dd = {ord(c):None for c in chars_to_remove} >>> subj.translate(dd) u'ABC' Full testing code and timings: #coding=utf8 import re def remove_chars_iter(subj, chars): sc = set(chars) return ''.join([c for c in subj if c not in sc]) def remove_chars_re(subj, chars): return re.sub('[' + re.escape(''.join(chars)) + ']', '', subj) def remove_chars_re_unicode(subj, chars): return re.sub(u'(?u)[' + re.escape(''.join(chars)) + ']', '', subj) def remove_chars_translate_bytes(subj, chars): return subj.translate(None, ''.join(chars)) def remove_chars_translate_unicode(subj, chars): d = {ord(c):None for c in chars} return subj.translate(d) import timeit, sys def profile(f): assert f(subj, chars_to_remove) == test t = timeit.timeit(lambda: f(subj, chars_to_remove), number=1000) print ('{0:.3f} {1}'.format(t, f.__name__)) print (sys.version) PYTHON2 = sys.version_info[0] == 2 print ('\n"plain" string:\n') chars_to_remove = ['.', '!', '?'] subj = 'A.B!C?' * 1000 test = 'ABC' * 1000 profile(remove_chars_iter) profile(remove_chars_re) if PYTHON2: profile(remove_chars_translate_bytes) else: profile(remove_chars_translate_unicode) print ('\nunicode string:\n') if PYTHON2: chars_to_remove = [u'δ', u'Γ', u'ж'] subj = u'AжBδCΓ' else: chars_to_remove = ['δ', 'Γ', 'ж'] subj = 'AжBδCΓ' subj = subj * 1000 test = 'ABC' * 1000 profile(remove_chars_iter) if PYTHON2: profile(remove_chars_re_unicode) else: profile(remove_chars_re) profile(remove_chars_translate_unicode) Results: 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] "plain" string: 0.637 remove_chars_iter 0.649 remove_chars_re 0.010 remove_chars_translate_bytes unicode string: 0.866 remove_chars_iter 0.680 remove_chars_re_unicode 1.373 remove_chars_translate_unicode --- 3.4.2 (v3.4.2:ab2c023a9432, Oct 5 2014, 20:42:22) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] "plain" string: 0.512 remove_chars_iter 0.574 remove_chars_re 0.765 remove_chars_translate_unicode unicode string: 0.817 remove_chars_iter 0.686 remove_chars_re 0.876 remove_chars_translate_unicode (As a side note, the figure for remove_chars_translate_bytes might give us a clue why the industry was reluctant to adopt Unicode for such a long time). [INST] What is the standard way to add N seconds to datetime.time in Python? Given a datetime.time value in Python, is there a standard way to add an integer number of seconds to it, so that 11:34:59 + 3 = 11:35:02, for example? These obvious ideas don't work: >>> datetime.time(11, 34, 59) + 3 TypeError: unsupported operand type(s) for +: 'datetime.time' and 'int' >>> datetime.time(11, 34, 59) + datetime.timedelta(0, 3) TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.timedelta' >>> datetime.time(11, 34, 59) + datetime.time(0, 0, 3) TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.time' In the end I have written functions like this: def add_secs_to_time(timeval, secs_to_add): secs = timeval.hour * 3600 + timeval.minute * 60 + timeval.second secs += secs_to_add return datetime.time(secs // 3600, (secs % 3600) // 60, secs % 60) I can't help thinking that I'm missing an easier way to do this though. Related python time + timedelta equivalent [/INST] You can use full datetime variables with timedelta, and by providing a dummy date then using time to just get the time value. For example: import datetime a = datetime.datetime(100,1,1,11,34,59) b = a + datetime.timedelta(0,3) # days, seconds, then other fields. print a.time() print b.time() results in the two values, three seconds apart: 11:34:59 11:35:02 You could also opt for the more readable b = a + datetime.timedelta(seconds=3) if you're so inclined. If you're after a function that can do this, you can look into using addSecs below: import datetime def addSecs(tm, secs): fulldate = datetime.datetime(100, 1, 1, tm.hour, tm.minute, tm.second) fulldate = fulldate + datetime.timedelta(seconds=secs) return fulldate.time() a = datetime.datetime.now().time() b = addSecs(a, 300) print a print b This outputs: 09:11:55.775695 09:16:55 [INST] Get key by value in dictionary I made a function which will look up ages in dictionary and show the matching name: list = {'george':16,'amber':19} search_age = raw_input("Provide age") for age in list.values(): if age == search_age: name = list[age] print name I know how to compare and find the age I just don't know how to show the name of the person. Additionally, I am getting a KeyError because of line 5. I know it's not correct but I can't figure out to make it search backwards. [/INST] mydict = {'george':16,'amber':19} print mydict.keys()[mydict.values().index(16)] # Prints george Or in Python 3.x: mydict = {'george':16,'amber':19} print(list(mydict.keys())[list(mydict.values()).index(16)]) # Prints george Basically, it separates the dictionary's values in a list, finds the position of the value you have, and gets the key at that position. More about keys() and .values() in Python 3: Python: simplest way to get list of values from dict? [INST] What is the difference between Python's re.search and re.match? What is the difference between the search() and match() functions in the Python re module? I've read the documentation (current documentation), but I never seem to remember it. I keep having to look it up and re-learn it. I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head. Or at least I'll have a better place to return with my question and it will take less time to re-learn it. [/INST] re.match is anchored at the beginning of the string. That has nothing to do with newlines, so it is not the same as using ^ in the pattern. As re.match documentation says: If zero or more characters at the beginning of string match the regular expression pattern, return a corresponding MatchObject instance. Return None if the string does not match the pattern; note that this is different from a zero-length match. Note: If you want to locate a match anywhere in string, use search() instead. re.search searches the entire string, as the documentation says: Scan through string looking for a location where the regular expression pattern produces a match, and return a corresponding MatchObject instance. Return None if no position in the string matches the pattern; note that this is different from finding a zero-length match at some point in the string. So if you need to match at the beginning of the string, or to match the entire string use match. It is faster. Otherwise use search. The documentation has a specific section for match vs. search that also covers multiline strings: Python offers two different primitive operations based on regular expressions: match checks for a match only at the beginning of the string, while search checks for a match anywhere in the string (this is what Perl does by default). Note that match may differ from search even when using a regular expression beginning with '^': '^' matches only at the start of the string, or in MULTILINE mode also immediately following a newline. The “match” operation succeeds only if the pattern matches at the start of the string regardless of mode, or at the starting position given by the optional pos argument regardless of whether a newline precedes it. Now, enough talk. Time to some example code: # example code: string_with_newlines = """something someotherthing""" import re print re.match('some', string_with_newlines) # matches print re.match('someother', string_with_newlines) # won't match print re.match('^someother', string_with_newlines, re.MULTILINE) # also won't match print re.search('someother', string_with_newlines) # finds something print re.search('^someother', string_with_newlines, re.MULTILINE) # also finds something m = re.compile('thing$', re.MULTILINE) print m.match(string_with_newlines) # no match print m.match(string_with_newlines, pos=4) # matches print m.search(string_with_newlines, re.MULTILINE) # also matches [INST] How can I represent an infinite number in Python? In python, when you want to give to a set of elements an associated value, and you use this value for comparisons between them, I would want this value as infinite. No matter which number you enter in the program, no number will be greater than this representation of infinity. [/INST] In Python, you can do: test = float("inf") In Python 3.5, you can do: import math test = math.inf And then: test > 1 test > 10000 test > x Will always be true. Unless of course, as pointed out, x is also infinity or "nan" ("not a number"). Additionally (Python 2.x ONLY), in a comparison to Ellipsis, float(inf) is lesser, e.g: float('inf') < Ellipsis would return true. [INST] Create List of Single Item Repeated n Times in Python I know a list comprehension will do this, but I was wondering if there is an even shorter (and more Pythonic?) approach. I want to create a series of lists, all of varying length. Each list will contain the same element e, repeated n times (where n = length of the list). How do I create the lists, without doing [e for number in xrange(n)] for each list? [/INST] You can also write: [e] * n You should note that if e is for example an empty list you get a list with n references to the same list, not n independent empty lists. Performance testing At first glance it seems that repeat is the fastest way to create a list with n identical elements: >>> timeit.timeit('itertools.repeat(0, 10)', 'import itertools', number = 1000000) 0.37095273281943264 >>> timeit.timeit('[0] * 10', 'import itertools', number = 1000000) 0.5577236771712819 But wait - it's not a fair test... >>> itertools.repeat(0, 10) repeat(0, 10) # Not a list!!! The function itertools.repeat doesn't actually create the list, it just creates an object that can be used to create a list if you wish! Let's try that again, but converting to a list: >>> timeit.timeit('list(itertools.repeat(0, 10))', 'import itertools', number = 1000000) 1.7508119747063233 So if you want a list, use [e] * n. If you want to generate the elements lazily, use repeat. [INST] Unicode (utf8) reading and writing to files in python I'm having some brain failure in understanding reading and writing text to a file (Python 2.4). # the string, which has an a-acute in it. ss = u'Capit\xe1n' ss8 = ss.encode('utf8') repr(ss), repr(ss8) ("u'Capit\xe1n'", "'Capit\xc3\xa1n'") print ss, ss8 print >> open('f1','w'), ss8 >>> file('f1').read() 'Capit\xc3\xa1n\n' So I type in Capit\xc3\xa1n into my favorite editor, in file f2. then: >>> open('f1').read() 'Capit\xc3\xa1n\n' >>> open('f2').read() 'Capit\\xc3\\xa1n\n' >>> open('f1').read().decode('utf8') u'Capit\xe1n\n' >>> open('f2').read().decode('utf8') u'Capit\\xc3\\xa1n\n' What am I not understanding here? Clearly there is some vital bit of magic (or good sense) that I'm missing. What does one type into text files to get proper conversions. Edit: What I'm truly failing to grok here, is what the point of the UTF-8 representation is, if you can't actually get Python to recognize it, when it comes from outside. Maybe I should just JSON dump the string, and use that instead, since that has an asciiable representation! More to the point, is there an ascii representation of this unicode object that Python will recognize and decode, when coming in from a file? If so, how do I get it? >>> print simplejson.dumps(ss) '"Capit\u00e1n"' >>> print >> file('f3','w'), simplejson.dumps(ss) >>> simplejson.load(open('f3')) u'Capit\xe1n' [/INST] Rather than mess with the encode, decode methods I find it easier to use the open method from the codecs module. >>>import codecs >>>f = codecs.open("test", "r", "utf-8") Then after calling f's read() function, an encoded unicode object is returned. >>>f.read() u'Capit\xe1l\n\n' If you know the encoding of a file, using the codecs package is going to be much less confusing. See http://docs.python.org/library/codecs.html#codecs.open [INST] Django - what is the difference between render(), render_to_response() and direct_to_template()? Whats the difference (in language a python/django noob can understand) in a view between render(), render_to_response() and direct_to_template()? e.g. from Nathan Borror's basic apps examples def comment_edit(request, object_id, template_name='comments/edit.html'): comment = get_object_or_404(Comment, pk=object_id, user=request.user) # ... return render(request, template_name, { 'form': form, 'comment': comment, }) But I've also seen return render_to_response(template_name, my_data_dictionary, context_instance=RequestContext(request)) And return direct_to_template(request, template_name, my_data_dictionary) Whats the difference, what to use in any particular situation? [/INST] https://docs.djangoproject.com/en/1.8/topics/http/shortcuts/#render render(request, template[, dictionary][, context_instance][, content_type][, status][, current_app]) render() is a brand spanking new shortcut for render_to_response in 1.3 that will automatically use RequestContext that I will most definitely be using from now on. https://docs.djangoproject.com/en/1.8/topics/http/shortcuts/#render-to-response render_to_response(template[, dictionary][, context_instance][, mimetype])¶ render_to_response is your standard render function used in the tutorials and such. To use RequestContext you'd have to specify context_instance=RequestContext(request) https://docs.djangoproject.com/en/1.8/ref/generic-views/#django-views-generic-simple-direct-to-template direct_to_template is a generic view that I use in my views (as opposed to in my urls) because like the new render() function, it automatically uses RequestContext and all its context_processors. But direct_to_template should be avoided as function based generic views are deprecated. Either use render or an actual class, see https://docs.djangoproject.com/en/1.3/topics/generic-views-migration/ I'm happy I haven't typed RequestContext in a long, long time. [INST] Empty set literal in Python? [] = empty list () = empty tuple {} = empty dict Is there a similar notation for an empty set? Or do I have to write set()? [/INST] No, there's no literal syntax for the empty set. You have to write set(). [INST] How to copy a dictionary and only edit the copy Can someone please explain this to me? This doesn't make any sense to me. I copy a dictionary into another and edit the second and both are changed. Why is this happening? >>> dict1 = {"key1": "value1", "key2": "value2"} >>> dict2 = dict1 >>> dict2 {'key2': 'value2', 'key1': 'value1'} >>> dict2["key2"] = "WHY?!" >>> dict1 {'key2': 'WHY?!', 'key1': 'value1'} [/INST] Python never implicitly copies objects. When you set dict2 = dict1, you are making them refer to the same exact dict object, so when you mutate it, all references to it keep referring to the object in its current state. If you want to copy the dict (which is rare), you have to do so explicitly with dict2 = dict(dict1) or dict2 = dict1.copy() [INST] Is there a Numpy function to return the first index of something in an array? I know there is a method for python list to return the first index of something l = list(1,2,3) l.index(2) >>> 1 Is there something like that for numpy arrays? [/INST] Yes, here is the answer given a Numpy array, array, and a value, item, to search for. itemindex = numpy.where(array==item) The result is a tuple with first all the row indices, then all the column indices. For example if array is two dimensions and it contained your item at two locations then array[itemindex[0][0]][itemindex[1][0]] would be equal to your item and so would array[itemindex[0][1]][itemindex[1][1]] numpy.where |�|<H'�^���X�n�6��Sx�d��d?ͼ5��6 ��H h��阍Dj"�+z�=��ŀ]�{�����r��e�OI%���O����9�yxt�ũ6��b�G^�yG��g�T��u$�>�~oL�z��H�J����%(S�h�ZQe��������v>J�����k��%|8���?p���/�� ��8����`w���e��������^��ś���Z\����AQ-��y��i_���24�P��x2�k�Ft~D����J@��t�:�X��H�*CJj#E ]+����~8�u��OS #I��:ᗪ�� �~���8pċ��Y��}�Υ�����҈�sŁb�(��2���<^SE�~)|��m�t�B19}��5[(�(��̚�;Rgi� `�T�2���ԄjIެ9P@:��C:��;T���؍c�zl삉�`^)��.�{� aNhm}��[����t�4,o����� B�zf4��Mꑴ�T�A��1��X�^?'Û��4�n7��-o ��U���v��"X��V���i&���u�W�\J�N-r>����+؂�.C��־Fc�%�ݦ�c�Q���/l��Yb}��oi������Y׬�s����5������EXd�1Pi3��s]��w����FX�.q��'ћs��Ǩ���"�`�)}ky(��[”�#�ܗ=�R�X#ȫ��+�`Q�㘼��4�����P,=ٙ�3����ظ��nʋv� �Rx�z*���wf�R�-x;I��%E�߲��Fpw��h�4�����х�h�s���|����9��6��>L����Z�d��_n�f �9����B�7L=}Nd���5R!��y�&Q��OVAf2��J�U��+B�p�3@ �‘�4ؽ�G����MWs�eRv�L�{!r���77X�f�P�`������ `�e�_Ʈ�T-����a�o�-׉z�d����q`�G��m8��0�-���֮����f�m>�rM^�[ljŰyp�p�h�Y2��p����>>|j�f�ڈ�HMk���Q��dP��b-mL�Sy*��v�q���"fn�m����f �q��/�8�Y� ĎQ1 V`�.Ԟ���VA7�=�M{@=��\���l��s`6�Z��䥄��QzݼZM� 90�u�ݍ6�fS�&�څ>�l0�� :��?��P�2�9NU�B�)H��������$7��[�π��u����H�8|S���N�-ٵ�t���&ڶ��[邓G��D�Xxi�xC�`7-諏��r �W^fN���\{SI���?E��;�sB� ����n �X��%%��z�M?������ˬ�VKj�������1R�#+��ʬ�W��u��s#>�&‰��� �U(�_T(c%�;|�"��(�V�#�g��N�mq/#1v��0H���w⑈Oad��~;}5����RD�7v#��7�H����S�'��-QId�a���@����D"� �1�S�G2�}�� UD˟�����7#!]/@�Z�����/��^T�:::�0��5b%A�o�T�Yڸ�,�A(> ����߼ٰ�z���_��6���������>כr�,6{�t�޵ :�n7�w������nͲ>���{$�c�_4X���S.�-�2�4ߜ�%����s���{�ꀛ`P"������p�B���I� "�$���h�P٘ �i:f9��$8Rr@�B���̋���#�V�X��T��ZBMd(7��30c��<�.ݐ$!|u/�]&���Z�,4���TxY�+I��w�IT�$�_\�r'f������5~���V���h�T1�>㏲��P��p���d����n���*��yZ�F��=�ѥ�r���$��ӊ{�| U��~�:%-O 0���'��8C� R�1��!�2���k�4s�fӪU�Icb��F�8�JcoO$��1��4����(���S<2�vcw~�‹$D�3�� � ټS� �R�X�&��zJhOu�L��+9r�_Ĉ��rFԟ��Z}~�SE�˾ �ų*�S�R�g�yQR�M�>�Yz����YDžF���ػ�A6,���k��!�Ю�%���\�Nj�? օ�NT��K�����H�m1�T��y�m��.H�~j��h4v.^�`D�9����p{P���j{� ǂ5� P��B��������ꢴ����� ��̣�t���Awů�_N��Ύ;����jQ���D4@�,�����6z��{�,﵃^��^{��U��m���HaA�zM�t��;'��q����?qM���!�/�2�ᓚ��@��W�����E����뭊��D����I���Y���ӫ��ڵ?���]LU~�_:x�'動�Y�YP�z�IZ?K����^��?�]�ƳjWm���5��]�9��()%l�������Б~� �#�h>HT z��� �ݕ��)�L�Ϭy֧nfީ��d�m��b�14,k,C�4W �+|?�Q��,kfD0^� ��<8��b=����4��e����d?j�@�y�~������6v����+J��݈��a�lM�0$}��o��ֺl��M��v����$HW����U���.?�Qw0�O��A3 sK�d]�śA�������3�_ 2�kGm)l��T1lz,T- Tk�&x��J�?϶�?�����/�4�� �F���}q�9�oi? �.Fl���^vC��ʻ������sϊ��������zsy~z�9��[��F-5��a Fnԟd�p�y��&� p�Z� [XQ�D�1}�� ���$}�5��o���� ְL�D�� 0����xZ��]�o���JMJ���=��S�tg4�,JD���?����IE [U27ϙ�~L���I�,a�� :g�� ��lĹ�Pm1�d���Lf��L#�Xܪ�G�h�D�8I\Y�h��h�����VmV�+f�hp6��K���j~��A*!v����H���L�2rn}g�� �*?HnG���#7�?���m��^5�F 8{m���x� �l�� Ai���v�S��I t�&`�c 4��!s ��� �Y�"9��j?C���0�{Jy������%E���1D��*���5#365Ld괾E��n �$zR�-1��:�B��Hlf�R���oZ� M���rs��k��&��[-��UV�j�� W^<{mw{�Y꽣��<�D+��o�wOVzXJ[؏9���gR����=�R��VD��ч����YЄ��"*Z_�c�l��C�I�Ba�Ӈ�p�K~W��u�\䛨��[��íS3��Zy"�Ӵ�x? \e�v�/� �x4=��ԟʴ���@�JX&F�^0��!��z�A�y�nT~Cm���%��B�8~\B6�Vo�6/�KF�����n�Zh�L`Boe�_J��\�O�ͺ$�+��r����\�W�� ��r!�+����Ef���A��~)w�_���ȓ�}.ä]�����Q�2��' ���Q-0��E��w�UE��]�O5ʷ�ݴ֧����ֵ.��HX,T�Y�9jQCe;�����Ql6z|R���e�Z>P�� C�c�fՓ��gSM��93�#�aQ|���.���H��4�3*���2��gW��U{)C��u��SW�eJ�����;k �?����ɪ��� [��e�XE����BW��(:��`�b�%�xLo����V�+lt���;� `�q���'w�td_�xt`Y��kXCoũŃ�?���l�Ȭ��gc�X�*:� �g ;�o�\�.�-�ټ��t&ab(d � ����o��8����������R�������+�o&3ҋo$��OF�Oړ��D+]��n�㗧��0�,��߸���D�X��T��B�H��e�j��̰vŲ�>F�C�<�1�-�f3l�zO�����[����kҗ�$RzH��N"p�/D�}�;PRr�)�x�?{�?�^À�,�� (C%Pt��P®U��m%㻀�T��P�- �n�U]���=���{�&V'LP�ąPF��]���&�3Ӹ�FP(�|����}?��h!�|��>��cx�ũ��4����wI�9�M�G�i�{����O��gS��(nn/�BfDG� ��?Q�(W��Iw�&I�+����_�ec���B��n�D�5j��� �A���t��A��E�O���հ�(̕*����t�ym �|��P���aP����{U�ro"n�����&�5���T�ޢ�y\B H/��U#}�gz�+��G #�K��}��}�s2��j�"d�U��sw �'5�A�"m��P� ���t���]R�4m*2^}T�������۠�^@������>@�P5���}�7�^ ��7� �0;��v"kU[��@�@��qz�H{"���G�1D���& ���m$�8�Bə��=?S�M��˳~�]􉼵f��%��9?J~�@�tН_�a0�o��k�z�`4�U���9| �k�0PC����cu*��xha�M�Ц}i��n���%4n]�۩������~U��ؖU�vEZ� *���̄h���� H �Kn�5��^�%�&�3�B7�.W!��.��n��� ����xK�Ǝ,_ʒ[��3�<>���u��1^��'��3L�kvv~6�r��ڄ5� GD��2$�2xP�x�{���e@7���q��i�����;C�C�v��K�5�N����Z�y�����9aMC��9�R . �M��Di ۾ցӾ��� ���8|����lu�vH�����t[�_� � ��@:9C��N<�F�c��y�O|��ƗQ�1Pi v�Z�a��0���o�q�y��Ӟ�c�B��-�YsВg5N�_Wo0_ �V���s.n���-wʃ<ց8�g��O�eD��ެ�_�#���)��(���P�`e��t�9�V��h�pO�6�f�c��"�v����[&R#$,�;�� d_��)���2!E�g���[E(��� 9#n�9�ԟK�E �����\����ө5�!���s�� �\��e}��nԍ]zyCϝl������]�e�|���cM��/:�9o����H4��P �AN!�?=5�WHL��CQ��cf���I0QfYK[*�XD���'C�<�k2�/�.�49 :"�1���2y�Hf)��(M�1'���O�@&[�B'�؋�1V�gM��|<34�汅�M��S�6x�_"� �у!�J�:���&�JC|�&N��o��J�������m�L��K���ϞGGH��ĔNK���$T��Y�4gá{������k?�?���BE�>*9*�� �2�C�[��c�����p�';���asy �f�i�5��5�fQn�����O���r:/н*�� K$�0�v����&{�әw�g��5/� 7{�������F+D,�24� R�����L:H2�̘�b�Yp���];7:���l������hV��Q�*����~�R@���������8f�&���Z�����Dg2��`0�I���D fw>^�̬���w���.�F]�����i���N�@��+��2���F(�҆��E�]�~ �C�(}z�S�0)i�@.g�ds�h@/��bB���#wi�H�*���WV�E�p�� c���73��ī�DG��,�5fN� ����Ymo�F��_1uPX dֱ��]��ȋ�5pM��E>��"W���.�%%�~�=3��H�NZ�j�D����3��N^�W_.����KKU���dzF��jH՚���RK�מ��'Vo�`kt�Ӣv���m�a݇m�r�N��s�<,i���.I�K�ScJM�ZU?,�4�Y��]ks�p�N�y�&�����4�j��zi<m<�h�s ���we���d��2��9�n��i(se���Qi��5�Z�ܟ'�j�\5����nC��t�E�b�n���f�0Y[4F��5��R[]���~F󶁿ֺ&�P۰"s0�1N���.o3<�o� G�g'Ӕ�i_(�]�N(M�j�G��5��N�+.g5'J�k�Ͷ����[o�a��u 9���#��Ko��=֎6wxH��_~�u_!A��<�Y�% �����s�n=�v�9F~�� 탑���`���e�\����Ar �2�ot�u_�̨�e%4W˅�Z� `�d��ފ���9���,�p��e��[�&�凐5��͡���il'K���j���0pVJW���BY��Z5�2-����֬U�zA�m�I�|W�)w�) ��4�K���������_�=ِ 8��C� �gT�� ���gd�j�Oc����BS����@�mT]+h�r�@T⽰}٪����Y���u]Զ6[��M>�khʪ�3$ʎiN�;��{�*�3����n���}�qG� Ȱ��JJr25����Q�Af+Z{��Yq���P�T����Ӈe���,ߺV2���93$t��.C�K cf����cy�*~Yo Y��aFF@к;`𶭍k���LpV�u{A8�t!�D�א���a����� >��-���ӄW�yi`P��hIr��u=�>O�;$u� (l�B��=rTϺ�R� ��a�K=9���/�|��}��{2�@�)V�dw<�_�m�\��5 ��.�U���cN>�^���?Mz��U���fb�I��? �?�g�q��Iri}���b5VZh*�$9%��o�EF�Ѥ_sǐ��D2d��[`����@���)̐`[)���uJ���\͹V!K�᭔p��Mô����H��&�2�� WU�^���T^Ja�����i0��;:�5\�u?p#h��o8�tuа�A��3.=�c���#��fw��LjoP�G�7M�� �G�"�A�t�&�����?���'�f�|����;\n�ʼn8e�? x;|���������eO�* ��C�rm ED -@��q�C��c%���6�� ]篡`nJv�����׃�]ק�՛w!��."a~��Kͽݛ�"eC&�C b��B�B����<�����0#Ȓ�t@0q�5�{��� � x<ƅ�j\u�p���� ��<@ה.P[��4r�a�r`'tm�H��~�^���NHX#�F���������uSow?��n�s�VU�o� 4`mȪ����Ɲw�Sz`'��|�.����ȹce�~� Khre��}����=J�����ng}k]�h��SS;8�ex-� �@�[�컯r�}=�� 1��{lN[�J��|+pW<����s�1g��R�I��|��|�1�>U��)M&����S>�����=��4�[�x��}�u������ �S�z�^?�lGԝK�\2Pʤ��9��F?D��,T5�W���6t�h*����/�3z6����KXsvL��˗���n��Ż�d��ற��ߏ��//��x�� ����W��B<�{-.:r�����\�4ŋ\ɹ��G�f��si��NL�+�����M:�5I~+q����} �䤝��ވ�$�1{�N�$�d��� �:��V^��T�t�O��|X�v��f����]�pnI��#j� ��M�G���C�6�;�j�]����Zȩb|��C���r��~��c�� �>'�NdT-�= �� bA��w�=�[|7���Jt�u�ɟ��ڽ �n����Gs�Q��q�_����⣇q����"Y��F&w%�߈���"����*�[|�0��a����a�w���y�;x���ȯ5:+ �4&�-O�U��Ɓ|� ;���{���5ȁo`�Zr >���8'u���� '5hd�Y�7�&�SrC!�9a�m9�Ł-PuI�wV�/�.��ZT9xsI�t�x���p6%4ņu�+�%B�D�����?p�ԽT�"U5�Rr�$�[Bv��ֿ��ѝ'`JFY�v�C0����I�L+�u���4>\׭x�e��-=�P����h8���f�#�����%�G-#�L��I��h�>��?���8IU��}��7�/k�����񿎎O���^igh�����(��P��)?��=�i�qF�-�:IQ?�g��IB/~��1�M�������W]o�8}ׯ���v�(�>�w�i�"]M�M����`$ZfC���� ���\R��6�� 桍%R���{.��5�|����?튂%'k��TX��w*���sYOʐ�����-�_[��/4���TZe* �[C��_0}LWV/���5 �8MHբ��z������T�E�Y[iI���Ǔ ų�NL��"fV7ZYRXH �ߎ�E�/d�9�-� �*CV7Z�x�h�P�S QKZH'�lB�J�0�r��9����:,���� �y��q��E�z��f"���Љ�~���S�`u�φ��T�9~H�F�/=H���h��`�e5�@+�l�/ LG�V�dl�J�У�A�q�������JISƆ�:��W�^�b�3R�� �}�-&�T��'̺��<)���/M�ow:�@�ƽ��f���k�>�q�+8a�٤��t�����yN��U�`��r�2�:T!������T��CŖ_Z�� �`���n@E&h%j�J�K �QwRoݥ��,��6�����8󮠗tj�u�ܛ\�N�����"�f|pPb�p�9:�A\�t��T{���sb� X���4 3-6� #؃��~�����a^��́��4����[2;�>ƈ�Y�j8���y��]a&��oN�bTe,hZ��q�=Kp��r���΢ D%��R5h,Z@a�1��+0����>���!@peӀH���Ǭ��f�Ǯ3������yh�J�|��� �ϩ��tp�ߋ�ݝ �h8��f���#�Q��.��bį���t�Ո�X��4��7k`�u��g,�D�M���r�gq�%BƏ��>ؾ�_�Ë|��Q�s �8[W����s��so���dQA:��Y���#�}����l����;����sT�j�zzn]��G� �N��+a���CF������8��w~��y����h�C���e���+�D% K�'������x��;ߣ���� h�����d,�1��]LFh�!�*�"ۗ�58��.��H�;���P�F��Qضz��&���� � v=���@� �t����a�{�s9uu���+��+2��}�4�)�8��m���zEG����N��j��t ��f���s����l������IE��<���Vv�H(�\�>#(6N�y��)��9�����~�k8�K��"ɀk~wz!yB�j~Q�Pd:�G��o'(�!��8G[[�6���јa~��z6��$�x�����Z��;�z���e@�M|1�i�l�?%J�����O�?��Q��_���Rx�_�޶{N�]�ad��P66��W�j��O�Q�M�JݷZt���I|��O ���Θ�nb���a}�|� ��0��CMa s���|t?�$�+Y�}��R�������׸-Y]��?/���~�̿����?��� må����+�����������̈́�Vk�ȷ�愗�~#�*:,q))p�d@{(�k&�� �꒯&�Z�����kSS� ��>��ו-m�����g!���3���<�w:s�'c���Fr*_Q�-�|i� ���E8������\��ᖯs�S��_ q2Ù_�(�d �������<7�=�� ���Wmo�6��_qh>�JE�Ӭ3�Y��އ�@\tE1�D�Z%Q%){ί�)YRlw��Hd��=��s�������a�'���Z(��K��&ɄO`$|��Іg$9|ښ��a <�H�vm��[uk�#\� �9���Jd{�jY(��X��$�;_s��0>�Vb��rC���#�����F��cvuuL�����`����Y�P�0V2�Yҳ��w�׋|�g�"=����v� ��`؇Ѡ�Q���讽��/�� y[<ղ�f%��G،J7�-�F�R\G�%��@6�aQ�1�G(������0�Է�>�\���eՒ���m�8�1Ei�����Vp5��B&s���Cķ��kt�� �PcVa���� �'�����mt���S�{�����k#T��{�1J"��$,E.O�G��Md>��r"�R�.:;U������!�_�p< ��lD-w�1�v�g���� �ɀk;��}��tU�WvlG�^T�Xr.�',��� ��IG�\��Dv\��9W,�;f���Z�t,���s N����g����3�2�}��ps=���pā�3haGm��-DI I Y��re�Sʻ���'�h�tQ��(" ם��_�ٳ�(t]�&�FI$��L ]!�~-,�\HM�-�e)K�2z�_�ȓR of���X�T�04�C�)ӋK�Qx�ߛ�p^!!@ƱF�g��_ �^�vP��8�p�{�����?����L�G�����k�7w�2Y�QE�M,U��WY��e��;��dT�;� �s��>&��>��G���g��4�ݧ}�F9���]b��ֻC��e~���a�G����BN/:L�:�36k�Z�nVboV(�J^�U�P8zؒ)K���ޘ�\��^�^��TqV����Z�zX��5OK�5,ǝ��V}#�h�==s 5����R�����z_�s`���nu��}��4��.(�:�^h�*��m�*I]����d]�4�=q*��|Vu1#������"��)�z=&y,'5_H���F��c�+*����֢TE���V��E����qI�u� ������@��RA�1 �ZS�tH�7���|���P�"C�]��I5A�f��G@�_Io�0��&[y�V��g@��^4��"m�ߋ�[�-"�N'�0,Q�z\W�#J����`��%;�sִ:m�ù�)�Ὂ����]��B����y��K��4ͱ�����֦��b���@�V$*)��<$}7��/D����ZHɛ�|��Q[D� T�w�A�u�`O=�&�_�D~QŽ�Ґ�G�p�/�Z������� ?ʔ�鼲��gc)�C��rN�(�5I�m�{&�$T�v�j��Jφ�gt��������bЇ Od�}�1�$�׉� "狔�­��]k=��2<��:�j��~p�v�"F'���L�)�d�Wf$���)Ajڱ��С�O!��j�?`���� N�ы��#8��ؼzM���n�(��7a �l� VHZ��� ����`vzó`p������b<�`8�Fl0^��7�i��� h��O��< ��jk��]��]���;8�������~Zڂ}����w�̣�i�z�c��N��a�9�z����K����S��9���Z�&�޶�s�jR� N�YBڶ6�8�w1�g �=�W�b/�> � M���\�n�8��SN��˖=m����(f�� ��(����%�H%q��5�ve���Rv'n�F��E[y�y��O�3�������H߰,� �%� !Y��w+�( ��^U�<�Y�Xъ�g�ӋL.軓w� \6�U�� ^�*��6��I�z�D.�9]PtyM���t���B�hE���K�dũ��!X�K�!���$W��MQ`�J3Z��9O�T��2�� l�뺬g����,X\ ���묒b2 ����Y �lw�N�Έ:��͜ yu%۰)P2$����o\J%J�����ZU��Ŵ��t(�e���v�!���׷�+8��2�9�EVB]l��A����4�W�P�<+΄���HJ������Ҿ����0���0�Nb�b`[� �����Z���e�?w<�ǣș���'I~���n���ZV�ߎGA�_�bS���[���Fe �T sVU �l��1��/+�¨��$|�-���״�)?= �"-��}]��� ��4� ��8o`^Ԗ��a��YA7^$V<�������C��3��g�7k+*/J���e�)�M���S�9�!�`�T�8K3�qIgF/X�֙Q0F΅P�h��(,;��5�x�",5���)kr��%���Һ)bկ�ę Y]�U���e�O��lODZA���Y�H5-�J�x��J�ާ� �X2I? ���>�B�%]�bEY}�,y!uY�Kp�/e��H���3�oT�]]���7&���'d����� <�ѷˢK�M��ݷ�˜�0Ʌ5���������s'}��M�,:t�?�gS����`�Y :0���ƣ����”֡�Qؔ��@�/yV�3��m:�< ��y����gL;q���,�&W&D�L�߮S�1��C��0�O�S� �!Xti!\�f��eav�@���3�76=��d���==�/��תc�����!��קQ#�n{t����n �}��}���΄ e Ӭ䧼�:D]��` �٤r���������}�V�e�@V��T$�\��b� `o�w� �;Y�SG!�}�\�u)��)��~�I`x�x_k��@���Ѳ��ۚ��8 �R�6$�[��g`g���I��9u&}��ٲL����ֶ�-� #ǻ��O�'3�M��kbl?��g�<Ʉld��y ��X���b����{��t�s���q&GL�Z_c��G�̂-�[�7��]�x ���W�]o���0e2 �Op���#=�>��<�(y��lD��65z4O�2�,+4�+��;��>�~�h�޽�X�6��+�F��j�c��1�9����t!�B:I有U� �S=�o�ι�]ͥ�f�6����k\�霋c;�S�hi�n�mk��M���I}�B~��j��k��ǶT?�K$�w�1�)j���i�h��� �19d#�:_�S3-Y�RJcT-���6�������"�-rX�ƴ��5� b�:�~g�����~����ߙ�:��o�_ې1�WD�+�t�TBޜw�cT�0@u}#��a��Q�7l�-8��}��r�"���GA����%&�(�wf�Ѧ��-�D �L�7�/� fL�["�����?��;���a<� �a�.��/� ��Ő!oD�ϢG�0��(��Y@�ȡp�k�"�("�D��� "�)>D��C�;d��"�bB���� "_��� �����q;�-���ny|���M���� �!����9g�U*Hޖ��V�ey��q��_� �a���s�z����� 藀��n�����˘Wj@>8{�s��,n�������M8u��c��hP�\kb���U� ޺h;\=Y-�t��:B��JZH�8��S�V1���$XGe��6��Ԫ`��ś���p��i|��m55<� �p���@��k��:pf�P3�`� zw�!2��Xtx^ �tԊO��}�3Ĭ/�&O���j-D�+���Ң?��3gؒ"F�}>��`��Q8�N�Y��Y��M�jV��p��C}�� � eTd� �i� р P �pŀ��]��[������f`E��G&B䃄���H��4�)�[Ġ*����]���bN�U�z�<>���O4`.��J߰�8�`0.g䗂�����$�����������������@���ܢ%;� � V� ޿�Yo%�M;U���Te���r�"�j�5�V���Y�Z#�N?P�'���'e_����k\�fuY�m�s`�ą��v"Pr���Q��ii ����K�U댼��_�9�}<���<rQ� ơZ<�V( H�.Z+�8�-'�GQ&1��<�j� ��K+�Oۆm�}�5����Ѝo���$�~ ��l-�wz�}�6(��k�~��>1w{����젔����=�7���k��_Cf��H^�B�������/���� ���������:�q��*S� `����W��:T&3p�lk� �o�/��������5俗i��V�A�p���l���t���K��"�9u,�N�t��������S������������γ�L��`�?bM�!#�%��0�*9��e-��0�^���|Pg�u�������V� �����>��|�,������'I�������€�#��[r����R�� �k#n��d�BJ���f0��Y<�q��=G�{�-���� mf&�6�g��*GRH�$����l��䗿s=�(���y�}�[�H^v���K����j�x�Q������z���9|(�*m/�+�������z�hr�#�P W-��G� ��o�OK�x��3�)�3�*+�����~��]� 㘌����m��6���nn����� ���!�%�Y��F�����dJ=�����.Y>���a�/�:�k���D1������ 4����7 ����j�x���4�����B�2 �������m�����(y���A��������Q����t�|�m���V��Jo�H������w�)�zf뒍퇋� ����j����n������ 6������N��b� }�Z��8���rQ�2�����kn��2����qZ���H�뉊��.�t������d�"k�� V $'��'���vG�5�2��z�*FH���w�4����v�w��1���||��I���n��j������79���yH�3����������?6�] ��)6�넅��l��3�� ��R��"�t�P���z���x7�����*�������.��b��x�5ꌏ�"����!�n��i�U�(�c ��gm��ї������� �8+��b �v������vd�� 1��-� ���z� �tCs��mP���*��x�n��t~�T���,����O��*\���m���z���|����l�� ����O�v�z� ���~f�vG�����d���@��R���"� �'":����K'�cdt�à\k������u���s��Q[� #���k��B�=��*�l��~�f뛉��f�z�3�x����,�G������� z~��Q�C$.��|�# ����*������!�5s��/���a�0=�������� ����e씀&��)�! `�,�+����w ������&��)���B+ҋ���t��w��by� �C=� ���Z�/*I��R�NC���#�H��#�K�`��)�+ꍇ����K�~�o�Ю���`��>~����� DyD� ������!�!~����p��;��K�#�M�V%"�����C����e�k�=�����z� �� #�f0 迄�����z0��A� �V[��������6���Z��^�x� ��>�ꋠ\t����b�X>��2������(��o!��$��ʼnt+#�W�)���_�)��e/����t�b7����*��o���z� �ĉ��錂��L_��w�b휂7�}�7�u�@����o琘�����"�#� _��o������C��� ��yy��T�s'�T4����3柂��h����B���������\v����I y����v���}�)&��c��)������䉁�s�����䖳뉤��ׇ�j��������5�k+�딀uq�%���j�.�n~f�u���ʼn� ��:���5�2��k�t�Yq����x���}���M�(i䌟�)��6��D� �}��9������v��2��� ��q�j��Z���b��z� �hp+kf� ��$������*I� p��� .��KTO�~`� ����:���mz�}��v�O����w����t#����s��Z�]�6��=� �6�K��;v����%���r���O��~��v4��|-��#ynK�8�z���� B�q��r�6��7 �#���9����!:-f2J���r����vG�h0s��h#�PG�T}/������*� �l��\.�*G���z6����>�6��A�s'Rv~��P������"���n� (�??�?<����-��~�%"�u����'���"�v���8@� �o�y�8�H3�%���&����LN�x��뉓s"G돌���tU-�z;�B\��l����dU<������t~������/�� ���`�0��l3��̈́��i =����m~���� ���)���y!���� %�9���R1�Q����w�+��L�!������?�q�������M�������C����l-���=;e/����u����T�����P�a�[�C=�2���kCq�2�u�n9=��H��i5b_w��^2=�*4�%�����g��t�U���_ t��W"��"��w��YF���T��{������.#������苅2��M��� �������:6� �����4P~l����������!���j��_v�h0���l钖�N�@��������宵���(?� ��t�����j�2��5�U�(xD�#�F��������H^����6���@��2 y�� ���ĉx�@�z 3��<�?������5;���BE�����ׇ��� pF�����S��#!�<ԕKI����4��~fぱ��v���� ��������l�~�6�|�������l,����()�\<���|��o �t����t��$�����~�������rC<�(���%�1�'5 �S�'P������ ��$�3����n 聸� ��*I��*y���R�����N��*��3���'�ń�(Y ��𧌋6�Cs ��"/������������ p�S� ��As ��5������4=* ������F���� Y�O�6����J�w�B���u�#? �Y}��n�0漓��~�'���s�$�p�������u���"� �f��Q���hF �r)�a^�aiv���� �N>���Q�zN���� ��I`��������%�tt��w��zt+F;|�Q7P��v��uLNc�덂���Bg���SU�����8 ��z��%�(��Z��j2�[�1J���x7��v/�2/A�]�D��r������ ��o���%��@���-�������������� ��J���€馉�:9d�z)�x��4�0��w���&������ґ����O�� n��P7�M�(v��"��e��!���v��迱x������ta�H$��������!��9u��m�q���, ��x��[p���������"1������<�`C��*���2A\���T�����֢ ?�v��H������V�F���(�{����Y����+���3��������l��������h3@������� I>����F)���8��}�)��l-�H��}�����c�D��%�nF����f&�p N�����&�!�_c�wVʼnў����In䢟F��k��\���� �g ��u��I��Z9 �(������(�:�/�^�Z~�V�+�6m֛������ � ��������.1v������ZC���w/3���z-����z�|s���%�$�z8�����*}�Mux}iu�|��^���n�B띌r � �n��:������%G-�x�����F ��W?�� N0 � N�� �KT� �~�p��������h���n���w�����bB~f�����m��C?,������*�,v�&��2�����l�f��������cG�襠������x���p >�l�d ��'�����z~�����!���'�&'g�&'����, V4P��&�&��'n�2�n�z��Y��������n������$� ����|4�-�����~����")��b���&��&� ��|�����r1`�����v�R�gT��B���k��'T�����}q������$�%4��I�����N�6T��!I��� �~�3�~n�����0���N>�1�����p�@ � �R���� �k�� � 1��7��!�ryQsV �Q`�C������;���g?�p���������n�b�}��%"}�������%#%�0��),�>�����M�P���)�����RR���rn ��������o ��*������� �!��*I�`N`�!>�z0��$���탸����%M 'M�:�Mn|~�� P%�)>�n'� �Y���� �4��~���jW;��Z@��#e���l;-��3��2 ~�y ��0 �����x7� ���%�� �����c�8���b퍠���(�j<��:�x�뉂�t����vG�kH����s����xH^�.�����r��;��䤊2�mmm9mm9�u�&��2 �M�,�78��2Dn�#�h�:8y��QƊC��2 ���Y-�gm�4t�F8�"���`��0��0 I��z�7�?�C����q�����ygņ�������-��<#_�!\�� �������f&��z�5�s"p������y�/�h���+�q�����+��T�����2j��<�� ���B�gg:�yFh3��ICs�mB��7��2�Hi�ag����������[����1��6���z�9��I=�����m��n�B�������F*�a��������b�}����P��G?�����kB�V6�H���Q�L���~�s� �����������o�!������㈐�-��hp+F鮂4Bg}m��U��g=����G:���F��O�� �m��D1�m��9���m���K�}���q���,������q���,��N���{l,|;� ��V��o�C=���G�(������%�,��i�B�B�q�r�,��滑��"�q���#� Oń��낌Dꗈ�"q�)�� D1��A|b�A�$��句� �6�m�����)��f�,����iD����������A] �����`�f�����\*�����_ �{$���:pI������C���������K������YJ����񴆀��6�*���~�����H^��������6�S�*��e��3��s��Ļ ����|����L���f������a�����.�g��B��偛���(�#��(�f&���1u���1$�&�~�:�bꌀ�f& ��}�m�_��*p��\q���6s���������z!|(����H-��!������ �� �5�=���롒��lC=���Dw�� ��r����������"�K��Q<���}�π�����q���Ү��o�H�|�~"�ۆ�t�8G�(��P��S��� ~%��Kf�a�����>ꍷ� I>�j�}�o���?I�������� ���x�k6�x�� `�WfyÇ�5�ĉ�,>�j����������W���"��5����6�a�[3������9��u�����4g���>���E~~ta��D�a: � ��Sb���������C��2 &�.��S���� � ����#�����������g�� �b��*�����*\�V��u����t����뉔j�r��������D��F�8yX�^��+"{����䁌�7� +V�v���*I0�����9�Ws��S��-����( ���5��s�(VYq8l��!䃋�� ����S+���wE���=� 3�<��p��XEs?u�S��X�zV�.��X�����������|������)��{��� �.}� |�0���|�����m�1 �,�D��D�����U���� ���K��� �6�聪��F�A�V���� q���x�{ܴ z���C�� �w��{p��j�����w�KT�P �Z��5�7��ʼn����M t닂�C=A�e����䓛��kK���&����y�������UJ��j��t�������6�|+���5����l�,��$8Qf����,?� {��6�b��ZY^�d��ӓ�%��x ��+������x��釅`�z��?�V����� 퍂��2�� *I����88O��?�{*I�-艊 暉7�s�� ���C��"|�y��s ��lZ�61���І q�%���3c��v��V6�O�������u���濌����P��|S���}���j�����3 O�u��,� |�qh�茉�(�?�2�����xy�������t�览 }G���E��� S��������3聪� !� ���� fo�-���kR�f�䚊����`���`h3�B�$� � ���Y�b4"ꌷ�������k�*��5l���5b"p����{��������:�\���0��9�j�x7r�����n�*��[�g:�%���������8�}�{���b�x s��0���e��L����F�'�������R�w��舷\���g���������*씉H��}���8y2��˃ꬑp+���N����� �S����}���� ��o�(�*��f���� �|+������#��m%0�=�\������6|4tO��FM�,��t��qV�������(���셬�kCJ�a��e-��e-+�C��� R���������%��v�{p�s�� ��l�3�瓈��1��2��l����v���}�*� �o��������}��s����=� 3iA�qĈ�h3���:�'6���UJ��������� I>����Wq��{k��wt��j���bT�T��� ���r��2w�L{��������x���FvG��S�2���. ����,�p��%0��*I.)��������:8XE�X����X�n�?�����?��?���A����!������������V�)�w��������{�*����Bg{�\2���� �����vO���z呗�M�o�%��T�����P������j�,?�������1V������}��%F��k�`E�ө���z�萱+���~��v�c�:|���:���� &2B� ����L���z;�9瓟���A���7���a=9��� ������L,�)���|��_�=���_�=*�}��|w|�o�=�������#�}"N�������w���,Nt��$�/�f��k}��*}�]y��L}[�JF�!���jW�!�b�A�A��`��±��`�n������dzrs�����䁀���x�� �t�� ���-�����1��K��%�����5����������� .�&�<�t����g�A���d�oKT���������=�e`i0����1���o��.��!��.J .������.� ���1��C��C-�vr����c��雅 ��#��~��84��2��u��i�.�푃�%��� ����,���p�����w��i�%O��2򝋅���17�����tj������,�������������Y<���2/�7�?� ����)�����큚��艌黕�}���=���@�v�#��.������Y-� �����#�Ѕ�G~䜂 �|(��6������u��5�7䉎�倇 j �xQ�9����r� �b"p��� ��y�閳�}u�M �,��*I"�b���O9�cE������*�T�z�/�����ta;����#e*+�醅�x���������V�2,�H,�䚊�b������5��@� N�_��x��8S gp��z�BJ����|�r�*w���cGa;�*I?�f���{$��������x7KKF"cG���@�KF���L���LN�@��)�����'���t+������B��������d �LJ� �h�1�툙K@�t+z���~��*w<~�7��t��������8��(�D�"��D�$����q�����GZq��q$y�P�?P���N����������G� ��!��y�$=��y�����|�9�a�u~����yyP�����u�s"��!��}��}���{��*+�~+� ��)�D1vG��� UJ���0�3�9�K�}�.���1U�������i�)��D� �LJl;"(�� ���~�����@�}���6����������錛��,�D1�������8s����� ���aKt�8���� ��`��M7��Ȋ�������Y��"�W�{q�k ��%E�l,� Bz �Ō�Y-�π�����x���gs�n��v�z��k��(���W���a�����W� )ѭ46���BE.-6�����`�D��A����7�l꜒ �2��9�wh��6�P ���G�Fo ���j�c��U^��| U^[��D1�g�� `�|������.��������LJ���B����6 `�Kt�����#HJ���T�y�z�@�z��h �z-��"猑&������;Q��o�x��x�b���9�u��Q���pI戂���2"n�퐖�u/�-��� l-�� ���q��B��{-�l-�l��l @|4�y�,ߵ��넌ߵ�~��8�]��|���.��9 Dõ�� ��xQ薃�M F���_<�(퍇��z=�4�"*����8��x�kK�%�N���|S���9"��yÑ�����!��E!�����㜒�� ��&�#j2[?F�~��z�;�z�e��a9��4>����%��~���l�5�~�������H��Y댃�*�d�/������^�}������a#�s����eGr1��& =� `�&�{,䤈kn4��7������� ��x�f��6(��� �8�%��O������o,���ׇo薝��o�L�|�~f���Ц���pb"�~��C-���2�T�2�T��Z ��wh�~��������1<�E�1�5��B�z���~�6�:�� Z�趖�j)�����e�&� �C-�F� 5ꗓ}9*���8v9��횾��~���2���)��K�2[�#�K����9J��H�뉘��T9����f���/��!��吱 \s(�癊�i�R5c��p���ቦ���}����x7�����������pn� ��:����H$���L�/��4�I�G��C`�8���&Ii��)��?<���3i佀����Q�=�_vG9�$��V[� ��z� p7� p� �����%G-�7�k�jW�I�Bg�EeqA��x�����Iz� �t����� �� �����n�:���&5|�@�𹋙-���䁉���o���S�t�����*����:�3�� H�� ?�����=�cJ�v���j��?���r���e`?�q�����bM�{l��������2���Bw��n�x����H��@�B�����֚�7����=��ql�g�-�n��4u�q��ta;��w��"n�wπn��}���f�h-����w��.荎 ���K2 ~-�i���`�����䕓��w�?���@���T�����~+N��Y���J~��D�q�E���Q�&5v���p+8�(��8w,�!��Yz!�|偌}��<� ���s� ��;����� "#���w �~�:�4C^�pK}�N�#���(=3=G�(G��K��K���C^��|��W��a��b������z� %�K��I_�G�@�a������Ŗ���"���o�T�����oҥ���m5�S�K~�����w+����62��0����5�e,�m���F�������l<-��� ��B1�9�x� N a����z���=���l3�Ā�H�뉁S� N�$�mȌ����h��wh�$�e����.���v�C^�!wa�#�eG��AlV=��(� �YJ��.^��t��������~C^���|��9��n����n���n���G��}�\F������ p���~�����_%����}"��(������~�Z ���.�:n� U� ��K�K2[��r7��z(�P�ܚ�����������y� ���u���,�v��=��U�f��|(�8y�����[���8 )����=�(��!e-����m����m7���@�䌟���� ��h��!Y-�c �������s�� �� �����[����!�cE��.�]�����)��j5���# �:�B��(���T��T��������+���,�������m�� �.h�g���������}����"×�x��}��|����+��%m���z�,� ���u��A���m��o���:����:�K7 ��o�K��:����2 � ��u��<�@[3"�.�z%����!�i�U���p ����b�#��{ ����i�CJ���������YJ����� �4C^���KK �� �:��G����~�:�h�#~�:�~�:�ğ�ۋ^����G���|���K�)�o��n���h�#n��Us��n��wN��n���n���o �n����"��]����"�ğ���o��� p�����������@�g��k� #���~�������䉀��v�Q�6��� 醉�9?��������p����пN�m�������m��H^����l���89��뙇����������_vG�����W���K�l;xy1�?��n���� �E=*v��!����q�$����6��������i=��j����|� �S�P�����w�������V�Fx띇5���3�����J�z���R�*I�����G.�8&��������C<�V����{-n�V�� �3�j)��.����씀���������}"`��n��i�C��+V��T)ѭ4Bg�j��"���8����K����H�{���,��!1�5q�z� �����_�0�����~�*��YJ�9�w+��~�������J��+�����F����P�����������l����"KF����� �t}*������"k��}� ���������-�%��|��)���V�����Cs�D��� ��� �� 6�!�"��zS�I�u�� �ǝH$��� H$ �`��܏z���#7��n��}m������m���b7炚|k ��q@���*���TZ�(�?�K��� ��(�?���A����!���������?���A����!���������H��8y��v��c�n�|-�3��C$������������������z�A�z��)��q� �:���f�������$�vG�C$~�V6��) |�}�o��\�~�֠\�~�����@��\�ﮎ����� ��t���S��}"3�5}�����6�i�������_{V[���� ����v@큍���h���p ���������k�w���b��]���������Td �x�d�����+��x�S��S��� �J���w�\8I�x4�� m���2�m!�xc���������|4*��$瓇� 5�{�*�CsT]��T�w�}%�����v��������������}���o�����o�� �~C<��������C<��:� 5�*����A�w�jp+����j� �C$s�� �5��w�lx鰌��~�y��Us�C��x�Y3�n��G���C^�,�@��S�b ��o��{$Wꅏ���!�c��}6I"�UZ}��R�k2��3����eG��F�%����Vs���w����Al�.s"��Al�.s"V=�W�f82`��������c��{�SW��(������� ��=����u�%r���8���r�օ������|�C^��A��f�������� s G���h�#��뭋�^��Us�C��q�Us��p�������ꔀ�yK� ��YJ��"*����n���9����n�uq������.�� G�e�h�#^��G�������G����yr�JA�f���t�����K~�:Us��~�:wN��~�:�"~�:���n�����~���.������wN��� �����C���C^�KK��}�����K�����c�����4����������������������9�����G��������A�������Dz��L �A��C������n�� G��n��Us�C�����n�� �n��C��n����zZG���I�,�� G���.���z�n���.6��������K������A� 3��n��C^�L#�p���������kz(�6�KT�1���x� ��:�k9 6�����-� �����f�F�-z��D��i���3pI��+pI�xu�R���q��k�+��|�����圃���KT�� ��S*��������A����H$-� ������w�l-J�+�������^^��K"� @�����8�� ����*�΀ Y�@���}��+\�8�o��}m�����!�c���t�(�����$��"�������t�Y<��9�x��h��F����0�f�V���m��#��wz���ﱍ��D1�FM�s~Y���S��8�o������Y�G��e� d�-�Έ{q� .�a|���U���+Us�[i䷂:�1M�+��r� �s�[��x�\��F�������J�t2��_��[�C=A}q�n�������������������y�na�[�C=A��������������xy1�#��n��n���s����Al��%��Bg�� 5��b"p����S�E=/�E=�6�E=�%Q��@����5�����i����S#�T����N!���vn��S���:�#Z �n����/�{C$�$��p{�1䃉7+��%�Bgf�� %��%����������z�� ���� � |����색6E�a!dn�}��v�i5v��|���~�_����q����$Y���8��� ��C^��w���N� ��������'��j�L�x+]/���$�3�C=��5��<�L�}���x��.���4��ꚾ����w�.�1H^����2���B52��5��5�������6H���������?���������9 �6g�9 #�e������u�z���� � ��i�fn�)���3x4�Y�y����)���������������������%�n�<�� ���wtU/�l�������j������!m�F�f&� ��,���k��}��󅋘�v��x�e�愋����b��Yz ��BOʼn���w�U"�Vs:� �}��-艌�t����w���V[c"g��������x�C���t��Ԋ�@�S+ oY�����m��Fo�� 5�N���@�/���%��4��v"-g��O!�C^�m3�F�=G�񒊌������흂4k,��x��v�����.�z���u��������)�6I�~�H����r)�mn��h�,�������,$��qA�q�!�����Fv��Oi� #���0�2씏����������*zC?�������������F�~����e������v8y���U�W����~����p=�?,-I����m��!���D1������ �}��Q���}�����T�X�x苩2�����}�u�����.�P���������A����4Hq9�l��aV�{�u�զ�#�ak3�F���v�А���f)�aV��@�p w��I�r轘 꽈�� ������� ����w�+:ё��艌��"�<�p1������B������������6��D�b_�������0��f����c��p�O������ 3s�t����s�t���� �������,�*�O�i�f� ���������`����`���l-�z���� ���,����5�5�������w�����~�6���;e-�KT�1���������������������������~e�� �������������������%"�����FP�Q��������a���/�����z~�~��B�� U����D� ��z�@�&�t� �D��3�V��d����T���q��i䈔�1����a����a��m.�������T���� ���P����yI��x��#���r�t�����}m�F�5����A����KT�ք9�����ӿ�����u���Q��0�{� l-�_ �!�\��&���A ���?�.�1�������徭�.�z�}�}܈��擛s��씐*V�� ��靓������.�٬� �c0!���y7����_����琘�)i Y��2�9���@���vf���"��b������g��n��� ���}裄�鬐�������8\��~f��؈��@�9��k)����L������������!��vG%�!���������d�z<ꑂ��T�}��k��G��G�d�z`���f��.+�}��F�����댋��5F鍇�俍���Nb� ��5����xQ荇 ����+��1��o���*\�u��� ���������b�����o��j�j�����v'�KT�1�������������'���w������c�2���x�d�謎 L�sU^�V�&����!��#��=��x�v"=���g�G�"�C���9����������`������i�/����}��k:�����!\���l-��!�z���%Gp�mw�1V���$������������z-�����m�}�!�z�5D1������om�_�m��u��_����������)�1���wzXX�m�5���z]��-�z�@���p���F��O��*\�}��O��*\�}�,��@�����C�l����5�+�̈́kz9 �!#7��U� ���"���}�8���8���D�Y�@� N�i`��������b��*\��������E�b���l-�wz�}�6(��k�~��>1w{����젔����=�7���k��_Cf��H^�B�������/���� ���������:�q��*S� `����W��:T&3p�lk� �o�/��������5俗i��V�A�p���l���t���K��"�9u,�N�t��������S������������γ�L��`�?bM�!#�%��0�*9��e-��0�^���|Pg�u�������V� �����>��|�,������'I�������€�#��[r����R�� �k#n��d�BJ���f0��Y<�q��=G�{�-���� mf&�6�g��*GRH�$����l��䗿s=�(���y�}�[�H^v���K����j�x�Q������z���9|(�*m/�+�������z�hr�#�P W-��G� ��o�OK�x��3�)�3�*+�����~��]� 㘌����m��6���nn����� ���!�%�Y��F�����dJ=�����.Y>���a�/�:�k���D1������ 4����7 ����j�x���4�����B�2 �������m�����(y���A��������Q����t�|�m���V��Jo�H������w�)�zf뒍퇋� ����j����n������ 6������N��b� }�Z��8���rQ�2�����kn��2����qZ���H�뉊��.�t������d�"k�� V $'��'���vG�5�2��z�*FH���w�4����v�w��1���||��I���n��j������79���yH�3����������?6�] ��)6�넅��l��3�� ��R��"�t�P���z���x7�����*�������.��b��x�5ꌏ�"����!�n��i�U�(�c ��gm��ї������� �8+��b �v������vd�� 1��-� ���z� �tCs��mP���*��x�n��t~�T���,����O��*\���m���z���|����l�� ����O�v�z� ���~f�vG�����d���@��R���"� �'":����K'�cdt�à\k������u���s��Q[� #���k��B�=��*�l��~�f뛉��f�z�3�x����,�G������� z~��Q�C$.��|�# ����*������!�5s��/���a�0=�������� ����e씀&��)�! `�,�+����w ������&��)���B+ҋ���t��w��by� �C=� ���Z�/*I��R�NC���#�H��#�K�`��)�+ꍇ����K�~�o�Ю���`��>~����� DyD� ������!�!~����p��;��K�#�M�V%"�����C����e�k�=�����z� �� #�f0 迄�����z0��A� �V[��������6���Z��^�x� ��>�ꋠ\t����b�X>��2������(��o!��$��ʼnt+#�W�)���_�)��e/����t�b7����*��o���z� �ĉ��錂��L_��w�b휂7�}�7�u�@����o琘�����"�#� _��o������C��� ��yy��T�s'�T4����3柂��h����B���������\v����I y����v���}�)&��c��)������䉁�s�����䖳뉤��ׇ�j��������5�k+�딀uq�%���j�.�n~f�u���ʼn� ��:���5�2��k�t�Yq����x���}���M�(i䌟�)��6��D� �}��9������v��2��� ��q�j��Z���b��z� �hp+kf� ��$������*I� p��� .��KTO�~`� ����:���mz�}��v�O����w����t#����s��Z�]�6��=� �6�K��;v����%���r���O��~��v4��|-��#ynK�8�z���� B�q��r�6��7 �#���9����!:-f2J���r����vG�h0s��h#�PG�T}/������*� �l��\.�*G���z6����>�6��A�s'Rv~��P������"���n� (�??�?<����-��~�%"�u����'���"�v���8@� �o�y�8�H3�%���&����LN�x��뉓s"G돌���tU-�z;�B\��l����dU<������t~������/�� ���`�0��l3��̈́��i =����m~���� ���)���y!���� %�9���R1�Q����w�+��L�!������?�q�������M�������C����l-���=;e/����u����T�����P�a�[�C=�2���kCq�2�u�n9=��H��i5b_w��^2=�*4�%�����g��t�U���_ t��W"��"��w��YF���T��{������.#������苅2��M��� �������:6� �����4P~l����������!���j��_v�h0���l钖�N�@��������宵���(?� ��t�����j�2��5�U�(xD�#�F��������H^����6���@��2 y�� ���ĉx�@�z 3��<�?������5;���BE�����ׇ��� pF�����S��#!�<ԕKI����4��~fぱ��v���� ��������l�~�6�|�������l,����()�\<���|��o �t����t��$�����~�������rC<�(���%�1�'5 �S�'P������ ��$�3����n 聸� ��*I��*y���R�����N��*��3���'�ń�(Y ��𧌋6�Cs ��"/������������ p�S� ��As ��5������4=* ������F���� Y�O�6����J�w�B���u�#? �Y}��n�0漓��~�'���s�$�p�������u���"� �f��Q���hF �r)�a^�aiv���� �N>���Q�zN���� ��I`��������%�tt��w��zt+F;|�Q7P��v��uLNc�덂���Bg���SU�����8 ��z��%�(��Z��j2�[�1J���x7��v/�2/A�]�D��r������ ��o���%��@���-�������������� ��J���€馉�:9d�z)�x��4�0��w���&������ґ����O�� n��P7�M�(v��"��e��!���v��迱x������ta�H$��������!��9u��m�q���, ��x��[p���������"1������<�`C��*���2A\���T�����֢ ?�v��H������V�F���(�{����Y����+���3��������l��������h3@������� I>����F)���8��}�)��l-�H��}�����c�D��%�nF����f&�p N�����&�!�_c�wVʼnў����In䢟F��k��\���� �g ��u��I��Z9 �(������(�:�/�^�Z~�V�+�6m֛������ � ��������.1v������ZC���w/3���z-����z�|s���%�$�z8�����*}�Mux}iu�|��^���n�B띌r � �n��:������%G-�x�����F ��W?�� N0 � N�� �KT� �~�p��������h���n���w�����bB~f�����m��C?,������*�,v�&��2�����l�f��������cG�襠������x���p >�l�d ��'�����z~�����!���'�&'g�&'����, V4P��&�&��'n�2�n�z��Y��������n������$� ����|4�-�����~����")��b���&��&� ��|�����r1`�����v�R�gT��B���k��'T�����}q������$�%4��I�����N�6T��!I��� �~�3�~n�����0���N>�1�����p�@ � �R���� �k�� � 1��7��!�ryQsV �Q`�C������;���g?�p���������n�b�}��%"}�������%#%�0��),�>�����M�P���)�����RR���rn ��������o ��*������� �!��*I�`N`�!>�z0��$���탸����%M 'M�:�Mn|~�� P%�)>�n'� �Y���� �4��~���jW;��Z@��#e���l;-��3��2 ~�y ��0 �����x7� ���%�� �����c�8���b퍠���(�j<��:�x�뉂�t����vG�kH����s����xH^�.�����r��;��䤊2�mmm9mm9�u�&��2 �M�,�78��2Dn�#�h�:8y��QƊC��2 ���Y-�gm�4t�F8�"���`��0��0 I��z�7�?�C����q�����ygņ�������-��<#_�!\�� �������f&��z�5�s"p������y�/�h���+�q�����+��T�����2j��<�� ���B�gg:�yFh3��ICs�mB��7��2�Hi�ag����������[����1��6���z�9��I=�����m��n�B�������F*�a��������b�}����P��G?�����kB�V6�H���Q�L���~�s� �����������o�!������㈐�-��hp+F鮂4Bg}m��U��g=����G:���F��O�� �m��D1�m��9���m���K�}���q���,������q���,��N���{l,|;� ��V��o�C=���G�(������%�,��i�B�B�q�r�,��滑��"�q���#� Oń��낌Dꗈ�"q�)�� D1��A|b�A�$��句� �6�m�����)��f�,����iD����������A] �����`�f�����\*�����_ �{$���:pI������C���������K������YJ����񴆀��6�*���~�����H^��������6�S�*��e��3��s��Ļ ����|����L���f������a�����.�g��B��偛���(�#��(�f&���1u���1$�&�~�:�bꌀ�f& ��}�m�_��*p��\q���6s���������z!|(����H-��!������ �� �5�=���롒��lC=���Dw�� ��r����������"�K��Q<���}�π�����q���Ү��o�H�|�~"�ۆ�t�8G�(��P��S��� ~%��Kf�a�����>ꍷ� I>�j�}�o���?I�������� ���x�k6�x�� `�WfyÇ�5�ĉ�,>�j����������W���"��5����6�a�[3������9��u�����4g���>���E~~ta��D�a: � ��Sb���������C��2 &�.��S���� � ����#�����������g�� �b��*�����*\�V��u����t����뉔j�r��������D��F�8yX�^��+"{����䁌�7� +V�v���*I0�����9�Ws��S��-����( ���5��s�(VYq8l��!䃋�� ����S+���wE���=� 3�<��p��XEs?u�S��X�zV�.��X�����������|������)��{��� �.}� |�0���|�����m�1 �,�D��D�����U���� ���K��� �6�聪��F�A�V���� q���x�{ܴ z���C�� �w��{p��j�����w�KT�P �Z��5�7��ʼn����M t닂�C=A�e����䓛��kK���&����y�������UJ��j��t�������6�|+���5����l�,��$8Qf����,?� {��6�b��ZY^�d��ӓ�%��x ��+������x��釅`�z��?�V����� 퍂��2�� *I����88O��?�{*I�-艊 暉7�s�� ���C��"|�y��s ��lZ�61���І q�%���3c��v��V6�O�������u���濌����P��|S���}���j�����3 O�u��,� |�qh�茉�(�?�2�����xy�������t�览 }G���E��� S��������3聪� !� ���� fo�-���kR�f�䚊����`���`h3�B�$� � ���Y�b4"ꌷ�������k�*��5l���5b"p����{��������:�\���0��9�j�x7r�����n�*��[�g:�%���������8�}�{���b�x s��0���e��L����F�'�������R�w��舷\���g���������*씉H��}���8y2��˃ꬑp+���N����� �S����}���� ��o�(�*��f���� �|+������#��m%0�=�\������6|4tO��FM�,��t��qV�������(���셬�kCJ�a��e-��e-+�C��� R���������%��v�{p�s�� ��l�3�瓈��1��2��l����v���}�*� �o��������}��s����=� 3iA�qĈ�h3���:�'6���UJ��������� I>����Wq��{k��wt��j���bT�T��� ���r��2w�L{��������x���FvG��S�2���. ����,�p��%0��*I.)��������:8XE�X����X�n�?�����?��?���A����!������������V�)�w��������{�*����Bg{�\2���� �����vO���z呗�M�o�%��T�����P������j�,?�������1V������}��%F��k�`E�ө���z�萱+���~��v�c�:|���:���� &2B� ����L���z;�9瓟���A���7���a=9��� ������L,�)���|��_�=���_�=*�}��|w|�o�=�������#�}"N�������w���,Nt��$�/�f��k}��*}�]y��L}[�JF�!���jW�!�b�A�A��`��±��`�n������dzrs�����䁀���x�� �t�� ���-�����1��K��%�����5����������� .�&�<�t����g�A���d�oKT���������=�e`i0����1���o��.��!��.J .������.� ���1��C��C-�vr����c��雅 ��#��~��84��2��u��i�.�푃�%��� ����,���p�����w��i�%O��2򝋅���17�����tj������,�������������Y<���2/�7�?� ����)�����큚��艌黕�}���=���@�v�#��.������Y-� �����#�Ѕ�G~䜂 �|(��6������u��5�7䉎�倇 j �xQ�9����r� �b"p��� ��y�閳�}u�M �,��*I"�b���O9�cE������*�T�z�/�����ta;����#e*+�醅�x���������V�2,�H,�䚊�b������5��@� N�_��x��8S gp��z�BJ����|�r�*w���cGa;�*I?�f���{$��������x7KKF"cG���@�KF���L���LN�@��)�����'���t+������B��������d �LJ� �h�1�툙K@�t+z���~��*w<~�7��t��������8��(�D�"��D�$����q�����GZq��q$y�P�?P���N����������G� ��!��y�$=��y�����|�9�a�u~����yyP�����u�s"��!��}��}���{��*+�~+� ��)�D1vG��� UJ���0�3�9�K�}�.���1U�������i�)��D� �LJl;"(�� ���~�����@�}���6����������錛��,�D1�������8s����� ���aKt�8���� ��`��M7��Ȋ�������Y��"�W�{q�k ��%E�l,� Bz �Ō�Y-�π�����x���gs�n��v�z��k��(���W���a�����W� )ѭ46���BE.-6�����`�D��A����7�l꜒ �2��9�wh��6�P ���G�Fo ���j�c��U^��| U^[��D1�g�� `�|������.��������LJ���B����6 `�Kt�����#HJ���T�y�z�@�z��h �z-��"猑&������;Q��o�x��x�b���9�u��Q���pI戂���2"n�퐖�u/�-��� l-�� ���q��B��{-�l-�l��l @|4�y�,ߵ��넌ߵ�~��8�]��|���.��9 Dõ�� ��xQ薃�M F���_<�(퍇��z=�4�"*����8��x�kK�%�N���|S���9"��yÑ�����!��E!�����㜒�� ��&�#j2[?F�~��z�;�z�e��a9��4>����%��~���l�5�~�������H��Y댃�*�d�/������^�}������a#�s����eGr1��& =� `�&�{,䤈kn4��7������� ��x�f��6(��� �8�%��O������o,���ׇo薝��o�L�|�~f���Ц���pb"�~��C-���2�T�2�T��Z ��wh�~��������1<�E�1�5��B�z���~�6�:�� Z�趖�j)�����e�&� �C-�F� 5ꗓ}9*���8v9��횾��~���2���)��K�2[�#�K����9J��H�뉘��T9����f���/��!��吱 \s(�癊�i�R5c��p���ቦ���}����x7�����������pn� ��:����H$���L�/��4�I�G��C`�8���&Ii��)��?<���3i佀����Q�=�_vG9�$��V[� ��z� p7� p� �����%G-�7�k�jW�I�Bg�EeqA��x�����Iz� �t����� �� �����n�:���&5|�@�𹋙-���䁉���o���S�t�����*����:�3�� H�� ?�����=�cJ�v���j��?���r���e`?�q�����bM�{l��������2���Bw��n�x����H��@�B�����֚�7����=��ql�g�-�n��4u�q��ta;��w��"n�wπn��}���f�h-����w��.荎 ���K2 ~-�i���`�����䕓��w�?���@���T�����~+N��Y���J~��D�q�E���Q����+�0K:`=�B�DIG�M�Q�X�dh{j�p�wD���*�t���;\������-�z�R���K�p�O� ��"�������� �����4���6.%�C0#���u�?giɽ��d}H��~Y*�P�N�yO{���dB�)ޢ����Х�j�@�[INST] Assign output of os.system to a variable and prevent it from being displayed on the screen I want to assign the output of a command I run using os.system to a variable and prevent it from being output to the screen. But, in the below code ,the output is sent to the screen and the value printed for var is 0, which I guess signifies whether the command ran successfully or not. Is there any way to assign the command output to the variable and also stop it from being displayed on the screen? var = os.system("cat /etc/services") print var #Prints 0 [/INST] From "Equivalent of Bash Backticks in Python", which I asked a long time ago, what you may want to use is popen: os.popen('cat /etc/services').read() I'm told that subprocess is a much better way to solve this, so here's the corresponding code: import subprocess proc = subprocess.Popen(["cat", "/etc/services"], stdout=subprocess.PIPE, shell=True) (out, err) = proc.communicate() print "program output:", out [INST] Use of "global" keyword in Python What I understand from reading the documentation is that Python has a separate namespace for functions, and if I want to use a global variable in that function, I need to use global. I'm using Python 2.7 and I tried this little test >>> sub = ['0', '0', '0', '0'] >>> def getJoin(): ... return '.'.join(sub) ... >>> getJoin() '0.0.0.0' It seems things are working fine even without global. I was able to access global variable without any problem. Am I missing anything? Also, following is from Python documentation: Names listed in a global statement must not be defined as formal parameters or in a for loop control target, class definition, function definition, or import statement. While formal parameters and class definition make sense to me, I'm not able to understand the restriction on for loop control target and function definition. [/INST] The keyword global is only useful to change or create global variables in a local context, although creating global variables is seldom considered a good solution. def bob(): me = "locally defined" # Defined only in local context print me bob() print me # Asking for a global variable The above will give you: locally defined Traceback (most recent call last): File "file.py", line 9, in print me NameError: name 'me' is not defined While if you use the global statement, the variable will become available "outside" the scope of the function, effectively becoming a global variable. def bob(): global me me = "locally defined" # Defined locally but declared as global print me bob() print me # Asking for a global variable So the above code will give you: locally defined locally defined In addition, due to the nature of python, you could also use global to declare functions, classes or other objects in a local context. Although I would advise against it since it causes nightmares if something goes wrong or needs debugging. [INST] How to check if a string in Python is in ASCII? I want to I check whether a string is in ASCII or not. I am aware of ord(), however when I try ord('é'), I have TypeError: ord() expected a character, but string of length 2 found. I understood it is caused by the way I built Python (as explained in ord()'s documentation). Is there another way to check? [/INST] I think you are not asking the right question-- A string in python has no property corresponding to 'ascii', utf-8, or any other encoding. The source of your string (whether you read it from a file, input from a keyboard, etc.) may have encoded a unicode string in ascii to produce your string, but that's where you need to go for an answer. Perhaps the question you can ask is: "Is this string the result of encoding a unicode string in ascii?" -- This you can answer by trying: try: mystring.decode('ascii') except UnicodeDecodeError: print "it was not a ascii-encoded unicode string" else: print "It may have been an ascii-encoded unicode string" [INST] Create an empty list in python with certain size I want to create an empty list (or whatever is the best way) that can hold 10 elements. After that I want to assign values in that list, for example this is supposed to display 0 to 9: s1 = list(); for i in range(0,9): s1[i] = i print s1 But when I run this code, it generates an error or in another case it just displays [] (empty). Can someone explain why? [/INST] You cannot assign to a list like lst[i] = something. You need to use append. lst.append(i). (You could use the assignment notation if you were using a dictionary). Creating an empty list: >>> l = [None] * 10 >>> l [None, None, None, None, None, None, None, None, None, None] range(x) creates a list from [0, 1, 2, ... x-1] # 2.X only. Use list(range(10)) in 3.X. >>> l = range(10) >>> l [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Using a function to create a list: >>> def display(): ... s1 = [] ... for i in range(9): # This is just to tell you how to create a list. ... s1.append(i) ... return s1 ... >>> print display() [0, 1, 2, 3, 4, 5, 6, 7, 8] List comprehension (Using the squares because for range you don't need to do all this, you can just return range(0,9) ): >>> def display(): ... return [x**2 for x in range(9)] ... >>> print display() [0, 1, 4, 9, 16, 25, 36, 49, 64] [INST] Deleting DataFrame row in Pandas based on column value I have the following DataFrame: daysago line_race rating rw wrating line_date 2007-03-31 62 11 56 1.000000 56.000000 2007-03-10 83 11 67 1.000000 67.000000 2007-02-10 111 9 66 1.000000 66.000000 2007-01-13 139 10 83 0.880678 73.096278 2006-12-23 160 10 88 0.793033 69.786942 2006-11-09 204 9 52 0.636655 33.106077 2006-10-22 222 8 66 0.581946 38.408408 2006-09-29 245 9 70 0.518825 36.317752 2006-09-16 258 11 68 0.486226 33.063381 2006-08-30 275 8 72 0.446667 32.160051 2006-02-11 475 5 65 0.164591 10.698423 2006-01-13 504 0 70 0.142409 9.968634 2006-01-02 515 0 64 0.134800 8.627219 2005-12-06 542 0 70 0.117803 8.246238 2005-11-29 549 0 70 0.113758 7.963072 2005-11-22 556 0 -1 0.109852 -0.109852 2005-11-01 577 0 -1 0.098919 -0.098919 2005-10-20 589 0 -1 0.093168 -0.093168 2005-09-27 612 0 -1 0.083063 -0.083063 2005-09-07 632 0 -1 0.075171 -0.075171 2005-06-12 719 0 69 0.048690 3.359623 2005-05-29 733 0 -1 0.045404 -0.045404 2005-05-02 760 0 -1 0.039679 -0.039679 2005-04-02 790 0 -1 0.034160 -0.034160 2005-03-13 810 0 -1 0.030915 -0.030915 2004-11-09 934 0 -1 0.016647 -0.016647 I need to remove the rows where line_race is equal to 0. What's the most efficient way to do this? [/INST] If I'm understanding correctly, it should be as simple as: df = df[df.line_race != 0] [INST] Pandas writing dataframe to CSV file I have a dataframe in pandas which I would like to write to a CSV file. I am doing this using: df.to_csv('out.csv') And getting the error: UnicodeEncodeError: 'ascii' codec can't encode character u'\u03b1' in position 20: ordinal not in range(128) Is there any way to get around this easily (i.e. I have unicode characters in my data frame)? And is there a way to write to a tab delimited file instead of a CSV using e.g. a 'to-tab' method (that I dont think exists)? [/INST] To delimit by a tab you can use the sep argument of to_csv: df.to_csv(file_name, sep='\t') To use a specific encoding (e.g. 'utf-8') use the encoding argument: df.to_csv(file_name, sep='\t', encoding='utf-8') @3[INST] Shuffle an array with python, randomize array item order with python What's the easiest way to shuffle an array with python? [/INST] import random random.shuffle(array) [INST] BaseException.message deprecated in Python 2.6 I get a warning that BaseException.message is deprecated in Python 2.6 when I use the following user-defined exception: class MyException(Exception): def __init__(self, message): self.message = message def __str__(self): return repr(self.message) This is the warning: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 self.message = message What's wrong with this? What do I have to change to get rid of the deprecation warning? [/INST] Solution - almost no coding needed Just inherit your exception class from Exception and pass the message as the first parameter to the constructor Example: class MyException(Exception): """My documentation""" try: raise MyException('my detailed description') except MyException as my: print my # outputs 'my detailed description' You can use str(my) or (less elegant) my.args[0] to access the custom message. Background In the newer versions of Python (from 2.6) we are supposed to inherit our custom exception classes from Exception which (starting from Python 2.5) inherits from BaseException. The background is described in detail in PEP352. class BaseException(object): """Superclass representing the base of the exception hierarchy. Provides an 'args' attribute that contains all arguments passed to the constructor. Suggested practice, though, is that only a single string argument be passed to the constructor.""" __str__ and __repr__ are already implemented in a meaningful way, especially for the case of only one arg (that can be used as message). You do not need to repeat __str__ or __init__ implementation or create _get_message as suggested by others. [INST] Retrieving the output of subprocess.call() How can I get the output of a process run using subprocess.call()? Passing a StringIO.StringIO object to stdout gives this error: Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 444, in call return Popen(*popenargs, **kwargs).wait() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 588, in __init__ errread, errwrite) = self._get_handles(stdin, stdout, stderr) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 945, in _get_handles c2pwrite = stdout.fileno() AttributeError: StringIO instance has no attribute 'fileno' >>> [/INST] If you have Python version >= 2.7, you can use subprocess.check_output which basically does exactly what you want (it returns standard output as string). As commented below you can find sample code and a more detailed explanation in this other answer. [INST] What is the most efficient way to loop through dataframes with pandas? I want to perform my own complex operations on financial data in dataframes in a sequential manner. For example I am using the following MSFT CSV file taken from Yahoo Finance: Date,Open,High,Low,Close,Volume,Adj Close 2011-10-19,27.37,27.47,27.01,27.13,42880000,27.13 2011-10-18,26.94,27.40,26.80,27.31,52487900,27.31 2011-10-17,27.11,27.42,26.85,26.98,39433400,26.98 2011-10-14,27.31,27.50,27.02,27.27,50947700,27.27 .... I then do the following: #!/usr/bin/env python from pandas import * df = read_csv('table.csv') for i, row in enumerate(df.values): date = df.index[i] open, high, low, close, adjclose = row #now perform analysis on open/close based on date, etc.. Is that the most efficient way? Given the focus on speed in pandas, I would assume there must be some special function to iterate through the values in a manner that one also retrieves the index (possibly through a generator to be memory efficient)? df.iteritems unfortunately only iterates column by column. [/INST] The newest versions of pandas now include a built-in function for iterating over rows. for index, row in df.iterrows(): # do some logic here Or, if you want it faster use itertuples() But, unutbu's suggestion to use numpy functions to avoid iterating over rows will produce the fastest code. [INST] Why can tuples contain mutable items? If a tuple is immutable then why can it contain mutable items? It is seemingly a contradiction that when a mutable item such as a list does get modified, the tuple it belongs to maintains being immutable. [/INST] That's because tuples don't contain lists, strings or numbers. They contain references to other objects.1 The inability to change the sequence of references a tuple contains doesn't mean that you can't mutate the objects associated with those references.2 1. Objects, values and types (see: second to last paragraph) 2. The standard type hierarchy (see: "Immutable sequences") [INST] When should I use uuid.uuid1() vs. uuid.uuid4() in python? I understand the differences between the two from the docs. uuid1(): Generate a UUID from a host ID, sequence number, and the current time uuid4(): Generate a random UUID. So uuid1 uses machine/sequence/time info to generate a UUID. What are the pros and cons of using each? I know uuid1() can have privacy concerns, since it's based off of machine-information. I wonder if there's any more subtle when choosing one or the other. I just use uuid4() right now, since it's a completely random UUID. But I wonder if I should be using uuid1 to lessen the risk of collisions. Basically, I'm looking for people's tips for best-practices on using one vs. the other. Thanks! [/INST] uuid1() is guaranteed to not produce any collisions (under the assumption you do not create too many of them at the same time). I wouldn't use it if it's important that there's no connection between the uuid and the computer, as the mac address gets used to make it unique across computers. You can create duplicates by creating more than 214 uuid1 in less than 100ns, but this is not a problem for most use cases. uuid4() generates, as you said, a random UUID. The chance of a collision is really, really, really small. Small enough, that you shouldn't worry about it. The problem is, that a bad random-number generator makes it more likely to have collisions. This excellent answer by Bob Aman sums it up nicely. (I recommend reading the whole answer.) Frankly, in a single application space without malicious actors, the extinction of all life on earth will occur long before you have a collision, even on a version 4 UUID, even if you're generating quite a few UUIDs per second. [INST] Getting the index of the returned max or min item using max()/min() on a list I'm using Python's max and min functions on lists for a minimax algorithm, and I need the index of the value returned by max() or min(). In other words, I need to know which move produced the max (at a first player's turn) or min (second player) value. for i in range(9): newBoard = currentBoard.newBoardWithMove([i / 3, i % 3], player) if newBoard: temp = minMax(newBoard, depth + 1, not isMinLevel) values.append(temp) if isMinLevel: return min(values) else: return max(values) I need to be able to return the actual index of the min or max value, not just the value. [/INST] You can find the min/max index and value at the same time if you enumerate the items in the list, but perform min/max on the original values of the list. Like so: import operator min_index, min_value = min(enumerate(values), key=operator.itemgetter(1)) max_index, max_value = max(enumerate(values), key=operator.itemgetter(1)) This way the list will only be traversed once for min (or max). [INST] Python: Why is functools.partial necessary? Partial application is cool. What functionality does functools.partial offer that you can't get through lambdas? >>> sum = lambda x, y : x + y >>> sum(1, 2) 3 >>> incr = lambda y : sum(1, y) >>> incr(2) 3 >>> def sum2(x, y): return x + y >>> incr2 = functools.partial(sum2, 1) >>> incr2(4) 5 Is functools somehow more efficient, or readable? [/INST] What functionality does functools.partial offer that you can't get through lambdas? Not much in terms of extra functionality (but, see later) -- and, readability is in the eye of the beholder. Most people who are familiar with functional programming languages (those in the Lisp/Scheme families in particular) appear to like lambda just fine -- I say "most", definitely not all, because Guido and I definitely are among those "familiar with" (etc) yet think of lambda as an eyesore anomaly in Python... he was repentant of ever having accepted it into Python and planned to remove it in Python 3, as one of "Python's glitches", and I fully supported him in that. (I love lambda in Scheme... but its limitations in Python, and the weird way it just doesn't fit in with the rest of the language, make my skin crawl). Not so, however, for the hordes of lambda lovers -- who staged one of the closest things to a rebellion ever seen in Python's history, until Guido backtracked and decided to leave lambda in. Several possible additions to functools (to make functions returning constants, identity, etc) didn't happen (to avoid explicitly duplicating more of lambda's functionality), though partial did of course remain (it's no total duplication, nor is it an eyesore). Remember that lambda's body is limited to be an expression, so it's got limitations. For example...: >>> import functools >>> f = functools.partial(int, base=2) >>> f.args () >>> f.func >>> f.keywords {'base': 2} >>> functools.partial's returned function is decorated with attributes useful for introspection -- the function it's wrapping, and what positional and named arguments it fixes therein. Further, the named arguments can be overridden right back (the "fixing" is rather, in a sense, the setting of defaults): >>> f('23', base=10) 23 So, as you see, it's definely not as simplistic as lambda s: int(s, base=2)!-) Yes, you could contort your lambda to give you some of this -- e.g., for the keyword-overriding, >>> f = lambda s, **k: int(s, **dict({'base': 2}, **k)) but I dearly hope that even the most ardent lambda-lover doesn't consider this horror more readable than the partial call!-). And, the "attribute setting" part is even harder, because of the "body's a single expression" limitation of Python's lambda (plus the fact that assignment can never be part of a Python expression)... you end up "faking assignments within an expression" by stretching list comprehension well beyond its design limits...: >>> f = [f for f in (lambda f: int(s, base=2),) if setattr(f, 'keywords', {'base': 2}) is None][0] Now combine the named-arguments overridability, plus the setting of three attributes, into a single expression, and tell me just how readable that is going to be...!-) [INST] Python multiprocessing.Pool: when to use apply, apply_async or map? I have not seen clear examples with use-cases for Pool.apply, Pool.apply_async and Pool.map. I am mainly using Pool.map; what are the advantages of others? [/INST] Back in the old days of Python, to call a function with arbitrary arguments, you would use apply: apply(f,args,kwargs) apply still exists in Python2.7 though not in Python3, and is generally not used anymore. Nowadays, f(*args,**kwargs) is preferred. The multiprocessing.Pool modules tries to provide a similar interface. Pool.apply is like Python apply, except that the function call is performed in a separate process. Pool.apply blocks until the function is completed. Pool.apply_async is also like Python's built-in apply, except that the call returns immediately instead of waiting for the result. An ApplyResult object is returned. You call its get() method to retrieve the result of the function call. The get() method blocks until the function is completed. Thus, pool.apply(func, args, kwargs) is equivalent to pool.apply_async(func, args, kwargs).get(). In contrast to Pool.apply, the Pool.apply_async method also has a callback which, if supplied, is called when the function is complete. This can be used instead of calling get(). For example: import multiprocessing as mp import time def foo_pool(x): time.sleep(2) return x*x result_list = [] def log_result(result): # This is called whenever foo_pool(i) returns a result. # result_list is modified only by the main process, not the pool workers. result_list.append(result) def apply_async_with_callback(): pool = mp.Pool() for i in range(10): pool.apply_async(foo_pool, args = (i, ), callback = log_result) pool.close() pool.join() print(result_list) if __name__ == '__main__': apply_async_with_callback() may yield a result such as [1, 0, 4, 9, 25, 16, 49, 36, 81, 64] Notice, unlike pool.map, the order of the results may not correspond to the order in which the pool.apply_async calls were made. So, if you need to run a function in a separate process, but want the current process to block until that function returns, use Pool.apply. Like Pool.apply, Pool.map blocks until the complete result is returned. If you want the Pool of worker processes to perform many function calls asynchronously, use Pool.apply_async. The order of the results is not guaranteed to be the same as the order of the calls to Pool.apply_async. Notice also that you could call a number of different functions with Pool.apply_async (not all calls need to use the same function). In contrast, Pool.map applies the same function to many arguments. However, unlike Pool.apply_async, the results are returned in an order corresponding to the order of the arguments. [INST] Initialize a datetime object with seconds since epoch The time module can be initialized using seconds since epoch: >>> import time >>> t1=time.gmtime(1284286794) >>> t1 time.struct_time(tm_year=2010, tm_mon=9, tm_mday=12, tm_hour=10, tm_min=19, tm_sec=54, tm_wday=6, tm_yday=255, tm_isdst=0) Is there an elegant way to initialize a datetime.datetime object in the same way? [/INST] datetime.datetime.fromtimestamp will do, if you know the time zone, you could produce the same output as with time.gmtime >>> datetime.datetime.fromtimestamp(1284286794) datetime.datetime(2010, 9, 12, 11, 19, 54) or >>> datetime.datetime.utcfromtimestamp(1284286794) datetime.datetime(2010, 9, 12, 10, 19, 54) �,[INST] error: command 'gcc' failed with exit status 1 while installing eventlet I wanted to install eventlet on my system in order to have "Herd" for software deployment.. but the terminal is showing a gcc error: root@agrover-OptiPlex-780:~# easy_install -U eventlet Searching for eventlet Reading http://pypi.python.org/simple/eventlet/ Reading http://wiki.secondlife.com/wiki/Eventlet Reading http://eventlet.net Best match: eventlet 0.9.16 Processing eventlet-0.9.16-py2.7.egg eventlet 0.9.16 is already the active version in easy-install.pth Using /usr/local/lib/python2.7/dist-packages/eventlet-0.9.16-py2.7.egg Processing dependencies for eventlet Searching for greenlet>=0.3 Reading http://pypi.python.org/simple/greenlet/ Reading https://github.com/python-greenlet/greenlet Reading http://bitbucket.org/ambroff/greenlet Best match: greenlet 0.3.4 Downloading http://pypi.python.org/packages/source/g/greenlet/greenlet- 0.3.4.zip#md5=530a69acebbb0d66eb5abd83523d8272 Processing greenlet-0.3.4.zip Writing /tmp/easy_install-_aeHYm/greenlet-0.3.4/setup.cfg Running greenlet-0.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_aeHYm/greenlet-0.3.4/egg-dist-tmp-t9_gbW In file included from greenlet.c:5:0: greenlet.h:8:20: fatal error: Python.h: No such file or directory compilation terminated. error: Setup script exited with error: command 'gcc' failed with exit status 1` Why can't Python.h be found? [/INST] Your install is failing because you don't have the python development headers installed. You can do this through apt on ubuntu/debian with: sudo apt-get install python-dev for python3 use: sudo apt-get install python3-dev For eventlet you might also need the libevent libraries installed so if you get an error talking about that you can install libevent with: sudo apt-get install libevent-dev [INST] What is the difference between encode/decode? I've never been sure that I understand the difference between str/unicode decode and encode. I know that str().decode() is for when you have a string of bytes that you know has a certain character encoding, given that encoding name it will return a unicode string. I know that unicode().encode() converts unicode chars into a string of bytes according to a given encoding name. But I don't understand what str().encode() and unicode().decode() are for. Can anyone explain, and possibly also correct anything else I've gotten wrong above? EDIT: Several answers give info on what .encode does on a string, but no-one seems to know what .decode does for unicode. [/INST] The decode method of unicode strings really doesn't have any applications at all (unless you have some non-text data in a unicode string for some reason -- see below). It is mainly there for historical reasons, i think. In Python 3 it is completely gone. unicode().decode() will perform an implicit encoding of s using the default (ascii) codec. Verify this like so: >>> s = u'ö' >>> s.decode() Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 0: ordinal not in range(128) >>> s.encode('ascii') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 0: ordinal not in range(128) The error messages are exactly the same. For str().encode() it's the other way around -- it attempts an implicit decoding of s with the default encoding: >>> s = 'ö' >>> s.decode('utf-8') u'\xf6' >>> s.encode() Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) Used like this, str().encode() is also superfluous. But there is another application of the latter method that is useful: there are encodings that have nothing to do with character sets, and thus can be applied to 8-bit strings in a meaningful way: >>> s.encode('zip') 'x\x9c;\xbc\r\x00\x02>\x01z' You are right, though: the ambiguous usage of "encoding" for both these applications is... awkard. Again, with separate byte and string types in Python 3, this is no longer an issue. [INST] Get last n lines of a file with Python, similar to tail I'm writing a log file viewer for a web application and for that I want to paginate through the lines of the log file. The items in the file are line based with the newest item on the bottom. So I need a tail() method that can read n lines from the bottom and supports an offset. What I came up with looks like this: def tail(f, n, offset=0): """Reads a n lines from f with an offset of offset lines.""" avg_line_length = 74 to_read = n + offset while 1: try: f.seek(-(avg_line_length * to_read), 2) except IOError: # woops. apparently file is smaller than what we want # to step back, go to the beginning instead f.seek(0) pos = f.tell() lines = f.read().splitlines() if len(lines) >= to_read or pos == 0: return lines[-to_read:offset and -offset or None] avg_line_length *= 1.3 Is this a reasonable approach? What is the recommended way to tail log files with offsets? [/INST] This may be quicker than yours. Makes no assumptions about line length. Backs through the file one block at a time till it's found the right number of '\n' characters. def tail( f, lines=20 ): total_lines_wanted = lines BLOCK_SIZE = 1024 f.seek(0, 2) block_end_byte = f.tell() lines_to_go = total_lines_wanted block_number = -1 blocks = [] # blocks of size BLOCK_SIZE, in reverse order starting # from the end of the file while lines_to_go > 0 and block_end_byte > 0: if (block_end_byte - BLOCK_SIZE > 0): # read the last block we haven't yet read f.seek(block_number*BLOCK_SIZE, 2) blocks.append(f.read(BLOCK_SIZE)) else: # file too small, start from begining f.seek(0,0) # only read what was not read blocks.append(f.read(block_end_byte)) lines_found = blocks[-1].count('\n') lines_to_go -= lines_found block_end_byte -= BLOCK_SIZE block_number -= 1 all_read_text = ''.join(reversed(blocks)) return '\n'.join(all_read_text.splitlines()[-total_lines_wanted:]) I don't like tricky assumptions about line length when -- as a practical matter -- you can never know things like that. Generally, this will locate the last 20 lines on the first or second pass through the loop. If your 74 character thing is actually accurate, you make the block size 2048 and you'll tail 20 lines almost immediately. Also, I don't burn a lot of brain calories trying to finesse alignment with physical OS blocks. Using these high-level I/O packages, I doubt you'll see any performance consequence of trying to align on OS block boundaries. If you use lower-level I/O, then you might see a speedup. [INST] Is there a way to detach matplotlib plots so that the computation can continue? After these instructions in the Python interpreter one gets a window with a plot: from matplotlib.pyplot import * plot([1,2,3]) show() # other code Unfortunately, I don't know how to continue to interactively explore the figure created by show() while the program does further calculations. Is it possible at all? Sometimes calculations are long and it would help if they would proceed during examination of intermediate results. [/INST] Use matplotlib's calls that won't block: Using draw(): from matplotlib.pyplot import plot, draw, show plot([1,2,3]) draw() print 'continue computation' # at the end call show to ensure window won't close. show() Using interactive mode: from matplotlib.pyplot import plot, ion, show ion() # enables interactive mode plot([1,2,3]) # result shows immediatelly (implicit draw()) print 'continue computation' # at the end call show to ensure window won't close. show() [INST] Efficient way to shift a list in python What is the most efficient way to shift a list in python? Right now I have something like this: >>> def shift(l, n): ... return l[n:] + l[:n] ... >>> l = [1,2,3,4] >>> shift(l,1) [2, 3, 4, 1] >>> shift(l,2) [3, 4, 1, 2] >>> shift(l,0) [1, 2, 3, 4] >>> shift(l,-1) [4, 1, 2, 3] Is there a better way? [/INST] A collections.deque is optimized for pulling and pushing on both ends. They even have a dedicated rotate() method. from collections import deque items = deque([1, 2]) items.append(3) # deque == [1, 2, 3] items.rotate(1) # The deque is now: [3, 1, 2] items.rotate(-1) # Returns deque to original state: [1, 2, 3] item = items.popleft() # deque == [2, 3] [INST] How does Python compare string and int? The following snippet is annotated with the output (as seen on ideone.com): print "100" < "2" # True print "5" > "9" # False print "100" < 2 # False print 100 < "2" # True print 5 > "9" # False print "5" > 9 # True Can someone explain why the output is as such? Implementation details Is this behavior mandated by the language spec, or is it up to implementors? Are there differences between any of the major Python implementations? Are there differences between versions of the Python language? [/INST] From the manual: CPython implementation detail: Objects of different types except numbers are ordered by their type names; objects of the same types that don’t support proper comparison are ordered by their address. When you order two strings or two numeric types the ordering is done in the expected way (lexicographic ordering for string, numeric ordering for integers). When you order a numeric and a non-numeric type, the numeric type comes first. >>> 5 < 'foo' True >>> 5 < (1, 2) True >>> 5 < {} True >>> 5 < [1, 2] True When you order two incompatible types where neither is numeric, they are ordered by the alphabetical order of their typenames: >>> [1, 2] > 'foo' # 'list' < 'str' False >>> (1, 2) > 'foo' # 'tuple' > 'str' True >>> class Foo(object): pass >>> class Bar(object): pass >>> Bar() < Foo() True One exception is old-style classes that always come before new-style classes. >>> class Foo: pass # old-style >>> class Bar(object): pass # new-style >>> Bar() < Foo() False Is this behavior mandated by the language spec, or is it up to implementors? There is no language specification. The language reference says: Otherwise, objects of different types always compare unequal, and are ordered consistently but arbitrarily. So it is an implementation detail. Are there differences between any of the major Python implementations? I can't answer this one because I have only used the official CPython implementation, but there are other implementations of Python such as PyPy. Are there differences between versions of the Python language? In Python 3.x the behaviour has been changed so that attempting to order an integer and a string will raise an error: >>> '10' > 5 Traceback (most recent call last): File "", line 1, in '10' > 5 TypeError: unorderable types: str() > int() [INST] Is there a standardized method to swap two variables in Python? In Python, I've seen two variable values swapped using this syntax: left, right = right, left Is this considered the standard way to swap two variable values or is there some other means by which two variables are by convention most usually swapped? [/INST] Python evaluates expressions from left to right. Notice that while evaluating an assignment, the right-hand side is evaluated before the left-hand side. http://docs.python.org/2/reference/expressions.html#evaluation-order That means the following for the expression a,b = b,a : the right-hand side b,a is evaluated, that is to say a tuple of two elements is created in the memory. The two element are the objects designated by the identifiers b and a, that were existing before the instruction is encoutered during an execution of program just after the creation of this tuple, no assignement of this tuple object have still been made, but it doesn't matter, Python internally knows where it is then, the left-hand side is evaluated, that is to say the tuple is assigned to the left-hand side as the left-hand side is composed of two identifiers, the tuple is unpacked in order that the first identifier a be assigned to the first element of the tuple (which is the object that was formely b before the swap because it had name b) and the second identifier b is assigned to the second element of the tuple (which is the object that was formerly a before the swap because its identifiers was a) This mechanism has effectively swapped the objects assigned to the identifiers a and b So, to answer to your question is: YES, it's the standard way to swap two identifiers on two objects. By the way, the objects are not variables, they are objects. [INST] Python: How to get a value of datetime.today() that is "timezone aware"? I am trying to subtract one date value from the value of datetime.today() to calculate how long ago something was. But it complains: TypeError: can't subtract offset-naive and offset-aware datetimes The value datetime.today() doesn't seem to be "timezone aware", while my other date value is. How do I get a value of datetime.today() that is timezone aware? Right now it's giving me the time in local time, which happens to be PST, i.e. UTC-8hrs. Worst case, is there a way I can manually enter a timezone value into the datetime object returned by datetime.today() and set it to UTC-8? Of course, the ideal solution would be for it to automatically know the timezone. [/INST] In the standard library, there is no cross-platform way to create aware timezones without creating your own timezone class. On Windows, there's win32timezone.utcnow(), but that's part of pywin32. I would rather suggest to use the pytz library, which has an up-to-date database of most timezones. Working with local timezones can be very tricky (read the pytz documentation!), so you may rather want to use UTC throughout your application. You can get the current date/time like so: import pytz from datetime import datetime datetime.utcnow().replace(tzinfo=pytz.utc) Mind that datetime.today() and datetime.now() return the local time, not the UTC time, so applying .replace(tzinfo=pytz.utc) to them would not be correct. Another nice way to do it is: datetime.now(pytz.utc) which is a bit shorter and does the same. [INST] Loading all modules in a folder in Python Could someone provide me with a good way of importing a whole directory of modules? I have a structure like this: /Foo bar.py spam.py eggs.py I tried just converting it to a package by adding __init__.py and doing from Foo import * but it didn't work the way I had hoped. [/INST] List all python (.py) files in the current folder and put them as __all__ variable in __init__.py from os.path import dirname, basename, isfile import glob modules = glob.glob(dirname(__file__)+"/*.py") __all__ = [ basename(f)[:-3] for f in modules if isfile(f)] [INST] Get loop count inside a Python FOR loop In a Python for loop that iterates over a list we can write: for item in list: print item and it neatly goes through all the elements in the list. Is there a way to know within the loop how many times I've been looping so far? For instance, I want to take a list and after I've processed ten elements I want to do something with them. The alternatives I thought about would be something like: count=0 for item in list: print item count +=1 if count % 10 == 0: print 'did ten' Or: for count in range(0,len(list)): print list[count] if count % 10 == 0: print 'did ten' Is there a better way (just like the for item in list) to get the number of iterations so far? [/INST] The pythonic way is to use enumerate: for idx,item in enumerate(list): [INST] How should I log while using multiprocessing in Python? Right now I have a central module in a framework that spawns multiple processes using the Python 2.6 multiprocessing module. Because it uses multiprocessing, there is module-level multiprocessing-aware log, LOG = multiprocessing.get_logger(). Per the docs, this logger has process-shared locks so that you don't garble things up in sys.stderr (or whatever filehandle) by having multiple processes writing to it simultaneously. The issue I have now is that the other modules in the framework are not multiprocessing-aware. The way I see it, I need to make all dependencies on this central module use multiprocessing-aware logging. That's annoying within the framework, let alone for all clients of the framework. Are there alternatives I'm not thinking of? [/INST] I just now wrote a log handler of my own that just feeds everything to the parent process via a pipe. I've only been testing it for ten minutes but it seems to work pretty well. (Note: This is hardcoded to RotatingFileHandler, which is my own use case.) Update: Implementation! This now uses a queue for correct handling of concurrency, and also recovers from errors correctly. I've now been using this in production for several months, and the current version below works without issue. from logging.handlers import RotatingFileHandler import multiprocessing, threading, logging, sys, traceback class MultiProcessingLog(logging.Handler): def __init__(self, name, mode, maxsize, rotate): logging.Handler.__init__(self) self._handler = RotatingFileHandler(name, mode, maxsize, rotate) self.queue = multiprocessing.Queue(-1) t = threading.Thread(target=self.receive) t.daemon = True t.start() def setFormatter(self, fmt): logging.Handler.setFormatter(self, fmt) self._handler.setFormatter(fmt) def receive(self): while True: try: record = self.queue.get() self._handler.emit(record) except (KeyboardInterrupt, SystemExit): raise except EOFError: break except: traceback.print_exc(file=sys.stderr) def send(self, s): self.queue.put_nowait(s) def _format_record(self, record): # ensure that exc_info and args # have been stringified. Removes any chance of # unpickleable things inside and possibly reduces # message size sent over the pipe if record.args: record.msg = record.msg % record.args record.args = None if record.exc_info: dummy = self.format(record) record.exc_info = None return record def emit(self, record): try: s = self._format_record(record) self.send(s) except (KeyboardInterrupt, SystemExit): raise except: self.handleError(record) def close(self): self._handler.close() logging.Handler.close(self) [INST] Proper way to handle multiple forms on one page in Django I have a template page expecting two forms. If I just use one form, things are fine as in this typical example: if request.method == 'POST': form = AuthorForm(request.POST,) if form.is_valid(): form.save() # do something. else: form = AuthorForm() If I want to work with multiple forms however, how do I let the view know that I'm submitting only one of the forms and not the other (i.e. it's still request.POST but I only want to process the form for which the submit happened)? This is the solution based on the answer where expectedphrase and bannedphrase are the names of the submit buttons for the different forms and expectedphraseform and bannedphraseform are the forms. if request.method == 'POST': if 'bannedphrase' in request.POST: bannedphraseform = BannedPhraseForm(request.POST, prefix='banned') if bannedphraseform.is_valid(): bannedphraseform.save() expectedphraseform = ExpectedPhraseForm(prefix='expected') elif 'expectedphrase' in request.POST: expectedphraseform = ExpectedPhraseForm(request.POST, prefix='expected') if expectedphraseform.is_valid(): expectedphraseform.save() bannedphraseform = BannedPhraseForm(prefix='banned') else: bannedphraseform = BannedPhraseForm(prefix='banned') expectedphraseform = ExpectedPhraseForm(prefix='expected') [/INST] You have a few options: Put different URLs in the action for the two forms. Then you'll have two different view functions to deal with the two different forms. Read the submit button values from the POST data. You can tell which submit button was clicked: How can I build multiple submit buttons django form? [INST] How can I explicitly free memory in Python? I wrote a Python program that acts on a large input file to create a few million objects representing triangles. The algorithm is: read an input file process the file and create a list of triangles, represented by their vertices output the vertices in the OFF format: a list of vertices followed by a list of triangles. The triangles are represented by indices into the list of vertices The requirement of OFF that I print out the complete list of vertices before I print out the triangles means that I have to hold the list of triangles in memory before I write the output to file. In the meanwhile I'm getting memory errors because of the sizes of the lists. What is the best way to tell Python that I no longer need some of the data, and it can be freed? [/INST] According to Python Official Documentation, you can force the Garbage Collector to release unreferenced memory with gc.collect() [INST] Iterate over model instance field names and values in template I'm trying to create a basic template to display the selected instance's field values, along with their names. Think of it as just a standard output of the values of that instance in table format, with the field name (verbose_name specifically if specified on the field) in the first column and the value of that field in the second column. For example, let's say we have the following model definition: class Client(Model): name = CharField(max_length=150) email = EmailField(max_length=100, verbose_name="E-mail") I would want it to be output in the template like so (assume an instance with the given values): Field Name Field Value ---------- ----------- Name Wayne Koorts E-mail waynes@email.com What I'm trying to achieve is being able to pass an instance of the model to a template and be able to iterate over it dynamically in the template, something like this: {% for field in fields %} {% endfor %}
{{ field.name }} {{ field.value }}
Is there a neat, "Django-approved" way to do this? It seems like a very common task, and I will need to do it often for this particular project. [/INST] model._meta.get_all_field_names() will give you all the model's field names, then you can use model._meta.get_field() to work your way to the verbose name, and getattr(model_instance, 'field_name') to get the value from the model. NOTE: model._meta.get_all_field_names() is deprecated in django 1.9. Instead use model._meta.get_fields() to get the model's fields and field.name to get each field name.
[INST] Can I force pip to reinstall the current version? I've come across situations where a current version of a package seems not to be working and requires reinstallation. But pip install -U won't touch a package that is already up-to-date. I see how to force a reinstallation by first uninstalling (with pip uninstall) and then installing, but is there a way to simply force an "update" to a nominally current version in a single step? [/INST] --force-reinstall When upgrading, reinstall all packages even if they are already up-to-date. -I, --ignore-installed Ignore the installed packages (reinstalling instead). [INST] How do I check if a string is unicode or ascii? What do I have to do in Python to figure out which encoding? [/INST] In Python 3, all strings are sequences of Unicode characters. There is a bytes type that holds raw bytes. In Python 2, a string may be of type str or of type unicode. You can tell which using code something like this: def whatisthis(s): if isinstance(s, str): print "ordinary string" elif isinstance(s, unicode): print "unicode string" else: print "not a string" [INST] Cross-platform way of getting temp directory in Python Is there a cross-platform way of getting the path to the temp directory in Python 2.6? For example, under Linux that would be /tmp, while under XP C:\Documents and settings\[user]\Application settings\Temp. Thanks! [/INST] That would be the tempfile module. It has functions to get the temporary directory, and also has some shortcuts to create temporary files and directories in it, either named or unnamed. Example: import tempfile print tempfile.gettempdir() # prints the current temporary directory f = tempfile.TemporaryFile() f.write('something on temporaryfile') f.seek(0) # return to beginning of file print f.read() # reads data back from the file f.close() # temporary file is automatically deleted here For completeness, here's how it searches for the temporary directory, according to the documentation: The directory named by the TMPDIR environment variable. The directory named by the TEMP environment variable. The directory named by the TMP environment variable. A platform-specific location: On RiscOS, the directory named by the Wimp$ScrapDir environment variable. On Windows, the directories C:\TEMP, C:\TMP, \TEMP, and \TMP, in that order. On all other platforms, the directories /tmp, /var/tmp, and /usr/tmp, in that order. As a last resort, the current working directory. [INST] How do I copy a string to the clipboard on Windows using Python? I'm kind of new to Python and I'm trying to make a basic Windows application that builds a string out of user input then adds it to the clipboard. How do I copy a string to the clipboard using Python? [/INST] Actually, pywin32 and ctypes seem to be an overkill for this simple task. Tkinter is a cross-platform GUI framework, which ships with Python by default and has clipboard accessing methods along with other cool stuff. If all you need is to put some text to system clipboard, this will do it: from Tkinter import Tk r = Tk() r.withdraw() r.clipboard_clear() r.clipboard_append('i can has clipboardz?') r.destroy() And that's all, no need to mess around with platform-specific third-party libraries. [INST] Python vs Cpython What's all this fuss about Python and CPython (Jython,IronPython), I don't get it: python.org mentions that CPython is: The "traditional" implementation of Python (nicknamed CPython) yet another Stack Overflow question mentions that: CPython is the default byte-code interpreter of Python, which is written in C. Honestly I don't get what both of those explanations practically mean but what I thought was that, if I use CPython does that mean when I run a sample python code, it compiles it to C language and then executes it as if it were C code So what exactly is CPython and how does it differ when compared with python and should I probably use CPython over Python and if so what are its advantages? [/INST] So what is CPython CPython is the original Python implementation. It is the implementation you download from Python.org. People call it CPython to distinguish it from other, later, Python implementations, and to distinguish the implementation of the language engine from the Python programming language itself. The latter part is where your confusion comes from; you need to keep Python-the-language separate from whatever runs the Python code. CPython happens to be implemented in C. That is just an implementation detail really. CPython compiles your python code into bytecode (transparently) and interprets that bytecode in a evaluation loop. CPython is also the first to implement new features; Python-the-language development uses CPython as the base, other implementations follow. What about Jython, etc. Jython, IronPython and PyPy are the current 'other' implementations of the Python programming language; these are implemented in Java, C# and RPython (a subset of Python), respectively. Jython compiles your Python code to Java bytecode, so your Python code can run on the JVM. IronPython lets you run Python on the Microsoft CLR. And PyPy, being implemented in (a subset of) Python, lets you run Python code faster than CPython, which rightly should blow your mind. :-) Actually compiling to C So CPython does not translate your Python code to C by itself. It instead runs a interpreter loop. There is a project that does translate Python-ish code to C, and that is called Cython. Cython adds a few extensions to the Python language, and lets you compile your code to C extensions, code that plugs into the CPython interpreter. [INST] Python code to pick out all possible combinations from a list? I have a list with 15 numbers in, and I need to write some code that produces all 32,768 combinations of those numbers. I've found some code (by googling) that apparently does what I'm looking for, but I found the code fairly opaque and am wary of using it. Plus I have a feeling there must be a more elegant solution. The only thing that occurs to me would be to just loop through the decimal integers 1-32768 and convert those to binary, and use the binary representation as a filter to pick out the appropriate numbers. Does anyone know of a better way? Using map(), maybe? [/INST] This answer missed one aspect: the OP asked for ALL combinations... not just combinations of length "r". So you'd either have to loop through all lengths "L": import itertools stuff = [1, 2, 3] for L in range(0, len(stuff)+1): for subset in itertools.combinations(stuff, L): print(subset) Or -- if you want to get snazzy (or bend the brain of whoever reads your code after you) -- you can generate the chain of "combinations()" generators, and iterate through that: from itertools import chain, combinations def all_subsets(ss): return chain(*map(lambda x: combinations(ss, x), range(0, len(ss)+1))) for subset in all_subsets(stuff): print(subset) [INST] How do I get the path of the current executed file in Python? This may seem like a newbie question, but it is not. Some common approaches don't work in all cases: sys.argv[0] This means using path = os.path.abspath(os.path.dirname(sys.argv[0])), but this does not work if you are running from another Python script in another directory, and this can happen in real life. __file__ This means using path = os.path.abspath(os.path.dirname(__file__)), but I found that this doesn't work: py2exe doesn't have a __file__ attribute, but there is a workaround When you run from IDLE with execute() there is no __file__ attribute OS X 10.6 where I get NameError: global name '__file__' is not defined Related questions with incomplete answers: Python - Find Path to File Being Run Path to current file depends on how I execute the program How to know the path of the running script in Python? Change directory to the directory of a Python script I'm looking for a generic solution, one that would work in all above use cases. Update Here is the result of a testcase: Output of python a.py (on Windows) a.py: __file__= a.py a.py: os.getcwd()= C:\zzz b.py: sys.argv[0]= a.py b.py: __file__= a.py b.py: os.getcwd()= C:\zzz a.py #! /usr/bin/env python import os, sys print "a.py: sys.argv[0]=", sys.argv[0] print "a.py: __file__=", __file__ print "a.py: os.getcwd()=", os.getcwd() print execfile("subdir/b.py") subdir/b.py #! /usr/bin/env python import os, sys print "b.py: sys.argv[0]=", sys.argv[0] print "b.py: __file__=", __file__ print "b.py: os.getcwd()=", os.getcwd() print tree C:. | a.py \---subdir b.py [/INST] You can't directly determine the location of the main script being executed. After all, sometimes the script didn't come from a file at all. For example, it could come from the interactive interpreter or dynamically generated code stored only in memory. However, you can reliably determine the location of a module, since modules are always loaded from a file. If you create a module with the following code and put it in the same directory as your main script, then the main script can import the module and use that to locate itself. some_path/module_locator.py: def we_are_frozen(): # All of the modules are built-in to the interpreter, e.g., by py2exe return hasattr(sys, "frozen") def module_path(): encoding = sys.getfilesystemencoding() if we_are_frozen(): return os.path.dirname(unicode(sys.executable, encoding)) return os.path.dirname(unicode(__file__, encoding)) some_path/main.py: import module_locator my_path = module_locator.module_path() If you have several main scripts in different directories, you may need more than one copy of module_locator. Of course, if your main script is loaded by some other tool that doesn't let you import modules that are co-located with your script, then you're out of luck. In cases like that, the information you're after simply doesn't exist anywhere in your program. Your best bet would be to file a bug with the authors of the tool. [INST] Python: Run function from the command line I have below code in my file: def hello(): return 'Hi :)' How would I run this from the command line? [/INST] With the -c (command) argument (assuming your file is named foo.py): $ python -c 'import foo; print foo.hello()' Alternatively, if you don't care about namespace pollution: $ python -c 'from foo import *; print hello()' And the middle ground: $ python -c 'from foo import hello; print hello()' [INST] Print in one line dynamically I would like to make several statements that give standard output without seeing newlines in between statements. Specifically, suppose I have: for item in range(1,100): print item The result is: 1 2 3 4 . . . How get this to instead look like: 1 2 3 4 5 ... Even better, is it possible to print the single number over the last number, so only one number is on the screen at a time? [/INST] Change print item to: print item, in Python 2.7 print(item, end=" ") in Python 3 [INST] Using Python 3 in virtualenv Using virtualenv, I run my projects with the default version of Python (2.7). On one project, I need to use Python 3.4. I used brew install python3 to install it on my Mac. Now, how do I create a virtualenv that uses the new version? e.g. sudo virtualenv envPython3 If I try: virtualenv -p python3 test I get: Running virtualenv with interpreter /usr/local/bin/python3 Using base prefix '/usr/local/Cellar/python3/3.4.0_1/Frameworks/Python.framework/Versions/3.4' New python executable in test/bin/python3.4 Also creating executable in test/bin/python Failed to import the site module Traceback (most recent call last): File "/Users/user/Documents/workspace/test/test/bin/../lib/python3.4/site.py", line 67, in import os File "/Users/user/Documents/workspace/test/test/bin/../lib/python3.4/os.py", line 634, in from _collections_abc import MutableMapping ImportError: No module named '_collections_abc' ERROR: The executable test/bin/python3.4 is not functioning ERROR: It thinks sys.prefix is '/Users/user/Documents/workspace/test' (should be '/Users/user/Documents/workspace/test/test') ERROR: virtualenv is not compatible with this system or executable [/INST] simply run virtualenv -p python3 envname Update after OP's edit: There was a bug in the OP's version of virtualenv, as described here. The problem was fixed by running: pip install --upgrade virtualenv [INST] Why do you need explicitly have the "self" argument into a Python method? When defining a method on a class in Python, it looks something like this: class MyClass(object): def __init__(self, x, y): self.x = x self.y = y But in some other languages, such as C#, you have a reference to the object that the method is bound to with the "this" keyword without declaring it as an argument in the method prototype. Was this an intentional language design decision in Python or are there some implementation details that require the passing of "self" as an argument? [/INST] I like to quote Peters' Zen of Python. "Explicit is better than implicit." In Java and C++, 'this.' can be deduced, except when you have variable names that make it impossible to deduce. So you sometimes need it and sometimes don't. Python elects to make things like this explicit rather than based on a rule. Additionally, since nothing is implied or assumed, parts of the implementation are exposed. self.__class__, self.__dict__ and other "internal" structures are available in an obvious way. [INST] Can't pickle when using python's multiprocessing Pool.map() I'm trying to use multiprocessing's Pool.map() function to divide out work simultaneously. When I use the following code, it works fine: import multiprocessing def f(x): return x*x def go(): pool = multiprocessing.Pool(processes=4) print pool.map(f, range(10)) if __name__== '__main__' : go() However, when I use it in a more object-oriented approach, it doesn't work. The error message it gives is: PicklingError: Can't pickle : attribute lookup __builtin__.instancemethod failed This occurs when the following is my main program: import someClass if __name__== '__main__' : sc = someClass.someClass() sc.go() and the following is my someClass class: import multiprocessing class someClass(object): def __init__(self): pass def f(self, x): return x*x def go(self): pool = multiprocessing.Pool(processes=4) print pool.map(self.f, range(10)) Anyone know what the problem could be, or an easy way around it? [/INST] The problem is that multiprocessing must pickle things to sling them among processes, and bound methods are not picklable. The workaround (whether you consider it "easy" or not;-) is to add the infrastructure to your program to allow such methods to be pickled, registering it with the copy_reg standard library method. For example, Steven Bethard's contribution to this thread (towards the end of the thread) shows one perfectly workable approach to allow method pickling/unpickling via copy_reg. [INST] Best programming aids for a quadriplegic programmer Before you jump to conclusions, yes, this is programming related. It covers a situation that comes under the heading of, "There, but for the grace of God, go you or I." This is brand new territory for me so I'm asking for some serious help here. A young man, Honza Ripa, in a nearby town did the classic Dumb Thing two weeks after graduating from High School -- he dove into shallow water in the Russian River and had a C-4/C-5 break, sometimes called a Swimming Pool break. In a matter of seconds he went from an exceptional golfer and wrestler to a quadriplegic. (Read the story ... all of us should have been so lucky as to have a girlfriend like Brianna.) That was 10 months ago and he has regained only tiny amounts of control of his right index finger and a couple of other hand/foot motions, none of them fine-grained. His total control of his computer (currently running Win7, but we can change that as needed) is via voice command. Honza's not dumb. He had a 3.7 GPA with AP math and physics. The Problems: Since all of his input is via voice command, he is concerned that the predominance of special characters in programming will require vast amount of verbose commands. Does anyone know of any well done voice input system specifically designed for programmers? I'm thinking about something that might be modal--e.g. you say "Python input" and it goes into a macro mode for doing class definitions, etc. Given all of the RSI in programmer-land there's got to be something out there. What OS(es) does it run on? I am planning on teaching him Python, which is my preferred language for programming and teaching. Are there any applications / whatevers that are written in Python and would be a particularly good match for engaging him mentally while supporting his disability? One of his expressed interests is in stock investing, but that not might be a good starting point for a brand-new programmer. There are a lot of environments (Flash, JavaScript, etc) that are not particularly friendly to people with accessibility challenges. I vaguely remember (but cannot find) a research project that basically created an overlay system on top of a screen environment and then allowed macro command construction on top of the screen image. If we can get/train this system, we may be able to remove many hurdles to using the net. I am particularly interested in finding open source Python-based robotics and robotic prostheses projects so that he can simultaneously learn advanced programming concepts while learning to solve some of his own immediate problems. I've done a ton of googling on this, but I know there are things I'm missing. I'm asking the SO community to step up to the plate here. I know this group has the answers, so let me hear them! Overwhelm me with the opportunities that any of us might have/need to still program after such a life-changing event. Update: I just registered computingforquads.org and I'll be creating pages for all sorts of solutions to all sorts of problems. Thanks for you help so far and keep those answers coming! [/INST] I have sports injuries, and I cannot type more than few characters without serious pain. Instead, I use emacs together with Dragon NaturallySpeaking. I have written macros and scripts to help it get by. The system is not perfect, but it works. I program mostly in C++, but I also use python. If you want to, I will help you with that. I have to warn you, it takes few months to get used to speech to text software and train it. moreover, I am not native English speaker, am sure that gets in the way Do not despair, there are solutions. here a link to emacs and Dragon files (unfortunately have not documented yet) http://code.google.com/p/asadchev/source/browse/#svn/trunk/home/Dragon http://code.google.com/p/asadchev/source/browse/#svn/trunk/emacs/elisp also, if you need more info, my number is 515 230 9363 (United States, Iowa). I will be glad to help you if I can [INST] How do I modify a text file in Python? I'm using Python, and would like to insert a string into a text file without deleting or copying the file. How can I do that? [/INST] Unfortunately there is no way to insert into the middle of a file without re-writing it. As previous posters have indicated, you can append to a file or overwrite part of it using seek but if you want to add stuff at the beginning or the middle, you'll have to rewrite it. This is an operating system thing, not a Python thing. It is the same in all languages. What I usually do is read from the file, make the modifications and write it out to a new file called myfile.txt.tmp or something like that. This is better than reading the whole file into memory because the file may be too large for that. Once the temporary file is completed, I rename it the same as the original file. This is a good, safe way to do it because if the file write crashes or aborts for any reason, you still have your untouched original file. [INST] Python format timedelta to string I'm a Python newbie (2 weeks) and I'm having trouble formatting a datetime.timedelta object. Here's what I'm trying to do: I have a list of objects and one of the members of the class of the object is a timedelta object that shows the duration of an event. I would like to display that duration in the format of hours:minutes. I have tried a variety of methods for doing this and I'm having difficulty. My current approach is to add methods to the class for my objects that return hours and minutes. I can get the hours by dividing the timedelta.seconds by 3600 and rounding it. I'm having trouble with getting the remainder seconds and converting that to minutes. By the way, I'm using Google AppEngine with Django Templates for presentation. If anyone can help or knows of a better way to resolve this, I would be very happy. Thanks, [/INST] You can just convert the timedelta to a string with str(). Here's an example: import datetime start = datetime.datetime(2009,2,10,14,00) end = datetime.datetime(2009,2,10,16,00) delta = end-start print str(delta) # prints 2:00:00 [INST] Define css class in django Forms Assume I have a form class SampleClass(forms.Form): name = forms.CharField(max_length=30) age = forms.IntegerField() django_hacker = forms.BooleanField(required=False) Is there a way for me to define css classes on each field such that I can then use jQuery based on class in my rendered page? I was hoping not to have to manually build the form. [/INST] Yet another solution that doesn't require changes in python code and so is better for designers and one-off presentational changes: django-widget-tweaks. Hope somebody will find it useful. [INST] Why do you have to call .iteritems() when iterating over a dictionary in python? Why do you have to call iteritems() to iterate over key, value pairs in a dictionary? ie dic = {'one':'1', 'two':'2'} for k, v in dic.iteritems(): print k, v Why isn't that the default behavior of iterating over a dictionary for k, v in dic: print k, v [/INST] For every python container C, the expectation is that for item in C: assert item in C will pass just fine -- wouldn't you find it astonishing if one sense of in (the loop clause) had a completely different meaning from the other (the presence check)? I sure would! It naturally works that way for lists, sets, tuples, ... So, when C is a dictionary, if in were to yield key/value tuples in a for loop, then, by the principle of least astonishment, in would also have to take such a tuple as its left-hand operand in the containment check. How useful would that be? Pretty useless indeed, basically making if (key, value) in C a synonym for if C.get(key) == value -- which is a check I believe I may have performed, or wanted to perform, 100 times more rarely than what if k in C actually means, checking the presence of the key only and completely ignoring the value. On the other hand, wanting to loop just on keys is quite common, e.g.: for k in thedict: thedict[k] += 1 having the value as well would not help particularly: for k, v in thedict.items(): thedict[k] = v + 1 actually somewhat less clear and less concise. (Note that items was the original spelling of the "proper" methods to use to get key/value pairs: unfortunately that was back in the days when such accessors returned whole lists, so to support "just iterating" an alternative spelling had to be introduced, and iteritems it was -- in Python 3, where backwards compatibility constraints with previous Python versions were much weakened, it became items again). [INST] Python if not == vs if != What is the difference between these two lines of code: if not x == 'val': and if x != 'val': Is one more efficient than the other? Would it be better to use if x == 'val': pass else: [/INST] Using dis to look at the bytecode generated for the two versions: not == 4 0 LOAD_FAST 0 (foo) 3 LOAD_FAST 1 (bar) 6 COMPARE_OP 2 (==) 9 UNARY_NOT 10 RETURN_VALUE != 4 0 LOAD_FAST 0 (foo) 3 LOAD_FAST 1 (bar) 6 COMPARE_OP 3 (!=) 9 RETURN_VALUE The latter has fewer operations, and is therefore likely to be slightly more efficient. It was pointed out in the commments (thanks, @Quincunx) that where you have if foo != bar vs. if not foo == bar the number of operations is exactly the same, it's just that the COMPARE_OP changes and POP_JUMP_IF_TRUE switches to POP_JUMP_IF_FALSE: not ==: 2 0 LOAD_FAST 0 (foo) 3 LOAD_FAST 1 (bar) 6 COMPARE_OP 2 (==) 9 POP_JUMP_IF_TRUE 16 != 2 0 LOAD_FAST 0 (foo) 3 LOAD_FAST 1 (bar) 6 COMPARE_OP 3 (!=) 9 POP_JUMP_IF_FALSE 16 In this case, unless there was a difference in the amount of work required for each comparison, it's unlikely you'd see any performance difference at all. However, note that the two versions won't always be logically identical, as it will depend on the implementations of __eq__ and __ne__ for the objects in question. Per the data model documentation: There are no implied relationships among the comparison operators. The truth of x==y does not imply that x!=y is false. For example: >>> class Dummy(object): def __eq__(self, other): return True def __ne__(self, other): return True >>> not Dummy() == Dummy() False >>> Dummy() != Dummy() True Finally, and perhaps most importantly: in general, where the two are logically identical, x != y is much more readable than not x == y. �$[INST] Creating a range of dates in Python I want to create a list of dates, starting with today, and going back an arbitrary number of days, say, in my example 100 days. Is there a better way to do it than this? import datetime a = datetime.datetime.today() numdays = 100 dateList = [] for x in range (0, numdays): dateList.append(a - datetime.timedelta(days = x)) print dateList [/INST] Marginally better... base = datetime.datetime.today() date_list = [base - datetime.timedelta(days=x) for x in range(0, numdays)] [INST] How to get a random number between a float range? (Python) randrange(start, stop) only takes integer arguments... So how would I get a random number between two float values? [/INST] Use random.uniform(a, b): >>> random.uniform(1.5, 1.9) 1.8733202628557872 [INST] Python strftime - date without leading 0? When using Python strftime, is there a way to remove the first 0 of the date if it's before the 10th, ie. so 01 is 1? Can't find a %thingy for that? Thanks! [/INST] Actually I had the same problem and I realized that, if you add a hyphen between the % and the letter, you can remove the leading zero. For example %Y/%-m/%-d. Only works on Unix (Linux, OS X). Doesn't work in Windows (including Cygwin). [INST] Ruby equivalent of virtualenv? Is there something similar to the Python utility virtualenv? Basically it allows you to install Python packages into a sandboxed environment, so easy_install django doesn't go in your system-wide site-packages directory, it would go in the virtualenv-created directory. For example: $ virtualenv test New python executable in test/bin/python Installing setuptools...cd .........done. $ cd test/ $ source bin/activate (test)$ easy_install tvnamer Searching for tvnamer Best match: tvnamer 0.5.1 Processing tvnamer-0.5.1-py2.5.egg Adding tvnamer 0.5.1 to easy-install.pth file Installing tvnamer script to /Users/dbr/test/bin Using /Library/Python/2.5/site-packages/tvnamer-0.5.1-py2.5.egg Processing dependencies for tvnamer Finished processing dependencies for tvnamer (test)$ which tvnamer /Users/dbr/test/bin/tvnamer Is there something like this for RubyGems? [/INST] RVM works closer to how virtualenv works since it lets you sandbox different ruby versions and their gems, etc. [INST] Standard way to embed version into python package? Is there a standard way to associate version string with a python package in such way that I could do the following? import foo print foo.version I would imagine there's some way to retrieve that data without any extra hardcoding, since minor/major strings are specified in setup.py already. Alternative solution that I found was to have import __version__ in my foo/__init__.py and then have __version__.py generated by setup.py. [/INST] Here is how I do this. Advantages of the following method: It provides a __version__ attribute. It provides the standard metadata version. Therefore it will be detected by pkg_resources or other tools that parse the package metadata (EGG-INFO and/or PKG-INFO, PEP 0345). It doesn't import your package (or anything else) when building your package, which can cause problems in some situations. (See the comments below about what problems this can cause.) There is only one place that the version number is written down, so there is only one place to change it when the version number changes, and there is less chance of inconsistent versions. Here is how it works: the "one canonical place" to store the version number is a .py file, named "_version.py" which is in your Python package, for example in myniftyapp/_version.py. This file is a Python module, but your setup.py doesn't import it! (That would defeat feature 3.) Instead your setup.py knows that the contents of this file is very simple, something like: __version__ = "3.6.5" And so your setup.py opens the file and parses it, with code like: import re VERSIONFILE="myniftyapp/_version.py" verstrline = open(VERSIONFILE, "rt").read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M) if mo: verstr = mo.group(1) else: raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,)) Then your setup.py passes that string as the value of the "version" argument to setup(), thus satisfying feature 2. To satisfy feature 1, you can have your package (at run-time, not at setup time!) import the _version file from myniftyapp/__init__.py like this: from _version import __version__ Here is an example of this technique that I've been using for years. The code in that example is a bit more complicated, but the simplified example that I wrote into this comment should be a complete implementation. Here is example code of importing the version. If you see anything wrong with this approach, please let me know: zooko at zooko dot com. If you don't see anything wrong with this approach then use it! Because the more packages come with their version numbers in the expected places the better! [INST] How to use Python to login to a webpage and retrieve cookies for later usage? I want to download and parse webpage using python, but to access it I need a couple of cookies set. Therefore I need to login over https to the webpage first. The login moment involves sending two POST params (username, password) to /login.php. During the login request I want to retrieve the cookies from the response header and store them so I can use them in the request to download the webpage /data.php. How would I do this in python (preferably 2.6)? If possible I only want to use builtin modules. [/INST] import urllib, urllib2, cookielib username = 'myuser' password = 'mypassword' cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) login_data = urllib.urlencode({'username' : username, 'j_password' : password}) opener.open('http://www.example.com/login.php', login_data) resp = opener.open('http://www.example.com/hiddenpage.php') print resp.read() resp.read() is the straight html of the page you want to open, and you can use opener to view any page using your session cookie. [INST] django import error - No module named core.management Ok, I see plenty of these errors around. I have tried everything I know to do and have yet to figure this out. I am working on a development server running python 2.5 and Django 1.3. Django 1.3 was installed using python setup.py install after unpacking the tar.gz download. All works well, I seldom have the need to run manage.py but am trying to use the new staticfiles app and am running into problems. python manage.py collectstatic Traceback (most recent call last): File "manage.py", line 2, in from django.core.management import execute_manager ImportError: No module named core.management Ok, so I have PATH issue. From Django install I double check my site-packages directory. python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" /usr/lib/python2.5/site-packages Ok, let's check out what I have, echo $PYTHON_PATH was empty, so I set it export PYTHON_PATH=/usr/lib/python2.5/site-packages/django Still no luck. Lets check what sys.path has to say >>> import sys >>> print sys.path ['', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packages/django', '/var/lib/python-support/python2.5'] path is there, I even created /usr/lib/python2.5/site-packages/django.pth with contents cat /usr/lib/python2.5/site-packages/django.pth /usr/lib/python2.5/site-packages/django/ Anyone got an clues to what is going on here? I found a symlink further up the path that was getting in the way, but no on to a new error. python manage.py collectstatic Traceback (most recent call last): File "manage.py", line 14, in execute_manager(settings) File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 349, in execute version=get_version(), File "/usr/lib/python2.5/site-packages/django/__init__.py", line 12, in get_version from django.utils.version import get_svn_revision ImportError: No module named utils.version I also tried creating a new project to see if there were any issues there and get the same utils.version error. Side node: Unode from #django helped me a bit, set up virtualenv on same machine and got past the errors so still not sure what is up with this actual install here, but it seems to not be in the django projects but in the django/python install. [/INST] If, like me, you are running your django in a virtualenv, and getting this error, look at your manage.py. The first line should define the python executable used to run the script. This should be the path to your virtualenv's python, but it is something wrong like /usr/bin/python, which is not the same path and will use the global python environment (and packages will be missing). Just change the path into the path to the python executable in your virtualenv. You can also replace your shebang line with #!/usr/bin/env python. This should use the proper python environment and interpreter provided that you activate your virtualenv first (I assume you know how to do this). �[INST] Python -- return, return None, and no return at all Consider three functions: def my_func1(): print "Hello World" return None def my_func2(): print "Hello World" return def my_func3(): print "Hello World" They all appear to return None. Are there any differences between how the returned value of these functions behave? Are there any reasons to prefer one versus the other? [/INST] On the actual behavior, there is no difference. They all return None and that's it. However, there is a time and place for all of these. The following instructions are basically how the different methods should be used (or atleast how I was taught they should be used), but they are not absolute rules so you can mix them up if you feel necessary to. Using return None. This tells that the function is indeed meant to return a value for later use, and in this case it returns None. This value None can then be used elsewhere. return None is never used if there are no other possible return values from the function. In the following example, we return person's mother if the person given is a human. If it's not a human, we return None since the "person" doesn't have a mother (let's suppose it's not an animal or so). def get_mother(person): if is_human(person): return person.mother else: return None Using return. This is used for the same reason as break in loops. The return value doesn't matter and you only want to exit the whole function. It's extremely useful in some places, even tho you don't need it that often. We got 15 prisoners and we know one of them has a knife. We loop through each prisoner one by one to check if they have a knife. If we hit the person with a knife, we can just exit the function cause we know there's only one knife and no reason the check rest of the prisoners. If we don't find the prisoner with a knife, we raise an the alert. This could be done in many different ways and using return is probably not even the best way, but it's just an example to show how to use return for exiting a function. def find_prisoner_with_knife(prisoners): for prisoner in prisoners: if "knife" in prisoner.items: prisoner.move_to_inquisition() return # no need to check rest of the prisoners nor raise an alert raise_alert() Note: You should never do var = find_prisoner_with_knife(), since the return value is not meant to be caught. Using no return at all. This will also return None, but that value is not meant to be used or caught. It simply means that the function ended successfully. It's basically the same as return in void functions in languages such as C++ or Java. In the following example, we set person's mother's name, and then the function exits after completing successfully. def set_mother(person, mother): if is_human(person): person.mother = mother Note: You should never do var = set_mother(my_person, my_mother), since the return value is not meant to be caught. [INST] Why does ~True result in -2? In Python console: ~True Gives me: -2 Why? Can someone explain this particular case to me in binary? [/INST] What is int(True)? It is 1. 1 is: 00000001 and ~1 is: 11111110 Which is -2 in Two's complement1 1 Flip all the bits, add 1 to the resulting number and interpret the result as a binary representation of the magnitude and add a negative sign (since the number begins with 1): 11111110 → 00000001 → 00000010 ↑ ↑ Flip Add 1 Which is 2, but the sign is negative since the MSB is 1. Worth mentioning: Think about bool, you'll find that it's numeric in nature - It has two values, True and False, and they are just "customized" versions of the integers 1 and 0 that only print themselves differently. They are subclasses of the integer type int. So they behave exactly as 1 and 0, except that bool redefines str and repr to display them differently. >>> type(True) >>> isinstance(True, int) True >>> True == 1 True >>> True is 1 # they're still different objects False [INST] Check if multiple strings exist in another string How can I check if any of the strings in an array exists in another string? Like: a = ['a', 'b', 'c'] str = "a123" if a in str: print "some of the strings found in str" else: print "no strings found in str" That code doesn't work, it's just to show what I want to achieve. [/INST] You can use any: if any(x in str for x in a): Similarly to check if all the strings from the list are found, use all instead of any. [INST] Reducing Django Memory Usage. Low hanging fruit? My memory usage increases over time and restarting Django is not kind to users. I am unsure how to go about profiling the memory usage but some tips on how to start measuring would be useful. I have a feeling that there are some simple steps that could produce big gains. Ensuring 'debug' is set to 'False' is an obvious biggie. Can anyone suggest others? How much improvement would caching on low-traffic sites? In this case I'm running under Apache 2.x with mod_python. I've heard mod_wsgi is a bit leaner but it would be tricky to switch at this stage unless I know the gains would be significant. Edit: Thanks for the tips so far. Any suggestions how to discover what's using up the memory? Are there any guides to Python memory profiling? Also as mentioned there's a few things that will make it tricky to switch to mod_wsgi so I'd like to have some idea of the gains I could expect before ploughing forwards in that direction. Edit: Carl posted a slightly more detailed reply here that is worth reading: http://stackoverflow.com/questions/488864/django-deployment-cutting-apaches-overhead Edit: Graham Dumpleton's article is the best I've found on the MPM and mod_wsgi related stuff. I am rather disappointed that no-one could provide any info on debugging the memory usage in the app itself though. Final Edit: Well I have been discussing this with Webfaction to see if they could assist with recompiling Apache and this is their word on the matter: "I really don't think that you will get much of a benefit by switching to an MPM Worker + mod_wsgi setup. I estimate that you might be able to save around 20MB, but probably not much more than that." So! This brings me back to my original question (which I am still none the wiser about). How does one go about identifying where the problems lies? It's a well known maxim that you don't optimize without testing to see where you need to optimize but there is very little in the way of tutorials on measuring Python memory usage and none at all specific to Django. Thanks for everyone's assistance but I think this question is still open! Another final edit ;-) I asked this on the django-users list and got some very helpful replies Honestly the last update ever! This was just released. Could be the best solution yet: Profiling Django object size and memory usage with Pympler [/INST] Make sure you are not keeping global references to data. That prevents the python garbage collector from releasing the memory. Don't use mod_python. It loads an interpreter inside apache. If you need to use apache, use mod_wsgi instead. It is not tricky to switch. It is very easy. mod_wsgi is way easier to configure for django than brain-dead mod_python. If you can remove apache from your requirements, that would be even better to your memory. spawning seems to be the new fast scalable way to run python web applications. EDIT: I don't see how switching to mod_wsgi could be "tricky". It should be a very easy task. Please elaborate on the problem you are having with the switch. [INST] Is "x < y < z" faster than "x < y and y < z"? From this page, we know that: Chained comparisons are faster than using the and operator. Write x < y < z instead of x < y and y < z. However, I got a different result testing the following code snippets: $ python -m timeit "x = 1.2" "y = 1.3" "z = 1.8" "x < y < z" 1000000 loops, best of 3: 0.322 usec per loop $ python -m timeit "x = 1.2" "y = 1.3" "z = 1.8" "x < y and y < z" 1000000 loops, best of 3: 0.22 usec per loop $ python -m timeit "x = 1.2" "y = 1.3" "z = 1.1" "x < y < z" 1000000 loops, best of 3: 0.279 usec per loop $ python -m timeit "x = 1.2" "y = 1.3" "z = 1.1" "x < y and y < z" 1000000 loops, best of 3: 0.215 usec per loop It seems that x < y and y < z is faster than x < y < z. Why? After searching some posts in this site (like this one) I know that "evaluated only once" is the key for x < y < z, however I'm still confused. To do further study, I disassembled these two functions using dis.dis: import dis def chained_compare(): x = 1.2 y = 1.3 z = 1.1 x < y < z def and_compare(): x = 1.2 y = 1.3 z = 1.1 x < y and y < z dis.dis(chained_compare) dis.dis(and_compare) And the output is: ## chained_compare ## 4 0 LOAD_CONST 1 (1.2) 3 STORE_FAST 0 (x) 5 6 LOAD_CONST 2 (1.3) 9 STORE_FAST 1 (y) 6 12 LOAD_CONST 3 (1.1) 15 STORE_FAST 2 (z) 7 18 LOAD_FAST 0 (x) 21 LOAD_FAST 1 (y) 24 DUP_TOP 25 ROT_THREE 26 COMPARE_OP 0 (<) 29 JUMP_IF_FALSE_OR_POP 41 32 LOAD_FAST 2 (z) 35 COMPARE_OP 0 (<) 38 JUMP_FORWARD 2 (to 43) >> 41 ROT_TWO 42 POP_TOP >> 43 POP_TOP 44 LOAD_CONST 0 (None) 47 RETURN_VALUE ## and_compare ## 10 0 LOAD_CONST 1 (1.2) 3 STORE_FAST 0 (x) 11 6 LOAD_CONST 2 (1.3) 9 STORE_FAST 1 (y) 12 12 LOAD_CONST 3 (1.1) 15 STORE_FAST 2 (z) 13 18 LOAD_FAST 0 (x) 21 LOAD_FAST 1 (y) 24 COMPARE_OP 0 (<) 27 JUMP_IF_FALSE_OR_POP 39 30 LOAD_FAST 1 (y) 33 LOAD_FAST 2 (z) 36 COMPARE_OP 0 (<) >> 39 POP_TOP 40 LOAD_CONST 0 (None) It seems that the x < y and y < z has less dissembled commands than x < y < z. Should I consider x < y and y < z faster than x < y < z? Tested with Python 2.7.6 on an Intel(R) Xeon(R) CPU E5640 @ 2.67GHz. [/INST] The difference is that in x < y < z y is only evaluated once. This does not make a large difference if y is a variable, but it does when it is a function call, which takes some time to compute. from time import sleep def y(): sleep(.2) return 1.3 %timeit 1.2 < y() < 1.8 10 loops, best of 3: 203 ms per loop %timeit 1.2 < y() and y() < 1.8 1 loops, best of 3: 405 ms per loop [INST] How to invoke the super constructor in Python? class A: def __init__(self): print "world" class B(A): def __init__(self): print "hello" B() hello In all other languages I've worked with the super constructor is invoked implicitly. How does one invoke it in Python? I would expect super(self) but this doesn't work [/INST] super() returns a parent-like object in new-style classes: class A(object): def __init__(self): print "world" class B(A): def __init__(self): print "hello" super(B, self).__init__() B() [INST] How can I get the source code of a Python function? Suppose I have a Python function as defined below: def foo(arg1,arg2): #do something with args a = arg1 + arg2 return a I can get the name of the function using foo.func_name. How can I programmatically get its source code, as I typed above? [/INST] If the function is from a source file available on the filesystem, then inspect.getsourcelines(foo) might be of help. I believe that if the function is compiled from a string, stream or imported from a compiled file, then you cannot retrieve its source code. [INST] How Python web frameworks, WSGI and CGI fit together I have a Bluehost account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in .htaccess: Options +ExecCGI AddType text/html py AddHandler cgi-script .py Now, whenever I look up web programming with Python, I hear a lot about WSGI and how most frameworks use it. But I just don't understand how it all fits together, especially when my web server is given (Apache running at a host's machine) and not something I can really play with (except defining .htaccess commands). How are WSGI, CGI, and the frameworks all connected? What do I need to know, install, and do if I want to run a web framework (say web.py or CherryPy) on my basic CGI configuration? How to install WSGI support? [/INST] How WSGI, CGI, and the frameworks are all connected ? Apache listens on port 80. It gets an HTTP request. It parses the request to find a way to respond. Apache has a LOT of choices for responding. One way to respond is to use CGI to run a script. Another way to respond is to simply serve a file. In the case of CGI, Apache prepares an environment and invokes the script through the CGI protocol. This is a standard Unix Fork/Exec situation -- the CGI subprocess inherits an OS environment including the socket and stdout. The CGI subprocess writes a response, which goes back to Apache; Apache sends this response to the browser. CGI is primitive and annoying. Mostly because it forks a subprocess for every request, and subprocess must exit or close stdout and stderr to signify end of response. WSGI is an interface that is based on the CGI design pattern. It is not necessarily CGI -- it does not have to fork a subprocess for each request. It can be CGI, but it doesn't have to be. WSGI adds to the CGI design pattern in several important ways. It parses the HTTP Request Headers for you and adds these to the environment. It supplies any POST-oriented input as a file-like object in the environment. It also provides you a function that will formulate the response, saving you from a lot of formatting details. What do I need to know / install / do if I want to run a web framework (say web.py or cherrypy) on my basic CGI configuration ? Recall that forking a subprocess is expensive. There are two ways to work around this. Embedded mod_wsgi or mod_python embeds Python inside Apache; no process is forked. Apache runs the Django application directly. Daemon mod_wsgi or mod_fastcgi allows Apache to interact with a separate daemon (or "long-running process"), using the WSGI protocol. You start your long-running Django process, then you configure Apache's mod_fastcgi to communicate with this process. Note that mod_wsgi can work in either mode: embedded or daemon. When you read up on mod_fastcgi, you'll see that Django uses flup to create a WSGI-compatible interface from the information provided by mod_fastcgi. The pipeline works like this. Apache -> mod_fastcgi -> FLUP (via FastCGI protocol) -> Django (via WSGI protocol) Django has several "django.core.handlers" for the various interfaces. For mod_fastcgi, Django provides a manage.py runfcgi that integrates FLUP and the handler. For mod_wsgi, there's a core handler for this. How to install WSGI support ? Follow these instructions. http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango For background see this http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index [INST] Extracting text from HTML file using Python I'd like to extract the text from an HTML file using Python. I want essentially the same output I would get if I copied the text from a browser and pasted it into notepad. I'd like something more robust than using regular expressions that may fail on poorly formed HTML. I've seen many people recommend Beautiful Soup, but I've had a few problems using it. For one, it picked up unwanted text, such as JavaScript source. Also, it did not interpret HTML entities. For example, I would expect ' in HTML source to be converted to an apostrophe in text, just as if I'd pasted the browser content into notepad. Update html2text looks promising. It handles HTML entities correctly and ignores JavaScript. However, it does not exactly produce plain text; it produces markdown that would then have to be turned into plain text. It comes with no examples or documentation, but the code looks clean. Related questions: Filter out HTML tags and resolve entities in python Convert XML/HTML Entities into Unicode String in Python [/INST] NOTE: NTLK no longer supports clean_html function Original answer below. Use NLTK I wasted my 4-5 hours fixing the issues with html2text. Luckily i could encounter NLTK. It works magically. import nltk from urllib import urlopen url = "http://news.bbc.co.uk/2/hi/health/2284783.stm" html = urlopen(url).read() raw = nltk.clean_html(html) print(raw) [INST] What is the fastest way to send 100,000 HTTP requests in Python? I am opening a file which has 100,000 url's. I need to send an http request to each url and print the status code. I am using Python 2.6, and so far looked at the many confusing ways Python implements threading/concurrency. I have even looked at the python concurrence library, but cannot figure out how to write this program correctly. Has anyone come across a similar problem? I guess generally I need to know how to perform thousands of tasks in Python as fast as possible - I suppose that means 'concurrently'. Thank you, Igor [/INST] Twistedless solution: from urlparse import urlparse from threading import Thread import httplib, sys from Queue import Queue concurrent = 200 def doWork(): while True: url = q.get() status, url = getStatus(url) doSomethingWithResult(status, url) q.task_done() def getStatus(ourl): try: url = urlparse(ourl) conn = httplib.HTTPConnection(url.netloc) conn.request("HEAD", url.path) res = conn.getresponse() return res.status, ourl except: return "error", ourl def doSomethingWithResult(status, url): print status, url q = Queue(concurrent * 2) for i in range(concurrent): t = Thread(target=doWork) t.daemon = True t.start() try: for url in open('urllist.txt'): q.put(url.strip()) q.join() except KeyboardInterrupt: sys.exit(1) This one is slighty faster than the twisted solution and uses less CPU. [INST] Add Variables to Tuple I am learning Python and creating a database connection. While trying to add to the DB, I am thinking of creating tuples out of information and then add them to the DB. What I am Doing: I am taking information from the user and store it in variables. Can I add these variables into a tuple? Can you please help me with the syntax? Also if there is an efficient way of doing this, please share... EDIT Let me edit this question a bit...I only need the tuple to enter info into the DB. Once the information is added to the DB, should I delete the tuple? I mean I don't need the tuple anymore. [/INST] Tuples are immutable; you can't change which variables they contain after construction. However, you can concatenate or slice them to form new tuples: a = (1, 2, 3) b = a + (4, 5, 6) c = b[1:] And, of course, build them from existing values: name = "Joe" age = 40 location = "New York" joe = (name, age, location) [INST] Python subprocess/Popen with a modified environment I believe that running an external command with a slightly modified environment is a very common case. That's how I tend to do it: import subprocess, os my_env = os.environ my_env["PATH"] = "/usr/sbin:/sbin:" + my_env["PATH"] subprocess.Popen(my_command, env=my_env) I've got a gut feeling that there's a better way; does it look alright? [/INST] I think os.environ.copy() is better if you don't intend to modify the os.environ for the current process: import subprocess, os my_env = os.environ.copy() my_env["PATH"] = "/usr/sbin:/sbin:" + my_env["PATH"] subprocess.Popen(my_command, env=my_env) [INST] Escaping regex string in Python I want to use input from a user as a regex pattern for a search over some text. It works, but how I can handle cases where user puts characters that have meaning in regex? For example, the user wants to search for Word (s): regex engine will take the (s) as a group. I want it to treat it like a string "(s)" . I can run replace on user input and replace the ( with \( and the ) with \) but the problem is I will need to do replace for every possible regex symbol. Do you know some better way ? [/INST] Use the re.escape() function for this: 4.2.3 re Module Contents escape(string) Return string with all non-alphanumerics backslashed; this is useful if you want to match an arbitrary literal string that may have regular expression metacharacters in it. A simplistic example, search any occurence of the provided string optionally followed by 's', and return the match object. def simplistic_plural(word, text): word_or_plural = re.escape(word) + 's?' return re.match(word_or_plural, text) [INST] Django 1.7 throws django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet This is the traceback on my windows system. Traceback (most recent call last): File "D:\AMD\workspace\steelrumors\manage.py", line 9, in django.setup() File "D:\AMD\Django\django-django-4c85a0d\django\__init__.py", line 21, in setup apps.populate(settings.INSTALLED_APPS) File "D:\AMD\Django\django-django-4c85a0d\django\apps\registry.py", line 108, in populate app_config.import_models(all_models) File "D:\AMD\Django\django-django-4c85a0d\django\apps\config.py", line 197, in import_models self.models_module = import_module(models_module_name) File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module __import__(name) File "C:\Python27\lib\site-packages\registration\models.py", line 15, in User = get_user_model() File "D:\AMD\Django\django-django-4c85a0d\django\contrib\auth\__init__.py", line 135, in get_user_model return django_apps.get_model(settings.AUTH_USER_MODEL) File "D:\AMD\Django\django-django-4c85a0d\django\apps\registry.py", line 199, in get_model self.check_models_ready() File "D:\AMD\Django\django-django-4c85a0d\django\apps\registry.py", line 131, in check_models_ready raise AppRegistryNotReady("Models aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet. And my manage.py looks like this: import os import sys import django if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "steelrumors.settings") django.setup() from django.core.management import execute_from_command_line execute_from_command_line(sys.argv) I get this error when i am trying to use registration app in Django 1.7 [/INST] Running these commands solved my problem (credit to this answer): import django django.setup() However I'm not sure why I need this. Comments would be appreciated. �[INST] Decode HTML entities in Python string? I'm parsing some HTML with Beautiful Soup 3, but it contains HTML entities which Beautiful Soup 3 doesn't automatically decode for me: >>> from BeautifulSoup import BeautifulSoup >>> soup = BeautifulSoup("

£682m

") >>> text = soup.find("p").string >>> print text £682m How can I decode the HTML entities in text to get "£682m" instead of "£682m". [/INST] Python 3.4+ HTMLParser.unescape is deprecated, and was supposed to be removed in 3.5, although it was left in by mistake. It will be removed from the language soon. Instead, use html.unescape(): import html print(html.unescape('£682m')) see https://docs.python.org/3/library/html.html#html.unescape Python 2.6-3.3 You can use the HTML parser from the standard library: >>> try: ... # Python 2.6-2.7 ... from HTMLParser import HTMLParser ... except ImportError: ... # Python 3 ... from html.parser import HTMLParser ... >>> h = HTMLParser() >>> print(h.unescape('£682m')) £682m See http://docs.python.org/2/library/htmlparser.html You can also use the six compatibility library to simplify the import: >>> from six.moves.html_parser import HTMLParser >>> h = HTMLParser() >>> print(h.unescape('£682m')) £682m
[INST] Is False == 0 and True == 1 in Python an implementation detail or is it guaranteed by the language? Is it guaranteed that False == 0 and True == 1, in Python? For instance, is it in any way guaranteed that the following code will always produce the same results, whatever the version of Python (both existing and, likely, future ones)? 0 == False # True 1 == True # True ['zero', 'one'][False] # is 'zero' Any reference to the official documentation would be much appreciated! Edit: As noted in many answers, bool inherits from int. The question can therefore be recast as: "Does the documentation officially say that programmers can rely on booleans inheriting from integers, with the values 0 and 1?". This question is relevant for writing robust code that won't fail because of implementation details! [/INST] In Python 2.x this is not guaranteed as it is possible for True and False to be reassigned. However, even if this happens, boolean True and boolean False are still properly returned for comparisons. In Python 3.x True and False are keywords and will always be equal to 1 and 0. Under normal circumstances in Python 2, and always in Python 3: False object is of type bool which is a subclass of int: object | int | bool It is the only reason why in your example, ['zero', 'one'][False] does work. It would not work with an object which is not a subclass of integer, because list indexing only works with integers, or objects that define a __index__ method (thanks mark-dickinson). Edit: It is true of the current python version, and of that of Python 3. The docs for python 2.6 and the docs for Python 3 both say: There are two types of integers: [...] Integers (int) [...] Booleans (bool) and in the boolean subsection: Booleans: These represent the truth values False and True [...] Boolean values behave like the values 0 and 1, respectively, in almost all contexts, the exception being that when converted to a string, the strings "False" or "True" are returned, respectively. So booleans are explicitly considered as integers in Python 2.6 and 3. So you're safe until Python 4 comes along. ;-) [INST] Django: Redirect to previous page after login I'm trying to build a simple website with login functionality very similar to the one here on SO. The user should be able to browse the site as an anonymous user and there will be a login link on every page. When clicking on the login link the user will be taken to the login form. After a successful login the user should be taken back to the page from where he clicked the login link in the first place. I'm guessing that I have to somehow pass the url of the current page to the view that handles the login form but I can't really get it to work. EDIT: I figured it out. I linked to the login form by passing the current page as a GET parameter and then used 'next' to redirect to that page. Thanks! EDIT 2: My explanation did not seem to be clear so as requested here is my code: Lets say we are on a page foo.html and we are not logged in. Now we would like to have a link on foo.html that links to login.html. There we can login and are then redirected back to foo.html. The link on foo.html looks like this: Login Now I wrote a custom login view that looks somewhat like this: def login_view(request): redirect_to = request.REQUEST.get('next', '') if request.method=='POST': #create login form... if valid login credentials have been entered: return HttpResponseRedirect(redirect_to) #... return render_to_response('login.html', locals()) And the important line in login.html:
So yeah thats pretty much it, hope that makes it clear. [/INST] You do not need to make an extra view for this, the functionality is already built in. First each page with a login link needs to know the current path, and the easiest way is to add the request context preprosessor to settings.py (the 4 first are default), then the request object will be available in each request: settings.py: TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.request", ) Then add in the template you want the Login link: base.html: Login This will add a GET argument to the login page that points back to the current page. The login template can then be as simple as this: registration/login.html: {% block content %} {{form.as_p}}
{% endblock %}
[INST] Building a minimal plugin architecture in Python I have an application, written in Python, which is used by a fairly technical audience (scientists). I'm looking for a good way to make the application extensible by the users, i.e. a scripting/plugin architecture. I am looking for something extremely lightweight. Most scripts, or plugins, are not going to be developed and distributed by a third-party and installed, but are going to be something whipped up by a user in a few minutes to automate a repeating task, add support for a file format, etc. So plugins should have the absolute minimum boilerplate code, and require no 'installation' other than copying to a folder (so something like setuptools entry points, or the Zope plugin architecture seems like too much.) Are there any systems like this already out there, or any projects that implement a similar scheme that I should look at for ideas / inspiration? [/INST] Mine is, basically, a directory called "plugins" which the main app can poll and then use imp.load_module to pick up files, look for a well-known entry point possibly with module-level config params, and go from there. I use file-monitoring stuff for a certain amount of dynamism in which plugins are active, but that's a nice-to-have. Of course, any requirement that comes along saying "I don't need [big, complicated thing] X; I just want something lightweight" runs the risk of re-implementing X one discovered requirement at a time. But that's not to say you can't have some fun doing it anyway :) [INST] Catching an exception while using a Python 'with' statement To my shame, I can't figure out how to handle exception for python 'with' statement. If I have a code: with open("a.txt") as f: print f.readlines() I really want to handle 'file not found exception' in order to do somehing. But I can't write with open("a.txt") as f: print f.readlines() except: print 'oops' and can't write with open("a.txt") as f: print f.readlines() else: print 'oops' enclosing 'with' in a try/except statement doesn't work else: exception is not raised. What can I do in order to process failure inside 'with' statement in a Pythonic way? [/INST] from __future__ import with_statement try: with open( "a.txt" ) as f : print f.readlines() except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available print 'oops' If you want different handling for errors from the open call vs the working code you could do: try: f = open('foo.txt') except IOError: print('error') else: with f: print f.readlines() [INST] How can I reference requirements.txt for the install_requires kwarg in setuptools' setup.py file? I have a requirements.txt file that I'm using with Travis-CI. It seems silly to duplicate the requirements in both requirements.txt and setup.py, so I was hoping to pass a file handle to the install_requires kwarg in setuptools.setup. Is this possible? If so, how should I go about doing it? For good measure, here is my requirements.txt file: guessit>=0.5.2 tvdb_api>=1.8.2 hachoir-metadata>=1.3.3 hachoir-core>=1.3.3 hachoir-parser>=1.3.4 [/INST] A requirement file can contain comments (#) and can include some other files (--requirement or -r). Thus, if you really want to parse a requirement.txt you should use the pip parser: from pip.req import parse_requirements # parse_requirements() returns generator of pip.req.InstallRequirement objects install_reqs = parse_requirements() # reqs is a list of requirement # e.g. ['django==1.5.1', 'mezzanine==1.4.6'] reqs = [str(ir.req) for ir in install_reqs] setup( ... install_requires=reqs ) NOTE: my answer is old now. Pip does not have a public API so this no longer works (e.g. parse_requirements now requires an instance of pip.download.PipSession). You can do the opposite: list the dependances in setup.py and have a single character -- a dot . -- in requirements.txt. [INST] Installing SetupTools on 64-bit Windows I'm running Python 2.7 on Windows 7 64-bit, and when I run the installer for setuptools it tells me that Python 2.7 is not installed. The specific error message is: `Python Version 2.7 required which was not found in the registry` My installed version of Python is: `Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32` I'm looking at the setuptools site and it doesn't mention any installers for 64-bit Windows. Have I missed something or do I have to install this from source? [/INST] Problem: you have 64-bit Python, and a 32-bit installer. This will cause problems for extension modules. The reasons why the installer doesn't finds Python is the transparent 32-bit emulation from Windows 7. 64-bit and 32-bit programs will write to different parts of the Windows registry. 64-bit: HKLM|HKCU\SOFTWARE\ 32-bit: HKLM|HKCU\SOFTWARE\wow6432node\. This means that the 64-bit Python installer writes to HKLM\SOFTWARE\Python, but the 32-bit setuptools installer looks at HKLM\SOFTWARE\wow6432node\Python (this is handled by windows automatically, programs don't notice). This is expected behavior and not a bug. Usually, you have these choices: the "clean" way: use 32-bit Python if you have to use 32-bit modules or extensions the other "clean" way: only use 64-bit installers when using 64-bit Python (see below) what the answer above suggests: copy HKLM\SOFTWARE\Python to HKLM\SOFTWARE\wow6432node\Python, but this will cause problems with binary distributions, as 64-bit Python can't load 32-bit compiled modules (do NOT do this!) install pure Python modules with setuptools instead of the distutils installer (easy_install or pip) For setuptools itself, for example, you can't use a 32-bit installer for 64-bit Python as it includes binary files. But there's a 64-bit installer at http://www.lfd.uci.edu/~gohlke/pythonlibs/ (has many installers for other modules too). As a rule of thumb: install pure-python modules using distribute and pip (see here), and find a binary package matching your installed Python architecture for everything else. [INST] Binary search (bisection) in Python Is there a library function that performs binary search on a list/tuple and return the position of the item if found and 'False' (-1, None, etc.) if not? I found the functions bisect_left/right in the bisect module, but they still return a position even if the item is not in the list. That's perfectly fine for their intended usage, but I just want to know if an item is in the list or not (don't want to insert anything). I thought of using bisect_left and then checking if the item at that position is equal to what I'm searching, but that seems cumbersome (and I also need to do bounds checking if the number can be larger than the largest number in my list). If there is a nicer method I'd like to know about it. Edit To clarify what I need this for: I'm aware that a dictionary would be very well suited for this, but I'm trying to keep the memory consumption as low as possible. My intended usage would be a sort of double-way look-up table. I have in the table a list of values and I need to be able to access the values based on their index. And also I want to be able to find the index of a particular value or None if the value is not in the list. Using a dictionary for this would be the fastest way, but would (approximately) double the memory requirements. I was asking this question thinking that I may have overlooked something in the Python libraries. It seems I'll have to write my own code, as Moe suggested. [/INST] from bisect import bisect_left def binary_search(a, x, lo=0, hi=None): # can't use a to specify default for hi hi = hi if hi is not None else len(a) # hi defaults to len(a) pos = bisect_left(a,x,lo,hi) # find insertion position return (pos if pos != hi and a[pos] == x else -1) # don't walk off the end [INST] Why are Python's arrays slow? I expected array.array to be faster than lists, as arrays seem to be unboxed. However, I get the following result: In [1]: import array In [2]: L = list(range(100000000)) In [3]: A = array.array('l', range(100000000)) In [4]: %timeit sum(L) 1 loop, best of 3: 667 ms per loop In [5]: %timeit sum(A) 1 loop, best of 3: 1.41 s per loop In [6]: %timeit sum(L) 1 loop, best of 3: 627 ms per loop In [7]: %timeit sum(A) 1 loop, best of 3: 1.39 s per loop What could be the cause of such a difference? [/INST] The storage is "unboxed", but every time you access an element Python has to "box" it (embed it in a regular Python object) in order to do anything with it. For example, your sum(A) iterates over the array, and boxes each integer, one at a time, in a regular Python int object. That costs time. In your sum(L), all the boxing was done at the time the list was created. So, in the end, an array is generally slower, but requires substantially less memory. Here's the relevant code from a recent version of Python 3, but the same basic ideas apply to all CPython implementations since Python was first released. Here's the code to access a list item: PyObject * PyList_GetItem(PyObject *op, Py_ssize_t i) { /* error checking omitted */ return ((PyListObject *)op) -> ob_item[i]; } There's very little to it: somelist[i] just returns the i'th object in the list (and all Python objects in CPython are pointers to a struct whose initial segment conforms to the layout of a struct PyObject). And here's the __getitem__ implementation for an array with type code l: static PyObject * l_getitem(arrayobject *ap, Py_ssize_t i) { return PyLong_FromLong(((long *)ap->ob_item)[i]); } The raw memory is treated as a vector of platform-native C long integers; the i'th C long is read up; and then PyLong_FromLong() is called to wrap ("box") the native C long in a Python long object (which, in Python 3, which eliminates Python 2's distinction between int and long, is actually shown as type int). This boxing has to allocate new memory for a Python int object, and spray the native C long's bits into it. In the context of the original example, this object's lifetime is very brief (just long enough for sum() to add the contents into a running total), and then more time is required to deallocate the new int object. This is where the speed difference comes from, always has come from, and always will come from in the CPython implementation. [INST] Sleeping in a batch file When writing a batch file to automate something on a Windows box, I've needed to pause its execution for several seconds (usually in a test/wait loop, waiting for a process to start). At the time, the best solution I could find uses ping (I kid you not) to achieve the desired effect. I've found a better write-up of it here, which describes a callable "wait.bat", implemented as follows: @ping 127.0.0.1 -n 2 -w 1000 > nul @ping 127.0.0.1 -n %1% -w 1000> nul You can then include calls to wait.bat in your own batch file, passing in the number of seconds to sleep. Apparently the Windows 2003 Resource Kit provides a Unix-like sleep command (at last!). In the meantime, for those of us still using Windows XP, Windows 2000 or (sadly) Windows NT, is there a better way? I modified the sleep.py script in the accepted answer, so that it defaults to one second if no arguments are passed on the command line: import time, sys time.sleep(float(sys.argv[1]) if len(sys.argv) > 1 else 1) [/INST] The timeout command is available from Vista onwards. c:\> timeout /? TIMEOUT [/T] timeout [/NOBREAK] Description: This utility accepts a timeout parameter to wait for the specified time period (in seconds) or until any key is pressed. It also accepts a parameter to ignore the key press. Parameter List: /T timeout Specifies the number of seconds to wait. Valid range is -1 to 99999 seconds. /NOBREAK Ignore key presses and wait specified time. /? Displays this help message. NOTE: A timeout value of -1 means to wait indefinitely for a key press. Examples: TIMEOUT /? TIMEOUT /T 10 TIMEOUT /T 300 /NOBREAK TIMEOUT /T -1 Note: Does not work with input redirection - trivial example: C:\>echo 1 | timeout /t 1 /nobreak ERROR: Input redirection is not supported, exiting the process immediately. [INST] How to install Python MySQLdb module using pip? How can I install the MySQLdb module for Python using pip? [/INST] It's easy to do, but hard to remember the correct spelling: pip install MySQL-python Note: Some dependencies might have to be in place when running the above command. Some hints on how to install these on various platforms: Ubuntu 14, Ubuntu 16, Debian 8.6 (jessie) sudo apt-get install python-pip python-dev libmysqlclient-dev Fedora 24: sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc [INST] Writing Unicode text to a text file? I'm pulling data out of a Google doc, processing it, and writing it to a file (that eventually I will paste into a Wordpress page). It has some non-ASCII symbols. How can I convert these safely to symbols that can be used in HTML source? Currently I'm converting everything to Unicode on the way in, joining it all together in a Python string, then doing: import codecs f = codecs.open('out.txt', mode="w", encoding="iso-8859-1") f.write(all_html.encode("iso-8859-1", "replace")) There is an encoding error on the last line: UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 12286: ordinal not in range(128) Partial solution: This Python runs without an error: row = [unicode(x.strip()) if x is not None else u'' for x in row] all_html = row[0] + "
" + row[1] f = open('out.txt', 'w') f.write(all_html.encode("utf-8") But then if I open the actual text file, I see lots of symbols like: Qur‚Äôan Maybe I need to write to something other than a text file? [/INST] Deal exclusively with unicode objects as much as possible by decoding things to unicode objects when you first get them and encoding them as necessary on the way out. If your string is actually a unicode object, you'll need to convert it to a unicode-encoded string object before writing it to a file: foo = u'Δ, Й, ק, ‎ م, ๗, あ, 叶, 葉, and 말.' f = open('test', 'w') f.write(foo.encode('utf8')) f.close() When you read that file again, you'll get a unicode-encoded string that you can decode to a unicode object: f = file('test', 'r') print f.read().decode('utf8')
[INST] Can't install PIL after Mac OS X 10.9 I've just updated my Mac OS to 10.9 and I discovered that some (all?) of my Python modules are not here anymore, especially the Image one. So I try to execute sudo pip install pil, but I get this error: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found # include ^ 1 error generated. error: command 'cc' failed with exit status 1 My Xcode is up-to-date and I don't have any idea. Is it possible that PIL is not yet 10.9 compatible ? [/INST] Following worked for me: ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11 sudo pip install pil UPDATE: But there is more correct solution below, provided by Will. open your terminal and execute: xcode-select --install [INST] Convert string representation of list to list in Python I was wondering what the simplest way is to convert a string list like the following to a list: x = u'[ "A","B","C" , " D"]' Even in case user puts spaces in between the commas, and spaces inside of the quotes. I need to handle that as well to: x = ["A", "B", "C", "D"] in Python. I know I can strip spaces with strip() and split() using the split operator and check for non alphabets. But the code was getting very kludgy. Is there a quick function that I'm not aware of? [/INST] >>> import ast >>> x = u'[ "A","B","C" , " D"]' >>> x = ast.literal_eval(x) >>> x ['A', 'B', 'C', ' D'] >>> x = [n.strip() for n in x] >>> x ['A', 'B', 'C', 'D'] ast.literal_eval: Safely evaluate an expression node or a string containing a Python expression. The string or node provided may only consist of the following Python literal structures: strings, numbers, tuples, lists, dicts, booleans, and None. [INST] What is the correct syntax for 'else if'? I'm a new Python programmer who is making the leap from 2.6.4 to 3.1.1. Everything has gone fine until I tried to use the 'else if' statement. The interpreter gives me a syntax error after the 'if' in 'else if' for a reason I can't seem to figure out. def function(a): if a == '1': print ('1a') else if a == '2' print ('2a') else print ('3a') function(input('input:')) I'm probably missing something very simple; however, I haven't been able to find the answer on my own. [/INST] In python "else if" is spelled "elif". Also, you need a colon after the elif and the else. Simple answer to a simple question. I had the same problem, when I first started (in the last couple of weeks). So your code should read: def function(a): if a == '1': print('1a') elif a == '2': print('2a') else: print('3a') function(input('input:')) [INST] How to change legend size with matplotlib.pyplot Simple question here: I'm just trying to get the size of my legend using matplotlib.pyplot to be smaller (ie, the text to be smaller). The code I'm using goes something like this: plot.figure() plot.scatter(k,sum_cf, color = 'black', label='Sum of Cause Fractions') plot.scatter(k, data[:, 0], color = 'b', label = 'Dis 1: cf = .6, var = .2') plot.scatter(k, data[:, 1], color = 'r', label = 'Dis 2: cf = .2, var = .1') plot.scatter(k, data[:, 2], color = 'g', label = 'Dis 3: cf = .1, var = .01') plot.legend(loc=2) [/INST] You can set an individual font size for the legend by adjusting the 'prop' keyword. plot.legend(loc=2,prop={'size':6}) This takes a dictionary of keywords corresponding to matplotlib.font_manager.FontProperties properties. See the documentation for legend: Keyword arguments: prop: [ None | FontProperties | dict ] A matplotlib.font_manager.FontProperties instance. If prop is a dictionary, a new instance will be created with prop. If None, use rc settings. It is also possible, as of version 1.2.1, to use the keyword fontsize. [INST] How to check if a user is logged in (how to properly use user.is_authenticated)? I am looking over this website but just can't seem to figure out how to do this as it's not working. I need to check if the current site user is logged in (authenticated), and am trying: request.user.is_authenticated despite being sure that the user is logged in, it returns just: > I'm able to do other requests (from the first section in the url above), such as: request.user.is_active which returns a successful response. [/INST] is_authenticated is a function. You should call it like if request.user.is_authenticated(): # do something if the user is authenticated As Peter Rowell pointed out, what may be tripping you up is that in the default Django template language, you don't tack on parenthesis to call functions. So you may have seen something like this in template code: {% if user.is_authenticated %} However, in Python code, it is indeed a method in the User class. [INST] Reusable library to get human readable version of file size? There are various snippets on the web that would give you a function to return human readable size from bytes size: >>> human_readable(2048) '2 kilobytes' >>> But is there a Python library that provides this? [/INST] Addressing the above "too small a task to require a library" issue by a straightforward implementation: def sizeof_fmt(num, suffix='B'): for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']: if abs(num) < 1024.0: return "%3.1f%s%s" % (num, unit, suffix) num /= 1024.0 return "%.1f%s%s" % (num, 'Yi', suffix) Supports: all currently known binary prefixes negative and positive numbers numbers larger than 1000 Yobibytes arbitrary units (maybe you like to count in Gibibits!) Example: >>> sizeof_fmt(168963795964) '157.4GiB' by Fred Cirera [INST] No Multiline Lambda in Python: Why not? I've heard it said that multiline lambdas can't be added in Python because they would clash syntactically with the other syntax constructs in Python. I was thinking about this on the bus today and realized I couldn't think of a single Python construct that multiline lambdas clash with. Given that I know the language pretty well, this surprised me. Now, I'm sure Guido had a reason for not including multiline lambdas in the language, but out of curiosity: what's a situation where including a multiline lambda would be ambiguous? Is what I've heard true, or is there some other reason that Python doesn't allow multiline lambdas? [/INST] Guido van Rossum (the inventor of Python) answers this exact question himself in an old blog post. Basically, he admits that it's theoretically possible, but that any proposed solution would be un-Pythonic: "But the complexity of any proposed solution for this puzzle is immense, to me: it requires the parser (or more precisely, the lexer) to be able to switch back and forth between indent-sensitive and indent-insensitive modes, keeping a stack of previous modes and indentation level. Technically that can all be solved (there's already a stack of indentation levels that could be generalized). But none of that takes away my gut feeling that it is all an elaborate Rube Goldberg contraption." [INST] How do I design a class in Python? I've had some really awesome help on my previous questions for detecting paws and toes within a paw, but all these solutions only work for one measurement at a time. Now I have data that consists off: about 30 dogs; each has 24 measurements (divided into several subgroups); each measurement has at least 4 contacts (one for each paw) and each contact is divided into 5 parts and has several parameters, like contact time, location, total force etc. Obviously sticking everything into one big object isn't going to cut it, so I figured I needed to use classes instead of the current slew of functions. But even though I've read Learning Python's chapter about classes, I fail to apply it to my own code (GitHub link) I also feel like it's rather strange to process all the data every time I want to get out some information. Once I know the locations of each paw, there's no reason for me to calculate this again. Furthermore, I want to compare all the paws of the same dog to determine which contact belongs to which paw (front/hind, left/right). This would become a mess if I continue using only functions. So now I'm looking for advice on how to create classes that will let me process my data (link to the zipped data of one dog) in a sensible fashion. [/INST] How to design a class. Write down the words. You started to do this. Some people don't and wonder why they have problems. Expand your set of words into simple statements about what these objects will be doing. That is to say, write down the various calculations you'll be doing on these things. Your short list of 30 dogs, 24 measurements, 4 contacts, and several "parameters" per contact is interesting, but only part of the story. Your "locations of each paw" and "compare all the paws of the same dog to determine which contact belongs to which paw" are the next step in object design. Underline the nouns. Seriously. Some folks debate the value of this, but I find that for first-time OO developers it helps. Underline the nouns. Review the nouns. Generic nouns like "parameter" and "measurement" need to be replaced with specific, concrete nouns that apply to your problem in your problem domain. Specifics help clarify the problem. Generics simply elide details. For each noun ("contact", "paw", "dog", etc.) write down the attributes of that noun and the actions in which that object engages. Don't short-cut this. Every attribute. "Data Set contains 30 Dogs" for example is important. For each attribute, identify if this is a relationship to a defined noun, or some other kind of "primitive" or "atomic" data like a string or a float or something irreducible. For each action or operation, you have to identify which noun has the responsibility, and which nouns merely participate. It's a question of "mutability". Some objects get updated, others don't. Mutable objects must own total responsibility for their mutations. At this point, you can start to transform nouns into class definitions. Some collective nouns are lists, dictionaries, tuples, sets or namedtuples, and you don't need to do very much work. Other classes are more complex, either because of complex derived data or because of some update/mutation which is performed. Don't forget to test each class in isolation using unittest. Also, there's no law that says classes must be mutable. In your case, for example, you have almost no mutable data. What you have is derived data, created by transformation functions from the source dataset. [INST] What do (lambda) function closures capture in Python? Recently I started playing around with Python and I came around something peculiar in the way closures work. Consider the following code: adders= [0,1,2,3] for i in [0,1,2,3]: adders[i]=lambda a: i+a print adders[1](3) It builds a simple array of functions that take a single input and return that input added by a number. The functions are constructed in for loop where the iterator i runs from 0 to 3. For each of these number a lambda funciton is created which captures i and adds it to the function's input. The last line calls the second lambda function with 3 as a parameter. To my surprise the output was: 6 I expected a 4. My reasoning was: in Python everything is an object and thus every variable is essential a pointer to it. When creating the lambda closures for i, I expected it to store a pointer to the integer object currently pointed to by i. That means that when i assigned a new integer object it shouldn't effect the previously created closures. Sadly, inspecting the adders array within a debugger shows that it does. All lambda functions refer to the last value of i, 3, which results in adders1 returning 6. Which me the following: what does the closures capture exactly? What is the most elegant way to convince that lambda functions to capture the current value of i and in a way that will not be affected when i changes it's value. [/INST] you may force the capture of a variable using an argument with a default value: >>> for i in [0,1,2,3]: ... adders[i]=lambda a,i=i: i+a # note the dummy parameter with a default value ... >>> print( adders[1](3) ) 4 the idea is to declare a parameter (cleverly named i) and give it a default value of the variable you want to capture (the value of i) [INST] I can't install python-ldap When I run the following command: sudo pip install python-ldap I get this error: In file included from Modules/LDAPObject.c:9: Modules/errors.h:8: fatal error: lber.h: No such file or directory Any ideas how to fix this? [/INST] The website says that python-ldap is based on OpenLDAP, so you need to have the development files (headers) in order to compile the Python module. If you're on Ubuntu, the package is called libldap2-dev. sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev [INST] Configuring so that pip install can work from github We'd like to use pip with github to install private packages to our production servers. This question concerns what needs to be in the github repo in order for the install to be successful. Assuming the following command line (which authenticates just fine and tries to install): pip install git+ssh://git@github.com/BlahCo/search/tree/prod_release_branch/ProductName What needs to reside in the ProductName? Is it the contents of what would normally be in the tar file after running setup.py with the sdist option, or is the actual tar.gz file, or something else? I'm asking here because I've tried several variations and can't make it work. Any help appreciated. [/INST] You need the whole python package, with a setup.py file in it. A package named foo would be: foo # the installable package ├── foo │   ├── __init__.py │   └── bar.py └── setup.py And install from github like: $ pip install git+git://github.com/myuser/foo.git@v123 or $ pip install git+git://github.com/myuser/foo.git@newbranch More info at http://www.pip-installer.org/en/latest/reference/pip_install.html#vcs-support [INST] How do I override __getattr__ in Python without breaking the default behavior? I want to override the __getattr__ method on a class to do something fancy but I don't want to break the default behavior. What's the correct way to do this? [/INST] Overriding __getattr__ should be fine -- __getattr__ is only called as a last resort i.e. if there are no attributes in the instance that match the name. For instance, if you access foo.bar, then __getattr__ will only be called if foo has no attribute called bar. If the attribute is one you don't want to handle, raise AttributeError: class Foo(object): def __getattr__(self, name): if some_predicate(name): # ... else: # Default behaviour raise AttributeError However, unlike __getattr__, __getattribute__ will be called first (only works for new style classes i.e. those that inherit from object). In this case, you can preserve default behaviour like so: class Foo(object): def __getattribute__(self, name): if some_predicate(name): # ... else: # Default behaviour return object.__getattribute__(self, name) See the Python docs for more. [INST] Why dict.get(key) instead of dict[key]? Today, I came across the dict method get which, given a key in the dictionary, returns the associated value. For what purpose is this function useful? If I wanted to find a value associated with a key in a dictionary, I can just do dict[key], and it returns the same thing: dictionary = {"Name": "Harry", "Age": 17} dictionary["Name"] dictionary.get("Name") [/INST] It allows you to provide a default value if the key is missing: dictionary.get("bogus", None) returns None, whereas dictionary["bogus"] would raise a KeyError. [INST] Get the cartesian product of a series of lists in Python How can I get the Cartesian product (every possible combination of values) from a group of lists? Input: somelists = [ [1, 2, 3], ['a', 'b'], [4, 5] ] Desired output: [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...] [/INST] In Python 2.6+ import itertools for element in itertools.product(*somelists): print element Documentation: Python 2 - itertools.product [INST] Changing the "tick frequency" on x or y axis in matplotlib? I am trying to fix how python plots my data. Say x = [0,5,9,10,15] and y = [0,1,2,3,4] Then I would do: matplotlib.pyplot.plot(x,y) matplotlib.pyplot.show() and the x axis' ticks are plotted in intervals of 5. Is there a way to make it show intervals of 1? [/INST] You could explicitly set where you want to tick marks with plt.xticks: plt.xticks(np.arange(min(x), max(x)+1, 1.0)) For example, import numpy as np import matplotlib.pyplot as plt x = [0,5,9,10,15] y = [0,1,2,3,4] plt.plot(x,y) plt.xticks(np.arange(min(x), max(x)+1, 1.0)) plt.show() (np.arange was used rather than Python's range function just in case min(x) and max(x) are floats instead of ints.) The plt.plot (or ax.plot) function will automatically set default x and y limits. If you wish to keep those limits, and just change the stepsize of the tick marks, then you could use ax.get_xlim() to discover what limits Matplotlib has already set. start, end = ax.get_xlim() ax.xaxis.set_ticks(np.arange(start, end, stepsize)) The default tick formatter should do a decent job rounding the tick values to a sensible number of significant digits. However, if you wish to have more control over the format, you can define your own formatter. For example, ax.xaxis.set_major_formatter(ticker.FormatStrFormatter('%0.1f')) Here's a runnable example: import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker x = [0,5,9,10,15] y = [0,1,2,3,4] fig, ax = plt.subplots() ax.plot(x,y) start, end = ax.get_xlim() ax.xaxis.set_ticks(np.arange(start, end, 0.712123)) ax.xaxis.set_major_formatter(ticker.FormatStrFormatter('%0.1f')) plt.show() [INST] Python creating a dictionary of lists I want to create a dictionary whose values are lists. For example: { 1: ['1'], 2: ['1','2'], 3: ['2'] } If I do: d = dict() a = ['1', '2'] for i in a: for j in range(int(i), int(i) + 2): d[j].append(i) I get a KeyError, because d[...] isn't a list. In this case, I can add the following code after the assignment of a to initialize the dictionary. for x in range(1, 4): d[x] = list() Is there a better way to do this? Lets say I don't know the keys I am going to need until I am in the second for loop. For example: class relation: scope_list = list() ... d = dict() for relation in relation_list: for scope_item in relation.scope_list: d[scope_item].append(relation) An alternative would then be replacing d[scope_item].append(relation) with if d.has_key(scope_item): d[scope_item].append(relation) else: d[scope_item] = [relation,] What is the best way to handle this? Ideally, appending would "just work". Is there some way to express that I want a dictionary of empty lists, even if I don't know every key when I first create the list? [/INST] You can use defaultdict: >>> from collections import defaultdict >>> d = defaultdict(list) >>> for i in a: ... for j in range(int(i), int(i) + 2): ... d[j].append(i) ... >>> d defaultdict(, {1: ['1'], 2: ['1', '2'], 3: ['2']}) >>> d.items() [(1, ['1']), (2, ['1', '2']), (3, ['2'])] [INST] How to send email attachments with Python I am having problems understanding how to email an attachment using Python. I have successfully emailed simple messages with the smtplib. Could someone please explain how to send an attachment in an email. I know there are other posts online but as a Python beginner I find them hard to understand. [/INST] Here's another, adapted from here: import smtplib from os.path import basename from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.utils import COMMASPACE, formatdate def send_mail(send_from, send_to, subject, text, files=None, server="127.0.0.1"): assert isinstance(send_to, list) msg = MIMEMultipart() msg['From'] = send_from msg['To'] = COMMASPACE.join(send_to) msg['Date'] = formatdate(localtime=True) msg['Subject'] = subject msg.attach(MIMEText(text)) for f in files or []: with open(f, "rb") as fil: part = MIMEApplication( fil.read(), Name=basename(f) ) part['Content-Disposition'] = 'attachment; filename="%s"' % basename(f) msg.attach(part) smtp = smtplib.SMTP(server) smtp.sendmail(send_from, send_to, msg.as_string()) smtp.close() It's much the same as the first example... But it should be easier to drop in. [INST] Python + Django page redirect How do I accomplish a simple redirect (e.g. cflocation in ColdFusion, or header(location:http://) in Django)? [/INST] It's simple: from django.http import HttpResponseRedirect def myview(request): ... return HttpResponseRedirect("/path/") More info in the official Django docs Update: Django 1.0 There is apparently a better way of doing this in Django now using generic views. Example - from django.views.generic.simple import redirect_to urlpatterns = patterns('', (r'^one/$', redirect_to, {'url': '/another/'}), #etc... ) There is more in the generic views documentation. Credit - Carles Barrobés. Update #2: Django 1.3+ In Django 1.5 *redirect_to* no longer exists and has been replaced by RedirectView. Credit to Yonatan from django.views.generic import RedirectView urlpatterns = patterns('', (r'^one/$', RedirectView.as_view(url='/another/')), ) [INST] Rename a dictionary key Is there a way to rename a dictionary key, without reassigning its value to a new name and removing the old name key; and without iterating through dict key/value? In case of OrderedDict, do the same, while keeping that key's position. [/INST] For a regular dict, you can use: mydict[new_key] = mydict.pop(old_key) For an OrderedDict, I think you must build an entirely new one using a comprehension. >>> OrderedDict(zip('123', 'abc')) OrderedDict([('1', 'a'), ('2', 'b'), ('3', 'c')]) >>> oldkey, newkey = '2', 'potato' >>> OrderedDict((newkey if k == oldkey else k, v) for k, v in _.viewitems()) OrderedDict([('1', 'a'), ('potato', 'b'), ('3', 'c')]) Modifying the key itself, as this question seems to be asking, is impractical because dict keys are usually immutable objects such as numbers, strings or tuples. Instead of trying to modify the key, reassigning the value to a new key and removing the old key is how you can achieve the "rename" in python. [INST] python decorators with parameters I have a problem with the transfer of variable 'insurance_mode' by the decorator. I would do it by the following decorator statement: @execute_complete_reservation(True) def test_booking_gta_object(self): self.test_select_gta_object() but unfortunately, this statement does not work. Perhaps maybe there is better way to solve this problem. def execute_complete_reservation(test_case,insurance_mode): def inner_function(self,*args,**kwargs): self.test_create_qsf_query() test_case(self,*args,**kwargs) self.test_select_room_option() if insurance_mode: self.test_accept_insurance_crosseling() else: self.test_decline_insurance_crosseling() self.test_configure_pax_details() self.test_configure_payer_details return inner_function [/INST] You mean def test_booking_gta_object, right? Anyway, the syntax for decorators with arguments is a bit different - the decorator with arguments should return a function that will take a function and return another function. So it should really return a normal decorator. A bit confusing, right? What I mean is: def decorator(argument): def real_decorator(function): def wrapper(*args, **kwargs): funny_stuff() something_with_argument(argument) function(*args, **kwargs) more_funny_stuff() return wrapper return real_decorator Here you can read more on the subject - it's also possible to implement this using callable objects and that is also explained there. [INST] Getting method parameter names in python Given the python function: def aMethod(arg1, arg2): pass How can I extract the number and names of the arguments. Ie. given that I have a reference to func, I want the func.[something] to return ("arg1", "arg2") The usage scenario for this is that I have a decorator, and I wish to use the method arguments in the same order that they appear for the actual function as a key. Ie. how would the decorator look that printed "a,b" when I call aMethod("a","b") [/INST] Take a look at the inspect module - this will do the inspection of the various code object properties for you. >>> inspect.getargspec(aMethod) (['arg1', 'arg2'], None, None, None) The other results are the name of the *args and **kwargs variables, and the defaults provided. ie. >>> def foo(a,b,c=4, *arglist, **keywords): pass >>> inspect.getargspec(foo) (['a', 'b', 'c'], 'arglist', 'keywords', (4,)) [INST] How to use a different version of python during NPM install? Salam (means Hello) :) I have terminal access to a VPS running centos 5.9 and default python 2.4.3 installed. I also installed python 2.7.3 via these commands: (I used make altinstall instead of make install) wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz tar -xf Python-2.7.3.tgz cd Python-2.7.3 ./configure make make altinstall then I installed node.js from source via these commands: python2.7 ./configure make make install The problem is, when I use npm install and try to install a node.js package which requires python > 2.4.3 I get this error: gyp ERR! configure error gyp ERR! stack Error: Python executable "python" is v2.4.3, which is not supported by gyp. gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0. gyp ERR! stack at failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:125:14) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:114:9 how should I "pass the --python switch to point to Python >= v2.5.0"? [/INST] You can use --python option to npm like so: npm install --python=python2.7 or set it to be used always: npm config set python python2.7 Npm will in turn pass this option to node-gyp when needed. (note: I'm the one who opened an issue on Github to have this included in the docs, as there were so many questions about it ;-) ) [INST] Python: split a list based on a condition? What's the best way, both aesthetically and from a performance perspective, to split a list of items into multiple lists based on a conditional? The equivalent of: good = [x for x in mylist if x in goodvals] bad = [x for x in mylist if x not in goodvals] is there a more elegant way to do this? Update: here's the actual use case, to better explain what I'm trying to do: # files looks like: [ ('file1.jpg', 33L, '.jpg'), ('file2.avi', 999L, '.avi'), ... ] IMAGE_TYPES = ('.jpg','.jpeg','.gif','.bmp','.png') images = [f for f in files if f[2].lower() in IMAGE_TYPES] anims = [f for f in files if f[2].lower() not in IMAGE_TYPES] [/INST] good, bad = [], [] for x in mylist: (bad, good)[x in goodvals].append(x) [INST] Python dictionary: are keys() and values() always the same order? It looks like the lists returned by keys() and values() methods of a dictionary are always a 1-to-1 mapping (assuming the dictionary is not altered between calling the 2 methods). For example: >>> d = {'one':1, 'two': 2, 'three': 3} >>> k, v = d.keys(), d.values() >>> for i in range(len(k)): print d[k[i]] == v[i] True True True If you do not alter the dictionary between calling keys() and calling values(), is it wrong to assume the above for-loop will always print True? I could not find any documentation confirming this. [/INST] Found this: If items(), keys(), values(), iteritems(), iterkeys(), and itervalues() are called with no intervening modifications to the dictionary, the lists will directly correspond. On 2.x documentation and 3.x documentation. [INST] How to execute a file within the python interpreter? I'm trying to execute a file with python commands from within the interpreter. EDIT: I'm trying to use variables and settings from that file, not to invoke a separate process. [/INST] Several ways. From the shell python someFile.py From inside IDLE, hit F5. If you're typing interactively, try this. >>> variables= {} >>> execfile( "someFile.py", variables ) >>> print variables # globals from the someFile module [INST] How to delete items from a dictionary while iterating over it? Is it legitimate to delete items from a dictionary in Python while iterating over it? For example: for k, v in mydict.iteritems(): if k == val: del mydict[k] The idea is to remove elements that don't meet a certain condition from the dictionary, instead of creating a new dictionary that's a subset of the one being iterated over. Is this a good solution? Are there more elegant/efficient ways? [/INST] A simple test in the console shows you cannot modify a dictionary while iterating over it: >>> mydict = {'one': 1, 'two': 2, 'three': 3, 'four': 4} >>> for k, v in mydict.iteritems(): ... if k == 'two': ... del mydict[k] ... ------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in RuntimeError: dictionary changed size during iteration As stated in delnan's answer, deleting entries causes problems when the iterator tries to move onto the next entry. Instead, use the keys() method to get a list of the keys and work with that: >>> for k in mydict.keys(): ... if k == 'two': ... del mydict[k] ... >>> mydict {'four': 4, 'three': 3, 'one': 1} If you need to delete based on the items value, use the items() method instead: >>> for k, v in mydict.items(): ... if v == 3: ... del mydict[k] ... >>> mydict {'four': 4, 'one': 1} [INST] Case insensitive Python regular expression without re.compile In Python, I can compile a regular expression to be case-insensitive using re.compile: >>> s = 'TeSt' >>> casesensitive = re.compile('test') >>> ignorecase = re.compile('test', re.IGNORECASE) >>> >>> print casesensitive.match(s) None >>> print ignorecase.match(s) <_sre.SRE_Match object at 0x02F0B608> Is there a way to do the same, but without using re.compile. I can't find anything like Perl's i suffix (e.g. m/test/i) in the documentation. [/INST] Pass re.IGNORECASE to the flags param of search, match, or sub: re.search('test', 'TeSt', re.IGNORECASE) re.match('test', 'TeSt', re.IGNORECASE) re.sub('test', 'xxxx', 'Testing', flags=re.IGNORECASE) [INST] find nearest value in numpy array is there a numpy-thonic way, e.g. function, to find the 'nearest value' in an array? example: np.find_nearest( array, value ) [/INST] import numpy as np def find_nearest(array,value): idx = (np.abs(array-value)).argmin() return array[idx] array = np.random.random(10) print(array) # [ 0.21069679 0.61290182 0.63425412 0.84635244 0.91599191 0.00213826 # 0.17104965 0.56874386 0.57319379 0.28719469] value = 0.5 print(find_nearest(array, value)) # 0.568743859261 [INST] Python Infinity - Any caveats? So Python has positive and negative infinity: float("inf"), float("-inf") This just seems like the type of feature that has to have some caveat. Is there anything I should be aware of? [/INST] You can still get not-a-number (NaN) values from simple arithmetic involving inf: >>> 0 * float("inf") nan Note that you will normally not get an inf value through usual arithmetic calculations: >>> 2.0**2 4.0 >>> _**2 16.0 >>> _**2 256.0 >>> _**2 65536.0 >>> _**2 4294967296.0 >>> _**2 1.8446744073709552e+19 >>> _**2 3.4028236692093846e+38 >>> _**2 1.157920892373162e+77 >>> _**2 1.3407807929942597e+154 >>> _**2 Traceback (most recent call last): File "", line 1, in ? OverflowError: (34, 'Numerical result out of range') The inf value is considered a very special value with unusual semantics, so it's better to know about an OverflowError straight away through an exception, rather than having an inf value silently injected into your calculations. [INST] Compact way of writing (a + b == c or a + c == b or b + c == a) Is there a more compact or pythonic way to write the boolean expression a + b == c or a + c == b or b + c == a I came up with a + b + c in (2*a, 2*b, 2*c) but that is a little strange. [/INST] If we look at the Zen of Python, emphasis mine: The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than right now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! The most Pythonic solution is the one that is clearest, simplest, and easiest to explain: a + b == c or a + c == b or b + c == a Even better, you don't even need to know Python to understand this code! It's that easy. This is, without reservation, the best solution. Anything else is intellectual masturbation. Furthermore, this is likely the best performing solution as well, as it is the only one out of all the proposals that short circuits. If a + b == c, only a single addition and comparison is done. [INST] How to hide output of subprocess in Python 2.7 I'm using eSpeak on Ubuntu and have a Python 2.7 script that prints and speaks a message: import subprocess text = 'Hello World.' print text subprocess.call(['espeak', text]) eSpeak produces the desired sounds, but clutters the shell with some errors (ALSA lib..., no socket connect) so i cannot easily read what was printed earlier. Exit code is 0. Unfortunately there is no documented option to turn off its verbosity, so I'm looking for a way to only visually silence it and keep the open shell clean for further interaction. How can I do this? [/INST] Redirect the output to DEVNULL: import os import subprocess FNULL = open(os.devnull, 'w') retcode = subprocess.call(['echo', 'foo'], stdout=FNULL, stderr=subprocess.STDOUT) It is effectively the same as running this shell command: retcode = os.system("echo 'foo' &> /dev/null") [INST] Iterate a list with indexes in Python I could swear I've seen the function (or method) that takes a list, like this [3, 7, 19] and makes it into iterable list of tuples, like so: [(0,3), (1,7), (2,19)] to use it instead of: for i in range(len(name_of_list)): name_of_list[i] = something but I can't remember the name and googling "iterate list" gets nothing. [/INST] >>> a = [3,4,5,6] >>> for i, val in enumerate(a): ... print i, val ... 0 3 1 4 2 5 3 6 >>> [INST] How to download large file in python with requests.py? Requests is a really nice library. I'd like to use it for download big files (>1GB). The problem is it's not possible to keep whole file in memory I need to read it in chunks. And this is a problem with the following code import requests def DownloadFile(url) local_filename = url.split('/')[-1] r = requests.get(url) f = open(local_filename, 'wb') for chunk in r.iter_content(chunk_size=512 * 1024): if chunk: # filter out keep-alive new chunks f.write(chunk) f.close() return By some reason it doesn't work this way. It still loads response into memory before save it to a file. [/INST] I figured out what should be changed. The trick was to set stream = True in the get() method. After this python process stopped to suck memory (stays around 30kb regardless size of the download file). Thank you @danodonovan for you syntax I use it here: def download_file(url): local_filename = url.split('/')[-1] # NOTE the stream=True parameter r = requests.get(url, stream=True) with open(local_filename, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: # filter out keep-alive new chunks f.write(chunk) #f.flush() commented by recommendation from J.F.Sebastian return local_filename See http://docs.python-requests.org/en/latest/user/advanced/#body-content-workflow for further reference. [INST] Why return NotImplemented instead of raising NotImplementedError Python has a singleton called NotImplemented. Why would someone want to ever return NotImplemented instead of raising the NotImplementedError exception? Won't it just make it harder to find bugs, such as code that executes invalid methods? [/INST] It's because __lt__() and related comparison methods are quite commonly used indirectly in list sorts and such. Sometimes the algorithm will choose to try another way or pick a default winner. Raising an exception would break out of the sort unless caught, whereas NotImplemented doesn't get raised and can be used in further tests. http://jcalderone.livejournal.com/32837.html To summarise that link: "NotImplemented signals to the runtime that it should ask someone else to satisfy the operation. In the expression a == b, if a.__eq__(b) returns NotImplemented, then Python tries b.__eq__(a). If b knows enough to return True or False, then the expression can succeed. If it doesn't, then the runtime will fall back to the built-in behavior (which is based on identity for == and !=)." [INST] Python multiprocessing pool.map for multiple arguments In the Python multiprocessing library, is there a variant of pool.map which support multiple arguments? text = "test" def harvester(text, case): X = case[0] return text+ str(X) if __name__ == '__main__': pool = multiprocessing.Pool(processes=6) case = RAW_DATASET pool.map(harvester(text,case),case, 1) pool.close() pool.join() [/INST] is there a variant of pool.map which support multiple arguments? Python 3.3 includes pool.starmap() method: #!/usr/bin/env python3 from functools import partial from itertools import repeat from multiprocessing import Pool, freeze_support def func(a, b): return a + b def main(): a_args = [1,2,3] second_arg = 1 with Pool() as pool: L = pool.starmap(func, [(1, 1), (2, 1), (3, 1)]) M = pool.starmap(func, zip(a_args, repeat(second_arg))) N = pool.map(partial(func, b=second_arg), a_args) assert L == M == N if __name__=="__main__": freeze_support() main() For older versions: #!/usr/bin/env python2 import itertools from multiprocessing import Pool, freeze_support def func(a, b): print a, b def func_star(a_b): """Convert `f([1,2])` to `f(1,2)` call.""" return func(*a_b) def main(): pool = Pool() a_args = [1,2,3] second_arg = 1 pool.map(func_star, itertools.izip(a_args, itertools.repeat(second_arg))) if __name__=="__main__": freeze_support() main() Output 1 1 2 1 3 1 Notice how itertools.izip() and itertools.repeat() are used here. Due to the bug mentioned by @unutbu you can't use functools.partial() or similar capabilities on Python 2.6, so the simple wrapper function func_star() should be defined explicitly. See also the workaround suggested by uptimebox. [INST] Python string.join(list) on object array rather than string array In Python, I can do: >>> list = ['a', 'b', 'c'] >>> ', '.join(list) 'a, b, c' Is there any easy way to do the same when I have a list of objects? >>> class Obj: ... def __str__(self): ... return 'name' ... >>> list = [Obj(), Obj(), Obj()] >>> ', '.join(list) Traceback (most recent call last): File "", line 1, in TypeError: sequence item 0: expected string, instance found Or do I have to resort to a for loop? [/INST] You could use a list comprehension or a generator expression instead: ', '.join([str(x) for x in list]) # list comprehension ', '.join(str(x) for x in list) # generator expression [INST] Is Python strongly typed? I've come across links that say Python is a strongly typed language. However, I thought in strongly typed languages you couldn't do this : bob = 1 bob = "bob" I thought a strongly typed language didn't accept type-changing at run-time. Maybe I've got a wrong (or too simplist) definition of strong/weak types. So, is Python a strongly or weakly typed language? [/INST] Python is strongly, dynamically typed. Strong typing means that the type of a value doesn't suddenly change. A string containing only digits doesn't magically become a number, as may happen in Perl. Every change of type requires an explicit conversion. Dynamic typing means that runtime objects (values) have a type, as opposed to static typing where variables have a type. As for your example bob = 1 bob = "bob" This works because the variable does not have a type; it can name any object. After bob=1, you'll find that type(bob) returns int, but after bob="bob", it returns str. (Note that type is a regular function, so it evaluates its argument, then returns the type of the value.) Contrast this with older dialects of C, which were weakly, statically typed, so that pointers and integers were pretty much interchangeable. (Modern ISO C requires conversions in many cases, but my compiler is still lenient about this by default.) I must add that the strong vs. weak typing is more of a continuum than a boolean choice. C++ has stronger typing than C (more conversions required), but the type system can be subverted by using pointer casts. The strength of the type system in a dynamic language such as Python is really determined by how its primitives and library functions respond to different types. E.g., + is overloaded so that it works on two numbers or two strings, but not a string and an number. This is a design choice made when + was implemented, but not really a necessity following from the language's semantics. In fact, when you overload + on a custom type, you can make it implicitly convert anything to a number: def to_number(x): """Try to convert x to a number.""" if x is None: return 0 # more special cases here else: return float(x) # works for numbers and strings class Foo(object): def __add__(self, other): other = to_number(other) # now do the addition (The only language that I know that is completely strongly typed, aka strictly typed, is Haskell, where types are entirely disjoint and only a controlled form of overloading is possible via type classes.) [INST] Sort a list by multiple attributes? I have a list of lists: [[12, 'tall', 'blue', 1], [2, 'short', 'red', 9], [4, 'tall', 'blue', 13]] If I wanted to sort by one element, say the tall/short element, I could do it via s = sorted(s, key = itemgetter(1)). If I wanted to sort by both tall/short and colour, I could do the sort twice, once for each element, but is there a quicker way? [/INST] A key can be a function that returns a tuple: s = sorted(s, key = lambda x: (x[1], x[2])) Or you can achieve the same using itemgetter: import operator s = sorted(s, key = operator.itemgetter(1, 2)) And notice that here you can use sort instead of using sorted and then reassigning: s.sort(key = operator.itemgetter(1, 2)) [INST] How to perform OR condition in django queryset? I want to write a Django query equivalent to this SQL query: SELECT * from user where income >= 5000 or income is NULL. How to construct the Djagno queryset filter? User.objects.filter(income__gte=5000, income=0) This doesn't work, because it ANDs the filters. I want to OR the filters to get union of individual querysets. [/INST] from django.db.models import Q User.objects.filter(Q(income__gte=5000) | Q(income__isnull=True)) via Documentation [INST] Is there a "not equal" operator in Python? How would you say does not equal? Like if hi == hi: print "hi" elif hi (does not equal) bye: print "no hi" Is there a replacement for == that means "not equal"? [/INST] Use != (preferred) or <> (deprecated). See comparison operators. For comparing object identities, you can use the keyword is and its negation is not. e.g. 1 == 1 # true 1 != 1 # false 1 <> 1 # false [] is [] # false (distinct objects) a = b = []; a is b # true (same object) [INST] Python setup.py develop vs install Two options in setup.py develop and install are confusing me. According to this site, using develop creates a special link to site-packages directory. People have suggested that I use python setup.py install for a fresh installation and python setup.py develop after any changes have been made to the setup file. Can anyone shed some light on the usage of these commands? [/INST] python setup.py install is used to install (typically third party) packages that you're not going to be developing/editing/debugging yourself. For your own stuff, you want to get your package installed and then be able to frequently edit your code and not have to re-install your package—this is exactly what python setup.py develop does: installs the package (typically just a source folder) in a way that allows you to conveniently edit your code after its installed to the (virtual) environment and have the changes take effect immediately. [INST] Why doesn't os.path.join() work in this case? The below code will not join, when debugged the command does not store the whole path but just the last entry. os.path.join('/home/build/test/sandboxes/', todaystr, '/new_sandbox/') When I test this it only stores the /new_sandbox/ part of the code. [/INST] The latter strings shouldn't start with a slash. If they start with a slash, then they're considered an "absolute path" and everything before them is discarded. Quoting the Python docs for os.path.join: If any component is an absolute path, all previous components (on Windows, including the previous drive letter, if there was one) are thrown away, and joining continues. [INST] How to start a background process in Python? I'm trying to port a shell script to the much more readable python version. The original shell script starts several processes (utilities, monitors, etc.) in the background with "&". How can I achieve the same effect in python? I'd like these processes not to die when the python scripts complete. I am sure it's related to the concept of a daemon somehow, but I couldn't find how to do this easily. [/INST] While jkp's solution works, the newer way of doing things (and the way the documentation recommends) is to use the subprocess module. For simple commands its equivalent, but it offers more options if you want to do something complicated. Example for your case: import subprocess subprocess.Popen(["rm","-r","some.file"]) This should run rm -r somefile in the background. But be wary: subprocess.Popen() only runs a process in the background if nothing in the python script depends on the output of the command being run: For example, the following command will not run in the background: import subprocess ls_output=subprocess.Popen(["ls", "-a"], stdout=subprocess.PIPE) See the documentation here. Also, a point of clarification: "Background" purely a shell concept: what you probably want is to spawn a new process. I've used "background" here to refer to shell-background-like behavior, but don't mistake this for the process actually being in the background. [INST] Convert a number range to another range, maintaining ratio I'm trying to convert one range of numbers to another, maintaining ratio. Maths is not my strong point. I have an image file where point values may range from -16000.00 to 16000.00 though the typical range may be much less. What I want to do is compress these values into the integer range 0-100, where 0 is the value of the smallest point, and 100 is the value of the largest. All points in between should keep a relative ratio even though some precision is being lost I'd like to do this in python but even a general algorithm should suffice. I'd prefer an algorithm where the min/max or either range can be adjusted (ie, the second range could be -50 to 800 instead of 0 to 100). [/INST] NewValue = (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin Or a little more readable: OldRange = (OldMax - OldMin) NewRange = (NewMax - NewMin) NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin Or if you want to protect for the case where the old range is 0 (OldMin = OldMax): OldRange = (OldMax - OldMin) if (OldRange == 0) NewValue = NewMin else { NewRange = (NewMax - NewMin) NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin } Note that in this case we're forced to pick one of the possible new range values arbitrarily. Depending on context, sensible choices could be: NewMin (see sample), NewMax or (NewMin + NewMax) / 2 [INST] Is there a way to use PhantomJS in Python? I want to use PhantomJS in Python. I googled this problem but couldn't find proper solutions. I find os.popen() may be a good choice. But I couldn't pass some arguments to it. Using subprocess.Popen() may be a proper solution for now. I want to know whether there's a better solution or not. Is there a way to use PhantomJS in Python? [/INST] The easiest way to use PhantomJS in python is via Selenium. The simplest installation method is Install NodeJS Using Node's package manager install phantomjs: npm -g install phantomjs install selenium (in your virtualenv, if you are using that) After installation, you may use phantom as simple as: from selenium import webdriver driver = webdriver.PhantomJS() # or add to your PATH driver.set_window_size(1024, 768) # optional driver.get('https://google.com/') driver.save_screenshot('screen.png') # save a screenshot to disk sbtn = driver.find_element_by_css_selector('button.gbqfba') sbtn.click() If your system path environment variable isn't set correctly, you'll need to specify the exact path as an argument to webdriver.PhantomJS(). Replace this: driver = webdriver.PhantomJS() # or add to your PATH ... with the following: driver = webdriver.PhantomJS(executable_path='/usr/local/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs') References: http://selenium-python.readthedocs.org/en/latest/api.html How do I set a proxy for phantomjs/ghostdriver in python webdriver? http://python.dzone.com/articles/python-testing-phantomjs [INST] In Python, how do I iterate over a dictionary in sorted order? There's an existing function that ends in: return dict.iteritems() that returns an unsorted iterator for a given dictionary. I would like to return an iterator that goes through the items in sorted order. How do I do that? [/INST] Haven't tested this very extensively, but works in Python 2.5.2. >>> d = {"x":2, "h":15, "a":2222} >>> it = iter(sorted(d.iteritems())) >>> it.next() ('a', 2222) >>> it.next() ('h', 15) >>> it.next() ('x', 2) >>> [INST] Easiest way to rename a model using Django/South? I've been hunting for an answer to this on South's site, Google, and SO, but couldn't find a simple way to do this. I want to rename a Django model using South. Say you have the following: class Foo(models.Model): name = models.CharField() class FooTwo(models.Model): name = models.CharField() foo = models.ForeignKey(Foo) and you want to convert Foo to Bar, namely class Bar(models.Model): name = models.CharField() class FooTwo(models.Model): name = models.CharField() foo = models.ForeignKey(Bar) To keep it simple, I'm just trying to change the name from Foo to Bar, but ignore the foo member in FooTwo for now. What's the easiest way to do this using South? I could probably do a data migration, but that seems pretty involved. Write a custom migration, e.g. db.rename_table('city_citystate', 'geo_citystate'), but I'm not sure how to fix the foreign key in this case. An easier way that you know? [/INST] To answer your first question, the simple model/table rename is pretty straightforward. Run the command: ./manage.py schemamigration yourapp rename_foo_to_bar --empty (Update 2: try --auto instead of --empty to avoid the warning below. Thanks to @KFB for the tip.) If you're using an older version of south, you'll need startmigration instead of schemamigration. Then manually edit the migration file to look like this: class Migration(SchemaMigration): def forwards(self, orm): db.rename_table('yourapp_foo', 'yourapp_bar') def backwards(self, orm): db.rename_table('yourapp_bar','yourapp_foo') You can accomplish this more simply using the db_table Meta option in your model class. But every time you do that, you increase the legacy weight of your codebase -- having class names differ from table names makes your code harder to understand and maintain. I fully support doing simple refactorings like this for the sake of clarity. (update) I just tried this in production, and got a strange warning when I went to apply the migration. It said: The following content types are stale and need to be deleted: yourapp | foo Any objects related to these content types by a foreign key will also be deleted. Are you sure you want to delete these content types? If you're unsure, answer 'no'. I answered "no" and everything seemed to be fine. [INST] What is the best way to call a Python script from another Python script? I have a script named test1.py which is not in a module. It just has code that should execute when the script itself is run. There are no functions, classes, methods, etc. I have another script which runs as a service. I want to call test1.py from the script running as a service. For example: File test1.py print "I am a test" print "see! I do nothing productive." File service.py # Lots of stuff here test1.py # do whatever is in test1.py I'm aware of one method which is opening the file, reading the contents, and basically eval'ing it. I'm assuming there's a better way of doing this. Or at least I hope so. [/INST] The usual way to do this is something like the following. test1.py def some_func(): print 'in test 1, unproductive' if __name__ == '__main__': # test1.py executed as script # do something some_func() service.py import test1 def service_func(): print 'service func' if __name__ == '__main__': # service.py executed as script # do something service_func() test1.some_func() [INST] Python variable scope error I've been programming for many years, and recently started learning Python. The following code works as expected in both python 2.5 and 3.0 (on OS X if that matters): a, b, c = (1, 2, 3) print(a, b, c) def test(): print(a) print(b) print(c) # (A) #c+=1 # (B) test() However, when I uncomment line (B), I get an UnboundLocalError: 'c' not assigned at line (A). The values of a and b are printed correctly. This has me completely baffled for two reasons: Why is there a runtime error thrown at line (A) because of a later statement on line (B)? Why are variables a and b printed as expected, while c raises an error? The only explanation I can come up with is that a local variable c is created by the assignment c+=1, which takes precedent over the "global" variable c even before the local variable is created. Of course, it doesn't make sense for a variable to "steal" scope before it exists. Could someone please explain this behavior? [/INST] Python treats variables in functions differently depending on whether you assign values to them from within the function or not. If you assign any value to a variable, it is treated by default as a local variable. Therefore, when you uncomment the line, you are attempting to reference a local variable before any value has been assigned to it. If you want the variable c to refer to the global c put global c as the first line of the function. As of python 3, there is now nonlocal c that you can use to refer to the nearest enclosing (not necessarily global) scope. [INST] Calculating arithmetic mean (average) in Python Is there a built-in or standard library method in Python to calculate the arithmetic mean (average) of a list of numbers? [/INST] I am not aware of anything in the standard library. However, you could use something like: def mean(numbers): return float(sum(numbers)) / max(len(numbers), 1) >>> mean([1,2,3,4]) 2.5 >>> mean([]) 0.0 In numpy, there's numpy.mean(). [INST] Django auto_now and auto_now_add For Django 1.1. I have this in my models.py: class User(models.Model): created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) When updating a row I get: [Sun Nov 15 02:18:12 2009] [error] /home/ptarjan/projects/twitter-meme/django/db/backends/mysql/base.py:84: Warning: Column 'created' cannot be null [Sun Nov 15 02:18:12 2009] [error] return self.cursor.execute(query, args) The relevant part of my database is: `created` datetime NOT NULL, `modified` datetime NOT NULL, Is this cause for concern? Side question: in my admin tool, those two fields aren't showing up. Is that expected? [/INST] Any field with the auto_now attribute set will also inherit editable=False and therefore will not show up in the admin panel. There has been talk in the past about making the auto_now and auto_now_add arguments go away, and although they still exist, I feel you're better off just using a custom save() method. So, to make this work properly, I would recommend not using auto_now or auto_now_add and instead define your own save() method to make sure that created is only updated if id is not set (such as when the item is first created), and have it update modified every time the item is saved. I have done the exact same thing with other projects I have written using Django, and so your save() would look like this: from django.utils import timezone class User(models.Model): created = models.DateTimeField(editable=False) modified = models.DateTimeField() def save(self, *args, **kwargs): ''' On save, update timestamps ''' if not self.id: self.created = timezone.now() self.modified = timezone.now() return super(User, self).save(*args, **kwargs) Hope this helps! Edit in response to comments: The reason why I just stick with overloading save() vs. relying on these field arguments is two-fold: The aforementioned ups and downs with their reliability. These arguments are heavily reliant on the way each type of database that Django knows how to interact with treats a date/time stamp field, and seems to break and/or change between every release. (Which I believe is the impetus behind the call to have them removed altogether). The fact that they only work on DateField, DateTimeField, and TimeField, and by using this technique you are able to automatically populate any field type every time an item is saved. Use django.utils.timezone.now() vs. datetime.datetime.now(), because it will return a TZ-aware or naive datetime.datetime object depending on settings.USE_TZ. To address why the OP saw the error, I don't know exactly, but it looks like created isn't even being populated at all, despite having auto_now_add=True. To me it stands out as a bug, and underscores item #1 in my little list above: auto_now and auto_now_add are flaky at best. [INST] Postgres: INSERT if does not exist already I'm using Python to write to a postgres database: sql_string = "INSERT INTO hundred (name,name_slug,status) VALUES (" sql_string += hundred + ", '" + hundred_slug + "', " + status + ");" cursor.execute(sql_string) But because some of my rows are identical, I get the following error: psycopg2.IntegrityError: duplicate key value violates unique constraint "hundred_pkey" How can I write an 'INSERT unless this row already exists' SQL statement? I've seen complex statements like this recommended: IF EXISTS (SELECT * FROM invoices WHERE invoiceid = '12345') UPDATE invoices SET billed = 'TRUE' WHERE invoiceid = '12345' ELSE INSERT INTO invoices (invoiceid, billed) VALUES ('12345', 'TRUE') END IF But firstly, is this overkill for what I need, and secondly, how can I execute one of those as a simple string? [/INST] How can I write an 'INSERT unless this row already exists' SQL statement? There is a nice way of doing conditional INSERT in PostgreSQL: INSERT INTO example_table (id, name) SELECT 1, 'John' WHERE NOT EXISTS ( SELECT id FROM example_table WHERE id = 1 ); CAVEAT This approach is not 100% reliable for concurrent write operations, though. There is a very tiny race condition between the SELECT in the NOT EXISTS anti-semi-join and the INSERT itself. It can fail under such conditions. [INST] How can I get the whole request POST body in Python with Flask? I want to be able to get the whole POST body of the request as a string or file handle that I can read but I'm unable to find a way (I'm new to Flask and Python for web at all). This is what I got: from flask import Flask app = Flask(__name__) @app.route('/', methods=['GET', 'POST']) def parse_request(): # obtain the whole post body here, in case the request is post... AS THIS QUESTION IS GETTING MANY VIEWS: The answer to the question linked below is telling a way that works only if the content-type is not recognised, this one instead is asking how to get the whole raw post body regardless of the headers: Get raw POST body in Python Flask regardless of Content-Type header [/INST] The docs describe the attributes available on the request. In most common cases request.data will be empty because it's used as a fallback: request.data Contains the incoming request data as string in case it came with a mimetype Flask does not handle. request.args: the key/value pairs in the URL query string request.form: the key/value pairs in the body, as sent by a HTML POST form request.files: the files in the body, which Flask keeps separate from form request.values: combined args and form, preferring args if keys overlap [INST] Flask - configure dev server to be visible across the network I'm not sure if this is Flask specific, but when I run an app in dev mode (http://localhost:5000), I cannot access it from other machines on the network (with http://[dev-host-ip]:5000). With Rails in dev mode, for example, it works fine. I couldn't find any docs regarding the Flask dev server configuration. Any idea what should be configured to enable this? [/INST] Add a parameter to your app.run(). By default it runs on localhost, change it to app.run(host= '0.0.0.0') to run on your machines IP address. Documented on the Flask site under "Externally Visible Server" on the Quickstart page: Externally Visible Server If you run the server you will notice that the server is only available from your own computer, not from any other in the network. This is the default because in debugging mode a user of the application can execute arbitrary Python code on your computer. If you have debug disabled or trust the users on your network, you can make the server publicly available. Just change the call of the run() method to look like this: app.run(host='0.0.0.0') This tells your operating system to listen on a public IP. [INST] Django set default form values I have a Model as follows class TankJournal(models.Model): user = models.ForeignKey(User) tank = models.ForeignKey(TankProfile) ts = models.IntegerField(max_length=15) title = models.CharField(max_length=50) body = models.TextField() I have a modelform as follows for that model class JournalForm(ModelForm): tank = forms.IntegerField(widget=forms.HiddenInput()) class Meta: model = TankJournal exclude = ('user','ts') I want to know how to set the default value for that tank hidden field.. Here is my function to show/save the form so far def addJournal(request, id=0): if not request.user.is_authenticated(): return HttpResponseRedirect('/') # # checking if they own the tank # from django.contrib.auth.models import User user = User.objects.get(pk=request.session['id']) if request.method == 'POST': form = JournalForm(request.POST) if form.is_valid(): obj = form.save(commit=False) # # setting the user and ts # from time import time obj.ts = int(time()) obj.user = user obj.tank = TankProfile.objects.get(pk=form.cleaned_data['tank_id']) # # saving the test # obj.save() else: form = JournalForm() try: tank = TankProfile.objects.get(user=user, id=id) except TankProfile.DoesNotExist: return HttpResponseRedirect('/error/') form.tank = id return render_to_response('ajax/tank_addJournal.html', {'form': form}, context_instance=RequestContext(request)) thanks! [/INST] You can use initial which is explained here You have two options either populate the value when calling form constructor: form = JournalForm(initial={'tank': 123}) or set the value in the form definition: tank = forms.IntegerField(widget=forms.HiddenInput(), initial=123) [INST] How do I get a Cron like scheduler in Python? I'm looking for a library in Python which will provide at and cron like functionality. I'd quite like have a pure Python solution, rather than relying on tools installed on the box; this way I run on machines with no cron. For those unfamiliar with cron: you can schedule tasks based upon an expression like: 0 2 * * 7 /usr/bin/run-backup # run the backups at 0200 on Every Sunday 0 9-17/2 * * 1-5 /usr/bin/purge-temps # run the purge temps command, every 2 hours between 9am and 5pm on Mondays to Fridays. The cron time expression syntax is less important, but I would like to have something with this sort of flexibility. If there isn't something that does this for me out-the-box, any suggestions for the building blocks to make something like this would be gratefully received. Edit I'm not interested in launching processes, just "jobs" also written in Python - python functions. By necessity I think this would be a different thread, but not in a different process. To this end, I'm looking for the expressivity of the cron time expression, but in Python. Cron has been around for years, but I'm trying to be as portable as possible. I cannot rely on its presence. [/INST] If you're looking for something lightweight checkout schedule: import schedule import time def job(): print("I'm working...") schedule.every(10).minutes.do(job) schedule.every().hour.do(job) schedule.every().day.at("10:30").do(job) while 1: schedule.run_pending() time.sleep(1) Disclosure: I'm the author of that library. [INST] How do I split a multi-line string into multiple lines? I have a multi-line string literal that I want to do an operation on each line, like so: inputString = """Line 1 Line 2 Line 3""" I want to do something like the following: for line in inputString: doStuff() [/INST] inputString.splitlines() Will give you a list with each item, the splitlines() method is designed to split each line into a list element. [INST] Hiding axis text in matplotlib plots I'm trying to plot a figure without tickmarks or numbers on either of the axes (I use axes in the traditional sense, not the matplotlib nomenclature!). An issue I have come across is where matplotlib adjusts the x(y)ticklabels by subtracting a value N, then adds N at the end of the axis. This may be vague, but the following simplified example highlights the issue, with '6.18' being the offending value of N: import matplotlib.pyplot as plt import random prefix = 6.18 rx = [prefix+(0.001*random.random()) for i in arange(100)] ry = [prefix+(0.001*random.random()) for i in arange(100)] plt.plot(rx,ry,'ko') frame1 = plt.gca() for xlabel_i in frame1.axes.get_xticklabels(): xlabel_i.set_visible(False) xlabel_i.set_fontsize(0.0) for xlabel_i in frame1.axes.get_yticklabels(): xlabel_i.set_fontsize(0.0) xlabel_i.set_visible(False) for tick in frame1.axes.get_xticklines(): tick.set_visible(False) for tick in frame1.axes.get_yticklines(): tick.set_visible(False) plt.show() The three things I would like to know are: How to turn off this behaviour in the first place (although in most cases it is useful, it is not always!) I have looked through matplotlib.axis.XAxis and cannot find anything appropriate How can I make N disappear (i.e. X.set_visible(False)) Is there a better way to do the above anyway? My final plot would be 4x4 subplots in a figure, if that is relevant. [/INST] Instead of hiding each element, you can hide the whole axis: frame1.axes.get_xaxis().set_visible(False) frame1.axes.get_yaxis().set_visible(False) Or, you can set the ticks to an empty list: frame1.axes.get_xaxis().set_ticks([]) frame1.axes.get_yaxis().set_ticks([]) In this second option, you can still use plt.xlabel() and plt.ylabel() to add labels to the axes. [INST] How to create a zip archive of a directory How can I create a zip archive of a directory structure in Python? [/INST] As others have pointed out, you should use zipfile. The documentation tells you what functions are available, but doesn't really explain how you can use them to zip an entire directory. I think it's easiest to explain with some example code: #!/usr/bin/env python import os import zipfile def zipdir(path, ziph): # ziph is zipfile handle for root, dirs, files in os.walk(path): for file in files: ziph.write(os.path.join(root, file)) if __name__ == '__main__': zipf = zipfile.ZipFile('Python.zip', 'w', zipfile.ZIP_DEFLATED) zipdir('tmp/', zipf) zipf.close() Adapted from: http://www.devshed.com/c/a/Python/Python-UnZipped/ [INST] Is it possible to use pip to install a package from a private github repository? As the title suggests I am trying to install a python package from a private github repo. For a public repository I can issue the following command which works fine: pip install git+git://github.com/django/django.git However if I try this for a private repository: pip install git+git://github.com/echweb/echweb-utils.git I get the following output: Downloading/unpacking git+git://github.com/echweb/echweb-utils.git Cloning Git repository git://github.com/echweb/echweb-utils.git to /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-VRsIoo-build Complete output from command /usr/local/bin/git clone git://github.com/echweb/echweb-utils.git /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-VRsIoo-build: fatal: The remote end hung up unexpectedly Cloning into /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-VRsIoo-build... ---------------------------------------- Command /usr/local/bin/git clone git://github.com/echweb/echweb-utils.git /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-VRsIoo-build failed with error code 128 I guess this is because I am trying to access a private repository without providing any authentication. I therefore tried to use git+ssh hoping that pip would use my ssh public key to authenticate: pip install git+ssh://github.com/echweb/echweb-utils.git This gives the following output: Downloading/unpacking git+ssh://github.com/echweb/echweb-utils.git Cloning Git repository ssh://github.com/echweb/echweb-utils.git to /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-DQB8s4-build Complete output from command /usr/local/bin/git clone ssh://github.com/echweb/echweb-utils.git /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-DQB8s4-build: Cloning into /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-DQB8s4-build... Permission denied (publickey). fatal: The remote end hung up unexpectedly ---------------------------------------- Command /usr/local/bin/git clone ssh://github.com/echweb/echweb-utils.git /var/folders/cB/cB85g9P7HM4jcPn7nrvWRU+++TI/-Tmp-/pip-DQB8s4-build failed with error code 128 Does anyone know if it what I am trying to achieve is even possible? If so can you please tell me how? [/INST] You can use git+ssh URI scheme, but you MUST set username: pip install git+ssh://git@github.com/echweb/echweb-utils.git See git@ part into URI? PS: Also read about deploy keys. PPS: In my installation the "git+ssh" URI scheme works only with "editable" requirements: pip install -e URI#egg=EggName Remember: Change the : character that git remote -v prints to a / character before using the remote's address in the pip command: $ git remote -v origin git@github.com:echweb/echweb-utils.git (fetch) ^ change this to a '/' character If you forget, you will get this error: ssh: Could not resolve hostname github.com:echweb: nodename nor servname provided, or not known [INST] 'import module' or 'from module import' I've tried to find a comprehensive guide on whether it is best to use import module or from module import. I've just started with Python, with the intention for developing web applications with Django and I'm trying to start off with best practices in mind. Basically, I was hoping if anyone could share their experiences, what preferences other developers have and whats the best way to avoid any gotchas down the road. [/INST] The difference between import module and from module import foo is mainly subjective. Pick the one you like best and be consistent in your use of it. Here are some points to help you decide. import module Pros: Less maintenance of your import statements. Don't need to add any additional imports to start using another item from the module Cons: Typing module.foo in your code can be tedious and redundant (tedium can be minimized by using import module as mo then typing mo.foo) from module import foo Pros: Less typing to use foo More control over which items of a module can be accessed Cons: To use a new item from the module you have to update your import statement You lose context about foo. For example, it's less clear what ceil() does compared to math.ceil() Either method is acceptable, but don't use from module import *. For any reasonable large set of code, if you import * you will likely be cementing it into the module, unable to be removed. This is because it is difficult to determine what items used in the code are coming from 'module', making it easy to get to the point where you think you don't use the import any more but it's extremely difficult to be sure. [INST] Using javadoc for Python documentation I am currently beginning with Python and I have a strong PHP background and in PHP I have took the habit of using javadoc as a documentation template. I was wondering if javadoc has its place as docstring documentation in Python. Is something like this too elaborate to fit in the Python mindset or should I try to be as concise as possible? """ replaces template place holder with values @param string timestamp formatted date to display @param string priority priority number @param string priority_name priority name @param string message message to display @return string formatted string """ And if I am a bit too exhaustive should I go with something like this instead (where most of the documentation doesn't get printed through the __doc__ method)? # replaces template place holder with values # # @param string timestamp formatted date to display # @param string priority priority number # @param string priority_name priority name # @param string message message to display # # @return string formatted string def format(self, timestamp = '', priority = '', priority_name = '', message = ''): """ replaces template place holder with values """ values = {'%timestamp%' : timestamp, '%priorityName%' : priority_name, '%priority%' : priority, '%message%' : message} return self.__pattern.format(**values) [/INST] Have a look at the reStructuredText (also known as "reST") format, which is a plaintext/docstring markup format, and probably the most popular in the Python world. And you should certainly look at Sphinx, a tool to generate documentation from reStructuredText (used for eg. the Python documentation itself). Sphinx includes the possibility to extract documentation from the docstrings in your code (see sphinx.ext.autodoc), and recognizes reST field lists following certain conventions. This has probably become (or is becoming) the most popular way to do it. Your example could look as follows: """Replaces template placeholder with values. :param timestamp: formatted date to display :param priority: priority number :param priority_name: priority name :param message: message to display :returns: formatted string """ Or extended with type information: """Replaces template placeholder with values. :param timestamp: formatted date to display :type timestamp: str or unicode :param priority: priority number :type priority: str or unicode :param priority_name: priority name :type priority_name: str or unicode :param message: message to display :type message: str or unicode :returns: formatted string :rtype: str or unicode """ [INST] Python: Check if a string represents an int, Without using Try/Except? Is there any way to tell whether a string represents an integer (e.g., '3', '-17' but not '3.14' or 'asfasfas') Without using a try/except mechanism? is_int('3.14') = False is_int('-7') = True [/INST] with positive integers you could use .isdigit: >>> '16'.isdigit() True it doesn't work with negative integers though. suppose you could try the following: >>> s = '-17' >>> s.startswith('-') and s[1:].isdigit() True it won't work with '16.0' format, which is similar to int casting in this sense. edit: def check_int(s): if s[0] in ('-', '+'): return s[1:].isdigit() return s.isdigit() [INST] How do you log server errors on django sites So, when playing with the development I can just set settings.DEBUG to True and if an error occures I can see it nicely formatted, with good stack trace and request information. But on kind of production site I'd rather use DEBUG=False and show visitors some standard error 500 page with information that I'm working on fixing this bug at this moment ;) At the same time I'd like to have some way of logging all those information (stack trace and request info) to a file on my server - so I can just output it to my console and watch errors scroll, email the log to me every hour or something like this. What logging solutions would you recomend for a django-site, that would meet those simple requirements? I have the application running as fcgi server and I'm using apache web server as frontend (although thinking of going to lighttpd). [/INST] Well, when DEBUG = False, Django will automatically mail a full traceback of any error to each person listed in the ADMINS setting, which gets you notifications pretty much for free. If you'd like more fine-grained control, you can write and add to your settings a middleware class which defines a method named process_exception(), which will have access to the exception that was raised: http://docs.djangoproject.com/en/dev/topics/http/middleware/#process-exception Your process_exception() method can then perform whatever type of logging you'd like: writing to console, writing to a file, etc., etc. Edit: though it's a bit less useful, you can also listen for the got_request_exception signal, which will be sent whenever an exception is encountered during request processing: http://docs.djangoproject.com/en/dev/ref/signals/#got-request-exception This does not give you access to the exception object, however, so the middleware method is much easier to work with. [INST] Can a line of Python code know its indentation nesting level? From something like this: print(get_indentation_level()) print(get_indentation_level()) print(get_indentation_level()) I would like to get something like this: 1 2 3 Can the code read itself in this way? All I want is the output from the more nested parts of the code to be more nested. In the same way that this makes code easier to read, it would make the output easier to read. Of course I could implement this manually, using e.g. .format(), but what I had in mind was a custom print function which would print(i*' ' + string) where i is the indentation level. This would be a quick way to make readable output on my terminal. Is there a better way to do this which avoids painstaking manual formatting? [/INST] If you want indentation in terms of nesting level rather than spaces and tabs, things get tricky. For example, in the following code: if True: print( get_nesting_level()) the call to get_nesting_level is actually nested one level deep, despite the fact that there is no leading whitespace on the line of the get_nesting_level call. Meanwhile, in the following code: print(1, 2, get_nesting_level()) the call to get_nesting_level is nested zero levels deep, despite the presence of leading whitespace on its line. In the following code: if True: if True: print(get_nesting_level()) if True: print(get_nesting_level()) the two calls to get_nesting_level are at different nesting levels, despite the fact that the leading whitespace is identical. In the following code: if True: print(get_nesting_level()) is that nested zero levels, or one? In terms of INDENT and DEDENT tokens in the formal grammar, it's zero levels deep, but you might not feel the same way. If you want to do this, you're going to have to tokenize the whole file up to the point of the call and count INDENT and DEDENT tokens. The tokenize module would be very useful for such a function: import inspect import tokenize def get_nesting_level(): caller_frame = inspect.currentframe().f_back filename, caller_lineno, _, _, _ = inspect.getframeinfo(caller_frame) with open(filename) as f: indentation_level = 0 for token_record in tokenize.generate_tokens(f.readline): token_type, _, (token_lineno, _), _, _ = token_record if token_lineno > caller_lineno: break elif token_type == tokenize.INDENT: indentation_level += 1 elif token_type == tokenize.DEDENT: indentation_level -= 1 return indentation_level [INST] Programmatically saving image to Django ImageField Ok, I've tried about near everything and I cannot get this to work. I have a Django model with an ImageField on it I have code that downloads an image via HTTP (tested and works) The image is saved directly into the 'upload_to' folder (the upload_to being the one that is set on the ImageField) All I need to do is associate the already existing image file path with the ImageField I've written this code about 6 different ways. The problem I'm running into is all of the code that I'm writing results in the following behavior: (1) Django will make a 2nd file, (2) rename the new file, adding an _ to the end of the file name, then (3) not transfer any of the data over leaving it basically an empty re-named file. What's left in the 'upload_to' path is 2 files, one that is the actual image, and one that is the name of the image,but is empty, and of course the ImageField path is set to the empty file that Django try to create. In case that was unclear, I'll try to illustrate: ## Image generation code runs.... /Upload generated_image.jpg 4kb ## Attempt to set the ImageField path... /Upload generated_image.jpg 4kb generated_image_.jpg 0kb ImageField.Path = /Upload/generated_image_.jpg How can I do this without having Django try to re-store the file? What I'd really like is something to this effect... model.ImageField.path = generated_image_path ...but of course that doesn't work. And yes I've gone through the other questions here like this one as well as the django doc on File UPDATE After further testing, it only does this behavior when running under Apache on Windows Server. While running under the 'runserver' on XP it does not execute this behavior. I am stumped. Here is the code which runs successfully on XP... f = open(thumb_path, 'r') model.thumbnail = File(f) model.save() [/INST] I have some code that fetches an image off the web and stores it in a model. The important bits are: from django.core.files import File # you need this somewhere import urllib # The following actually resides in a method of my model result = urllib.urlretrieve(image_url) # image_url is a URL to an image # self.photo is the ImageField self.photo.save( os.path.basename(self.url), File(open(result[0])) ) self.save() That's a bit confusing because it's pulled out of my model and a bit out of context, but the important parts are: The image pulled from the web is not stored in the upload_to folder, it is instead stored as a tempfile by urllib.urlretrieve() and later discarded. The ImageField.save() method takes a filename (the os.path.basename bit) and a django.core.files.File object. Let me know if you have questions or need clarification. Edit: for the sake of clarity, here is the model (minus any required import statements): class CachedImage(models.Model): url = models.CharField(max_length=255, unique=True) photo = models.ImageField(upload_to=photo_path, blank=True) def cache(self): """Store image locally if we have a URL""" if self.url and not self.photo: result = urllib.urlretrieve(self.url) self.photo.save( os.path.basename(self.url), File(open(result[0])) ) self.save() [INST] How to get week number in Python? How to find out what week number is this year on June 16th (wk24) with Python? [/INST] datetime.date has a isocalendar() method, which returns a tuple containing the calendar week: >>> datetime.date(2010, 6, 16).isocalendar()[1] 24 datetime.date.isocalendar() is an instance-method returning a tuple containing year, weeknumber and weekday in respective order for the given date instance. [INST] Pelican 3.3 pelican-quickstart error "ValueError: unknown locale: UTF-8" When I was trying to use pelican3.3, I typed the commend "pelican-quickstart", some errors showed up. These are the errors: (PelicanEnv)59-127-113-90:myblog Richo$ pelican-quickstart Traceback (most recent call last): File "/Users/Richo/Dropbox/Github/PelicanEnv/bin/pelican-quickstart", line 9, in load_entry_point('pelican==3.3', 'console_scripts', 'pelican-quickstart')() File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point return ep.load() File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/pelican/__init__.py", line 16, in from pelican.generators import (ArticlesGenerator, PagesGenerator, File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/pelican/generators.py", line 20, in from pelican.readers import Readers File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/pelican/readers.py", line 11, in import docutils.core File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/docutils/core.py", line 20, in from docutils import frontend, io, utils, readers, writers File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/docutils/frontend.py", line 41, in import docutils.utils File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in import docutils.io File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/docutils/io.py", line 18, in from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1] File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/locale.py", line 513, in getdefaultlocale return _parse_localename(localename) File "/Users/Richo/Dropbox/Github/PelicanEnv/lib/python2.7/locale.py", line 445, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8 My OS is OS X Mavericks. [/INST] You could try a solution posted here or here. Basically, add some lines to your ~/.bash_profile: export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 There is an outstanding bug report related to this issue. It appears that Python makes some assumptions about the format of locale names that aren't universally valid. Explicitly setting these environment vars is basically just a workaround for that bug. [Edit:] As @asmeurer correctly points out, the above fix assumes English and the U.S. You should really pick your preferred locale from the list given by locale -a (generally one that ends in UTF-8). [INST] How to check whether two lists are circularly identical in Python For instance, I have lists: a[0] = [1, 1, 1, 0, 0] a[1] = [1, 1, 0, 0, 1] a[2] = [0, 1, 1, 1, 0] # and so on They seem to be different, but if it is supposed that the start and the end are connected, then they are circularly identical. The problem is, each list which I have has a length of 55 and contains only three ones and 52 zeros in it. Without circular condition, there are 26,235 (55 choose 3) lists. However, if the condition 'circular' exists, there are a huge number of circularly identical lists Currently I check circularly identity by following: def is_dup(a, b): for i in range(len(a)): if a == list(numpy.roll(b, i)): # shift b circularly by i return True return False This function requires 55 cyclic shift operations at the worst case. And there are 26,235 lists to be compared with each other. In short, I need 55 * 26,235 * (26,235 - 1) / 2 = 18,926,847,225 computations. It's about nearly 20 Giga! Is there any good way to do it with less computations? Or any data types that supports circular? [/INST] First off, this can be done in O(n) in terms of the length of the list You can notice that if you will duplicate your list 2 times ([1, 2, 3]) will be [1, 2, 3, 1, 2, 3] then your new list will definitely hold all possible cyclic lists. So all you need is to check whether the list you are searching is inside a 2 times of your starting list. In python you can achieve this in the following way (assuming that the lengths are the same). list1 = [1, 1, 1, 0, 0] list2 = [1, 1, 0, 0, 1] print ' '.join(map(str, list2)) in ' '.join(map(str, list1 * 2)) Some explanation about my oneliner: list * 2 will combine a list with itself, map(str, [1, 2]) convert all numbers to string and ' '.join() will convert array ['1', '2', '111'] into a string '1 2 111'. As pointed by some people in the comments, oneliner can potentially give some false positives, so to cover all the possible edge cases: def isCircular(arr1, arr2): if len(arr1) != len(arr2): return False str1 = ' '.join(map(str, arr1)) str2 = ' '.join(map(str, arr2)) if len(str1) != len(str2): return False return str1 in str2 + ' ' + str2 P.S.1 when speaking about time complexity, it is worth noticing that O(n) will be achieved if substring can be found in O(n) time. It is not always so and depends on the implementation in your language (although potentially it can be done in linear time KMP for example). P.S.2 for people who are afraid strings operation and due to this fact think that the answer is not good. What important is complexity and speed. This algorithm potentially runs in O(n) time and O(n) space which makes it much better than anything in O(n^2) domain. To see this by yourself, you can run a small benchmark (creates a random list pops the first element and appends it to the end thus creating a cyclic list. You are free to do your own manipulations) from random import random bigList = [int(1000 * random()) for i in xrange(10**6)] bigList2 = bigList[:] bigList2.append(bigList2.pop(0)) # then test how much time will it take to come up with an answer from datetime import datetime startTime = datetime.now() print isCircular(bigList, bigList2) print datetime.now() - startTime # please fill free to use timeit, but it will give similar results 0.3 seconds on my machine. Not really long. Now try to compare this with O(n^2) solutions. While it is comparing it, you can travel from US to Australia (most probably by a cruise ship) [INST] What's the bad magic number error? What's the "Bad magic number" ImportError in python, and how do I fix it? The only thing I can find online suggests this is caused by compiling a .py -> .pyc file and then trying to use it with the wrong version of python. In my case, however, the file seems to import fine some times but not others, and I'm not sure why. The information python's providing in the traceback isn't particularly helpful (which is why I was asking here...), but here it is in case it helps: Traceback (most recent call last): File "run.py", line 7, in from Normalization import Normalizer [/INST] The magic number comes from UNIX-type systems where the first few bytes of a file held a marker indicating the file type. Python puts a similar marker into its pyc files when it creates them. Then the python interpreter makes sure this number is correct when loading it. Anything that damages this magic number will cause your problem. This includes editing the pyc file or trying to run a pyc from a different version of python (usually later) than your interpreter. If they are your pyc files, just delete them and let the interpreter re-compile the py files. On UNIX type systems, that could be something as simple as: rm *.pyc or: find . -name '*.pyc' -delete If they are not yours, you'll have to either get the py files for re-compilation, or an interpreter that can run the pyc files with that particular magic value. One thing that might be causing the intermittent nature. The pyc that's causing the problem may only be imported under certain conditions. It's highly unlikely it would import sometimes. You should check the actual full stack trace when the import fails? As an aside, the first word of all my 2.5.1(r251:54863) pyc files is 62131, 2.6.1(r261:67517) is 62161. The list of all magic numbers can be found in Python/import.c, reproduced here for completeness (current as at the time the answer was posted, it may have changed since then): 1.5: 20121 1.5.1: 20121 1.5.2: 20121 1.6: 50428 2.0: 50823 2.0.1: 50823 2.1: 60202 2.1.1: 60202 2.1.2: 60202 2.2: 60717 2.3a0: 62011 2.3a0: 62021 2.3a0: 62011 2.4a0: 62041 2.4a3: 62051 2.4b1: 62061 2.5a0: 62071 2.5a0: 62081 2.5a0: 62091 2.5a0: 62092 2.5b3: 62101 2.5b3: 62111 2.5c1: 62121 2.5c2: 62131 2.6a0: 62151 2.6a1: 62161 2.7a0: 62171 [INST] How do I get the parent directory in Python? Could someone tell me how to get the parent directory of a path in Python in a cross platform way. E.g. C:\Program Files ---> C:\ and C:\ ---> C:\ If the directory doesn't have a parent directory, it returns the directory itself. The question might seem simple but I couldn't dig it up through Google. [/INST] Using os.path.dirname: >>> os.path.dirname(r'C:\Program Files') 'C:\\' >>> os.path.dirname('C:\\') 'C:\\' >>> [INST] Else clause on Python while statement I've noticed the following code is legal in Python. My question is why? Is there a specific reason? n = 5 while n != 0: print n n -= 1 else: print "what the..." [/INST] The else clause is only executed when your while condition becomes false. If you break out of the loop, or if an exception is raised, it won't be executed. One way to think about it is as an if/else construct with respect to the condition: if condition: handle_true() else: handle_false() is analogous to the looping construct: while condition: handle_true() else: # condition is false now, handle and go on with the rest of the program handle_false() An example might be along the lines of: while value < threshold: if not process_acceptable_value(value): # something went wrong, exit the loop; don't pass go, don't collect 200 break value = update(value) else: # value >= threshold; pass go, collect 200 handle_threshold_reached() [INST] How to initialize a two-dimensional array in Python? I'm beginning python and I'm trying to use a two-dimensional list, that I initially fill up with the same variable in every place. I came up with this: def initialize_twodlist(foo): twod_list = [] new = [] for i in range (0, 10): for j in range (0, 10): new.append(foo) twod_list.append(new) new = [] It gives the desired result, but feels like a workaround. Is there an easier/shorter/more elegant way to do this? [/INST] A pattern that often came up in Python was bar = [] for item in some_iterable: bar.append(SOME EXPRESSION) which helped motivate the introduction of list comprehensions, which convert that snippet to bar = [SOME EXPRESSION for item in some_iterable] which is shorter and sometimes clearer. Usually you get in the habit of recognizing these and often replacing loops with comprehensions. Your code follows this pattern twice twod_list = [] \ for i in range (0, 10): \ new = [] \ can be replaced } this too for j in range (0, 10): } with a list / new.append(foo) / comprehension / twod_list.append(new) / [INST] How to download image using requests I'm trying to download and save an image from the web using python's requests module. Here is the (working) code I used: img = urllib2.urlopen(settings.STATICMAP_URL.format(**data)) with open(path, 'w') as f: f.write(img.read()) Here is the new (non-working) code using requests: r = requests.get(settings.STATICMAP_URL.format(**data)) if r.status_code == 200: img = r.raw.read() with open(path, 'w') as f: f.write(img) Can you help me on what attribute from the response to use from requests? [/INST] You can either use the response.raw file object, or iterate over the response. To use the response.raw file-like object will not, by default, decode compressed responses (with GZIP or deflate). You can force it to decompress for you anyway by setting the decode_content attribute to True (requests sets it to False to control decoding itself). You can then use shutil.copyfileobj() to have Python stream the data to a file object: import requests import shutil r = requests.get(settings.STATICMAP_URL.format(**data), stream=True) if r.status_code == 200: with open(path, 'wb') as f: r.raw.decode_content = True shutil.copyfileobj(r.raw, f) To iterate over the response use a loop; iterating like this ensures that data is decompressed by this stage: r = requests.get(settings.STATICMAP_URL.format(**data), stream=True) if r.status_code == 200: with open(path, 'wb') as f: for chunk in r: f.write(chunk) This'll read the data in 128 byte chunks; if you feel another chunk size works better, use the Response.iter_content() method with a custom chunk size: r = requests.get(settings.STATICMAP_URL.format(**data), stream=True) if r.status_code == 200: with open(path, 'wb') as f: for chunk in r.iter_content(1024): f.write(chunk) Note that you need to open the destination file in binary mode to ensure python doesn't try and translate newlines for you. We also set stream=True so that requests doesn't download the whole image into memory first. [INST] How can I tell PyCharm what type a parameter is expected to be? When it comes to constructors, and assignments, and method calls, the PyCharm IDE is pretty good at analyzing my source code and figuring out what type each variable should be. I like it when it's right, because it gives me good code-completion and parameter info, and it gives me warnings if I try to access an attribute that doesn't exist. But when it comes to parameters, it knows nothing. The code-completion dropdowns can't show anything, because they don't know what type the parameter will be. The code analysis can't look for warnings. class Person: def __init__(self, name, age): self.name = name self.age = age peasant = Person("Dennis", 37) # PyCharm knows that the "peasant" variable is of type Person peasant.dig_filth() # shows warning -- Person doesn't have a dig_filth method class King: def repress(self, peasant): # PyCharm has no idea what type the "peasant" parameter should be peasant.knock_over() # no warning even though knock_over doesn't exist King().repress(peasant) # Even if I call the method once with a Person instance, PyCharm doesn't # consider that to mean that the "peasant" parameter should always be a Person This makes a certain amount of sense. Other call sites could pass anything for that parameter. But if my method expects a parameter to be of type, say, pygame.Surface, I'd like to be able to indicate that to PyCharm somehow, so it can show me all of Surface's attributes in its code-completion dropdown, and highlight warnings if I call the wrong method, and so on. Is there a way I can give PyCharm a hint, and say "psst, this parameter is supposed to be of type X"? (Or perhaps, in the spirit of dynamic languages, "this parameter is supposed to quack like an X"? I'd be fine with that.) EDIT: CrazyCoder's answer, below, does the trick. For any newcomers like me who want the quick summary, here it is: class King: def repress(self, peasant): """ Exploit the workers by hanging on to outdated imperialist dogma which perpetuates the economic and social differences in our society. @type peasant: Person @param peasant: Person to repress. """ peasant.knock_over() # Shows a warning. And there was much rejoicing. The relevant part is the @type peasant: Person line of the docstring. If you also go to File > Settings > Python Integrated Tools and set "Docstring format" to "Epytext", then PyCharm's View > Quick Documentation Lookup will pretty-print the parameter information instead of just printing all the @-lines as-is. [/INST] Yes, you can use special documentation format for methods and their parameters so that PyCharm can know the type. Recent PyCharm version supports most common doc formats. For example, PyCharm extracts types from @param style comments. See also reStructuredText and docstring conventions (PEP 257). Another option is Python 3 annotations. Please refer to the PyCharm documentation section for more details and samples. [INST] Print current call stack from a method in Python code In Python, how can I print the current call stack from within a method (for debugging purposes). [/INST] Here's an example of getting the stack via the traceback module, and printing it: import traceback def f(): g() def g(): for line in traceback.format_stack(): print(line.strip()) f() # Prints: # File "so-stack.py", line 10, in # f() # File "so-stack.py", line 4, in f # g() # File "so-stack.py", line 7, in g # for line in traceback.format_stack(): If you really only want to print the stack to stderr, you can use: traceback.print_stack() Or to print to stdout (useful if want to keep redirected output together), use: traceback.print_stack(file=sys.stdout) But getting it via traceback.format_stack() lets you do whatever you like with it. [INST] Sort a list of tuples by 2nd item (integer value) I have a list of tuples that looks something like this: [('abc', 121),('abc', 231),('abc', 148), ('abc',221)] I want to sort this list in ascending order by the integer value inside the tuples. Is it possible? [/INST] Try using the key keyword with sorted(). sorted([('abc', 121),('abc', 231),('abc', 148), ('abc',221)], key=lambda x: x[1]) key should be a function that identifies how to retrieve the comparable element from your data structure. In your case, it is the second element of the tuple, so we access [1]. For optimization, see jamylak's response using itemgetter(1), which is essentially a faster version of lambda x: x[1]. [INST] Get the name of current script with Python I'm trying to get the name of the Python script that is currently running. For example, I have a script called foo.py and I would like to do something like this inside it: print Scriptname and get: foo.py. [/INST] Use __file__. If you want to omit the directory part (which might be present), you can use import os,os.path.basename(__file__). [INST] Python exit commands - why so many and when should each be used? It seems that python supports many different commands to stop script execution.The choices I've found are: quit(), exit(), sys.exit(), os._exit() Have I missed any? What's the difference between them? When would you use each? [/INST] Let me give some information on them: quit raises the SystemExit exception behind the scenes. Furthermore, if you print it, it will give a message: >>> print (quit) Use quit() or Ctrl-Z plus Return to exit >>> This functionality was included to help people who do not know Python. After all, one of the most likely things a newbie will try to exit Python is typing in quit. Nevertheless, quit should not be used in production code. This is because it only works if the site module is loaded. Instead, this function should only be used in the interpreter. exit is an alias for quit (or vice-versa). They exist together simply to make Python more user-friendly. Furthermore, it too gives a message when printed: >>> print (exit) Use exit() or Ctrl-Z plus Return to exit >>> However, like quit, exit is considered bad to use in production code and should be reserved for use in the interpreter. This is because it too relies on the site module. sys.exit raises the SystemExit exception in the background. This means that it is the same as quit and exit in that respect. Unlike those two however, sys.exit is considered good to use in production code. This is because the sys module will always be there. os._exit exits the program without calling cleanup handlers, flushing stdio buffers, etc. Thus, it is not a standard way to exit and should only be used in special cases. The most common of these is in the child process(es) created by os.fork. Note that, of the four methods given, only this one is unique in what it does. Summed up, all four methods exit the program. However, the first two are considered bad to use in production code and the last is a non-standard, dirty way that is only used in special scenarios. So, if you want to exit a program normally, go with the third method: sys.exit. Or, even better in my opinion, you can just do directly what sys.exit does behind the scenes and run: raise SystemExit This way, you do not need to import sys first. However, this choice is simply one on style and is purely up to you. [INST] Django: "projects" vs "apps" I have a fairly complex "product" I'm getting ready to build using Django. I'm going to avoid using the terms "project" and "application" in this context, because I'm not clear on their specific meaning in Django. Projects can have many apps. Apps can be shared among many projects. Fine. I'm not reinventing the blog or forum - I don't see any portion of my product being reusable in any context. Intuitively, I would call this one "application." Do I then do all my work in a single "app" folder? If so... in terms of Django's project.app namespace, my inclination is to use myproduct.myproduct, but of course this isn't allowed (but the application I'm building is my project, and my project is an application!). I'm therefore lead to believe that perhaps I'm supposed to approach Django by building one app per "significant" model, but I don't know where to draw the boundaries in my schema to separate it into apps - I have a lot of models with relatively complex relationships. I'm hoping there's a common solution to this... [/INST] Try to answer question: "What does my application do?". If you cannot answer in a single sentence, then maybe you can split it into several apps with cleaner logic. I read this thought somewhere soon after I've started to work with django and I find that I ask this question of myself quite often and it helps me. Your apps don't have to be reusable, they can depend on each other, but they should do one thing. [INST] Accessing dict keys like an attribute in Python? I find it more conveniant to access dict keys as obj.foo instead of obj['foo'], so I wrote this snippet: class AttributeDict(dict): def __getattr__(self, attr): return self[attr] def __setattr__(self, attr, value): self[attr] = value However, I assume there must be some reason that Python doesn't provide this functionality out of the box. What would be the caveats and pitfalls of accessing dict keys in this manner? [/INST] The best way to do this is: class AttrDict(dict): def __init__(self, *args, **kwargs): super(AttrDict, self).__init__(*args, **kwargs) self.__dict__ = self Some pros: It actually works! No dictionary class methods are shadowed (e.g. .keys() work just fine) Attributes and items are always in sync Trying to access non-existent key as an attribute correctly raises AttributeError instead of KeyError Cons: Methods like .keys() will not work just fine if they get overwritten by incoming data Causes a memory leak in Python < 2.7.4 / Python3 < 3.2.3 Pylint goes bananas with E1123(unexpected-keyword-arg) and E1103(maybe-no-member) For the uninitiated it seems like pure magic. A short explanation on how this works All python objects internally store their attributes in a dictionary that is named __dict__. There is no requirement that the internal dictionary __dict__ would need to be "just a plain dict", so we can assign any subclass of dict() to the internal dictionary. In our case we simply assign the AttrDict() instance we are instantiating (as we are in __init__). By calling super()'s __init__() method we made sure that it (already) behaves exactly like a dictionary, since that function calls all the dictionary instantiation code. One reason why Python doesn't provide this functionality out of the box As noted in the "cons" list, this combines the namespace of stored keys (which may come from arbitrary and/or untrusted data!) with the namespace of builtin dict method attributes. For example: d = AttrDict() d.update({'items':["jacket", "necktie", "trousers"]}) for k, v in d.items(): # TypeError: 'list' object is not callable print "Never reached!" [INST] Stripping everything but alphanumeric chars from a string in Python What is the best way to strip all non alphanumeric characters from a string, using Python? The solutions presented in the PHP variant of this question will probably work with some minor adjustments, but don't seem very 'pythonic' to me. For the record, I don't just want to strip periods and commas (and other punctuation), but also quotes, brackets, etc. [/INST] I just timed some functions out of curiosity. In these tests I'm removing non-alphanumeric characters from the string string.printable (part of the built-in string module). $ python -m timeit -s \ "import string" \ "''.join(ch for ch in string.printable if ch.isalnum())" 10000 loops, best of 3: 57.6 usec per loop $ python -m timeit -s \ "import string" \ "filter(str.isalnum, string.printable)" 10000 loops, best of 3: 37.9 usec per loop $ python -m timeit -s \ "import re, string" \ "re.sub('[\W_]', '', string.printable)" 10000 loops, best of 3: 27.5 usec per loop $ python -m timeit -s \ "import re, string" \ "re.sub('[\W_]+', '', string.printable)" 100000 loops, best of 3: 15 usec per loop $ python -m timeit -s \ "import re, string; pattern = re.compile('[\W_]+')" \ "pattern.sub('', string.printable)" 100000 loops, best of 3: 11.2 usec per loop [INST] How to send an email with Gmail as provider using Python? I am trying to send email (Gmail) using python, but I am getting following error. Traceback (most recent call last): File "emailSend.py", line 14, in server.login(username,password) File "/usr/lib/python2.5/smtplib.py", line 554, in login raise SMTPException("SMTP AUTH extension not supported by server.") smtplib.SMTPException: SMTP AUTH extension not supported by server. The Python script is the following. import smtplib fromaddr = 'user_me@gmail.com' toaddrs = 'user_you@gmail.com' msg = 'Why,Oh why!' username = 'user_me@gmail.com' password = 'pwd' server = smtplib.SMTP('smtp.gmail.com:587') server.starttls() server.login(username,password) server.sendmail(fromaddr, toaddrs, msg) server.quit() [/INST] def send_email(user, pwd, recipient, subject, body): import smtplib gmail_user = user gmail_pwd = pwd FROM = user TO = recipient if type(recipient) is list else [recipient] SUBJECT = subject TEXT = body # Prepare actual message message = """From: %s\nTo: %s\nSubject: %s\n\n%s """ % (FROM, ", ".join(TO), SUBJECT, TEXT) try: server = smtplib.SMTP("smtp.gmail.com", 587) server.ehlo() server.starttls() server.login(gmail_user, gmail_pwd) server.sendmail(FROM, TO, message) server.close() print 'successfully sent the mail' except: print "failed to send mail" if you want to use Port 465 you have to create an SMTP_SSL object: # SMTP_SSL Example server_ssl = smtplib.SMTP_SSL("smtp.gmail.com", 465) server_ssl.ehlo() # optional, called by login() server_ssl.login(gmail_user, gmail_pwd) # ssl server doesn't support or need tls, so don't call server_ssl.starttls() server_ssl.sendmail(FROM, TO, message) #server_ssl.quit() server_ssl.close() print 'successfully sent the mail' [INST] Installing SciPy with pip It is possible to install NumPy with pip using pip install numpy. Is there a similar possibility with SciPy? (Doing pip install scipy does not work.) Update The package SciPy is now available to be installed with pip! [/INST] Prerequisite: sudo apt-get install build-essential gfortran libatlas-base-dev python-pip python-dev sudo pip install --upgrade pip Actual packages: sudo pip install numpy sudo pip install scipy Optional packages: sudo pip install matplotlib OR sudo apt-get install python-matplotlib sudo pip install -U scikit-learn sudo pip install pandas src [INST] How to terminate a python subprocess launched with shell=True I'm launching a subprocess with the following command: p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) However, when I try to kill using: p.terminate() or p.kill() The command keeps running in the background, so I was wondering how can I actually terminate the process. Note that when I run the command with: p = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) It does terminate successfully when issuing the p.terminate(). [/INST] Use a process group so as to enable sending a signal to all the process in the groups. For that, you should attach a session id to the parent process of the spawned/child processes, which is a shell in your case. This will make it the group leader of the processes. So now, when a signal is sent to the process group leader, it's transmitted to all of the child processes of this group. Here's the code: import os import signal import subprocess # The os.setsid() is passed in the argument preexec_fn so # it's run after the fork() and before exec() to run the shell. pro = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) os.killpg(os.getpgid(pro.pid), signal.SIGTERM) # Send the signal to all the process groups [INST] Generating an MD5 checksum of a file Is there any simple way of generating (and checking) MD5 checksums of a list of files in Python? (I have a small program I'm working on, and I'd like to confirm the checksums of the files). [/INST] There is a way that's pretty memory inefficient. single file: print hashlib.md5(open(full_path, 'rb').read()).hexdigest() list of files: import hashlib [(fname, hashlib.md5(open(fname, 'rb').read()).digest()) for fname in fnamelst] But, MD5 is known broken and (IMHO) should come with scary deprecation warnings and removed from the library, so here's how you should actually do it: import hashlib [(fname, hashlib.sha256(open(fname, 'rb').read()).digest()) for fname in fnamelst] If you only want 128 bits worth of digest you can do .digest()[:16]. This will give you a list of tuples, each tuple containing the name of its file and its hash. Again I strongly question your use of MD5. You should be at least using SHA1. Some people think that as long as you're not using MD5 for 'cryptographic' purposes, you're fine. But stuff has a tendency to end up being broader in scope than you initially expect, and your casual vulnerability analysis may prove completely flawed. It's best to just get in the habit of using the right algorithm out of the gate. It's just typing a different bunch of letters is all. It's not that hard. Here is a way that is more complex, but memory efficient: import hashlib def hashfile(afile, hasher, blocksize=65536): buf = afile.read(blocksize) while len(buf) > 0: hasher.update(buf) buf = afile.read(blocksize) return hasher.digest() [(fname, hashfile(open(fname, 'rb'), hashlib.md5())) for fname in fnamelst] And, again, since MD5 is broken and should not really ever be used anymore: import hashlib def hashfile(afile, hasher, blocksize=65536): buf = afile.read(blocksize) while len(buf) > 0: hasher.update(buf) buf = afile.read(blocksize) return hasher.digest() [(fname, hashfile(open(fname, 'rb'), hashlib.sha256())) for fname in fnamelst] Again, you can put [:16] after the call to hashfile(...) if you only want 128 bits worth of digest. [INST] Making Python loggers output all messages to stdout in addition to log Is there a way to make Python logging using the logging module automatically output things to stdout in addition to the log file where they are supposed to go? For example, I'd like all calls to logger.warning, logger.critical, logger.error to go to their intended places but in addition always be copied to stdout. This is to avoid duplicating messages like: mylogger.critical("something failed") print "something failed" [/INST] All logging output is handled by the handlers; just add a logging.StreamHandler() to the root logger. Here's an example configuring a stream handler (using stdout instead of the default stderr) and adding it to the root logger: import logging import sys root = logging.getLogger() root.setLevel(logging.DEBUG) ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') ch.setFormatter(formatter) root.addHandler(ch) [INST] In Python, when to use a Dictionary, List or Set? When should I use a dictionary, list or set? Are there scenarios that are more suited for each data type? [/INST] A list keeps order, dict and set don't: when you care about order, therefore, you must use list (if your choice of containers is limited to these three, of course;-). dict associates with each key a value, while list and set just contain values: very different use cases, obviously. set requires items to be hashable, list doesn't: if you have non-hashable items, therefore, you cannot use set and must instead use list. set forbids duplicates, list does not: also a crucial distinction. (A "multiset", which maps duplicates into a different count for items present more than once, can be found in collections.Counter -- you could build one as a dict, if for some weird reason you couldn't import collections, or, in pre-2.7 Python as a collections.defaultdict(int), using the items as keys and the associated value as the count). Checking for membership of a value in a set (or dict, for keys) is blazingly fast (taking about a constant, short time), while in a list it takes time proportional to the list's length in the average and worst cases. So, if you have hashable items, don't care either way about order or duplicates, and want speedy membership checking, set is better than list. [INST] How do I clone a Django model instance object and save it to the database? Foo.objects.get(pk="foo") In the database, I want to add another object which is a copy of the object above. Suppose my table has one row. I want to insert the first row object into another row with a different primary key. How can I do that? [/INST] Just change the primary key of your object and run save(). obj = Foo.objects.get(pk="foo") obj.pk = "bar" obj.save() If you want auto-generated key, set the new key to None. More on UPDATE/INSERT here. [INST] ImportError: No module named requests Whenever I run this code, I consistently get an error saying No module Named requests: import requests The error I get: File "ex2.py", line 1, in import requests ImportError: No module named requests [/INST] Requests is not a built in module, so you will have to download it. You can get it here: https://pypi.python.org/pypi/requests OSX/Linux Use $ sudo pip install requests if you have pip installed On OSX you can also use sudo easy_install -U requests if you have easy_install installed. Windows Use > Path\easy_install.exe requests if you have a windows machine, where easy_install can be found in your Python*\Scripts folder, if it was installed. (Note Path\easy_install.exe is an example, mine is C:\Python32\Scripts\easy_install.exe) If you don't have easy install and are running on a windows machine, you can get it here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#distribute If you manually want to add a library to a windows machine, you can download the compressed library, uncompress it, and then place it into the Lib folder of your python path. From Source (Universal) For any missing library, the source is usually available at https://pypi.python.org/pypi/. Then: On mac osx and windows, after downloading the source zip, uncompress it and from the termiminal/cmd run python setup.py install from the uncompressed dir. [INST] How do I calculate the date six months from the current date using the datetime Python module? I am using the datetime Python module. I am looking to calculate the date 6 months from the current date. Could someone give me a little help doing this? The reason I want to generate a date 6 months from the current date is to produce a Review Date. If the user enters data into the system it will have a review date of 6 months from the date they entered the data. [/INST] I found this solution to be good. (This uses the python-dateutil extension) from datetime import date from dateutil.relativedelta import relativedelta six_months = date.today() + relativedelta(months=+6) The advantage of this approach is that it takes care of issues with 28, 30, 31 days etc. This becomes very useful in handling business rules and scenarios (say invoice generation etc.) $ date(2010,12,31)+relativedelta(months=+1) datetime.date(2011, 1, 31) $ date(2010,12,31)+relativedelta(months=+2) datetime.date(2011, 2, 28) [INST] What's the difference between filter and filter_by in SQLAlchemy? Could anyone explain the difference between filter and filter_by functions in SQLAlchemy? I am confused and can't really see the difference. Which one should I be using? [/INST] filter_by is used for simple queries on the column names like db.users.filter_by(name='Joe') The same can be accomplished with filter by writing db.users.filter(db.users.name=='Joe') but you can also write more powerful queries containing expressions like db.users.filter(or_(db.users.name=='Ryan', db.users.country=='England')) [INST] Find and list duplicates in Python list How can I find the duplicates in a Python list and create another list of the duplicates? The list is just integers. [/INST] To remove duplicates use set(a), to print duplicates - something like a = [1,2,3,2,1,5,6,5,5,5] import collections print [item for item, count in collections.Counter(a).items() if count > 1] ## [1, 2, 5] Note that Counter is not particularly efficient (timings) and probably an overkill here, set will perform better: seen = set() uniq = [] for x in a: if x not in seen: uniq.append(x) seen.add(x) or, more concisely: seen = set() uniq = [x for x in a if x not in seen and not seen.add(x)] I don't recommend the latter style though. [INST] Redirect stdout to a file in Python? How do I redirect stdout to an arbitrary file in Python? When a long-running Python script (e.g, web application) is started from within the ssh session and backgounded, and the ssh session is closed, the application will raise IOError and fail the moment it tries to write to stdout. I needed to find a way to make the application and modules output to a file rather than stdout to prevent failure due to IOError. Currently, I employ nohup to redirect output to a file, and that gets the job done, but I was wondering if there was a way to do it without using nohup, out of curiosity. I have already tried sys.stdout = open('somefile', 'w'), but this does not seem to prevent some external modules from still outputting to terminal (or maybe the sys.stdout = ... line did not fire at all). I know it should work from simpler scripts I've tested on, but I also didn't have time yet to test on a web application yet. [/INST] If you want to do the redirection within the Python script, set sys.stdout to an file object does the trick: import sys sys.stdout = open('file', 'w') print 'test' A far more common method is to use shell redirection when executing (same on Windows and Linux): $ python foo.py > file [INST] In Python, what is the difference between '/' and '//' when used for division? Is there a benefit to using one over the other? They both seem to return the same results. >>> 6/3 2 >>> 6//3 2 [/INST] In Python 3.0, 5 / 2 will return 2.5 and 5 // 2 will return 2. The former is floating point division, and the latter is floor division, sometimes also called integer division. In Python 2.2 or later in the 2.x line, there is no difference for integers unless you perform a from __future__ import division, which causes Python 2.x to adopt the behavior of 3.0 Regardless of the future import, 5.0 // 2 will return 2.0 since that's the floor division result of the operation. You can find a detailed description at https://docs.python.org/whatsnew/2.2.html#pep-238-changing-the-division-operator [INST] Find full path of the Python interpreter? How do I find the full path of the currently running Python interpreter from within the currently executing Python script? [/INST] sys.executable contains full path of the currently running Python interpreter. import sys print(sys.executable) which is now documented here [INST] What is the difference between pip and conda? I know pip is a package manager for python packages. However, I saw the installation on iPython's website use conda to install iPython. Can I use pip to install iPython? Why should I use conda as another python package manager when I already have pip? What is the difference between pip and conda? [/INST] Quoting from the Conda blog: Having been involved in the python world for so long, we are all aware of pip, easy_install, and virtualenv, but these tools did not meet all of our specific requirements. The main problem is that they are focused around Python, neglecting non-Python library dependencies, such as HDF5, MKL, LLVM, etc., which do not have a setup.py in their source code and also do not install files into Python’s site-packages directory. So Conda is a packaging tool and installer that aims to do more than what pip does; handle library dependencies outside of the Python packages as well as the Python packages themselves. Conda also creates a virtual environment, like virtualenv does. As such, Conda should be compared to Buildout perhaps, another tool that lets you handle both Python and non-Python installation tasks. Because Conda introduces a new packaging format, you cannot use pip and Conda interchangeably; pip cannot install the Conda package format. You can use the two tools side by side but they do not interoperate either. [INST] String Interpolation in Python Is there a Python equivalent to Ruby's string interpolation? Ruby example: name = "Spongebob Squarepants" puts "Who lives in a Pineapple under the sea? \n#{name}." Whilst I could succeed using string concatenation in Python, it's seemingly verbose to me coming from Ruby. [/INST] Python 3.6 will add literal string interpolation similar to Ruby's string interpolation. Starting with that version of Python (which is scheduled to be released by the end of 2016), you will be able to include expressions in "f-strings", e.g. name = "Spongebob Squarepants" print(f"Who lives in a Pineapple under the sea? {name}.") Prior to 3.6, the closest you can get to this is name = "Spongebob Squarepants" print("Who lives in a Pineapple under the sea? %(name)s." % locals()) The % operator can be used for string interpolation in Python. The first operand is the string to be interpolated, the second can have different types including a "mapping", mapping field names to the values to be interpolated. Here I used the dictionary of local variables locals() to map the field name name to its value as a local variable. The same code using the .format() method of recent Python versions would look like this: name = "Spongebob Squarepants" print("Who lives in a Pineapple under the sea? {name!s}.".format(**locals())) There is also the string.Template class: tmpl = string.Template("Who lives in a Pineapple under the sea? $name.") print(tmpl.substitute(name="Spongebob Squarepants")) [INST] Python: create object and add attributes to it I want to create a dynamic object (inside another object) in Python and then add attributes to it. I tried: obj = someobject obj.a = object() setattr(obj.a, 'somefield', 'somevalue') but this didn't work. Any ideas? edit: I am setting the attributes from a for loop which loops through a list of values, e.g. params = ['attr1', 'attr2', 'attr3'] obj = someobject obj.a = object() for p in params: obj.a.p # where p comes from for loop variable In the above example I would get obj.a.attr1, obj.a.attr2, obj.a.attr3. I used the setattr function because I didn't know how to do obj.a.NAME from a for loop. How would I set the attribute based on the value of p in the example above? [/INST] The built-in object can be instantiated but can't have any attributes set on it. (I wish it could, for this exact purpose.) It doesn't have a __dict__ to hold the attributes. I generally just do this: class Object(object): pass a = Object() a.somefield = somevalue When I can, I give the Object class a more meaningful name, depending on what kind of data I'm putting in it. Some people do a different thing, where they use a sub-class of dict that allows attribute access to get at the keys. (d.key instead of d['key']) Edit: For the addition to your question, using setattr is fine. You just can't use setattr on object() instances. params = ['attr1', 'attr2', 'attr3'] for p in params: setattr(obj.a, p, value) [INST] Python list of dictionaries search Assume I have this: [ {"name": "Tom", "age": 10}, {"name": "Mark", "age": 5}, {"name": "Pam", "age": 7} ] and by searching "Pam" as name, I want to retrieve the related dictionary: {name: "Pam", age: 7} How to achieve this ? [/INST] You can use a generator expression: >>> dicts = [ ... { "name": "Tom", "age": 10 }, ... { "name": "Mark", "age": 5 }, ... { "name": "Pam", "age": 7 }, ... { "name": "Dick", "age": 12 } ... ] >>> (item for item in dicts if item["name"] == "Pam").next() {'age': 7, 'name': 'Pam'} ���J��] ����X�r۸�ϧ�q~X�RJb��F��I�$��6�t3��x2�%�A�@Kܧ�s/H}8N��d&�~�{���˫��~��~t��JmuԤ2Q�dRdM�d*����sxAoIմ�1�fE��\G��ʻ�+�k�z�2ږ�1qMA�j�uh]�ONN��N��V�]D]�RHGk]�,�6��A�g']+k''GϟL��-�^�FS\#kn�� � ;�C�����|6�-�^P�d�[Z�:�?0X��9��ӱ�099|�L�dtM�k`ZE��ɥЪB�8�R��d���+�2�f��R���I;WaE�m�i�8�$�k�M�^�SZ�<�%^��Ǟ�t|ᚨ�� =$�N��k�U�V�L֭V��Tn1�1;�p՝���u�9u��p�ʇ7Vէ�2���ӗwg ���(=yS��$7�����VC���8һ�.//)��߶�; vDZ���(�5� �+�6�쫱�b����v��7\�=Yd4��uq\߹�_� z�H ӑN�P�V�9w���&����h�^��&��S^�pj-Y����XM'��>����Ǘ'9���|�s1�׮쬾֡�E�?e;��{�t�g;]�>K��z���+h2�y��V7���zD�����h⋌�%B|2������jV8{��}�$��頛BSV�)Xv��*:���mm/�y]�[M��kW�3A�G�I w��8O�'� ��awD:t�$��f0R�\Qtދon0#�v�Ԟi~x�˴��wj� �$e9���&3�D�loU��8u�ת^ ��`wڃ���yp�!ҳA &���Y9�S��e�&I� c�e��m��; ��R#�v>�n`�]�_ \�����o��o�/�(F���� 'i��Le �4��\�!��dJ�j�8@&O�p,c-�q�e�芇O�����ӿ�3�[�)� ����cln�a�?� �]P�aro\Q�Ԡ���Ar �j#��4<���q��l���f(+k�����)(L��z���4�{�jZ+�����Tp�����+�t;|7�&�;$��t�hc�����_�n�r5�s�|V�`{�uJ_�>�׃ Sv$����<{v���2���,U�6��M��8Ƣ���Rk��Z�:�<�챢�LhQ���߬�&04Dv���5Љ%6�E-S�?���M��TQc�rx�YL�J�S�_ >ӖǟI����j�@���6Er��A��3(���Bx ��U�(��Ug�(��vZ���0���! ��$�"�T)&M��SK� /L��^+��)����oڻ�H�&;��iX.�e��<�ŒL8�� ��3��Bj��Ô@ε����b�t6��p1 ���< ��'�#�L�̭�:��J.U���v5>�Y�J�H�����qJ�!r9���?g�ML(��qn��M��z�f�-MU�$7LH�P0f�����.��q�;�CG�J7I81Ep��ܜ%ǿ��k_bD�{2��,>]�RYӕ�{�43��1�M�`rX�ha����:.#�R;p� I!����]���� �bN該�ցJ�[�Ռ�����2��5�H� u���sz��U����(+D&GD%�Q�_���p���adԭj�?��$)�� �{�)c����N�9v�=f"�"2t�ږ`՞3CנD('�! �n�,Kq�f����0�l�8��b������-� �����ԅ�S1� �q�d� V��g��&ŵ=�9�h"/����cZ��c���Yu�lh G�C���s�G5��2�j[���L�uYԃ�eM�)F��"e9�4�T��Xv���lH�2ڑ���0�% �=�\���@������`I����t���>D��Z��M���F̸(]R��d��2�I�ۓ�>0�Q��1!�f [�d񉢿�!��A�a7Je&�(�ZC��S������w�����+��V�֣Q![�i�j�!�N�X��S�k��i�_s�'N�k�N�F��c�\-�Z���zon�;.JI�y �n�e�Fg��XnY�ߵ:u=��i"/ 0��趸���wb)�8��$�"u��^��h��]������3e� �ΰ�n�0l$�./�%�nɲ��•c�~!��+/-�:f ̂���޺�O*����u������{;�*�_ہ&*#�R%��_Ƭ�2z�(\�&�B�eE&���Z�n#�}���l�\P4)��]��@�Y ��j�v`4�M���0�3���F~���XNUu������Z�쮮�:u���̽�����wW�ljU��>�۲P���j ��+�ҭ�tZ�ʩ�����2k�d�2��b��S7�����A}^�9����gW�mM�]'�_�V6ߕU����r��mL����I�]jm��}�h^�����O�q��*�3�o��Rm��Q���J�27jc�KSY�Ue�t��U���}XK�@�k����*g���W��g��q�bT�����Z� �+u���w�ص�.8*�c���8�W%-k��Y���V�^�Ґ%͛]�Y�w�p^>�m�ЬlMצ�o �''9���$]��ّi�L�f�1���'����.� Y���5)а&O>�ʖ�S��eָ)�Pomq��@.�j[�[���Ə�L������A�Ձ�Tz;cM�����f\: x@2��:�ݴ��@.ѵߥL՚ȥ[xP�MU����겢� /W�ʦ�u>�����ΰ|gS����ȈuMR�ͦx�UYF`̑�� ����d`ZG��Ұ ����\��;��C��,�^�R�S�s�-S��,� 6��2���Ԁ9�`e��P������󳗬�-�gxS�fg�����.��\'�S;ޓ|<������I�!�)�e6�y$ w�!���q&_ ;b����rӸ���`H�|����w�~��������%кm�d+��� !Gx�Q� ����7c̒�<#�b��)��V� �냘 �O"��Ao*���'�W��|�����]�^�-^]��o躿Q \|(U��Jضk��O���u���D3��K+l9��9��8l�o�Ո�}���qݝ���ܕ�2�ͯ�ܸ��p��¹��ƌ�/' c� zB@�+�R] EvAJ�ƌ�� R.���+��z�3��i� [9O9n�(��,emA��سĐ�lS��PAh�K��� ���O'���$����� #3y�1�o�u���嫳���Ze`����D;a7΋`�r�F���8�mk�wm"ǚ�!=l�V��U�/��q�����=�-��Lx^a�R�1��uQ�Ü'�o��C�����qgꛁ)xc�u�d|H��=q��,ղ*��.�6S�Ĕ��&0k �H�pT_7�,�ҜGZ�� �ih����b2mw���@+I;!��|j�L����G���r��G�o�x1骬^|ӗ���?�kh��7���hB[.:yI�DC�-��<��b�EB�����H��*��,�T~�>�1! :j��)��L��RIx~q��d+�`��W��Jv�� [� �A��&0J���QM�$�F�L[���W��$��D(e����1�� �Ub�TS�F��;��L�0� b�M�Ee�)з>d�������;c�pT�t����; ܺ2:�r��y����+_ŵ.Y"���6e(@�����{—J"��ÜZ������k��Y8W9���J�w8A$T-¦�U�P�\&�W�B�sX^��?9�=tΣ.�ZQh���� �u��~��8��@�DA� � &`�B�*#Su2��F���,���Y5c *�y u\5���.� É�@�vU|do�P5E�@��$���sQ�՟�����O�X�2��>f=� ���ԡʢg�#��3��]R�� �����h"������/�O=�����.����BT���<�r�A��!ٜ�Ua�aF��k+����r}�t���t6a;8�6�/��˩@�L2/&�p��|*� '�+�����$����$&k�O��$�H�=����%�=Q'O&�qny�5)�E��z�:=- ����,���Hc]B�)\���Ű��?i�l����m����Y嗲�Χ���L �#t�m@.uz/&��A�2�]��'����.�!_���H���7 ���ms]G ��l�?���m7IS.��]g�(y��S�mE�B\/&��mY�,W�:9;nu��8��h{��j�k=e�(���)�[����E��O�&��)�#1qX�_�D3/�-L~8�>Q�ñ�\�"X~7+�uU7�{ ��A������l�Cۂy7��0 B?a�c11�Z�''�`V�"����E�W���g.�,��Ъ�T4�6�^3z���ryrpop�qTL����XA\'œ� Er�p%�"�&63�|y�vF6�]_m��(�=��a�޲Q�(@)t�im��L�|��MWv.�?�R�ʶ8�%��S�<�}�/��nF�4�`:$�v�/�P�ߣ�:Z �W���jzP�/���^L�10�Q��<`��k;.h��^#a��M�iI,�q�RM$�|.���р1 �%���.��O�b��7��S�_�gq%�^�O�j�&vE�`h� u8A�͖�d��iP+DT�)�Ӓ����x�����X�~֠\A�D�x)�_�m�Q.mMkܶ��bsI�F�Ƞ���!U����Ō�er����/|k#.A��8��w%{�����bk�,�t��"X���vcP��CÓR�� ��Zpx2K ޹ې���E9 ~=q;�I(l���MN_�+�м��)�������)?h"��@{nl�KaVuZ�"D�!�md _(����>�0��W�T�� �fN����� �h��L 1�d�fQ�q����j��"Ox����ԣ V �ĵ#����*�G���+Ϻɢ�C�7��q���Ki�[� �^��9 � fԻ� t-�'x��)�����|؏����K׆�Lz������ u9�G�, �w =�X��=Ĉ^��'������H� D���Kq�BD�5%[FE C)ͨ�Ș���3� ��s�������zQ����/����L(q���F��ݠ��l!�g���u�7�'O� � �c��&�ɇ�����%�N������\Rǡ���%��i�<5 8��� �s����z�j�uR �X�v<�{���P����{.*��u�����V ��r�2���9�C�}z�i ��3�0�N���x,B;ͮ,�Q[�e�F�9����25 6�3�����#"��B�u �*sR��A��i����$��q��`����J.���OWDzaC���Q�pqwZ[0}P�SS�z�|DӇ�b>Ws�T-�X;~��v5���U4U�0�4�+�� �D���>;;;��BC5P(��r���Nt�d~��;>gD`�4���@���jL]Gh���;�p��?�`�e*����N� ���w����]]^^\�� Q��2��QG-O��[��q����T� ��c�.TS��;HAҞ��; ���z;c�q6���)��d�.�;�cU ��C;�ҁz�5j,�%��H��BwO_F�P�{�*���OSݶ�����E�3}�H��� q���h �� �ю��,��F�`�q�HEBp�F�+�6�4N| ��z���4y��9��B=�ݴ��‡��������[2������e_�:t2��Y�L}*��!e =^��w�S�}��C�0��=��q�,ۛ�d�g�C��Ø ��1٨�J7%�557@�c\�7~�zȮ�l�3��>�g ��'���LX�E&�{����[��8�����!���4�@ ��Wm���nK���j��Ep C�����9����uW��>W��嗯?�����O�Br����� ]ps-YS�#�O�TM�� ��i��%��'V��˻����(�:�*G��7�U�)����e�T n�|Cf%��� 2Ÿ�=V��Ԉ��˖X�:ׄTV}@5ɭ쀲W��Ü�d�;���%�Y��%��Z���!��Ov#�~A_�fт���������3t$b�� �$�D��V5�9X<�MC��_~~Q�^�f�g�V��L��0����<���t=*6.'>2P],� ��0Tձ��׊��;"nyC{ ��|���r���B�|R^� �&��\K���L� םX%eu��z<ژ�$kXݭ,z����<���E^PA>}j� ͤ�W`��]���`!�\kZ5��eX�o��K �,% }F�[ \ҌZ��xJ��K�� UC�Z"]eB$a���[��m�i/� eGZ<��w����.F��K9z6#N�đD(ku�4�Er ��&)���H�$��U��J)a+�0� �W�w���I{�&L6�٭2�8�`H�����X>�Q���' ��4&3:��rFY��&��=���p�I�7��N$�Z ��S������ -�ܝ�$�pZ�m ���2cVC�c�ʀ.�z�U����:�; vR6��1H�ޑ3+sR�S#,�`�]��ԸӤ����c��@�N@ �~�s$�ý;���).Ng�JHt���38n�ץO����� ����3����(��5 ]�R� ������}0"ϗ��a��rᘏ�\<��m|��D��xڤ;��i뷖Q� Ŷ�$^�1`}�P��!�+�L����#�_��㉁��1���."H|qI���Y )d��}~9AQ9�t���_6�#�RD��7�k��m����f�XWW���ӊYʹ��K"㍦��� �F��1��H�K"�(�����Jijť-Q���DT���.A��*� �0���tg)�VHcp9#�e=���J���S;� ș��N���}��œ�] �eP7q=9P��I��Z�Q�&nLpM^L�H �: �U�\���>�����Ӊ=��pLUaKz.�U-�c/qGD/JbF���ex��X&$2��hr��A��#ڔ 3� ����8�V\#����t�F��S�@[eL�h)�7��rD�>J� ��L����|��4���R��.NF�$bm�~].�u���@����*s��4���P]�,-(ӻ �����^�~R��jubH�B��]�h�.p� ��5������qxG4SúD�v�� ��f ]/I&��*�'���;�#Zu6^�j�U'� ��~�x2�/4� 1 %�_�{���]�j�/Z8"�›�f\ߓ@��I�,ÜV�"��B�K{��3cዓ ���J�`�@ .���:�j��+�D��3rC/�Hg0tc����K���L��nD��M!q.%ս���$I<��1E�-�� ��� R�� ��-R�po�F銯��`��ֆ&i,�x%8+���O:B_!uk4c{�V����R";��v-ۋ������\�-7vd���)H���F�2t̃.C �� C(��B:\�j�n��*H8��hrD{�s�[�h�y�K����B�ܠ�@��+�5t� �$^��{�P%L;>G� ����A��v6�X!�֚HK�⒈�w���—HKv q��< ; �������ݾ�R�k��<���F{iF������6�;l��\�+w�ik�iS�7�����\S��Oi,c�ap�Č)��� !߫ ˁ �'�@z�(K� �c)w�Hc���.a�eh�$�/�U�M8��ޗL��PS��F~ ;�?,�g��AZ[��PW��]���#σ~���^hL�qgK\���y�8A ˲N� 'x ���l�l���V����($-��5� ��h��W6���+ۂ U ��V��R~�ou�,I�|8v|~~�>~^Q���P��������V'�����I/�*�����<�&G�Y�-Lqe�r�q�u���%�?��r.�E]� N\�d�d 2^� NH�S����^�����}t�U�� ���y�k���|���Ɵj��)99L�K�V����,��'��O�t3�{�P���XQ�۶~Ŏ� ��Qv��5�ǩ��ڦ������dn "q" %+M�{�]�b�����`w���ە��߿_����'z��.���" N��:���j4=�{z�U�Ӵ��.Iu���1� �vd���v��j��� �j�CXP��7�Hj �������������u;¥�z�} � p�V%m4� ��v��Hmp�8���X�6X��^;�lد�p9�K 8��º�~hO?�Cs�O,��>� ����T�����Պ1�X���*K].N{�E�U��4ۭ)�l����ʓu����@�Ze:�;h�ŠlU �=��ik�$�P����v�nh��V�bd~ ]0�Ed� {�p��U��?�_���v���8��a��U������lݕfo�A5��/��@�.N���\��pP��4ʺF�6l�Qޏ��!�}:�>��fm�P���Ӗ�}kl��lO�� �B��Q��CR�j�'o؞Ň���Gfٓ�69m�X��+k �w��o���14�LӒ��;b�'����4�˲�T.�_l�Y�X��&(�5SI�M)la/����w�T^ܫ���$�}D`���l�IG= :j����Ȼ(e���jc���]�"I�2�ΆD�.�d�7 ���)�lCKK�������9���� x=v���^k~q� H�/��54��/�5�4w ���~�{�;K�ʧb2�x�����0E!��pL��)�oƷ��Up(%����U�2k;�'�{ �:��_Ʊ�Sdqy�*����Zܯ�N$��MI/�'ؾ�]�(��N�1�dИd����D_8:��Jwکf t�R��4D`��~�͓Ax�c��j x؆���BP�k&�z�P{ �oC��XK�@��$X����b�r����-�F(�H)j�aұ ��ĢL�^7ۜ� �T� �`�"rb0�l�������NJ#�lZ+X�_8%���JyF��� q��.5v8� 1[p��V��`����"@�� Sk@ ,��1Y'�i�A8�j�Ŷ+�a6yƷg�7� >����+b�@9LG��c-���{N����9�W���ܿ|��ђ��7�w{`�az/8��G�Y>�x��.X-Ӱ��e�S=�,�����=�� D#W[�p��p?w���h2�d��g�j��at�W�i�Es�u���e�Jf�V����6�R'����r��”sJG��q�x�K����,�������w7�������l�����u���qyk-޼�6�g?�X����nЈ]Wx1��p��8�_�ǣ�y�nv�NGHS�֧�@���?>�C��ʫ��R%,0Cn1=���Gtҁ��?p��l}]���y�3�%��1Yoc�$�a��>c���� �5��o1�E.�� �= ��y�"�۫W����8��+�Fѯ� W�ER��[�7}Aa�1��ソ��c��.���0@����c:�+E,��=��C�3A��)�n�6�9�'��T�:���� yg��й��s�O��嬖��֍T��|tVnry��l���1v5n��CӠ�b�>�9�CȞ[�oY=Yqui����9�w��U����'�{�����4�� Q�z�s8�3����v�[��.�2V��שwvϪy��ͭϕ���w�/�}�a�� >S*D���ہe�_�?j||eO�j8R�n�� /6�P�9���[mo#Gr��_�K� �n4�ծ�D���O'��:� ͙&9�p�7=#����������SU�==��q�3�9/���UO=U���}u{��7w���Tg��m�6{��;�O��ϭy�l��_z��6�J�l�t��Sa��4���L�������[S��Q��Lѩ�ڴFiU���>�ƹ���L�}��pu�Q�k�ժ��I���8��N_w���Bժ¶���MI��g�ɕ���u��P��0~I��}5��8o�պS��6]��/ϕ\XWM���Y��.�+ݜ��N�m� ��Cö�ȩ�6�� !���N��:�6�TXsa7Ʃ�.T���ƺN�G��(M��@�����_����=ͺ�K����J�N��#�>_r>�f���O�A��w���C�kӷ���+%����g���@�7� ��_��;��jI Z�ΰ�X8�va��1 �ª�u��X��HC _���+Ә��v���`X(b� #��Ggvٙf��Z�+e�X��X���C��6� l����������_�s���`�X0���g;��)�������u����� +� g���i �7�Y ���k�k]62]�m��\�И�-��� ��� ���[�vU�N���7���Dv�vk|߶v�� �~�?�5L !�`wM�&}KV��-܊v�[I��Wpa�m�W�bi�7���0W��>���~��,�q��� M�X��!��O�b'�W[���t���5 d/�i�5����E6���1�.�R�&̓l��nV��-}(uS`lg�pт���nk 1��)4y� xT��jыT�G�֮�J���\���%�A!K�*��5Pa��#^b����B�v ��_�*��=̦�&|�*^DQ��L�#sFn��m�O�<��ېSض�}�i��JB10���!�v��&�5�. �����ܲm��dp4F���!�lVŚ<���5`�۪x��9Z���@>O ���n[���VHt0��E�Ӵ2�7�l�7e-V���<��,#���_���j[�o��'o���qN2�boh/t���g�W�p/B߳L��.]�S�Gδ�o�2�N�C}�&|8 �╷Gw���I�FR5z}~0m�Gri�Z�\�2u{��7�:���L�����"S�����?��ɝ��'���F�� ;�!�IXbI��0�F$�Ե��@�&� � �߃�%����2���y�p�/y���*Ռ��30q��j�je@\�d� ?Z�u��{~�X �]5�G2gB�Б ��H�������� ��@����Ӄ1[oQ�����-,ؚ�nKﰄ/?�^M��k�c�kf����(����X�kA�5 ��-�3v���+���@*DȨ� ۾���A��G1�����y�.z(���W����"�ȏ��92qs�ѕj��cj@8��Z�6O�|<�솣�"~��o:fK@�r��6�`*�1��� �������sL��՜��V$�-+c\�]P)��f�����-)Ch�@�� Z���I�1$�J]u �p�J|��-���� ��5�1��\��{ U�y��{e��#]G�J6�]QU�ru��z��=?�o5v��єǺ&�+lIN��$:���3# �c�P�ƴ����U�ƒ0�+{6A��ճ݂�ac���z寬�n��^���b�d��m�9N��v5���}��;�L���+���>K ��N��,E%�z��#={�!�f�F|�,�q_�d �&"=YY�R ,���°E4��=#�uf����<�q5�T@>�̥�TЊ@�1��Ond;a~X�r�L��)2"L[`D��Tӭ�\����z/�nY�� |�\��D��祭�k�*�xk>ڪ��1�����5X#��q�F|�ѧeD����!�*�$�0?h.���(%n�C��d%IjHk�\����X2�ݙ������~%���}U ����K(@&�~>=99m��ߞ$�@�{N���]�R��0 �� #���%���k\V�m�H��˲�\�L$���j���;��e�)6B ���zȟ��0����{���ޤ���Oj`�l�&���zH�3�ai��\��יh��&n�$�aا�fΛJ�XtbL��ʳ��ggꂳ�H�2uI �5E��_�_��<�>o���@�w=X�x��<܆��sID#�&u���+����ZP��.�JL��F�UPB8t0�Ő�s��B�����a��۲��z����D���/�B�U����Fv��B [��LD=p)ft�7��GXP`���;����'�7@aa��g�R$ͱ���?�^v^�A5�����~2$�B�M����s^�p bi�jS�T���� �Q)���d�L�AV��O D�j�� ^AgV��~B0� Ֆ�`�ɷ�x.��ځ���t �Z������[�s)��=��!���)��FOj`��f�`�d��<��$İ:�p���Y��2:1��T��|1$�OJ�˾'��"K�]0�?S0s��>#�I������ 99�����Q5Y�@�3�n���嬂���'#�^�[����J�Ӹr_X�S�������O�>���a������yc������ v�~��gJ�V�� �IWi���͟��ls����j\�7�+ �T �qR��x�Pt9X[���r/�R�K��=U��d��� ��՟�����2�W�տ��}�@������O񗾿��ˣ��7�f#���H fHDҵ��M�Ġr� l��C�A�{ ���S�L���Q1U���%��"C�J���Ѿ�طo�����՛ �{@��;#'lљ^�G?�g�G�?�~C��/ !�_� �����ױ$�N�"w��c��kkΨ��*N�,p]h,j�Er�ˀ]4Ơ�}��g���=��`硾Ӡ�oA1=\p�#�^��ȃQ��%%��F����~L�����+�l�q�;��5]�6��h1=�9�h~�) Xņ�2�X/�E��,%��̋#���\<�7*C�rr��.����� �|1=(�z���i,������9�-��`Ë ���c�_��^����B�7�&ЁsuAU<�Ȍ���2�J�U����f���y"+{�'�! ṛ�ޅK��R���)��l�>��X]������'D�e����u�p���L�sJ?ʲ|@ ��Nl��=���O�Y% ����к�|��(Z���W�;���R��hN�b�q@%aT0(�H�.n7�ۆS��z�/9�(cW 4C��� n��n JJ|ǯ�V�Qʫ���Ŝk�1��y���T�[��OçG�AQ�v�<��yd�(|!�����JH~Z���߳�x����W�E}��eh��}���Z�?(����s8Nbp(�����P�SpѸ�c��΂P����ǒ��O��R�!Y��8Ö���h��z�*m����β��/�'���Q�W[G v9VH���uH"�t�c5�\�Uͳ�&��ANGE����c�V��|T�J�N��QC=�{�:�~Fz� -,� ���X��zk��!�򺨚-��4�P2!���0]�?� �A��Wx�5�˟t��5�`�<[a� ���w�� +Nnpv���@�P�ᮁ\eVNՈU�h1^�Z��g�H�cXb�J�����4� DQ�H���NJx!<��Ԅ��j����!�Lg3q��ݖsq��p��ki�� �E�$�8J�0�RI���jr�j����p�7�����E�x�l�D��d�>9��D`�������{��lj�G6.�D;�����)q�����s�$�\f���0D� *���͢�rdgk�������|R���5"��S�S/�ݖ����>n�f聤P�p� �d8�5]�q �@Ju �%�]8���y�`��E�#_g�ɘI�V�xb0���(Վy���/*�F�d�Q�>De�72?�/�I�S�H��9���R�U?�&�HhI; ���'3N�'�TF��W�Sh���楐'�)����۳̿|w����s��>�T㋵����� cH�F��m����O���u);:vD�L���.�v���ø����ދ��p�ѵ�!�����q�~��: 4�Z&0RtcC�֓-�%PZ�7� �[��}����E���/p��ސ��{���YԁF0^R�p/}�i6CG��v�h �Q�#V�˴�h��)�@1>�y��UH�T�F.�����R��E�į���G�v:�����>���C0aBMw��s ��2WI�!~'�p����l��@ �C�Mv.��N<����¼T���-y�T����ǰ�0�?�X_�н�31t�?���I�Ȁ�} �bG������:�PWlAY�`����(\˛��ST"��<���y �q�� 4?u]Ȇ��j��[J��S� �:�(N��2���誟��Һ�hT�Tsb�r�x� N1��ڕ9�e6�D���J���M8��7{�ӧ�\� ����,1��|~���f(?����=��2��3^!mE�7�\��g߇��M�YJ3�_ u�,IE��d�����rz� =��J�s��ƺ��)��G~]�������T�Z4�3�C������#��N�g�8z��� G|8�-P�?�p���NΝ/����q%]^F�0� ?W �i�T͚k �C�Rz��� ���/�hT��V�C��cb/H9����=ʏ�\«c�`�v�g��x�?4N�([�����R `Ƨ0{3�.�|�6T��k���%���J�?���)p���'�����dz��&�������H9 m���X�s������J�#rBA?�5�J�q;-?����ד9G�J��������B�ݺ}�&K�ao����w��_�[����{�v{P֫��U��F�|�]��o��_�W�R6��Q�6�j�k�<�3J{}�xn*�K���g������6l���U�`��3^�۲. {���֨`��V�����\���T!U�f�5�4�1��Z�j��EG��f��*7���l��L9��+������Ѵ v�q���]�j,*J��O������^[�i횇n�Dݸ�x/���"�4!x��~��K 0]'K�spK+�5�jz" �@��>�(xG�+�+�[�/�h��U3n���֍��-�[s����|� [uiW�1���#:D�s�1��!t���� h#5���ڎ/���CغJ=t=G�b>|��K_ٚx���W/:�O�m�۲��AMG1�mgݲX>��Y\\�/�9W>!4��@M�Vk��Y�N����X����Yw.�޺=�u�D��Œ���: *w�=r�����lc�a1jQv'�6�� Uâ\���n*��y0N�r���-`�cQ�8���vc��i�|�>�2uu���� V�>���#���2��u�i��� ��v��B����o��eOd���Uޖ5�<��q+iYAأs�j���+���ι �ER�dٵ�t~�,C�H��&dEa,�$���Tx� T+&F�Qo� $���ۛ��Z{r"�> �� � 扚�l�R�@�XZ;���o�ճ��0e�kVȝ�/V�o��="��nVzcb>l��[v+�a�/v��3���<�;�\.۩��k�˰'�-o�;���?�9�+�T��ܪ��͜,W���#��ʛ�ٰ(�&'0�u�:&ߣ���ƶ����%��ǚ��dcP*8o���t�]l\g$ks_4�\X9�^�����k�Y)b�� 3�n���ޱr0Ps@��sXI�������� �e���8$xX��{�*ĉ�#�e�m���[�A�@?`�d�� n���)Gl+�{Wd'�Vc��F� � YM�D�j˕i$�TM� l����9G��g�q�����������^�ی9VH,��Kf�����s�b�/#�ˋ/$j_ �d� �$he�6����,�e�ehV�P��6�@��3��2�Goى}���645tۃ��������-򘪜 `��u���ݟ�)�C,89�AӁ�����DvP>��:�iL�N�cg,}��A�( �#���+�v0B���vzo�j3����8�(�%Z 'I�!>� �BA#z��a΢�2�;�-�16�d�{KhEvR3۶d�.��3�,�ڦ�`!]a��DU�"�2"�b d}�X� "�|�~B-�k������M�W�Ѝwn�ft���Ct#܊9�M�4���]�|!y����%I��dyR�dH�;��ۺ8"z2�BxM0(��Hc�� ���K2��N<���>�wֵM�Q,��2�S�Dz��9����ؼ���jb�&F�w&&9]�� V� :۽)�y Jd�����!��u� �b״ݹbQ�t���"Is@D��dp�O���ʵd�y��&U�$�I�&I��9�»��p�]~�x��R�o:K�=ˢa:��~�EB��ǧIx��:U#���_cӧ������o�gk����TM���%ɓ�d��@$��J��b��$�}yJ�03�iڞ$�o�l:!���0�c�d���_ש�&/f��l6�snT��l�XȌS��a�T|:<�`�^��#G�Hqŀ��T�i �&2�'�y������%�zw�<�_��N^���)m!��8�6�Q9��� }Ԙx��B G���;�jq:K��$Vp����!j��!^L��f� jk7[�1a���o��N|�b(�Wx��� mSţ.��P��1D�e)� d��OՔ޽~U�p��++�K��+�z��$����y��=��H����I����O#�Ș��q�� -�p̃f��ą��x�X�gj�T���pmēF|��6�@�u����N�ȷ��l<���v�����ޮ�mb�,�a�%���H������3!� �$G�ȡܮ\~�<6��^���gx�.(��H��53�".�Y�|���d(>�$'G��U���ύ��z@��a H�z��Y���Ů���8�V�N���@sPp[�C;rWJ��5��xV�g&��S'�v�ն:B5\�>?�u�q�(֋�N�rLy�"��5��|��`&�O�=.nkGN��^��Ө��x��I �,��k�x�>�#�Š^c B��:R�|^6\����v%���p�Ih>fޑ�ɪм4�o��yw�+76���RP��έ1'�X�q��{�w�e�X���O Ө�{<��Vǃ��5<0���#������������]b���~�~�qDq4}� NZG�H(t�'�� +9"��r/�M�1� �x�1[t� r�OO8~����oM�j '"8��S�^/�L�Z��B�| ����]�xU�<�W�r �m�����W�n�F}�Wl����85Z�(�M�m�IPEQ,ɕ��r�ًi��{f��%q/(8���˙�3g� ����y��w�ܩ n��:+Zy����wr�V�k�Q���:e�c��{�^Z��;m�щ� ��T�x9�8��*��蒨���Uh�4f�oe��o�X�ߵ�΁�f�a!��Y3����j��F�p��A�ԗ�8�^�*E[q�c��) ��Ѷ�5��>IJ��2|?��r���P���nœǗW��s��j_�!~Y^�����؊[ݗ�a0�TJ���y�Znd�0�m�o�adx})~�Кa�B�S]�뢇��@c�UQ�"[5~!���?ʱR!���1� n#����2JU�u���/Ԯ��qD���)�5�+/��Y��+��Pwʏ��ȍ*~?�q�� u_�ԨFl��D Tڽ�#�h��w��t�h�Fo6�N�@�o�� �rA�=�B'����']� -�����Q;;���L�gP阺��@K����%#)3�����_�|E��2H�]8O�@��� �_ʕG���U[��(i��.r��d�Ò�v۽���>d����� �}�}y��Ȏ^Ǔ�*��h�P{]�\Uʸ�,�� L�:�����H�m���y��V�����rj���~p)�ZP'N&`酠�V��䫒}�k�z���l��4=���@$�K��,��Pp ��J�@���FE��(�2�ԕ��o�h�*��x��ql�*�o�)~��i��p�����cr��#T�c�A/�.д��j *�I�8<7X�d�I��2:��#�؞��q3�N��Q����lJ���W�~�u���t~��E�R�wO��1� \̃�3q�K�r ���#r{��i�eQ�������Km��Z��;�?�g�F�a(m�}�V�m��#Z�X�2(�)�6��Cpv�h=l�p�(@�� [ZAt�3\2xӌ�W�=.� �9�i�ƛ�p?[t��r��U�S�ً�+�c�|���ZI˳�����QK���*�i��:a%s���Bޝ�K�x�3Ryp ޢ ����!9���"��{fm9����tϟO�~��;ZD�G"�d=V��3�l�iQ��Y+'����w���SV~?<��(}�����k�D��a�t�#�0ԣ��lЛ�(p5DŽ ��=� ���T>��tu�����!������R�u� ��L=��J[��6 ��)1�ś ��x��*/��cq ��$9�Ё�t�{�� �\��;@�������50�lJ6 ` �b��D�����9���M}l�����f�����J��&u�J����sH�w}"ݹW�ԏ���c V~[38�1��P� \�)�^hc����1RmN����;�/{�x�~ڠ��ř�w�g� ,�ib�j���x��3mk з�:@G���q�s��x﵍!g>庠 ��O�O��[G�9�������ܲXD;62�����ٻWrymPj����0��su�#J�B��fZS��z�n��LCOo�0! �,lQ�T��b� 0�Z] z�W� ��S�.r�K����*��x��1�c�}��r'���r�ҟ�vH,� �V�+<���0�///\�_�䳩��˜1�@��$�^�� ������r�$@�F�_�R4�<�ҀU�|A��jw�)�� &�,_?9~Hr�ڊ��D�f'F��]�B>D�j M��A���/<�,���=k m6��`��س�:�s�Q*3ѱlpoD�g�!���6��O���,�>��N⒄"cwzwǗfv�b�"��La�Y���$F�[萘,��%d��\�|=_O͸\jp<�3Ż��G��\F (`wti�������A�­��������M���U��/��P�����X�s���Ś�`���̤���,۱��RE&�����#y"�c�����{����c�I0c���>���N/��.> G��Ս�f�·�o(��lAS� U�h�ܜDEg7▮.�#2�?���.(�u�Sm%Y]J��b��rYl�;�� ��F;�9�+*e6��%���rCg��>�R[��Ew%i��B�eNn.)W&�8��A4wn9H�\g6���}�5 He��r�9M3]9�&if�4���L/U#�jT��\�������� GK1�$oE��=�+�E���R�@�Q�cG�"�\VΒ��L�s�J�]���BV�M�T�!��Mb���x+E. e�( ='�HYRU.a�R/�B8��x�@�� �rI�vdkH��59M+i�t ���,-ӆ#Ч L���B� |����!�S��V�w>���D/��ADZ�����=^x���-� �|'Vb��t��/ �Ɲ���6�2���9}��U@Vl�� ף_#£��=9��w�i~��κg��q﹟��e|����ŝ7æk��!�m�����/xk�`_Jc��R��S����(�t�,}#'����1�� �����3u|��쥷��Uz�w�ۣgt���Iy�F~)�����x�b3�!LV1��XR����E�C$��BZ) BN��R��!�b��*����b�!�զ���t��ޯ)�])��Y����,��r � �M��)����r)��V5�W >���#��¶0� �P08�|��%bƋ��k�i� X5�B\�����>C��jR�$zW��� !��;��M��KS��*��hk3@�kX0�r9�(�M9����)�E�m�MP_M� G-��I������l\w�j��پ_�I4��$�3��GoQ䮥]���kjo��a���fƀ�zH��^���.g�w� �d2v�����s���:C�0�B�P}�����NaY;��8}ߨ�w��qn�u�:�-�7VWq��wG��Q;����8X�o ??�\#|�@uD-�m��� (������f����(�nվ$sW����F ����jˏ��֍U�T�����!���{\�|���=��5����qg����砷����x���l�gb�X<2�%�Cw>�J���併�'q�o�a����C��-Ɠ�=��7 �#+�{ ����M(i;҈�F�3@����H�D&Th���ú� ��;�a�0bi`y���}S�P�^\� �-���s��rj (�������폓�Ǹ���X#�O��E�ϣ����� �9k�^?p�ZN =�L0��}�Z��F�M u ��f���� ��w�m��=��AWi�a�j�:�]�ٲ�����_��I��+#WJ�ֻ�b�����Z��g�̞�Ϫ���Xλ���2U��� �YSU�%��ߣ[����w� K1\ �S���m��ڰ7��bo���5�xlis @Նi`������a��){ �+�B��w-?l�ܻ���h���Y�E[�=Sw�ڳ�P7��waTV7S,�Б�*G���ȄQ������������]��O7鐙��[R�y�E~s��w.��3��=Uɽ#s�_�Θ8�]���?�}�^����n�{V�P�hG[�E�����j ���4� bK5�t��lx�a������|~uԴ�����j#3��й�_�� �殺�$6��@���;�j,�p9b*���&�n���f��a��X���TU�~D �z)��B�R9�K磳�˳��K�����U \k���"�?�4�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������NBRZ��c��������