code: def get_algo_requirements(algorithm):
      """Return a dict() of requirements of the algorithm based on interface < v0.1.10"""
      if hasattr(algorithm, "requires"):
          log.warning(
              "Algorithm.requires is deprecated and will stop being supporting in v0.3."
          )
          requirements = algorithm.requires
          requirements = (
              requirements
              if isinstance(requirements, list)
              else [requirements]
          )
  
          log.debug("Algorithm requirements: %s", requirements)
  
          requirements = copy.deepcopy(requirements)
  
          if "linear" in requirements:
              dist_requirement = "linear"
              del requirements[requirements.index("linear")]
          else:
              dist_requirement = None
  
          if "flattened" in requirements:
              shape_requirement = "flattened"
              del requirements[requirements.index("flattened")]
          else:
              shape_requirement = None
  
          if requirements:
              assert len(requirements) == 1
              type_requirement = requirements[0]
          else:
              type_requirement = None
  
          requirements = dict(
              type_requirement=type_requirement,
              shape_requirement=shape_requirement,
              dist_requirement=dist_requirement,
          )
  
          log.debug(
              "Algorithm requirements in new format:\n%s",
              pprint.pformat(requirements),
          )
  
          return requirements
  
      return dict(
          type_requirement=algorithm.requires_type,
          shape_requirement=algorithm.requires_shape,
          dist_requirement=algorithm.requires_dist,
      )
  
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 7 for calling a global function with example usage: get_algo_requirements(algorithm) and returns: dict, requirements