<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class Iterator ( object ) : <EOL> def __init__ ( self , nums ) : <EOL> """<STR_LIT>""" <EOL> def hasNext ( self ) : <EOL> """<STR_LIT>""" <EOL> def next ( self ) : <EOL> """<STR_LIT>""" <EOL> class PeekingIterator ( object ) : <EOL> def __init__ ( self , iterator ) : <EOL> """<STR_LIT>""" <EOL> self . nxt = None <EOL> self . iterator = iterator <EOL> def peek ( self ) : <EOL> """<STR_LIT>""" <EOL> if not self . nxt : <EOL> self . nxt = self . iterator . next ( ) <EOL> return self . nxt <EOL> def next ( self ) : <EOL> """<STR_LIT>""" <EOL> ret = self . peek ( ) <EOL> self . nxt = None <EOL> return ret <EOL> def hasNext ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . nxt is not None or self . iterator . hasNext ( ) </s>
