code: def _process_constraints_after_trial(
      constraints_func: Callable[[FrozenTrial], Sequence[float]],
      study: Study,
      trial: FrozenTrial,
      state: TrialState,
  ) -> None:
      if state not in [TrialState.COMPLETE, TrialState.PRUNED]:
          return
  
      constraints = None
      try:
          con = constraints_func(trial)
          if np.any(np.isnan(con)):
              raise ValueError("Constraint values cannot be NaN.")
          if not isinstance(con, (tuple, list)):
              warnings.warn(
                  f"Constraints should be a sequence of floats but got {type(con).__name__}."
              )
          constraints = tuple(con)
      finally:
          assert constraints is None or isinstance(constraints, tuple)
  
          study._storage.set_trial_system_attr(
              trial._trial_id,
              _CONSTRAINTS_KEY,
              constraints,
          )
  
imports: import abc
  from typing import Any
  from typing import Callable
  from typing import Dict
  from typing import Optional
  from typing import Sequence
  import warnings
  import numpy
  from optuna.distributions import BaseDistribution
  from optuna.study import Study
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
label_desc: Use image node_id 1 for calling a global function with example usage: _process_constraints_after_trial(constraints_func, study, trial, state) without return types