� K�gs��Z�gd�ZddlZddlZddlmZddlmZd d�Zd d�Z d d �Z dd �Z eZ dS))�parent� reference�at�parents�children�N�)� _proxy_helper)�_locate_object�c�b�d}t||||��}|���}||urdS|S)al >>> listiter = iter([4,5,6,7]) >>> obj = parent(listiter, list) >>> obj == [4,5,6,7] # actually 'is', but don't have handle any longer True NOTE: objtype can be a single type (e.g. int or list) or a tuple of types. WARNING: if obj is a sequence (e.g. list), may produce unexpected results. Parent finds *one* parent (e.g. the last member of the sequence). rN)r�pop)�obj�objtype�ignore�depth�chainrs �]/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/dill/pointers.pyrrs<�� �E� �C��%�� 0� 0�E� �Y�Y�[�[�F� ��}�}��t� �M�c���tj}�fd�}t|d��s|fn|}d�|D��}t||||��ddd�}|S)z�Find the chain of referents for obj. Chain will end with obj. objtype: an object type or tuple of types to search for depth: search depth (e.g. depth=2 is 'grandparents') ignore: an object or tuple of objects to ignore in the search c�$��t|���S�N�� isinstance��xrs �r�<lambda>zparents.<locals>.<lambda>-����*�Q��0�0�r�__len__c3�4K�|]}t|��V��dSr��id��.0rs r� <genexpr>zparents.<locals>.<genexpr>0�(���� (� (�#�b��g�g� (� (� (� (� (� (rN�����)�gc� get_referents�hasattr� find_chain�rrrr� edge_func� predicaters ` rrr%sk���� �I�0�0�0�0�I�%�f�i�8�8� D�f�Y�Y�f�F� (� (�� (� (� (�F� �s�I�y�%� 8� 8���2�� >�E� �Lrc���tj}�fd�}t|d��s|fn|}d�|D��}t|||||��}|S)aFind the chain of referrers for obj. Chain will start with obj. objtype: an object type or tuple of types to search for depth: search depth (e.g. depth=2 is 'grandchildren') ignore: an object or tuple of objects to ignore in the search NOTE: a common thing to ignore is all globals, 'ignore=(globals(),)' NOTE: repeated calls may yield different results, as python stores the last value in the special variable '_'; thus, it is often good to execute something to replace '_' (e.g. >>> 1+1). c�$��t|���Srrrs �rrzchildren.<locals>.<lambda>Drrrc3�4K�|]}t|��V��dSrr r"s rr$zchildren.<locals>.<genexpr>Gr%r)r'� get_referrersr)r*r+s ` rrr6sb���� �I�0�0�0�0�I�%�f�i�8�8� D�f�Y�Y�f�F� (� (�� (� (� (�F� �s�I�y�%�� @� @�E� �Lr�c��|g}t|��di}t|��di}t|��}|�t|����|�t|����|�t|����|�t|����|�t|����|�ttj������|�ttjd������t j��|�r(|�d��} || ��rY| g} |t| ���?|t| ��} | �| ��|t| ���?| S|t| ��} | |kr�|| ��} |�t| ����| D]a} t| ��|vr�t| ��|vr<| dz|t| ��<| |t| ��<|�| ���b|��(|gS)Nrr) r!�set�add�sys� _getframer'�collectr �append)rr-r,� max_depth� extra_ignore�queuerrr�targetr�tdepth� referrers�sources rr*r*Ss:�� �E�E� ��W�W�a�L�E���g�g�t�_�F� �� � �F� �J�J�r�,��� � � � �J�J�r�%�y�y���� �J�J�r�%�y�y���� �J�J�r�&�z�z���� �J�J�r�&�z�z���� �J�J�r�#�-�/�/�"�"�#�#�#� �J�J�r�#�-��"�"�#�#�$�$�$��J�L�L�L� �)����1���� �9�V� � � ��H�E���F���$�0���6� � �+��� � �V�$�$�$���F���$�0��L��r�&�z�z�"�� �I� � �!� �&�)�)�I� �J�J�r�)�}�}� %� %� %�#� )� )���f�:�:��'�'���f�:�:�U�*�*�(.�� �E�"�V�*�*�%�)/�F�2�f�:�:�&��L�L��(�(�(��% �)�& �5�Lr)r )rr )r2r ) �__all__r'r6�_dillr rr rrrrr*� refobjectr rr�<module>rDs��� ?� >� >�� � � � � � � � �-�-�-�-�-�-�'�'�'�'�'�'�����(����"����: � � � �H � � � r
Memory