def SetAttribute(self, attribute):
    # Grab the attribute registered for this name
    self.attribute = attribute
    self.attribute_obj = Attribute.GetAttributeByName(attribute)
    if self.attribute_obj is None:
      raise lexer.ParseError("Attribute %s not defined" % attribute)
Checks that attribute is a valid Attribute() instance.
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/AttributeExpression.SetAttribute