code: def _assert_valid_key(self, name):
      
      if name not in self._measurements:
        raise NotAMeasurementError('Not a measurement', name, self._measurements)
docs: Raises if name is not a valid measurement.