def __getattr__(self, attr):  # pylint: disable=invalid-name
    """Support our default set of validators as direct attributes."""
    # Don't provide a back door to validators.py private stuff accidentally.
    if attr.startswith('_') or not hasattr(validators, attr):
      raise AttributeError("'%s' object has no attribute '%s'" % (
          type(self).__name__, attr))

    # Create a wrapper to invoke the attribute from within validators.
    def _WithValidator(*args, **kwargs):  # pylint: disable=invalid-name
      return self.WithValidator(getattr(validators, attr)(*args, **kwargs))
    return _WithValidator
dataset/ETHPy150Open google/openhtf/openhtf/util/measurements.py/Measurement.__getattr__/original