� ��g��� �dZddlmZmZd�ZdS)z%Generic tools for working with trees.�)�ceil�logc�����|sgS�dksJ�ttt|�������}|dkrt|��Sg}d}�|dz z}t dt|��|��D]�}||||z��t���|kr�}ngt����kr>��fd�t dt������D���t����k�>|������|rst |����t����t|��z kr|����n|����t|���ksJ�|S)z�Build N-ary tree from sequence of leaf nodes. Return a list of lists where each non-leaf node is a list containing max n nodes. �Nrc�*��g|]}�||�z���S�r)�.0�k�n�subtrees ���h/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fontTools/misc/treeTools.py� <listcomp>z$build_n_ary_tree.<locals>.<listcomp> s&���M�M�M�a�w�q�1�q�5�y�)�M�M�M�)rr�len�list�range�append�build_n_ary_tree�extend)�leavesr �depth�root� unassigned� full_step�ir s ` @r rrs����� ��� � �q�5�5�5�5� ��S��[�[�!�$�$� %� %�E� ��z�z��F�|�|�� �D��J��e�a�i� �I� �1�c�&�k�k�9� -� -������Q��]�*�+�� �w�<�<�)� #� #� �J� �E��'�l�l�Q���M�M�M�M�M�5��C��L�L�!�3L�3L�M�M�M�G��'�l�l�Q��� � � �G�������"�:�q�1�1�� �w�<�<�1�s�4�y�y�=� (� (� �K�K�� � � � � �K�K�� � � ��4�y�y�A�~�~�~�~� �KrN)�__doc__�mathrrrrrr �<module>rs<��+�+���������'�'�'�'�'r
Memory