def YamlLoader(string):
 representation = yaml.load(string)
 result_cls = aff4.FACTORY.AFF4Object(representation['aff4_class'])
 aff4_attributes = {}
 for (predicate, values) in representation['attributes'].items():
  attribute = aff4.Attribute.PREDICATES[predicate]
  tmp = aff4_attributes[attribute] = []
  for (rdfvalue_cls_name, value, age) in values:
   rdfvalue_cls = aff4.FACTORY.RDFValue(rdfvalue_cls_name)
   value = rdfvalue_cls(value, age=rdfvalue.RDFDatetime(age))
   tmp.append(value)
 result = result_cls(urn=representation['_urn'], clone=aff4_attributes, mode='rw', age=representation['age_policy'])
 (result.new_attributes, result.synced_attributes) = (result.synced_attributes, {})
 result._dirty = True
 return result

def YamlLoader ( string ) : representation = yaml . load ( string ) result_cls = aff4 . FACTORY . AFF4Object ( representation [ 'aff4_class' ] ) aff4_attributes = { } for ( predicate , values ) in representation [ 'attributes' ] . items ( ) : attribute = aff4 . Attribute . PREDICATES [ predicate ] tmp = aff4_attributes [ attribute ] = [ ] for ( rdfvalue_cls_name , value , age ) in values : rdfvalue_cls = aff4 . FACTORY . RDFValue ( rdfvalue_cls_name ) value = rdfvalue_cls ( value , age = rdfvalue . RDFDatetime ( age ) ) tmp . append ( value ) result = result_cls ( urn = representation [ '_urn' ] , clone = aff4_attributes , mode = 'rw' , age = representation [ 'age_policy' ] ) ( result . new_attributes , result . synced_attributes ) = ( result . synced_attributes , { } ) result . _dirty = True return result
load an aff4 object from a serialized yaml representation .