code: def _check_metrics(cls, schema, metrics):
          
          for name, value in metrics.items():
              metric = schema.get(name)
              if not metric:
                  message = "Unexpected metric '{}' returned".format(name)
                  raise Exception(message)
              cls._check_metric(schema, metric, name, value)
docs: Ensure that returned metrics are properly exposed