parameters: (filename)
docstring: Parse out the crash information from the report file.
docstring_summary: Parse out the crash information from the report file.
docstring_tokens: Parse out the crash information from the report file .
function: def parse_crash(filename):
      """ Parse out the crash information from the report file. """
  
      match = re.match(r'(.*)\.info\.txt', filename)
      name = match.group(1) if match else None
      with open(filename, mode='rb') as handler:
          # this is a workaround to fix windows read '\r\n' as new lines.
          lines = [line.decode().rstrip() for line in handler.readlines()]
          return {
              'source': lines[0],
              'problem': lines[1],
              'file': name,
              'info': name + '.info.txt',
              'stderr': name + '.stderr.txt'
          }
function_tokens: def parse_crash ( filename ) : match = re . match ( r'(.*)\.info\.txt' , filename ) name = match . group ( 1 ) if match else None with open ( filename , mode = 'rb' ) as handler : # this is a workaround to fix windows read '\r\n' as new lines. lines = [ line . decode ( ) . rstrip ( ) for line in handler . readlines ( ) ] return { 'source' : lines [ 0 ] , 'problem' : lines [ 1 ] , 'file' : name , 'info' : name + '.info.txt' , 'stderr' : name + '.stderr.txt' }