code: def get_gradient_predivide_factor(world_size: int) -> float:
      factor: int = 1
      while world_size % factor == 0 and world_size / factor > factor:
          factor *= 2
      return float(factor)
  
file_path: colossalai/colossalai/legacy/zero/sharded_model/_utils.py
imports: from typing import Any, Callable, List, Tuple, Union
  import torch
  import torch.nn.functional
  from colossalai.legacy.zero.gemini.stateful_tensor import StatefulTensor
label_desc: Use image node_id 1 for calling a global function with example usage: get_gradient_predivide_factor(world_size) and returns: float