you can just write `n = as_int(n)` after importing that function from `sympy.core.compatibility`