<commit_before>from sympy import (Rational, Symbol, Float, I, sqrt, oo, nan, pi, E, Integer,
                   S, factorial, Catalan, EulerGamma, GoldenRatio, cos, exp,
                   Number, zoo, log, Mul, Pow)
from sympy.core.power import integer_nthroot

from sympy.core.numbers import igcd, ilcm, igcdex, seterr, _intcache
from sympy.utilities.pytest import raises
from sympy import mpmath

def test_integers_cache():
    python_int = 2**65 + 3175259

    while python_int in _intcache or hash(python_int) in _intcache:
        value += 1

    sympy_int = Integer(python_int)

    assert python_int in _intcache
    assert hash(python_int) not in _intcache
    assert sympy_int not in _intcache

    sympy_int_int = Integer(sympy_int)

    assert python_int in _intcache
    assert hash(python_int) not in _intcache
    assert sympy_int_int not in _intcache

    sympy_hash_int = Integer(hash(python_int))

    assert python_int in _intcache<commit_msg>Fixed test_integers_cache for multiple test runs (#1946)<commit_after>from sympy import (Rational, Symbol, Float, I, sqrt, oo, nan, pi, E, Integer,
                   S, factorial, Catalan, EulerGamma, GoldenRatio, cos, exp,
                   Number, zoo, log, Mul, Pow)
from sympy.core.power import integer_nthroot

from sympy.core.numbers import igcd, ilcm, igcdex, seterr, _intcache
from sympy.utilities.pytest import raises
from sympy import mpmath

def test_integers_cache():
    python_int = 2**65 + 3175259

    while python_int in _intcache or hash(python_int) in _intcache:
        python_int += 1

    sympy_int = Integer(python_int)

    assert python_int in _intcache
    assert hash(python_int) not in _intcache
    assert sympy_int not in _intcache

    sympy_int_int = Integer(sympy_int)

    assert python_int in _intcache
    assert hash(python_int) not in _intcache
    assert sympy_int_int not in _intcache

    sympy_hash_int = Integer(hash(python_int))

    assert python_int in _intcache
{'fraction_non_alphanumeric': 0.0654158215010142, 'fraction_numerical': 0.013184584178498986, 'mean_word_length': 3.577726218097448, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1664731', 'n_tokens_mistral': 674, 'n_tokens_neox': 628, 'n_words': 201}