code: def create_schema(
      tensorizers: Dict[str, Tensorizer],
      extra_schema: Optional[Dict[str, Type]] = None,
  ) -> Schema:
      schema: Dict[str, Type] = {}
  
      def add_to_schema(name, type):
          if name in schema:
              if type != Any and type != schema[name]:
                  raise TypeError(
                      f"Unexpected different types for column {name}: "
                      f"{type} != {schema[name]}"
                  )
          else:
              schema[name] = type
  
      for tensorizer in tensorizers.values():
          for name, type in tensorizer.column_schema:
              add_to_schema(name, type)
  
      for name, type in (extra_schema or {}).items():
          # Schema type check is not needed, ClassificationMetricReporter
          # automatically casts data to string.
          add_to_schema(name, type)
  
      print(f"PyText data schema: {schema}.")
      return schema
  
imports: from typing import Any, Dict, Optional, Type, Union
  import torch
  from accelerators.pytorch.lib.accelerator_lowering import lower_modules_to_accelerator, lower_split_model_to_accelerator
  from accelerators.pytorch.lib.export_helper import AccelerateOptions
  from accelerators.pytorch.lib.model_rewriter import find_module_instances, MODULE_TO_REWRITER, rewrite_nnpi_modules, swap_modules
  from accelerators.pytorch.lib.quantize import quantize_fx, quantize_statically
  from pytext.common.constants import Stage
  from pytext.config import ConfigBase, ExportConfig, PyTextConfig
  from pytext.config.component import ComponentType, create_component, create_trainer
  from pytext.data.data import Data
  from pytext.data.sources.data_source import Schema
  from pytext.data.tensorizers import Tensorizer
  from pytext.metric_reporters import MetricReporter
  from pytext.models.model import BaseModel
  from pytext.models.representations.bilstm import BiLSTM
  from pytext.models.roberta import RoBERTaEncoder
  from pytext.trainers import TaskTrainer, TrainingState
  from pytext.utils import cuda, onnx, precision
  from pytext.utils.file_io import PathManager
  from pytext.utils.usage import log_accelerator_feature_usage, log_class_usage, log_feature_usage
  from torch import sort
  from .task import TaskBase
label_desc: Use image node_id 1 for calling a global function with example usage: create_schema(tensorizers, extra_schema) and returns: schema