code: def main(args):
      """List all experiments inside database."""
      config = experiment_builder.get_cmd_config(args)
      builder = experiment_builder.ExperimentBuilder(
          config.get("storage")
      )
  
      query = {}
  
      if args["name"]:
          query["name"] = args["name"]
          query["version"] = args.get("version", None) or 1
  
      experiments = builder.storage.fetch_experiments(query)
  
      if args["name"]:
          root_experiments = experiments
      else:
          root_experiments = [
              exp
              for exp in experiments
              if exp["refers"].get("root_id", exp["_id"]) == exp["_id"]
          ]
  
      if not root_experiments:
          print("No experiment found")
          return
  
      for root_experiment in root_experiments:
          root = builder.load(
              name=root_experiment["name"],
              version=root_experiment.get("version"),
          ).node
          print_tree(root, nameattr="tree_name")
  
imports: import logging
  from orion.core.cli import base
  from orion.core.io import experiment_builder
  from orion.core.utils.pptree import print_tree
label_desc: Use image node_id 2 for calling a global function with example usage: main(args) without return types