code: def _get_per_param_group(
      optimizer: Optimizer,
      name: str,
      value: Union[float, Sequence[float]],
  ) -> Sequence[float]:
      num_param_groups = len(optimizer.param_groups)
  
      if isinstance(value, float):
          return [value] * num_param_groups
  
      if len(value) != num_param_groups:
          raise ValueError(
              f"The length of `{name}` must be equal to the number of parameter groups ({num_param_groups}), but is {len(value)} instead."
          )
  
      return value
  
imports: import math
  import warnings
  from abc import ABC, abstractmethod
  from typing import List, Sequence, Union, final
  from torch.optim import Optimizer
  from torch.optim.lr_scheduler import _LRScheduler
  from typing_extensions import TypeAlias
  from fairseq2.typing import finaloverride
label_desc: Use image node_id 1 for calling a global function with example usage: _get_per_param_group(optimizer, name, value) and returns: value, unknown