content/test/gpu/flake_suppressor/result_output.py
def _RecursiveHtmlToFile(node, output_file):
  """Recursively outputs a string map to an output file as HTML.

  Specifically, contents are output as an unordered list (<ul>).

  Args:
    node: The current node to output. Must be either a dict or list.
    output_file: A file-like object to output the HTML to.
  """
  if isinstance(node, dict):
    for key, value in node.items():
      output_file.write('<li>%s</li>\n' % key)
      output_file.write('<ul>\n')
      _RecursiveHtmlToFile(value, output_file)
      output_file.write('</ul>\n')
  elif isinstance(node, list):
    for element in node:
      output_file.write('<li><a href="%s">%s</a></li>\n' % (element, element))
  else:
    raise RuntimeError('Unsupported type %s' % type(node).__name__)
Recursively outputs a string map to an output file as HTML.

  Specifically, contents are output as an unordered list (<ul>).

  Args:
    node: The current node to output. Must be either a dict or list.
    output_file: A file-like object to output the HTML to.
  
Recursively outputs a string map to an output file as HTML.
Specifically, contents are output as an unordered list ().
Recursively outputs a string map to an output file as HTML . Specifically contents are output as an unordered list () .
def _RecursiveHtmlToFile(node, output_file):
  if isinstance(node, dict):
    for key, value in node.items():
      output_file.write('<li>%s</li>\n' % key)
      output_file.write('<ul>\n')
      _RecursiveHtmlToFile(value, output_file)
      output_file.write('</ul>\n')
  elif isinstance(node, list):
    for element in node:
      output_file.write('<li><a href="%s">%s</a></li>\n' % (element, element))
  else:
    raise RuntimeError('Unsupported type %s' % type(node).__name__)
def _RecursiveHtmlToFile ( node , output_file ) : if isinstance ( node , dict ) : for key , value in node . items ( ) : output_file . write ( '<li>%s</li>\n' % key ) output_file . write ( '<ul>\n' ) _RecursiveHtmlToFile ( value , output_file ) output_file . write ( '</ul>\n' ) elif isinstance ( node , list ) : for element in node : output_file . write ( '<li><a href="%s">%s</a></li>\n' % ( element , element ) ) else : raise RuntimeError ( 'Unsupported type %s' % type ( node ) . __name__ )
Recursively outputs a string map to an output file as HTML.
Recursively outputs a string map to an output file as HTML .
"""Recursively outputs a string map to an output file as HTML.

  Specifically, contents are output as an unordered list (<ul>).

  Args:
    node: The current node to output. Must be either a dict or list.
    output_file: A file-like object to output the HTML to.
  """
node
The current node to output. Must be either a dict or list.
The current node to output . Must be either a dict or list .
output_file
A file-like object to output the HTML to.
A file - like object to output the HTML to .