#NEWLINE# def getResource( self , offer ) : #NEWLINE# #INDENT# ( cpus , mem ) = ( 0 , 0 ) #NEWLINE# for r in offer . resources : #NEWLINE# #INDENT# if ( r . name == 'cpus' ) : #NEWLINE# #INDENT# cpus = float ( r . scalar . value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( r . name == 'mem' ) : #NEWLINE# #INDENT# mem = float ( r . scalar . value ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( cpus , mem )