def _CheckAttribute(self, attribute, value):
    if not isinstance(attribute, Attribute):
      raise AttributeError("Attribute %s must be of type aff4.Attribute()",
                           attribute)

    if not isinstance(value, attribute.attribute_type):
      raise ValueError("Value for attribute %s must be of type %s()" % (
          attribute, attribute.attribute_type.__name__))
Check that the value is of the expected type.
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/AFF4Object._CheckAttribute