class_docstr: A class representing a modular integer. 
class_docstr_tok: ["A","class","representing","a","modular","integer","."]
code: def __init__(self, val):
      if isinstance(val, self.__class__):
          self.val = val.val % self.mod
      else:
          self.val = self.dom.convert(val) % self.mod
  
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 2 to create a new ModularInteger object from inherited base classes: PicklableWithSlots, DomainElement with example: obj = ModularInteger(val)