code: def check_metric(self, metric):
          
          if metric not in self.VALID_METRICS:
              raise ValueError(
                  f"`{self.__class__.__name__}` does not support the `{metric}` "
                  f"metric. Please choose one of the supported metrics: "
                  f"{', '.join(self.VALID_METRICS)}."
              )
docs: Check that the metric is supported by the KNNIndex instance.