code: def get_bert_configured_parameters(
      module, lr=None, weight_decay=0.01
  ):
      # module param can either be a nn.Module or in some cases can also be
      # a list of named parameters for a nn.Module
      if isinstance(module, nn.Module):
          param_optimizer = list(module.named_parameters())
      elif isinstance(module, list):
          param_optimizer = module
  
      no_decay = ["bias", "LayerNorm.bias", "LayerNorm.weight"]
      optimizer_grouped_parameters = [
          {
              "params": [
                  p
                  for n, p in param_optimizer
                  if not any(nd in n for nd in no_decay)
              ],
              "weight_decay": weight_decay,
          },
          {
              "params": [
                  p
                  for n, p in param_optimizer
                  if any(nd in n for nd in no_decay)
              ],
              "weight_decay": 0.0,
          },
      ]
  
      if lr is not None:
          for p in optimizer_grouped_parameters:
              p["lr"] = lr
  
      return optimizer_grouped_parameters
  
imports: import logging
  from torch import nn
label_desc: Use image node_id 1 for calling a global function with example usage: get_bert_configured_parameters(module, lr, weight_decay) and returns: optimizer_grouped_parameters