#NEWLINE# def GetLabelsFromDict( metadata ) : #NEWLINE# #INDENT# 'Converts a metadata dictionary to a string of labels.\n\n  Args:\n    metadata: a dictionary of string key value pairs.\n\n  Returns:\n    A string of labels in the format that Perfkit uses.\n  ' #NEWLINE# labels = [ ] #NEWLINE# for ( k , v ) in metadata . iteritems ( ) : #NEWLINE# #INDENT# labels . append ( ( '|%s:%s|' % ( k , v ) ) ) #NEWLINE# #UNINDENT# return ',' . join ( labels )