parameters: (results)
return_statement: return (passes, failures, flakes)
docstring: Extract the failures from the test run.
docstring_summary: Extract the failures from the test run.
docstring_tokens: Extract the failures from the test run .
function: def _ParseLayoutTestResults(results):
    """Extract the failures from the test run."""
    # Cloned from third_party/WebKit/Tools/Scripts/print-json-test-results
    tests = _ConvertTrieToFlatPaths(results['tests'])
    failures = {}
    flakes = {}
    passes = {}
    for (test, result) in tests.iteritems():
      if result.get('is_unexpected'):
        actual_results = result['actual'].split()
        expected_results = result['expected'].split()
        if len(actual_results) > 1:
          # We report the first failure type back, even if the second
          # was more severe.
          if actual_results[1] in expected_results:
            flakes[test] = actual_results[0]
          else:
            failures[test] = actual_results[0]
        elif actual_results[0] == 'PASS':
          passes[test] = result
        else:
          failures[test] = actual_results[0]
  
    return (passes, failures, flakes)
function_tokens: def _ParseLayoutTestResults ( results ) : # Cloned from third_party/WebKit/Tools/Scripts/print-json-test-results tests = _ConvertTrieToFlatPaths ( results [ 'tests' ] ) failures = { } flakes = { } passes = { } for ( test , result ) in tests . iteritems ( ) : if result . get ( 'is_unexpected' ) : actual_results = result [ 'actual' ] . split ( ) expected_results = result [ 'expected' ] . split ( ) if len ( actual_results ) > 1 : # We report the first failure type back, even if the second # was more severe. if actual_results [ 1 ] in expected_results : flakes [ test ] = actual_results [ 0 ] else : failures [ test ] = actual_results [ 0 ] elif actual_results [ 0 ] == 'PASS' : passes [ test ] = result else : failures [ test ] = actual_results [ 0 ] return ( passes , failures , flakes )