code: def config_benchmark_logger(flag_obj=None):
      """Config the global benchmark logger."""
      _logger_lock.acquire()
      try:
          global _benchmark_logger
          if not flag_obj:
              flag_obj = FLAGS
  
          if (
              not hasattr(flag_obj, "benchmark_logger_type")
              or flag_obj.benchmark_logger_type == "BaseBenchmarkLogger"
          ):
              _benchmark_logger = BaseBenchmarkLogger()
          elif flag_obj.benchmark_logger_type == "BenchmarkFileLogger":
              _benchmark_logger = BenchmarkFileLogger(
                  flag_obj.benchmark_log_dir
              )
          elif (
              flag_obj.benchmark_logger_type
              == "BenchmarkBigQueryLogger"
          ):
              from benchmark import (
                  benchmark_uploader as bu,
              )  # pylint: disable=g-import-not-at-top
  
              bq_uploader = bu.BigQueryUploader(
                  gcp_project=flag_obj.gcp_project
              )
              _benchmark_logger = BenchmarkBigQueryLogger(
                  bigquery_uploader=bq_uploader,
                  bigquery_data_set=flag_obj.bigquery_data_set,
                  bigquery_run_table=flag_obj.bigquery_run_table,
                  bigquery_run_status_table=flag_obj.bigquery_run_status_table,
                  bigquery_metric_table=flag_obj.bigquery_metric_table,
                  run_id=str(uuid.uuid4()),
              )
          else:
              raise ValueError(
                  "Unrecognized benchmark_logger_type: %s"
                  % flag_obj.benchmark_logger_type
              )
  
      finally:
          _logger_lock.release()
      return _benchmark_logger
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import datetime
  import json
  import multiprocessing
  import numbers
  import os
  import threading
  import uuid
  from six.moves import _thread
  from absl import flags
  import tensorflow
  from tensorflow.python.client import device_lib
  from utils.logs import cloud_lib
label_desc: Use image node_id 1 for calling a global function with example usage: config_benchmark_logger(flag_obj) and returns: _benchmark_logger