code: def create_optimizer(parameters, state: Optional = None):
      # return torch.optim.Adam(parameters, lr=0.01)
      optimizer = ZeroRedundancyOptimizer_(
          parameters, optimizer_class=torch.optim.Adam, lr=0.001
      )
      if state is not None:
          optimizer.load_state_dict(state)
  
      return optimizer
  
imports: import random
  import torch
  import torch.distributed
  from docopt import docopt
  from dpu_utils.utils import RichPath, run_and_debug
  from functools import partial
  from pathlib import Path
  from torch.distributed.optim import ZeroRedundancyOptimizer
  from typing import Optional
  from ptgnn.baseneuralmodel.distributedtrainer import DistributedModelTrainer
  from ptgnn.baseneuralmodel.utils.amlutils import configure_logging, log_run
  from ptgnn.baseneuralmodel.utils.data import ShardedLazyDataIterable
  from ptgnn.implementations.typilus.graph2class import Graph2Class
  from ptgnn.implementations.typilus.train import create_graph2class_gnn_model
label_desc: Use image node_id 2 for calling a global function with example usage: create_optimizer(parameters, state) and returns: optimizer