code: def create_optimizer(params: Iterator[Parameter], cfg: Any) -> Any:
      r"""Creates a config-driven optimizer."""
      params = filter(lambda p: p.requires_grad, params)
      func = register.optimizer_dict.get(cfg.optimizer, None)
      if func is not None:
          return from_config(func)(params, cfg=cfg)
      raise ValueError(f"Optimizer '{cfg.optimizer}' not supported")
  
file_path: pytorch_geometric/torch_geometric/graphgym/optim.py
imports: from dataclasses import dataclass, field
  from typing import Any, Iterator, List, Optional
  from torch.nn import Parameter
  from torch.optim import SGD, Adam, Optimizer
  from torch.optim.lr_scheduler import CosineAnnealingLR, MultiStepLR, StepLR
  import torch_geometric.graphgym.register
  from torch_geometric.graphgym.config import from_config
label_desc: Use image node_id 3 for calling a global function with example usage: create_optimizer(params, cfg) and returns: from_config