<s> __author__ = "<STR_LIT>" <EOL> def usual_dict ( dict_data ) : <EOL> newdata = { } <EOL> for k , v in dict_data : <EOL> if k in newdata : <EOL> newdata [ k ] . append ( v ) <EOL> else : <EOL> newdata [ k ] = [ v ] <EOL> return newdata <EOL> def setdefault_dict ( dict_data ) : <EOL> newdata = { } <EOL> for k , v in dict_data : <EOL> newdata . setdefault ( k , [ ] ) . append ( v ) <EOL> return newdata <EOL> def test_setdef ( module_name = '<STR_LIT>' ) : <EOL> dict_data = ( ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , ) <EOL> print ( usual_dict ( dict_data ) ) <EOL> print ( setdefault_dict ( dict_data ) ) <EOL> s = '<STR_LIT>' <EOL> print ( s . format ( name = module_name , con = '<STR_LIT>' ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> test_setdef ( ) </s>
