code: def to_3_11(ctx, hashes, yes):
      """Optimize Runs Metrics data for read access."""
      if len(hashes) == 0:
          click.echo("Please specify at least one Run to update.")
          exit(1)
      repo_path = ctx.obj["repo"]
      repo = Repo.from_path(repo_path)
  
      matched_hashes = match_runs(repo, hashes)
      remaining_runs = []
      if yes:
          confirmed = True
      else:
          confirmed = click.confirm(
              f"This command will optimize the metrics data for {len(matched_hashes)} "
              f"runs from aim repo located at '{repo_path}'. This process might take a while. "
              f"Do you want to proceed?"
          )
      if not confirmed:
          return
  
      index_manager = RepoIndexManager.get_index_manager(repo)
      for run_hash in tqdm(matched_hashes):
          try:
              run = Run(run_hash, repo=repo)
              if run.check_metrics_version():
                  backup_run(run)
                  run.update_metrics()
                  index_manager.index(run_hash)
              else:
                  click.echo(
                      f"Run {run.hash} is already up to date. Skipping"
                  )
          except Exception:
              remaining_runs.append(run_hash)
  
      if not remaining_runs:
          click.echo("Finished optimizing metric data.")
      else:
          click.echo(
              "Finished optimizing metric data. The following runs were skipped:"
          )
          click.secho(" ".join(remaining_runs), fg="yellow")
      click.echo(
          "In case of any issues the following command can be used to restore data:"
      )
      click.secho(
          f"aim storage --repo {repo.root_path} restore '*'",
          fg="yellow",
      )
  
file_path: aim/aim/cli/storage/commands.py
imports: import click
  import os
  from tqdm import tqdm
  from aim.cli.runs.utils import match_runs
  from aim.cli.upgrade.utils import convert_2to3
  from aim.sdk.maintenance_run import MaintenanceRun
  from aim.sdk.utils import backup_run, restore_run_backup
  from aim.sdk.repo import Repo
  from aim.sdk.index_manager import RepoIndexManager
label_desc: Use image node_id 4 for calling a global function with example usage: to_3_11(ctx, hashes, yes) without return types