code: def __new__(mcs, name, parents, attrs):
      for k in attrs["_valid_params"]:
          attrs[k] = property(
              partial(_get_param, name=k),
              partial(_set_param, name=k),
              partial(_del_param, name=k),
              "Parameter {} of metric {}".format(k, name),
          )
  
      attrs["params_with_defaults"] = staticmethod(
          lambda: {
              param: {
                  "default_value": default_value,
                  "is_mandatory": attrs["_is_mandatory_param"][param],
              }
              for param, default_value in attrs["_valid_params"].items()
          }
      )
      # Set the serialization function.
      docstring = ["Builtin metric: '{}'".format(name), "Parameters:"]
      if not attrs["_valid_params"]:
          docstring[-1] += " none"
      for param, value in attrs["_valid_params"].items():
          if not attrs["_is_mandatory_param"][param]:
              docstring.append(
                  " " * 4
                  + "{} = {} (default value)".format(param, repr(value))
              )
          else:
              docstring.append(" " * 4 + "{} (mandatory)".format(param))
      attrs["__doc__"] = "\n".join(docstring)
      attrs["__repr__"] = lambda self: "{}({})".format(
          self._underlying_metric_name,
          ", ".join(
              [
                  "{}={} [mandatory={}]".format(
                      param,
                      repr(value),
                      self._is_mandatory_param[param],
                  )
                  for param, value in _current_params(
                      self, False
                  ).items()
              ]
          ),
      )
      attrs["__str__"] = _to_string
  
      def set_hints(self, **hints):
          for hint_key, hint_value in hints.items():
              if isinstance(hint_value, bool):
                  hints[hint_key] = str(hint_value).lower()
          setattr(
              self,
              "hints",
              "|".join(
                  [
                      "{}~{}".format(hint_key, hint_value)
                      for hint_key, hint_value in hints.items()
                  ]
              ),
          )
          if "hints" not in self._params:
              self._params.append("hints")
          return self
  
      attrs["set_hints"] = set_hints
  
      cls = super(_MetricGenerator, mcs).__new__(
          mcs, name, parents, attrs
      )
      return cls
  
imports: from functools import partial
  import numpy
  from .None import _catboost
label_desc: Use image node_id 1 for calling the _MetricGenerator obj's underlying member method code with example usage: obj.__new__(mcs, name, parents, attrs) and returns: cls, self