code: def __prepare_analytics_zoo_env():
      jar_dir = os.path.abspath(__file__ + "/../../")
      conf_paths = glob.glob(os.path.join(jar_dir, "share/conf/*.conf"))
      extra_resources_paths = glob.glob(
          os.path.join(jar_dir, "share/extra-resources/*")
      )
      analytics_zoo_classpath = get_analytics_zoo_classpath()
  
      def append_path(env_var_name, path):
          try:
              if path not in os.environ[env_var_name]:
                  log.info(f"Adding {path} to {env_var_name}")
                  os.environ[env_var_name] = (
                      path + ":" + os.environ[env_var_name]
                  )  # noqa
          except KeyError:
              os.environ[env_var_name] = path
  
      if analytics_zoo_classpath:
          append_path("BIGDL_JARS", analytics_zoo_classpath)
  
      if conf_paths:
          assert (
              len(conf_paths) == 1
          ), "Expecting one conf, but got: %s" % len(conf_paths)
          if conf_paths[0] not in sys.path:
              log.info(f"Prepending {conf_paths[0]} to sys.path")
              sys.path.insert(0, conf_paths[0])
  
      if extra_resources_paths:
          for resource in extra_resources_paths:
              if resource not in extra_resources_paths:
                  log.info(f"Prepending {resource} to sys.path")
                  sys.path.insert(0, resource)
  
      if os.environ.get("BIGDL_JARS", None) and is_spark_below_2_2():
          for jar in os.environ["BIGDL_JARS"].split(":"):
              append_path("SPARK_CLASSPATH", jar)
  
      if os.environ.get("BIGDL_PACKAGES", None):
          for package in os.environ["BIGDL_PACKAGES"].split(":"):
              if package not in sys.path:
                  sys.path.insert(0, package)
  
file_path: analytics-zoo/pyzoo/zoo/util/engine.py
imports: import sys
  import os
  import glob
  import warnings
  import logging
label_desc: Use image node_id 4 for calling a global function with example usage: __prepare_analytics_zoo_env() without return types