code: def __prepare_bigdl_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/*")
      )
      bigdl_classpath = get_bigdl_classpath()
  
      def append_path(env_var_name, jar_path):
          try:
              if jar_path not in os.environ[env_var_name].split(":"):
                  log.info(f"Adding {jar_path} to {env_var_name}")
                  os.environ[env_var_name] = (
                      jar_path + ":" + os.environ[env_var_name]
                  )  # noqa
          except KeyError:
              os.environ[env_var_name] = jar_path
  
      if bigdl_classpath:
          append_path("BIGDL_JARS", bigdl_classpath)
  
      if conf_paths:
          invalidInputError(
              len(conf_paths) == 1,
              "Expecting one conf: %s" % len(conf_paths),
          )
          __sys_path_insert(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(":"):
              __sys_path_insert(package)
  
file_path: BigDL/python/dllib/src/bigdl/dllib/utils/engine.py
imports: import sys
  import os
  import glob
  import warnings
  import logging
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 5 for calling a global function with example usage: __prepare_bigdl_env() without return types