parameters: (result)
docstring: Convert a trace result to the format to be output into HTML.
  
    If the trace result is a dictionary or list, JSON-encode it.
    If the trace result is a string, leave it unchanged.
docstring_summary: Convert a trace result to the format to be output into HTML.
docstring_tokens: Convert a trace result to the format to be output into HTML .
function: def _ConvertToHtmlString(result):
    """Convert a trace result to the format to be output into HTML.
  
    If the trace result is a dictionary or list, JSON-encode it.
    If the trace result is a string, leave it unchanged.
    """
    if isinstance(result, dict) or isinstance(result, list):
      return json.dumps(result)
    elif isinstance(result, str):
      return result
    else:
      raise ValueError('Invalid trace result format for HTML output')
function_tokens: def _ConvertToHtmlString ( result ) : if isinstance ( result , dict ) or isinstance ( result , list ) : return json . dumps ( result ) elif isinstance ( result , str ) : return result else : raise ValueError ( 'Invalid trace result format for HTML output' )