class_docstr: A class representing a modular integer. 
class_docstr_tok: ["A","class","representing","a","modular","integer","."]
code: def to_int(self):
      sympy_deprecation_warning(
          """ModularInteger.to_int() is deprecated.
  
              Use int(a) or K = GF(p) and K.to_int(a) instead of a.to_int().
              """,
          deprecated_since_version="1.13",
          active_deprecations_target="modularinteger-to-int",
      )
  
      if self.sym:
          if self.val <= self.mod // 2:
              return self.val
          else:
              return self.val - self.mod
      else:
          return self.val
  
imports: from __future__ import annotations
  from typing import Any
  import operator
  from sympy.polys.polyutils import PicklableWithSlots
  from sympy.polys.polyerrors import CoercionFailed
  from sympy.polys.domains.domainelement import DomainElement
  from sympy.utilities import public
  from sympy.utilities.exceptions import sympy_deprecation_warning
label_desc: Use image node_id 7 for calling the ModularInteger obj's underlying member method code with example usage: obj.to_int() and returns: self, self, unknown