def _serialize_dependencies(artifact):
 dependencies = {}
 for relation in artifact.metadata.attributes.dependencies.values():
  serialized_dependency = []
  if isinstance(relation, declarative.ListAttributeDefinition):
   for dep in relation.get_value(artifact):
    serialized_dependency.append(dep.id)
  else:
   relation_data = relation.get_value(artifact)
   if relation_data:
    serialized_dependency.append(relation.get_value(artifact).id)
  dependencies[relation.name] = serialized_dependency
 return dependencies

def _serialize_dependencies ( artifact ) : dependencies = { } for relation in artifact . metadata . attributes . dependencies . values ( ) : serialized_dependency = [ ] if isinstance ( relation , declarative . ListAttributeDefinition ) : for dep in relation . get_value ( artifact ) : serialized_dependency . append ( dep . id ) else : relation_data = relation . get_value ( artifact ) if relation_data : serialized_dependency . append ( relation . get_value ( artifact ) . id ) dependencies [ relation . name ] = serialized_dependency return dependencies
returns a dict of serialized dependencies for given artifact .