def DecodeValueFromAttribute(self, attribute_name, value, ts):
    """Given a serialized value, decode the attribute.

    Only attributes which have been previously defined are permitted.

    Args:
       attribute_name: The string name of the attribute.
       value: The serialized attribute value.
       ts: The timestamp of this attribute.
    """
    try:
      # Get the Attribute object from our schema.
      attribute = Attribute.PREDICATES[attribute_name]
      cls = attribute.attribute_type
      self._AddAttributeToCache(attribute, LazyDecoder(cls, value, ts),
                                self.synced_attributes)
    except __HOLE__:
      pass
    # TODO(user): uncomment as soon as some messages-flood protection
    # mechanisms are implemented in logging.debug().
    # if not attribute_name.startswith("index:"):
    #   logging.debug("Attribute %s not defined, skipping.", attribute_name)
    except (ValueError, rdfvalue.DecodeError):
      logging.debug("%s: %s invalid encoding. Skipping.",
                    self.urn, attribute_name)
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/AFF4Object.DecodeValueFromAttribute