tools/perf/cli_tools/flakiness_cli/analysis.py
def CompactResults(results):
  """Aggregate results from multime runs into a single result code."""
  def Compact(result):
    if len(result) == 1:
      return result  # Test ran once; use same value.
    elif all(r == 'Q' for r in result):
      return 'Q'  # All runs failed; test failed.
    else:
      return 'L'  # Sometimes failed, sometimes not; test flaky.

  return results.map({r: Compact(r) for r in results.unique()})
Aggregate results from multime runs into a single result code.
Aggregate results from multime runs into a single result code.
Aggregate results from multime runs into a single result code .
def CompactResults(results):
  def Compact(result):
    if len(result) == 1:
      return result  
    elif all(r == 'Q' for r in result):
      return 'Q'  
    else:
      return 'L'  
  return results.map({r: Compact(r) for r in results.unique()})
def CompactResults ( results ) : def Compact ( result ) : if len ( result ) == 1 : return result elif all ( r == 'Q' for r in result ) : return 'Q' else : return 'L' return results . map ( { r : Compact ( r ) for r in results . unique ( ) } )
Aggregate results from multime runs into a single result code.
Aggregate results from multime runs into a single result code .
"""Aggregate results from multime runs into a single result code.""" # Test ran once; use same value. # All runs failed; test failed. # Sometimes failed, sometimes not; test flaky.
results