code: def _get_class_type(cls):
      """
      type(cls) has an inconsistent behavior between 3.6 and 3.7 because of
      changes in the typing module. We therefore rely on __extra (3.6) and
      __origin__ (3.7), present only in classes from typing to extract the origin
      of the class for comparison, otherwise default to the type sent directly
      :param cls: class to infer
      :return: class or in the case of classes from typing module, the real type
      (Union, List) of the created object
      """
      return getattr(cls, "__extra__", getattr(cls, "__origin__", cls))
  
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 16 for calling a global function with example usage: _get_class_type(cls) and returns: getattr