code: def build_gradient_handler(config, model, optimizer):
      """Returns a gradient handler object of :class:`BaseGradientHandler` constructed from `config`,
      `model` and `optimizer`.
  
      Args:
          config (dict or :class:`colossalai.context.Config`): A python dict or
              a :class:`colossalai.context.Config` object containing information
              used in the construction of the ``GRADIENT_HANDLER``.
          model (:class:`nn.Module`): A model containing parameters for the gradient handler
          optimizer (:class:`torch.optim.Optimizer`): An optimizer object containing parameters for the gradient handler
  
      Returns:
          An object of :class:`colossalai.legacy.engine.BaseGradientHandler`
      """
      config_ = config.copy()
      config_["model"] = model
      config_["optimizer"] = optimizer
      return build_from_registry(config_, GRADIENT_HANDLER)
  
imports: import inspect
  from colossalai.legacy.registry import *
label_desc: Use image node_id 3 for calling a global function with example usage: build_gradient_handler(config, model, optimizer) and returns: build_from_registry