code: def port_algo_config(config):
      """Convert algorithm configuration to be compliant with factory interface
  
      Examples
      --------
      >>> port_algo_config('algo_name')
      {'of_type': 'algo_name'}
      >>> port_algo_config({'algo_name': {'some': 'args'}})
      {'of_type': 'algo_name', 'some': 'args'}
      >>> port_algo_config({'of_type': 'algo_name', 'some': 'args'})
      {'of_type': 'algo_name', 'some': 'args'}
  
      """
      config = copy.deepcopy(config)
      if isinstance(config, dict) and len(config) == 1:
          algo_name, algo_config = next(iter(config.items()))
          config = algo_config
          config["of_type"] = algo_name
      elif isinstance(config, str):
          config = {"of_type": config}
  
      return config
  
file_path: orion/src/orion/core/utils/backward.py
imports: import copy
  import logging
  import pprint
  import orion.core
  from orion.core.io.orion_cmdline_parser import OrionCmdlineParser
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 8 for calling a global function with example usage: port_algo_config(config) and returns: config