code: def get_optional_fields(cls) -> List[str]:
      """return list of optional annotated fields"""
      ret: List[str] = []
      for f in fields(cls):
          # Check if exactly two arguments exists and one of them are None type
          if (
              hasattr(f.type, "__args__")
              and type(None) in f.type.__args__
          ):
              ret.append(f.name)
      return ret
  
imports: from abc import ABC, abstractmethod
  from dataclasses import asdict, dataclass, field, fields
  from typing import Any, Callable, Dict, List, Optional, Union
  import numpy
  import reagent.core.types
  import torch
  import torch.nn.functional
label_desc: Use image node_id 1 for calling a global function with example usage: get_optional_fields(cls) and returns: ret