code: def opt_at(opt, idx):
      return list(opt.state.values())[idx]
  
file_path: pytorch/torch/distributed/checkpoint/examples/fsdp_checkpoint_example.py
imports: import os
  import shutil
  import torch
  import torch.distributed
  import torch.distributed.checkpoint
  import torch.multiprocessing
  from torch.distributed.checkpoint.optimizer import load_sharded_optimizer_state_dict
  from torch.distributed.fsdp import FullyShardedDataParallel
  from torch.distributed.fsdp.fully_sharded_data_parallel import StateDictType
label_desc: Use image node_id 1 for calling a global function with example usage: opt_at(opt, idx) and returns: list