<s> from firehose . model import Issue , File , Message , Location , Point <EOL> import re <EOL> LINE_RE = re . compile ( r"<STR_LIT>" ) <EOL> def parse_pylint ( lines ) : <EOL> severity_opts = { '<STR_LIT:E>' : '<STR_LIT:error>' , <EOL> '<STR_LIT:F>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:C>' : '<STR_LIT>' , <EOL> '<STR_LIT:R>' : '<STR_LIT>' } <EOL> for line in lines : <EOL> if LINE_RE . match ( line ) : <EOL> info = LINE_RE . match ( line ) . groupdict ( ) <EOL> else : <EOL> continue <EOL> severity = severity_opts [ info [ '<STR_LIT>' ] ] <EOL> yield Issue ( cwe = None , testid = info [ '<STR_LIT:id>' ] , <EOL> location = Location ( file = File ( info [ '<STR_LIT:path>' ] , None ) , <EOL> function = None , <EOL> point = Point ( int ( info [ '<STR_LIT>' ] ) , int ( info [ '<STR_LIT>' ] ) ) ) , <EOL> severity = severity , <EOL> message = Message ( text = info [ '<STR_LIT>' ] ) , notes = None , trace = None ) </s>
