class_docstr: A helper class for generating traces in Chrome Trace Format.
class_docstr_tok: ["A","helper","class","for","generating","traces","in","Chrome","Trace","Format","."]
docstr: Formats the chrome trace to a string.
  
  Args:
    pretty: (Optional.)  If True, produce human-readable JSON output.
  
  Returns:
    A JSON-formatted string in Chrome Trace format.
docstr_tok: ["Formats","the","chrome","trace","to","a","string",".","Args",":","pretty",":","(","Optional",".",")","If","True",",","produce","human-readable","JSON","output",".","Returns",":","A","JSON-formatted","string","in","Chrome","Trace","format","."]
code: def format_to_string(self, pretty: bool = False) -> str:
      """Formats the chrome trace to a string.
  
      Args:
        pretty: (Optional.)  If True, produce human-readable JSON output.
  
      Returns:
        A JSON-formatted string in Chrome Trace format.
      """
      trace = {}
      trace["traceEvents"] = self._metadata + self._events
      if pretty:
          return json.dumps(trace, indent=4, separators=(",", ": "))
      else:
          return json.dumps(trace, separators=(",", ":"))
  
imports: import collections
  import copy
  import json
  import re
  from typing import Any, Dict, List, Optional, Tuple, Union
  from tensorflow.core.framework import step_stats_pb2
  from tensorflow.python.platform import build_info
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 13 for calling the _ChromeTraceFormatter obj's underlying member method code with example usage: obj.format_to_string(pretty) and returns: json, json