

def __getattr__(self, attr):
    'Support our default set of validators as direct attributes.'
    if (attr.startswith('_') or (not hasattr(validators, attr))):
        raise AttributeError(("'%s' object has no attribute '%s'" % (type(self).__name__, attr)))

    def _WithValidator(*args, **kwargs):
        return self.WithValidator(getattr(validators, attr)(*args, **kwargs))
    return _WithValidator

dataset/ETHPy150Open google/openhtf/openhtf/util/measurements.py Measurement.__getattr__/original