<s> '''<STR_LIT>''' <EOL> import os <EOL> def __generator ( x ) : <EOL> for line in x : <EOL> line = line . strip ( ) <EOL> if not line or line [ <NUM_LIT:0> ] in '<STR_LIT>' : <EOL> continue <EOL> fields = line . split ( ) <EOL> if len ( fields ) == <NUM_LIT:1> : <EOL> yield ( ( fields [ <NUM_LIT:0> ] , fields [ <NUM_LIT:0> ] , None ) ) <EOL> else : <EOL> yield ( ( '<STR_LIT:U+0020>' . join ( fields [ <NUM_LIT:0> : - <NUM_LIT:1> ] ) , fields [ - <NUM_LIT:1> ] , None ) ) <EOL> def lookup ( name ) : <EOL> '''<STR_LIT>''' <EOL> if os . path . isdir ( name ) : <EOL> return __generator ( os . listdir ( name ) ) <EOL> if os . path . isfile ( name ) or os . path . islink ( name ) : <EOL> content = open ( name , '<STR_LIT:r>' ) . readlines ( ) <EOL> if content : <EOL> return __generator ( content ) <EOL> return None </s>
