def _serialize_blobs(artifact):
 blobs = {}
 for blob in artifact.metadata.attributes.blobs.values():
  serialized_blob = []
  if isinstance(blob, declarative.ListAttributeDefinition):
   for b in (blob.get_value(artifact) or []):
    serialized_blob.append({'size': b.size, 'locations': b.locations, 'checksum': b.checksum, 'item_key': b.item_key})
  else:
   b = blob.get_value(artifact)
   if (not b):
    continue
   serialized_blob.append({'size': b.size, 'locations': b.locations, 'checksum': b.checksum, 'item_key': b.item_key})
  blobs[blob.name] = serialized_blob
 return blobs

def _serialize_blobs ( artifact ) : blobs = { } for blob in artifact . metadata . attributes . blobs . values ( ) : serialized_blob = [ ] if isinstance ( blob , declarative . ListAttributeDefinition ) : for b in ( blob . get_value ( artifact ) or [ ] ) : serialized_blob . append ( { 'size' : b . size , 'locations' : b . locations , 'checksum' : b . checksum , 'item_key' : b . item_key } ) else : b = blob . get_value ( artifact ) if ( not b ) : continue serialized_blob . append ( { 'size' : b . size , 'locations' : b . locations , 'checksum' : b . checksum , 'item_key' : b . item_key } ) blobs [ blob . name ] = serialized_blob return blobs
return a dict of serialized blobs for given artifact .