code: def cli():
      title = "ClearML launch - launch any codebase on remote machine running clearml-agent"
      print(title)
      parser = ArgumentParser(description=title)
      setup_parser(parser)
  
      # get the args
      args = parser.parse_args()
  
      if len(sys.argv) < 2:
          parser.print_help()
          exit(0)
  
      if args.version:
          print("Version {}".format(__version__))
          exit(0)
  
      if not args.name and not args.import_offline_session:
          raise ValueError(
              "Task name must be provided, use `--name <task-name>`"
          )
  
      if (
          args.docker_bash_setup_script
          and Path(args.docker_bash_setup_script).is_file()
      ):
          with open(
              args.docker_bash_setup_script, "r"
          ) as bash_setup_script_file:
              bash_setup_script = bash_setup_script_file.readlines()
              # remove Bash Shebang
              if bash_setup_script and bash_setup_script[
                  0
              ].strip().startswith("#!"):
                  bash_setup_script = bash_setup_script[1:]
      else:
          bash_setup_script = args.docker_bash_setup_script or None
  
      if args.import_offline_session:
          print(
              "Importing offline session: {}".format(
                  args.import_offline_session
              )
          )
          Task.import_offline_session(args.import_offline_session)
      else:
          create_populate = CreateAndPopulate(
              project_name=args.project,
              task_name=args.name,
              task_type=args.task_type,
              repo=args.repo or args.folder,
              branch=args.branch,
              commit=args.commit,
              script=args.script,
              working_directory=args.cwd,
              packages=args.packages,
              requirements_file=args.requirements,
              docker=args.docker,
              docker_args=args.docker_args,
              docker_bash_setup_script=bash_setup_script,
              output_uri=args.output_uri,
              base_task_id=args.base_task_id,
              add_task_init_call=not args.skip_task_init,
              raise_on_missing_entries=True,
              verbose=True,
          )
          # verify args before creating the Task
          create_populate.update_task_args(args.args)
          print("Creating new task")
          create_populate.create_task()
          # update Task args
          create_populate.update_task_args(args.args)
  
          # noinspection PyProtectedMember
          create_populate.task._set_runtime_properties(
              {"_CLEARML_TASK": True}
          )
  
          print(
              "New task created id={}".format(create_populate.get_id())
          )
          if not args.queue:
              print(
                  "Warning: No queue was provided, leaving task in draft-mode."
              )
              exit(0)
  
          Task.enqueue(create_populate.task, queue_name=args.queue)
          print(
              "Task id={} sent for execution on queue {}".format(
                  create_populate.get_id(), args.queue
              )
          )
          print(
              "Execution log at: {}".format(
                  create_populate.task.get_output_log_web_page()
              )
          )
  
file_path: clearml/clearml/cli/task/__main__.py
imports: import sys
  from argparse import ArgumentParser
  from pathlib2 import Path
  import clearml.backend_api.session
  from clearml import Task
  from clearml.backend_interface.task.populate import CreateAndPopulate
  from clearml.version import __version__
label_desc: Use image node_id 2 for calling a global function with example usage: cli() without return types