code: def _prepare_class_assumptions(cls):
      """Precompute class level assumptions and generate handlers.
  
      This is called by Basic.__init_subclass__ each time a Basic subclass is
      defined.
      """
  
      local_defs = {}
      for k in _assume_defined:
          attrname = as_property(k)
          v = cls.__dict__.get(attrname, "")
          if isinstance(v, (bool, int, type(None))):
              if v is not None:
                  v = bool(v)
              local_defs[k] = v
  
      defs = {}
      for base in reversed(cls.__bases__):
          assumptions = getattr(
              base, "_explicit_class_assumptions", None
          )
          if assumptions is not None:
              defs.update(assumptions)
      defs.update(local_defs)
  
      cls._explicit_class_assumptions = defs
      cls.default_assumptions = StdFactKB(defs)
  
      cls._prop_handler = {}
      for k in _assume_defined:
          eval_is_meth = getattr(cls, "_eval_is_%s" % k, None)
          if eval_is_meth is not None:
              cls._prop_handler[k] = eval_is_meth
  
      # Put definite results directly into the class dict, for speed
      for k, v in cls.default_assumptions.items():
          setattr(cls, as_property(k), v)
  
      # protection e.g. for Integer.is_even=F <- (Rational.is_integer=F)
      derived_from_bases = set()
      for base in cls.__bases__:
          default_assumptions = getattr(
              base, "default_assumptions", None
          )
          # is an assumption-aware class
          if default_assumptions is not None:
              derived_from_bases.update(default_assumptions)
  
      for fact in derived_from_bases - set(cls.default_assumptions):
          pname = as_property(fact)
          if pname not in cls.__dict__:
              setattr(cls, pname, make_property(fact))
  
      # Finally, add any missing automagic property (e.g. for Basic)
      for fact in _assume_defined:
          pname = as_property(fact)
          if not hasattr(cls, pname):
              setattr(cls, pname, make_property(fact))
  
imports: from sympy.utilities.exceptions import sympy_deprecation_warning
  from .facts import FactRules, FactKB
  from .sympify import sympify
  from sympy.core.random import _assumptions_shuffle
  from sympy.core.assumptions_generated import generated_assumptions
label_desc: Use image node_id 10 for calling a global function with example usage: _prepare_class_assumptions(cls) without return types