code: def check_global_invariants(subject, invariants):
      error_codes = tuple(
          error_code
          for is_ok, error_code in (
              invariant(subject) for invariant in invariants
          )
          if not is_ok
      )
      if error_codes:
          raise InvariantException(
              error_codes, (), "Global invariant failed"
          )
  
imports: from pyrsistent._checked_types import CheckedPMap, CheckedPSet, CheckedPVector, CheckedType, InvariantException, _restore_pickle, get_type, maybe_parse_user_type, maybe_parse_many_user_types
  from pyrsistent._checked_types import optional
  from pyrsistent._checked_types import wrap_invariant
  import inspect
label_desc: Use image node_id 2 for calling a global function with example usage: check_global_invariants(subject, invariants) without return types