code: def main(script, exp_json, func_name, output):
      """Convert script for Auptimizer
      \b\n
      Copyright (C) 2018  LG Electronics Inc.
      \b\n
      GPL-3.0 License. This program comes with ABSOLUTELY NO WARRANTY;
      \b\n
      Arguments:
          script {str} -- Script name to train an ML model and return result
          exp_json {str} -- JSON file name contrains experiment configuration (e.g. hyperparameter)
          func_name {str} -- Name of the main function in the script for the training
  
      \b\n
      Raises:
          Exception: If the script is not self-executable.
      """
      variable_names = get_param(exp_json)
      script = open(script).read()
      script = add_shenbang(script)
      script = add_func(script, func_name, variable_names)
      script = add_main(script)
      if output is None:
          output = get_output_name(exp_json)
      with open(output, "w") as f:
          f.write(script)
      if os.name == "posix":
          os.chmod(output, stat.S_IRWXU)
  
      else:
          logging.critical(
              "Non-*nix OS is not fully supported, change permission by yourself."
          )
  
      if not os.access(output, os.X_OK):
          raise Exception(
              "Failed at the last step - script %s is not executable"
              % output
          )
  
file_path: auptimizer/src/aup/convert.py
imports: import json
  import logging
  import os
  import stat
  import click
label_desc: Use image node_id 6 for calling a global function with example usage: main(script, exp_json, func_name, output) without return types