code: def main() -> None:
      parser = ArgumentParser(
          description=(
              "A utility to upgrade old checkpoints to the format of the current Lightning version."
              " This will also save a backup of the original files."
          )
      )
      parser.add_argument(
          "path",
          type=str,
          help="Path to a checkpoint file or a directory with checkpoints to upgrade",
      )
      parser.add_argument(
          "--extension",
          "-e",
          type=str,
          default=".ckpt",
          help="The file extension to look for when searching for checkpoint files in a directory.",
      )
      parser.add_argument(
          "--map-to-cpu",
          action="store_true",
          help=(
              "Map all tensors in the checkpoint to CPU. Enable this option if you are converting a GPU checkpoint"
              " on a machine without GPUs."
          ),
      )
      args = parser.parse_args()
      _upgrade(args)
  
file_path: pytorch-lightning/src/lightning/pytorch/utilities/upgrade_checkpoint.py
imports: import glob
  import logging
  from argparse import ArgumentParser, Namespace
  from pathlib import Path
  from shutil import copyfile
  from typing import List
  import torch
  from tqdm import tqdm
  from lightning.pytorch.utilities.migration import migrate_checkpoint, pl_legacy_patch
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types