code: def process_param_groups(params, **kwargs):
      param_groups = list(params)
      if not isinstance(param_groups[0], dict):
          param_groups = [{"params": param_groups}]
      for param_group in param_groups:
          if "lr" not in param_group:
              param_group["lr"] = kwargs["lr"]
          if "weight_decay" not in param_group:
              param_group["weight_decay"] = kwargs.get(
                  "weight_decay", 0.0
              )
      return param_groups
  
imports: from collections import defaultdict
  from torch.optim import SGD, Adam, AdamW
label_desc: Use image node_id 1 for calling a global function with example usage: process_param_groups(params) and returns: param_groups