code: def _is_optional(cls):
      return (
          _get_class_type(cls) == Union and type(None) in cls.__args__
      )
  
imports: from enum import Enum
  from typing import Any, Dict, List, Tuple, Type, Union
  from pytext.common.utils import eprint
  from .component import Registry
  from .config_adapter import upgrade_to_latest
  from .pytext_config import PyTextConfig
label_desc: Use image node_id 6 for calling a global function with example usage: _is_optional(cls) and returns: unknown