�
��g% � �z � d dl mZ d dlmZ d dlmZmZ d dlmZ d dl m
Z
d dlmZ ddl
mZ G d � d
e
� � ZdS )� )�S)�sympify)�Eq�Ne)�global_parameters)�Boolean)� func_name� )�Setc �@ � � e Zd ZdZd� fd� Zed� � � Zd� Z� xZS )�Containsa�
Asserts that x is an element of the set S.
Examples
========
>>> from sympy import Symbol, Integer, S, Contains
>>> Contains(Integer(2), S.Integers)
True
>>> Contains(Integer(-2), S.Naturals)
False
>>> i = Symbol('i', integer=True)
>>> Contains(i, S.Naturals)
Contains(i, Naturals)
References
==========
.. [1] https://en.wikipedia.org/wiki/Element_%28mathematics%29
Nc � �� t |� � }t |� � }|�t j }t |t � � st dt
|� � z � � �|rX|� |� � }t |t � � r|t j
t j fv r|S n|�t d� � �t � � �
| ||� � S )Nzexpecting Set, not %sz)_contains() should return Boolean or None)r r �evaluate�
isinstancer � TypeErrorr � _containsr r �true�false�super�__new__)�cls�x�sr �result� __class__s ��c/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/sets/contains.pyr zContains.__new__ s� �� ��A�J�J���A�J�J����(�1�H��!�S�!�!� D��3�i��l�l�B�C�C�C��
M� �[�[��^�^�F��&�'�*�*�
M��a�f�a�g�.�.�.�!�M� /��#�� K�L�L�L��w�w���s�A�q�)�)�)� c �b � t � � j d� | j d j D � � � S )Nc �p � g | ]3}|j s#|j st |t t f� � �,|j ��4S � )�
is_Boolean� is_Symbolr r r �binary_symbols)�.0�is r �
<listcomp>z+Contains.binary_symbols.<locals>.<listcomp>9 sT � � %� %� %���|�%� �{�%�
�q�2�r�(�#�#�%�Q�-� %� %� %r r
)�set�union�args��selfs r r# zContains.binary_symbols7 s<