class_docstr: Python interface commandline parser
  
  The `OrionCmdlineParser` is used as a way to obtain the parsing process of Orion
  through a Python interface. It provides different dictionaries containing information
  for different parts of the parsing process. It also exposes methods to retrieve the
  command line with formatted values for parameters.
  
  Parameters
  ----------
  config_prefix : str, optional
      Prefix for the configuration file used by the parser to identify it.
  allow_non_existing_files : bool, optional
      If True, will parse all commandline but ignore non existing user script or configuration
      files if non-existent. Default is False
  
  Attributes
  ----------
  parser : CmdlineParser
      Parser that will be used to parse the commandline.
  cmd_priors : OrderedDict
      An OrderedDict containing only the priors inside the commandline.
  file_priors : OrderedDict
      An OrderedDict obtained by parsing the config file, if one was found.
  priors : OrderedDict
      An OrderedDict obtained from merging `cmd_priors` and `file_priors`.
  user_script : str
      File path of the script executed (inferred from parsed commandline)
  config_prefix : str
      Prefix for the configuration file used by the parser to identify it.
  file_config_path : str
      If a config file was found, this file contain the path. `None` otherwise.
  converter : BaseConverter
      A BaseConverter object to parse the config file.
  
  Methods
  -------
  parse(commandline)
      Parses the commandline and populate the OrderedDict
  format(trial, experiment) : str
      Return the commandline with replaced values for priors and attributes
docstr: Change directly name priors to more general form.
  
  Pass through the current commandline arguments and replace priors of the form
  `--<name>~<prior>` to the more general one `--<name> orion~<prior>` to stay consistent
  with parameters passed as list.
  
  Parameters
  ----------
  args: list
      A list of the current commandline arguments.
  
  Returns
  -------
  list
      A list composed of the same elements as `args` augmented with the new form
      of the priors.
docstr_tok: ["Change","directly","name","priors","to","more","general","form",".","Pass","through","the","current","commandline","arguments","and","replace","priors","of","the","form","`","--","<","name",">","~","<","prior",">","`","to","the","more","general","one","`","--","<","name",">","orion~","<","prior",">","`","to","stay","consistent","with","parameters","passed","as","list",".","Parameters","--","--","--","--","--","args",":","list","A","list","of","the","current","commandline","arguments",".","Returns","--","--","--","-","list","A","list","composed","of","the","same","elements","as","`","args","`","augmented","with","the","new","form","of","the","priors","."]
code: def _replace_priors(args):
      """Change directly name priors to more general form.
  
      Pass through the current commandline arguments and replace priors of the form
      `--<name>~<prior>` to the more general one `--<name> orion~<prior>` to stay consistent
      with parameters passed as list.
  
      Parameters
      ----------
      args: list
          A list of the current commandline arguments.
  
      Returns
      -------
      list
          A list composed of the same elements as `args` augmented with the new form
          of the priors.
  
      """
      replaced = []
      for item in args:
          if item.startswith("-"):
              # Get the prior part after the `~`
              parts = item.split("~")
  
              if len(parts) > 1 and _is_nonprior_wave(parts[1]):
                  replaced.append(item)
                  continue
  
              # If the argument was defined has a long one but only has a single letter
              # then it needs to be shortened.
              if parts[0].startswith("--") and len(parts[0]) == 3:
                  parts[0] = parts[0][1:]
  
              replaced.append(parts[0])
  
              if len(parts) > 1:
                  replaced.append("orion~" + parts[1])
          else:
              replaced.append(item)
  
      return replaced
  
imports: import copy
  import errno
  import logging
  import os
  import re
  import shutil
  from collections import OrderedDict, defaultdict
  from orion.core.io.cmdline_parser import CmdlineParser
  from orion.core.io.convert import infer_converter_from_file_type
  from orion.core.utils.flatten import flatten
label_desc: Use image node_id 7 for calling the OrionCmdlineParser obj's underlying member method code with example usage: obj._replace_priors(args) and returns: replaced