Edit File: arguments.cpython-311.pyc
� ����r�d�2����������������������t�����d�dl�mZ�d�dlmZ�d�dlmZ�d�dlmZmZ�d�dl m Z mZ�d�dlm Z mZ��G�d��d������������Zd S�) �����)�annotations)�nodes)�Instance)�CallContext�InferenceContext)�InferenceError� NoDefault)�Uninferable�UninferableBasec�������������������b�����e�Zd�ZdZ � �ddd�Zeddd���������������Zd ��Zdd�Zddd �Z ddd�Z d��ZdS�)�CallSitea���Class for understanding arguments passed into a call site. It needs a call context, which contains the arguments and the keyword arguments that were passed into a given call site. In order to infer what an argument represents, call :meth:`infer_argument` with the corresponding function node and the argument name. :param callcontext: An instance of :class:`astroid.context.CallContext`, that holds the arguments for the call site. :param argument_context_map: Additional contexts per node, passed in from :attr:`astroid.context.Context.extra_context` :param context: An instance of :class:`astroid.context.Context`. N�callcontextr����context�InferenceContext | Nonec�����������������J����|�i�}||�_���������|j��������}|j��������}t������������������������|�_��������|����������������������||�������������|�_��������|����������������������||�������������|�_��������d��|�j��������D���������������|�_ ��������d��|�j��������� ����������������������������������D���������������|�_��������d�S�)N�r���c�����������������<�����g�|�]}t����������|t�����������������������|��S����� isinstancer�����.0�args��� �b/builddir/build/BUILD/cloudlinux-venv-1.0.2/venv/lib/python3.11/site-packages/astroid/arguments.py� <listcomp>z%CallSite.__init__.<locals>.<listcomp>.���s7�������% ��% ��% ��j��o�6V�6V�% ��% ��% ��% �����c�����������������D�����i�|�]\��}}t����������|t�����������������������||��S�r���r����r����key�values��� r���� <dictcomp>z%CallSite.__init__.<locals>.<dictcomp>1���s>�������" ��" ��" ���U��e�_�5�5�" ���" ��" ��" r���)�argument_context_map�args�keywords�set�duplicated_keywords�_unpack_args�_unpacked_args�_unpack_keywords�_unpacked_kwargs�positional_arguments�items�keyword_arguments)�selfr���r"���r���r#���r$���s��� r����__init__zCallSite.__init__���s�������� �'�#%� �$8��!�����'��-0�U�U�� �"�/�/��g�/�F�F��� $� 5� 5�h�� 5� P� P���% ��% ��.�% ��% ��% ��!�" ��" �"�3�9�9�;�;�" ��" ��" ����r���c�����������������p�����|p t������������������������}t����������|j��������|j��������������������}�|�||�������������S�)zxGet a CallSite object from the given Call node. context will be used to force a single inference path. r���)r���r���r#���r$���)�cls� call_noder���r���s��� r���� from_callzCallSite.from_call7���s>��������/�-�/�/��!�)�.�)�2D�E�E���s�;��0�0�0�0r���c�����������������V�����t����������|�j��������������������t����������|�j��������������������k����S�)ao��Check if in the current CallSite were passed *invalid* arguments. This can mean multiple things. For instance, if an unpacking of an invalid object was passed, then this method will return True. Other cases can be when the arguments can't be inferred by astroid, for example, by passing objects which aren't known statically. )�lenr+���r(����r.���s��� r����has_invalid_argumentszCallSite.has_invalid_argumentsC���s%��������4�,�-�-��T�5H�1I�1I�I�Ir����return�boolc�����������������V�����t����������|�j��������������������t����������|�j��������������������k����S�)ag��Check if in the current CallSite were passed *invalid* keyword arguments. For instance, unpacking a dictionary with integer keys is invalid (**{1:2}), because the keys must be strings, which will make this method to return True. Other cases where this might return True if objects which can't be inferred were passed. )r5���r-���r*���r6���s��� r����has_invalid_keywordszCallSite.has_invalid_keywordsM���s%��������4�)�*�*�c�$�2G�.H�.H�H�Hr���c���������������������i�}|p t������������������������}|�j��������|_��������|D��]b\��}}|��T �t����������|���������������������|�������������������������}n%#�t ����������$�r �t����������||<���Y��Dt����������$�r�Y��Ow�xY�wt����������|t����������j ��������������������st����������||<����x|j��������D�]�\��}} �t����������|���������������������|�������������������������}n%#�t ����������$�r �t����������||<���Y��@t����������$�r�Y��Kw�xY�wt����������|t����������j��������������������st����������||<����tt����������|j ��������t����������������������st����������||<�����|j ��������|v�r/t����������||j ��������<���|�j�����������������������������|j �����������������������|||j ��������<����ܐ�]|||<�����d|S�)Nr���)r���r"���� extra_context�next�inferr���r ���� StopIterationr���r����Dictr,����Constr ����strr&����add) r.���r$���r����values�namer ����inferred�dict_key� dict_values ��� r���r)���zCallSite._unpack_keywordsW���s���������/�-�/�/�� $� 9���#��% %��% %�K�D�%��|��#�E�K�K��K�$@�$@�A�A�H�H��%�������#.�F�4�L��H�$��������H������"�(�E�J�7�7���#.�F�4�L��,4�N��8��8�(�H�j�!�#'����w��(G�(G�#H�#H����)��!��!��!�'2��t�� ��(��!��!��!� ��!����%�h���<�<��!�'2��t�� �%�h�n�c�:�:��!�'2��t�� ��~��/�/�1<��x�~�.��0�4�4�X�^�D�D�D� �-7�F�8�>�*�*�'8�*� %��t���� s/����#A�A1�% A1�0A1�&#C � C,� C,�+C,c�����������������X����g�}|p t������������������������}|�j��������|_��������|D��]}t����������|t����������j��������������������r� �t ����������|j�����������������������������|�������������������������}n5#�t����������$�r�|� ��������������������t�����������������������Y��mt����������$�r�Y��xw�xY�wt����������|t����������������������r|� ��������������������t�������������������������t����������|d������������s|� ��������������������t�������������������������|���������������������|j�����������������������|� ��������������������|��������������� |S�)Nr����elts)r���r"���r=���r���r����Starredr>���r ���r?���r����appendr ���r@���r����hasattr�extendrK���)r.���r#���r���rE���r���rG���s��� r���r'���zCallSite._unpack_args����s4��������/�-�/�/�� $� 9����� #�� #�C��#�u�}�-�-�� #��#�C�I�O�O�G�O�$D�$D�E�E�H�H��%��������M�M�+�.�.�.��H�$��������H�������h��8�8����M�M�+�.�.�.���x��0�0����M�M�+�.�.�.��� � �h�m�,�,�,�,�� � �c�"�"�"�"�� s����(A(�($B� B�Bc����������� ������ �����||�j���������v�rt����������d|�|||�������������� �|�j��������|������������������������������|������������S�#�t����������$�r�Y�nw�xY�wt����������|�j��������������������t����������|j��������j��������������������k����r,|j��������j��������s |j��������j ��������st����������d|�|||��������������|�j��������dt����������|j��������j������������������������������}|�j��������t����������|j��������j��������������������d����������}|j��������� ��������������������|������������d���������}d��|j��������j��������D�����������������fd�|�j�������������������������������������������D���������������}t����������|������������t����������|j��������j��������������������k�����rG|j��������j��������D�]:}|j ��������|v�r/|���������������������|j ��������������������} |���������������������| ��������������;|��ct!����������|dd������������} |dk�����r |j��������d v��r�| �)|j��������d k����r|r|d������������������������������|�������������S�| �|j�����������������������������d� ������������} t)����������| t*����������j��������������������r?|j�������������������������������������������}|| �����������������������������������u�rt3����������| f������������S�|j��������d k����r9t)����������| t4����������������������s| �����������������������������������} t3����������| f������������S�|j��������dk����rt3����������| f������������S�|j��������d v�r| r|dz��} �|�j��������|������������������������������|������������S�#�t8����������$�r�Y�nw�xY�w|j��������j��������|k����r�|������������������������������������r t����������d|�j��������|�j��������|�|||��������������t+����������j ��������|j��������j!��������|j��������j"��������|j���������������������}|�#��������������������d��|�����������������������������������D����������������������������t3����������|f������������S�|j��������j��������|k����r�|��$����������������������������������r t����������d|�j��������|�j%��������|�|||��������������t+����������j&��������|j��������j!��������|j��������j"��������|j���������������������} | �#��������������������|�������������t3����������| f������������S� �|j���������'��������������������|���������������������������������|������������S�#�tP����������$�r�Y�nw�xY�wt����������d|�|||��������������)a��Infer a function argument value according to the call context. Arguments: funcnode: The function being called. name: The name of the argument whose value is being inferred. context: Inference context object z9The arguments passed to {func!r} have duplicate keywords.)� call_site�funcr���r���zJToo many positional arguments passed to {func!r} that does not have *args.Nr���c����������������������h�|�] }|j����������� S�r���)rF���r���s��� r���� <setcomp>z*CallSite.infer_argument.<locals>.<setcomp>����s������C�C�C�3�c�h�C�C�Cr���c�����������������$������i�|�]\��}}|�v� ||�� S�r���r���)r���r���r ���� kwonlyargss��� �r���r!���z+CallSite.infer_argument.<locals>.<dictcomp>����s4�������� �� �� ���U��*�$�$�� ��$�$�$r���� boundnode>����method�classmethodrX���r���T)�futurerY�������z�Inference failed to find values for all keyword arguments to {func!r}: {unpacked_kwargs!r} doesn't correspond to {keyword_arguments!r}.)r-����unpacked_kwargsrQ���rR���r���r���)�lineno� col_offset�parentc�����������������@�����g�|�]\��}}t����������j��������|������������|f��S�r���)r���� const_factoryr���s��� r���r���z+CallSite.infer_argument.<locals>.<listcomp>��s,������T�T�T�z�s�E�%�%�c�*�*�E�2�T�T�Tr���z�Inference failed to find values for all positional arguments to {func!r}: {unpacked_args!r} doesn't correspond to {positional_arguments!r}.)r+���� unpacked_argsrQ���rR���r���r���z-No value found for argument {arg} to {func!r}))r&���r���r-���r?����KeyErrorr5���r+���r#����vararg�posonlyargs�find_argnamerV���r,���rF����poprM����getattr�typer_����framer���r����ClassDef�scope� metaclass�iterr����instantiate_class� IndexError�kwargr;���r*���rA���r]���r^����postinitr7���r(����Tuple� default_valuer ���)r.����funcnoderF���r���� positionalrd����argindex�kwargs�func_argr���rW����method_scoperq���r#���rV���s��� @r����infer_argumentzCallSite.infer_argument����sh��������4�+�+�+� �K����������� � ��)�$�/�5�5�g�>�>�>���� �� �� ��D� ������t�(�)�)�C�� �0B�,C�,C�C�C��=�'�� �� �0I�� �$�&��#�!��#����������.�/H��X�]�5G�1H�1H�/H�I� ��*�3�x�}�/A�+B�+B�+D�+D�E���=�-�-�d�3�3�A�6��C�C�(�-�*B�C�C�C� � �� �� �� �"�4�:�:�<�<� �� �� ����z�?�?�S���!3�4�4�4�4�$�M�.�� +�� +���=�F�*�*� �*�*�X�]�3�3�C��%�%�c�*�*�*�������d�;�;�I��1�}�}���2K�!K�!K���$���(�)B�)B�z�)B�%�a�=�.�.�w�.�?�?�?��$� (�� 5� 5�T� 5� B� B�I��i���8�8��2� �$,�?�#8�#8�#:�#:�L�#�y�':�':�'<�'<�<�<�#�Y�L�1�1�1��=�H�,�,�%�i��:�:��B�$-�$?�$?�$A�$A� ����-�-�-��=�M�1�1����-�-�-���}� 9�9�9�i�9��A� �� ��0��:�@�@��I�I�I���� �� �� ��� ������=��$�&�&���(�(�*�*�� �$�-��'+�&<�$(�$9�"�!��#� �� �� �� ���J��}�+�#�=�3��}������E� � �N�N�T�T�V�\�\�^�^�T�T�T� �� �� �����>�>�!��=��4�'�'���)�)�+�+�� �$�>��*.�)B�"&�"5�"�!��#� �� �� �� ���;��}�+�#�=�3��}������D� � �M�M�&�!�!�!����=�=� � ��=�.�.�t�4�4�:�:�7�C�C�C���� �� �� ��D� �����;����� �� �� �� s5����A���� A �A �9L�� L&�%L&�8,R%��% R2�1R2)NN)r���r���r���r���)N)r���r���)r8���r9���)�__name__� __module__�__qualname__�__doc__r/���rY���r3���r7���r;���r)���r'���r{���r���r���r���r ���r ������s������������������&�"�+/� �� �� �� �� �0�� 1�� 1�� 1�� 1���[� 1�J��J��J�I��I��I��I�*��*��*��*��*�X���������2Y ��Y ��Y ��Y ��Y r���r ���N)� __future__r����astroidr���� astroid.basesr����astroid.contextr���r����astroid.exceptionsr���r ����astroid.utilr ���r���r ���r���r���r����<module>r�������s������ �#��"��"��"��"��"��������������"��"��"��"��"��"��9��9��9��9��9��9��9��9��8��8��8��8��8��8��8��8��5��5��5��5��5��5��5��5�g ��g ��g ��g ��g ��g ��g ��g ��g ��g r���