<commit_before>from core import C
from sympify import sympify
from singleton import S
from expr import Expr, AtomicExpr
from cache import cacheit
from sympy.logic.boolalg import Boolean

import re

class Symbol(AtomicExpr, Boolean):
    """
    Assumptions::
       commutative = True

    You can override the default assumptions in the constructor::
       >>> from sympy import symbols
       >>> A,B = symbols('AB', commutative = False)
       >>> bool(A*B != B*A)
       True
       >>> bool(A*B*2 == 2*A*B) == True # multiplication by scalars is commutative
       True

    """

    is_comparable = False

    __slots__ = ['is_commutative', 'name']

    is_Symbol = True

    def __new__(cls, name, commutative=True, **assumptions):
        """Symbols are identified by name and commutivity::

        >>> from sympy import Symbol
        >>> bool(Symbol("x") == Symbol("x")) == True
        True
        >>> bool(Symbol("x", real=True) == Symbol("x", real=False)) == True
        True
        >>> bool(Symbol("x", commutative=True) ==
        ...      Symbol("x", commutative=False)) == True
        False

        """

        if 'dummy' in assumptions:
            import warnings
            warnings.warn("\nuse Dummy() or symbols() to create dummy symbols.",
                          DeprecationWarning)
        return Symbol.__xnew_cached_(cls, name, commutative, **assumptions)

    def __new_stage2__(cls, name, commutative=True, **assumptions):
        assert isinstance(name, str),`type(name)`
        obj = Expr.__new__(cls, **assumptions)
        obj.is_commutative = commutative
        obj.name = name
        return obj

    __xnew__       = staticmethod(__new_stage2__)            # never cached (e.g. dummy)
    __xnew_cached_ = staticmethod(cacheit(__new_stage2__))   # symbols are always cached

    def __getnewargs__(self):
        return (self.name, self.is_commutative)

    def _hashable_content(self):<commit_msg>A more gentle deprecation of Dummy via Symbol<commit_after>from core import C
from sympify import sympify
from singleton import S
from expr import Expr, AtomicExpr
from cache import cacheit
from sympy.logic.boolalg import Boolean

import re

class Symbol(AtomicExpr, Boolean):
    """
    Assumptions::
       commutative = True

    You can override the default assumptions in the constructor::
       >>> from sympy import symbols
       >>> A,B = symbols('AB', commutative = False)
       >>> bool(A*B != B*A)
       True
       >>> bool(A*B*2 == 2*A*B) == True # multiplication by scalars is commutative
       True

    """

    is_comparable = False

    __slots__ = ['is_commutative', 'name']

    is_Symbol = True

    def __new__(cls, name, commutative=True, **assumptions):
        """Symbols are identified by name and commutivity::

        >>> from sympy import Symbol
        >>> bool(Symbol("x") == Symbol("x")) == True
        True
        >>> bool(Symbol("x", real=True) == Symbol("x", real=False)) == True
        True
        >>> bool(Symbol("x", commutative=True) ==
        ...      Symbol("x", commutative=False)) == True
        False

        """

        if 'dummy' in assumptions:
            import warnings
            warnings.warn(
                    "\nThe syntax Symbol('x', dummy=True) is deprecated and will"
                    "\nbe dropped in a future version of Sympy. Please use Dummy()"
                    "\nor symbols(..., cls=Dummy) to create dummy symbols.",
                    DeprecationWarning)
            if assumptions.pop('dummy'):
                return Dummy(name, commutative, **assumptions)
        return Symbol.__xnew_cached_(cls, name, commutative, **assumptions)

    def __new_stage2__(cls, name, commutative=True, **assumptions):
        assert isinstance(name, str),`type(name)`
        obj = Expr.__new__(cls, **assumptions)
        obj.is_commutative = commutative
        obj.name = name
        return obj

    __xnew__       = staticmethod(__new_stage2__)            # never cached (e.g. dummy)
    __xnew_cached_ = staticmethod(cacheit(__new_stage2__))   # symbols are always cached

    def __getnewargs__(self):
        return (self.name, self.is_commutative)

    def _hashable_content(self):
{'fraction_non_alphanumeric': 0.11440778542606218, 'fraction_numerical': 0.0023736055067647755, 'mean_word_length': 2.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1265114', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1147, 'n_words': 345}