code: def inspect(logdir="", event_file="", tag=""):
      """Main function for inspector that prints out a digest of event files.
  
      Args:
        logdir: A log directory that contains event files.
        event_file: Or, a particular event file path.
        tag: An optional tag name to query for.
  
      Raises:
        ValueError: If neither logdir and event_file are given, or both are given.
      """
      print(
          PRINT_SEPARATOR
          + "Processing event files... (this can take a few minutes)\n"
          + PRINT_SEPARATOR
      )
      inspection_units = get_inspection_units(logdir, event_file, tag)
  
      for unit in inspection_units:
          if tag:
              print(
                  "Event statistics for tag {} in {}:".format(
                      tag, unit.name
                  )
              )
          else:
              # If the user is not inspecting a particular tag, also print the list of
              # all available tags that they can query.
              print("These tags are in {}:".format(unit.name))
              print_dict(get_unique_tags(unit.field_to_obs))
              print(PRINT_SEPARATOR)
              print("Event statistics for {}:".format(unit.name))
  
          print_dict(
              get_dict_to_print(unit.field_to_obs),
              show_missing=(not tag),
          )
          print(PRINT_SEPARATOR)
  
file_path: tensorboard/tensorboard/backend/event_processing/event_file_inspector.py
imports: import dataclasses
  import itertools
  import os
  from typing import Any, Generator, Mapping
  from tensorboard.backend.event_processing import event_accumulator
  from tensorboard.backend.event_processing import event_file_loader
  from tensorboard.backend.event_processing import io_wrapper
  from tensorboard.compat import tf
  from tensorboard.compat.proto import event_pb2
label_desc: Use image node_id 9 for calling a global function with example usage: inspect(logdir, event_file, tag) without return types