code: def params2names(self, model: Module, params: List) -> List[Dict]:
      param_groups = list(params)
      assert len(param_groups) > 0
      if not isinstance(param_groups[0], dict):
          param_groups = [{"params": param_groups}]
  
      for param_group in param_groups:
          params = param_group["params"]
          if isinstance(params, Tensor):
              params = [params]
          elif isinstance(params, set):
              raise TypeError(
                  "optimizer parameters need to be organized in ordered collections, but "
                  "the ordering of tensors in sets will change between runs. Please use a list instead."
              )
          else:
              params = list(params)
          param_ids = [id(p) for p in params]
          param_group["params"] = [
              name
              for name, p in model.named_parameters()
              if id(p) in param_ids
          ]
  
      return param_groups
  
imports: from __future__ import annotations
  from copy import deepcopy
  from typing import Callable, Dict, List, Type
  from torch import Tensor
  from torch.nn import Module
  from torch.optim import Optimizer
  from nni.common.serializer import is_traceable
  from nni.common.types import SCHEDULER
label_desc: Use image node_id 2 for calling the OptimizerConstructHelper obj's underlying member method code with example usage: obj.params2names(model, params) and returns: param_groups