code: def _get_warmup_factor_at_iter(
      method: str, iter: int, warmup_iters: int, warmup_factor: float
  ) -> float:
      """
      Return the learning rate warmup factor at a specific iteration.
      See :paper:`ImageNet in 1h` for more details.
  
      Args:
          method (str): warmup method; either "constant" or "linear".
          iter (int): iteration at which to calculate the warmup factor.
          warmup_iters (int): the number of warmup iterations.
          warmup_factor (float): the base warmup factor (the meaning changes according
              to the method used).
  
      Returns:
          float: the effective warmup factor at the given iteration.
      """
      if iter >= warmup_iters:
          return 1.0
  
      if method == "constant":
          return warmup_factor
      elif method == "linear":
          alpha = iter / warmup_iters
          return warmup_factor * (1 - alpha) + alpha
      else:
          raise ValueError("Unknown warmup method: {}".format(method))
  
imports: import logging
  import math
  from bisect import bisect_right
  from typing import List
  import torch
  from fvcore.common.param_scheduler import CompositeParamScheduler, ConstantParamScheduler, LinearParamScheduler, ParamScheduler
label_desc: Use image node_id 1 for calling a global function with example usage: _get_warmup_factor_at_iter(method, iter, warmup_iters, warmup_factor) and returns: int, warmup_factor, unknown