<s> """<STR_LIT>""" <EOL> def smart_open ( filename , mode ) : <EOL> """<STR_LIT>""" <EOL> if filename . endswith ( "<STR_LIT>" ) : <EOL> import bz2 <EOL> opener = bz2 . BZ2File <EOL> elif filename . endswith ( "<STR_LIT>" ) : <EOL> import gzip <EOL> opener = gzip . open <EOL> else : <EOL> opener = open <EOL> return opener ( filename , mode ) </s>
