code: def _set_param(metric_obj, value, name):
      """Validate a new parameter value in a created metric object."""
      if name not in metric_obj._valid_params:
          raise ValueError(
              "Metric {} doesn't have a parameter {}.".format(
                  metric_obj.__name__, name
              )
          )
      setattr(metric_obj, "_" + name, value)
  
imports: from functools import partial
  import numpy
  from .None import _catboost
label_desc: Use image node_id 2 for calling a global function with example usage: _set_param(metric_obj, value, name) without return types