code: def _copy_state(opt, pgs1, pgs2):
      opt.param_lists = pgs2
      for pg1, pg2 in zip(pgs1, pgs2):
          for p1, p2 in zip(pg1, pg2):
              opt.state[p2] = copy_clone(opt.state.pop(p1, {}))
  
imports: from __future__ import annotations
  from ..basics import *
  from .progress import *
  from torch.cuda.amp import GradScaler, autocast
  from torch.cuda.amp.grad_scaler import OptState
  from ..fp16_utils import convert_network, model_grads_to_master_grads, master_params_to_model_params
  from torch.nn.utils import parameters_to_vector
label_desc: Use image node_id 10 for calling a global function with example usage: _copy_state(opt, pgs1, pgs2) without return types