<s> """<STR_LIT>""" <EOL> __all__ = [ '<STR_LIT>' ] <EOL> try : <EOL> from UserDict import DictMixin <EOL> except ImportError : <EOL> class DictMixin : <EOL> def __iter__ ( self ) : <EOL> for k in self . keys ( ) : <EOL> yield k <EOL> def has_key ( self , key ) : <EOL> try : <EOL> value = self [ key ] <EOL> except KeyError : <EOL> return False <EOL> return True <EOL> def __contains__ ( self , key ) : <EOL> return self . has_key ( key ) <EOL> def iteritems ( self ) : <EOL> for k in self : <EOL> yield ( k , self [ k ] ) <EOL> def iterkeys ( self ) : <EOL> return self . __iter__ ( ) <EOL> def itervalues ( self ) : <EOL> for _ , v in self . iteritems ( ) : <EOL> yield v <EOL> def values ( self ) : <EOL> return [ v for _ , v in self . iteritems ( ) ] <EOL> def items ( self ) : <EOL> return list ( self . iteritems ( ) ) <EOL> def clear ( self ) : <EOL> for key in self . keys ( ) : <EOL> del self [ key ] <EOL> def setdefault ( self , key , default = None ) : <EOL> try : <EOL> return self [ key ] <EOL> except KeyError : <EOL> self [ key ] = default <EOL> return default <EOL> def pop ( self , key , * args ) : <EOL> if len ( args ) > <NUM_LIT:1> : <EOL> raise TypeError , "<STR_LIT>" + repr ( <NUM_LIT:1> + len ( args ) ) <EOL> try : <EOL> value = self [ key ] <EOL> except KeyError : <EOL> if args : <EOL> return args [ <NUM_LIT:0> ] <EOL> raise <EOL> del self [ key ] <EOL> return value <EOL> def popitem ( self ) : <EOL> try : <EOL> k , v = self . iteritems ( ) . next ( ) <EOL> except StopIteration : <EOL> raise KeyError , '<STR_LIT>' <EOL> del self [ k ] <EOL> return ( k , v ) <EOL> def update ( self , other = None , ** kwargs ) : <EOL> if other is None : <EOL> pass <EOL> elif hasattr ( other , '<STR_LIT>' ) : <EOL> for k , v in other . iteritems ( ) : <EOL> self [ k ] = v <EOL> elif hasattr ( other , '<STR_LIT>' ) : <EOL> for k in other . keys ( ) : <EOL> self [ k ] = other [ k ] <EOL> else : <EOL> for k , v in other : <EOL> self [ k ] = v <EOL> if kwargs : <EOL> self . update ( kwargs ) <EOL> def get ( self , key , default = None ) : <EOL> try : <EOL> return self [ key ] <EOL> except KeyError : <EOL> return default <EOL> def __repr__ ( self ) : <EOL> return repr ( dict ( self . iteritems ( ) ) ) <EOL> def __cmp__ ( self , other ) : <EOL> if other is None : <EOL> return <NUM_LIT:1> <EOL> if isinstance ( other , DictMixin ) : <EOL> other = dict ( other . iteritems ( ) ) <EOL> return cmp ( dict ( self . iteritems ( ) ) , other ) <EOL> def __len__ ( self ) : <EOL> return len ( self . keys ( ) ) </s>
