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: Creates a new Chrome Trace event.
  
  For details of the file format, see:
  https://github.com/catapult-project/catapult/blob/master/tracing/README.md
  
  Args:
    ph:  The type of event - usually a single character.
    category: The event category as a string.
    name:  The event name as a string.
    pid:  Identifier of the process generating this event as an integer.
    tid:  Identifier of the thread generating this event as an integer.
    timestamp:  The timestamp of this event as a long integer.
  
  Returns:
    A JSON compatible event object.
docstr_tok: ["Creates","a","new","Chrome","Trace","event",".","For","details","of","the","file","format",",","see",":","https",":","\/\/github.com\/catapult-project\/catapult\/blob\/master\/tracing\/README.md","Args",":","ph",":","The","type","of","event","-","usually","a","single","character",".","category",":","The","event","category","as","a","string",".","name",":","The","event","name","as","a","string",".","pid",":","Identifier","of","the","process","generating","this","event","as","an","integer",".","tid",":","Identifier","of","the","thread","generating","this","event","as","an","integer",".","timestamp",":","The","timestamp","of","this","event","as","a","long","integer",".","Returns",":","A","JSON","compatible","event","object","."]
code: def _create_event(
      self,
      ph: str,
      category: str,
      name: str,
      pid: int,
      tid: int,
      timestamp: int,
  ) -> Dict[str, Union[str, int]]:
      """Creates a new Chrome Trace event.
  
      For details of the file format, see:
      https://github.com/catapult-project/catapult/blob/master/tracing/README.md
  
      Args:
        ph:  The type of event - usually a single character.
        category: The event category as a string.
        name:  The event name as a string.
        pid:  Identifier of the process generating this event as an integer.
        tid:  Identifier of the thread generating this event as an integer.
        timestamp:  The timestamp of this event as a long integer.
  
      Returns:
        A JSON compatible event object.
      """
      event = {}
      event["ph"] = ph
      event["cat"] = category
      event["name"] = name
      event["pid"] = pid
      event["tid"] = tid
      event["ts"] = timestamp
      return event
  
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 2 for calling the _ChromeTraceFormatter obj's underlying member method code with example usage: obj._create_event(ph, category, name, pid, tid, timestamp) and returns: event