class_docstr: Builds graphs and other summary information from eventlogs.
docstr: Initializes StatsBuilder class.
  
  Args:
    eventlog_dirs: List of paths to event log directories to process.
    event_tag: Event to extract from the logs.
    output_path: Output path for artifacts, e.g. graphs and cvs files.
    title: Title of the graph.
    xaxis_title: Title for x-axis of the graph. Defaults to "steps".
    yaxis_title: Title for the y-axis. Defaults to the `event_tag`.
    graph_agg: Aggregation for the graph.
    output_prefix: Prefix for the artifact files. Defaults to "results".
    end_step: If set, processing of the event log ends on this step.
    show_graph: If true, blocks and shows graph. Only tests in linux.
  
  Raises:
    ValueError: Raised if the graph_agg passed is not understood.
docstr_tok: ["Initializes","StatsBuilder","class",".","Args",":","eventlog_dirs",":","List","of","paths","to","event","log","directories","to","process",".","event_tag",":","Event","to","extract","from","the","logs",".","output_path",":","Output","path","for","artifacts",",","e.g",".","graphs","and","cvs","files",".","title",":","Title","of","the","graph",".","xaxis_title",":","Title","for","x-axis","of","the","graph",".","Defaults","to","``","steps","''",".","yaxis_title",":","Title","for","the","y-axis",".","Defaults","to","the","`","event_tag","`",".","graph_agg",":","Aggregation","for","the","graph",".","output_prefix",":","Prefix","for","the","artifact","files",".","Defaults","to","``","results","''",".","end_step",":","If","set",",","processing","of","the","event","log","ends","on","this","step",".","show_graph",":","If","true",",","blocks","and","shows","graph",".","Only","tests","in","linux",".","Raises",":","ValueError",":","Raised","if","the","graph_agg","passed","is","not","understood","."]
code: def __init__(
      self,
      eventlog_dirs: List[str],
      event_tag: str,
      output_path: str = ".",
      title: str = "",
      xaxis_title: str = "steps",
      yaxis_title: Optional[str] = None,
      graph_agg: GraphAggTypes = GraphAggTypes.MEAN,
      output_prefix: str = "results",
      end_step: Optional[int] = None,
      show_graph: bool = False,
  ):
      """Initializes StatsBuilder class.
  
      Args:
        eventlog_dirs: List of paths to event log directories to process.
        event_tag: Event to extract from the logs.
        output_path: Output path for artifacts, e.g. graphs and cvs files.
        title: Title of the graph.
        xaxis_title: Title for x-axis of the graph. Defaults to "steps".
        yaxis_title: Title for the y-axis. Defaults to the `event_tag`.
        graph_agg: Aggregation for the graph.
        output_prefix: Prefix for the artifact files. Defaults to "results".
        end_step: If set, processing of the event log ends on this step.
        show_graph: If true, blocks and shows graph. Only tests in linux.
  
      Raises:
        ValueError: Raised if the graph_agg passed is not understood.
      """
      self.eventlog_dirs = eventlog_dirs
      self.event_tag = event_tag
      self.output_path = output_path
      self.title = title
      self.xaxis_title = xaxis_title
      self.show_graph = show_graph
      self.end_step = end_step
      if graph_agg == GraphAggTypes.MEAN:
          self.graph_agg = np.mean
      elif graph_agg == GraphAggTypes.MEDIAN:
          self.graph_agg = np.median
      else:
          raise ValueError("Unknown graph_agg:{}".format(graph_agg))
  
      # Makes the output path absolute for clarity.
      self.output_dir = os.path.abspath(output_path)
      os.makedirs(self.output_dir, exist_ok=True)
      self.output_prefix = output_prefix
  
      if yaxis_title:
          self.yaxis_title = yaxis_title
      else:
          self.yaxis_title = event_tag
  
imports: import csv
  import enum
  import os
  from typing import Dict, List, Optional, Sequence, Tuple, Union
  from absl import app
  from absl import flags
  from absl import logging
  import matplotlib.pyplot
  import numpy
  import pandas
  import seaborn
  from tf_agents.benchmark import utils
label_desc: Use image node_id 1 to create a new StatsBuilder object from inherited base classes: object with example: obj = StatsBuilder(eventlog_dirs, event_tag, output_path, title, xaxis_title, yaxis_title, graph_agg, output_prefix, end_step, show_graph)