<s> from collections import Mapping <EOL> try : <EOL> from UserDict import UserDict <EOL> except ImportError : <EOL> from collections import UserDict <EOL> def get_variables ( type ) : <EOL> return { '<STR_LIT>' : get_dict , <EOL> '<STR_LIT>' : MyDict , <EOL> '<STR_LIT>' : get_MyMapping , <EOL> '<STR_LIT>' : get_UserDict , <EOL> '<STR_LIT>' : MyUserDict , <EOL> '<STR_LIT>' : get_JavaMap } [ type ] ( ) <EOL> def get_dict ( ) : <EOL> return { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : <NUM_LIT:2> } <EOL> class MyDict ( dict ) : <EOL> def __init__ ( self ) : <EOL> dict . __init__ ( self , from_my_dict = '<STR_LIT>' , from_my_dict2 = <NUM_LIT:2> ) <EOL> def get_MyMapping ( ) : <EOL> data = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : <NUM_LIT:2> } <EOL> class MyMapping ( Mapping ) : <EOL> def __init__ ( self , data ) : <EOL> self . data = data <EOL> def __getitem__ ( self , item ) : <EOL> return self . data [ item ] <EOL> def __len__ ( self ) : <EOL> return len ( self . data ) <EOL> def __iter__ ( self ) : <EOL> return iter ( self . data ) <EOL> return MyMapping ( data ) <EOL> def get_UserDict ( ) : <EOL> return UserDict ( { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : <NUM_LIT:2> } ) <EOL> class MyUserDict ( UserDict ) : <EOL> def __init__ ( self ) : <EOL> UserDict . __init__ ( self , { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:2> } ) <EOL> def get_JavaMap ( ) : <EOL> from java . util import HashMap <EOL> map = HashMap ( ) <EOL> map . put ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> map . put ( '<STR_LIT>' , <NUM_LIT:2> ) <EOL> return map </s>
