<s> import re <EOL> from MockRegion import MockRegion <EOL> class FakeView : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , contents = None ) : <EOL> self . contents = contents <EOL> def find ( self , pattern , pos ) : <EOL> text = self . contents [ pos : ] <EOL> match = re . search ( pattern , text ) <EOL> if match : <EOL> return MockRegion ( match . start ( ) + pos , match . end ( ) + pos ) <EOL> return None <EOL> def extract_scope ( self , point ) : <EOL> return MockRegion ( <NUM_LIT:0> , len ( self . contents ) ) <EOL> def replace ( self , edit , region , text ) : <EOL> before = self . contents [ <NUM_LIT:0> : region . begin ( ) ] <EOL> after = self . contents [ region . end ( ) : ] <EOL> self . contents = before + text + after <EOL> def scope_name ( self , point ) : <EOL> return u'<STR_LIT>' <EOL> def substr ( self , region ) : <EOL> return self . contents [ region . begin ( ) : region . end ( ) ] </s>
