code: def get_metric_writer() -> tensorboard.BatchMetricWriter:
      try:
          from determined.tensorboard.metric_writers import tensorflow
  
          writer: tensorboard.MetricWriter = tensorflow.TFWriter()
  
      except ModuleNotFoundError:
          logger.warning("TensorFlow writer not found")
          from determined.tensorboard.metric_writers import pytorch
  
          writer = pytorch._TorchWriter()
  
      return tensorboard.BatchMetricWriter(writer)
  
imports: import abc
  import logging
  import pathlib
  import queue
  import threading
  import time
  from dataclasses import dataclass
  from typing import Any, Callable, List
  from determined import tensorboard
  from determined.common import util
label_desc: Use image node_id 1 for calling a global function with example usage: get_metric_writer() and returns: tensorboard