code: def _build_from_args(cmd_args):
      userconfig = None
      is_userconfig_an_option = None
      userargs_search = r"\W*([a-zA-Z0-9_-]+)=([^ ]+)"
      userargs_regex_tmpl = r"(.*)=(.*)"
      userconfig_option = "--config="
  
      transformed_args = {}
      userargs_tmpl = collections.defaultdict(list)
      args_pattern = re.compile(userargs_search)
      args_prefix_pattern = re.compile(userargs_regex_tmpl)
  
      for arg in cmd_args:
          found = args_pattern.findall(arg)
          if len(found) != 1:
              if arg.startswith(userconfig_option):
                  if not userconfig:
                      userconfig = arg[len(userconfig_option) :]
                      is_userconfig_an_option = True
                  else:
                      raise ValueError(
                          f"Already found one configuration file in: {userconfig}"
                      )
              else:
                  userargs_tmpl[None].append(arg)
              continue
  
          name, value = found[0]
          namespace = "/" + name
  
          if namespace in transformed_args:
              raise ValueError(
                  f"Conflict for name '{namespace}' in script configuration and arguments."
              )
  
          transformed_args[namespace] = value
  
          found = args_prefix_pattern.findall(arg)
          assert (
              len(found) == 1 and found[0][1] == value
          ), "Parsing prefix problem."
          userargs_tmpl[namespace] = found[0][0] + "="
  
      if (
          not userconfig and userargs_tmpl[None]
      ):  # try the first positional argument
          if os.path.isfile(userargs_tmpl[None][0]):
              userconfig = userargs_tmpl[None].pop(0)
              is_userconfig_an_option = False
  
      return transformed_args, userconfig, is_userconfig_an_option
  
file_path: orion/src/orion/core/cli/insert.py
imports: import collections
  import logging
  import os
  import re
  from orion.core.cli import base
  from orion.core.io import experiment_builder
  from orion.core.io.convert import infer_converter_from_file_type
  from orion.core.utils.format_trials import tuple_to_trial
label_desc: Use image node_id 8 for calling a global function with example usage: _build_from_args(cmd_args) and returns: transformed_args,  userconfig,  is_userconfig_an_option