code: def validate_constraint_parameters(
      parameters: List[Parameter],
  ) -> None:
      """Basic validation of parameters used in a constraint.
  
      Args:
          parameters: Parameters used in constraint.
  
      Raises:
          ValueError if the parameters are not valid for use.
      """
      unique_parameter_names = {p.name for p in parameters}
      if len(unique_parameter_names) != len(parameters):
          raise ValueError("Duplicate parameter in constraint.")
  
      for parameter in parameters:
          if not parameter.is_numeric:
              raise ValueError(
                  "Parameter constraints only supported for numeric parameters."
              )
  
          # Constraints on FixedParameters are non-sensical.
          if isinstance(parameter, FixedParameter):
              raise ValueError(
                  "Parameter constraints not supported for FixedParameter."
              )
  
          # ChoiceParameters are transformed either using OneHotEncoding
          # or the OrderedChoice transform. Both are non-linear, and
          # Ax models only support linear constraints.
          if isinstance(parameter, ChoiceParameter):
              raise ValueError(
                  "Parameter constraints not supported for ChoiceParameter."
              )
  
          # Log parameters require a non-linear transformation, and Ax
          # models only support linear constraints.
          if (
              isinstance(parameter, RangeParameter)
              and parameter.log_scale is True
          ):
              raise ValueError(
                  "Parameter constraints not allowed on log scale parameters."
              )
  
imports: from __future__ import annotations
  from typing import Dict, List, Union
  from ax.core.parameter import ChoiceParameter, FixedParameter, Parameter, RangeParameter
  from ax.core.types import ComparisonOp
  from ax.utils.common.base import SortableBase
label_desc: Use image node_id 1 for calling a global function with example usage: validate_constraint_parameters(parameters) without return types