code: def _validate_constraints(
      population: list[FrozenTrial],
      constraints_func: Callable[[FrozenTrial], Sequence[float]]
      | None = None,
  ) -> None:
      if constraints_func is None:
          return
      for _trial in population:
          _constraints = _trial.system_attrs.get(_CONSTRAINTS_KEY)
          if _constraints is None:
              continue
          if np.any(np.isnan(np.array(_constraints))):
              raise ValueError(
                  "NaN is not acceptable as constraint value."
              )
  
file_path: optuna/optuna/samplers/nsgaii/_dominates.py
imports: from __future__ import annotations
  from collections.abc import Callable
  from collections.abc import Sequence
  import warnings
  import numpy
  from optuna.samplers._base import _CONSTRAINTS_KEY
  from optuna.study import StudyDirection
  from optuna.study._multi_objective import _dominates
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_constraints(population, constraints_func) without return types