code: def get_stage_id_for_convnext(var_name, max_stage_id):
      """Get the stage id to set the different learning rates in ``stage_wise``
      decay_type.
  
      Args:
          var_name (str): The key of the model.
          max_stage_id (int): Maximum stage id.
  
      Returns:
          int: The id number corresponding to different learning rate in
          ``LearningRateDecayOptimizerConstructor``.
      """
  
      if var_name in (
          "backbone.cls_token",
          "backbone.mask_token",
          "backbone.pos_embed",
      ):
          return 0
      elif var_name.startswith("backbone.downsample_layers"):
          return 0
      elif var_name.startswith("backbone.stages"):
          stage_id = int(var_name.split(".")[2])
          return stage_id + 1
      else:
          return max_stage_id - 1
  
file_path: mmdetection/mmdet/engine/optimizers/layer_decay_optimizer_constructor.py
imports: import json
  from typing import List
  import torch.nn
  from mmengine.dist import get_dist_info
  from mmengine.logging import MMLogger
  from mmengine.optim import DefaultOptimWrapperConstructor
  from mmdet.registry import OPTIM_WRAPPER_CONSTRUCTORS
label_desc: Use image node_id 2 for calling a global function with example usage: get_stage_id_for_convnext(var_name, max_stage_id) and returns: int, int, unknown, unknown