code: def main():
      """Main Function."""
      # Choose which objective to minimise and the configuration file
      objective_to_min, config_file, fidel_cost_func = _CHOOSER_DICT[
          (PROBLEM, IS_MF)
      ]
      config = load_config_file(config_file)
      log_stream = open(LOG_FILE, "w")
      # Call the optimiser
      if IS_MF:
          opt_val, opt_pt, history = minimise_multifidelity_function(
              objective_to_min,
              config.fidel_space,
              config.domain,
              config.fidel_to_opt,
              fidel_cost_func,
              MAX_CAPITAL,
              capital_type="realtime",
              config=config,
              reporter=log_stream,
          )
      else:
          opt_val, opt_pt, history = minimise_function(
              objective_to_min,
              config.domain,
              MAX_CAPITAL,
              capital_type="realtime",
              config=config,
              reporter=log_stream,
          )
      # Print out result
      log_stream.close()
      print(
          "Optimum Value found in %02.f time (%d evals): %0.4f"
          % (MAX_CAPITAL, len(history.curr_opt_points), opt_val)
      )
      print("Optimum Point: %s." % (str(opt_pt)))
  
file_path: dragonfly/examples/tree_reg/in_code_demo.py
imports: from __future__ import print_function
  from dragonfly import minimise_function, minimise_multifidelity_function
  from dragonfly.exd.cp_domain_utils import load_config_file
  from naval_gbr_mf import objective
  from naval_gbr_mf import cost
  from naval_gbr import objective
  from news_rfr_mf import objective
  from news_rfr_mf import cost
  from news_rfr import objective
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types