#NEWLINE# def _to_size( self , data ) : #NEWLINE# #INDENT# ram = data [ 'name' ] . lower ( ) #NEWLINE# if ( 'mb' in ram ) : #NEWLINE# #INDENT# ram = int ( ram . replace ( 'mb' , '' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'gb' in ram ) : #NEWLINE# #INDENT# ram = ( int ( ram . replace ( 'gb' , '' ) ) * 1024 ) #NEWLINE# #UNINDENT# #UNINDENT# return NodeSize ( id = data [ 'id' ] , name = data [ 'name' ] , ram = ram , disk = 0 , bandwidth = 0 , price = 0 , driver = self )