code: def collect_runs(lrepo: LegacyRepo):
      lruns = []
      for branch in lrepo.list_branches():
          for commit in lrepo.list_branch_commits(branch):
              lruns.append(
                  LegacyRun(
                      lrepo, experiment_name=branch, run_hash=commit
                  )
              )
      return lruns
  
file_path: aim/aim/cli/upgrade/utils.py
imports: import os.path
  import click
  import shutil
  from aim.cli.upgrade._legacy_repo import AimRepo, Run, deserialize_pb, AIM_MAP_METRICS_KEYWORD
  from aim.sdk.configs import AIM_REPO_NAME
  from aim.sdk.utils import clean_repo_path
  from aim.sdk.run import Run
  from aim.sdk.repo import Repo
label_desc: Use image node_id 2 for calling a global function with example usage: collect_runs(lrepo) and returns: lruns