code: def prepare_config(config_file, isCreate=False, isSave=False):
      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)
  
      if isSave:
          save_files(config)
  
      return config
  
imports: import sys
  import datetime
  import os
  import yaml
  import random
  import shutil
  import six
  import warnings
  import glob
label_desc: Use image node_id 8 for calling a global function with example usage: prepare_config(config_file, isCreate, isSave) and returns: config