code: def initialize(config):
      global _initialized, _mt, _init_args
      assert not _initialized
      _init_args = {
          "master": f"local[{config.cores}]",
          "quiet": not config.hail_verbose,
          "log": config.log,
      }
  
      if config.profile is not None:
          if config.prof_fmt == "html":
              filetype = "html"
              fmt_arg = "tree=total"
          elif config.prof_fmt == "flame":
              filetype = "svg"
              fmt_arg = "svg=total"
          else:
              filetype = "jfr"
              fmt_arg = "jfr"
  
          prof_args = (
              f"-agentpath:{config.profiler_path}/build/libasyncProfiler.so=start,"
              f"event={config.profile},"
              f"{fmt_arg},"
              f"file=bench-profile-{config.profile}-%t.{filetype},"
              "interval=1ms,"
              "framebuf=15000000"
          )
  
          _init_args["spark_conf"] = {
              "spark.driver.extraJavaOptions": prof_args,
              "spark.executor.extraJavaOptions": prof_args,
          }
  
      hl.init(**_init_args)
      _initialized = True
  
      # make JVM do something to ensure that it is fresh
      hl.utils.range_table(1)._force_count()
      logging.getLogger("py4j").setLevel(logging.CRITICAL)
      logging.getLogger("py4j.java_gateway").setLevel(logging.CRITICAL)
  
imports: import timeit
  import contextlib
  import hail
  import logging
  import os
  import re
  import shutil
  import signal
  from py4j.protocol import Py4JError
  from .resources import all_resources
label_desc: Use image node_id 8 for calling a global function with example usage: initialize(config) without return types