#NEWLINE# @ contract #NEWLINE# def write_vm_data_locally( path , data , data_length ) : #NEWLINE# #INDENT# ' Write a set of CPU MHz values for a set of VMs.\n\n    :param path: A path to write the data to.\n     :type path: str\n\n    :param data: A map of VM UUIDs onto the corresponing CPU MHz history.\n     :type data: dict(str : list(int))\n\n    :param data_length: The maximum allowed length of the data.\n     :type data_length: int\n    ' #NEWLINE# for ( uuid , values ) in data . items ( ) : #NEWLINE# #INDENT# with open ( os . path . join ( path , data_length ) , 'w' ) as f : #NEWLINE# #INDENT# if ( data_length > 0 ) : #NEWLINE# #INDENT# f . write ( ( '\n' . join ( [ str ( x ) for x in values [ ( - data_length ) : ] ] ) + '\n' ) )