<s> def journal_disk_validate ( journal_disks , journal_disk_size ) : <EOL> disk_dict = { } <EOL> unit_gb = <NUM_LIT> * <NUM_LIT> * <NUM_LIT> <EOL> for disk in journal_disks : <EOL> disk_name , disk_size = disk . split ( "<STR_LIT::>" , <NUM_LIT:1> ) <EOL> if disk_name : <EOL> cnt = disk_dict [ disk_name ] [ '<STR_LIT:count>' ] + <NUM_LIT:1> if disk_name in disk_dict else <NUM_LIT:1> <EOL> disk_dict [ disk_name ] = { '<STR_LIT:size>' : round ( float ( disk_size ) / unit_gb , <NUM_LIT:2> ) , '<STR_LIT:count>' : cnt } <EOL> for disk in disk_dict : <EOL> req_size = disk_dict [ disk ] [ '<STR_LIT:count>' ] * journal_disk_size / float ( <NUM_LIT> ) <EOL> act_size = disk_dict [ disk ] [ '<STR_LIT:size>' ] <EOL> if req_size > act_size : <EOL> return "<STR_LIT>" % ( disk , round ( req_size , <NUM_LIT:2> ) , act_size ) <EOL> return True <EOL> class FilterModule ( object ) : <EOL> def filters ( self ) : <EOL> return { '<STR_LIT>' : journal_disk_validate } </s>
