code: def prepare_config(
      config_file, isCreate=False, isSave=False, worker_index=None
  ):
      if os.path.isfile(config_file):
          config = load_config(config_file)
          config = AttrDict(config)
      else:
          raise TypeError("%s is not a yaml file" % config_file)
  
      if isCreate:
          create_necessary_dirs(config, worker_index)
  
      if isSave:
          if worker_index is None or worker_index == 0:
              save_files(config)
  
      return config
  
imports: import sys
  import time
  import datetime
  import os
  import yaml
  import random
  import shutil
  import six
  import warnings
  import glob
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: prepare_config(config_file, isCreate, isSave, worker_index) and returns: config