code: def generate_vegalite_channel_wrappers(
      schemafile: str, version: str, imports: Optional[List[str]] = None
  ) -> str:
      # TODO: generate __all__ for top of file
      schema = load_schema_with_shorthand_properties(schemafile)
      if imports is None:
          imports = [
              "import sys",
              "from . import core",
              "import pandas as pd",
              "from altair.utils.schemapi import Undefined, UndefinedType, with_property_setters",
              "from altair.utils import parse_shorthand",
              "from typing import Any, overload, Sequence, List, Literal, Union, Optional",
              "from typing import Dict as TypingDict",
          ]
      contents = [HEADER]
      contents.append(CHANNEL_MYPY_IGNORE_STATEMENTS)
      contents.extend(imports)
      contents.append("")
  
      contents.append(CHANNEL_MIXINS)
  
      encoding_def = "FacetedEncoding"
  
      encoding = SchemaInfo(
          schema["definitions"][encoding_def], rootschema=schema
      )
  
      channel_infos: dict[str, ChannelInfo] = {}
  
      for prop, propschema in encoding.properties.items():
          def_dict = get_field_datum_value_defs(propschema, schema)
  
          supports_arrays = any(
              schema_info.is_array() for schema_info in propschema.anyOf
          )
          channel_info = ChannelInfo(
              supports_arrays=supports_arrays,
              deep_description=propschema.deep_description,
          )
  
          for encoding_spec, definition in def_dict.items():
              classname = prop[0].upper() + prop[1:]
              basename = definition.split("/")[-1]
              basename = get_valid_identifier(basename)
  
              defschema = {"$ref": definition}
  
              Generator: Union[
                  Type[FieldSchemaGenerator],
                  Type[DatumSchemaGenerator],
                  Type[ValueSchemaGenerator],
              ]
              if encoding_spec == "field":
                  Generator = FieldSchemaGenerator
                  nodefault = []
                  channel_info.field_class_name = classname
  
              elif encoding_spec == "datum":
                  Generator = DatumSchemaGenerator
                  classname += "Datum"
                  nodefault = ["datum"]
                  channel_info.datum_class_name = classname
  
              elif encoding_spec == "value":
                  Generator = ValueSchemaGenerator
                  classname += "Value"
                  nodefault = ["value"]
                  channel_info.value_class_name = classname
  
              gen = Generator(
                  classname=classname,
                  basename=basename,
                  schema=defschema,
                  rootschema=schema,
                  encodingname=prop,
                  nodefault=nodefault,
                  haspropsetters=True,
                  altair_classes_prefix="core",
              )
              contents.append(gen.schema_class())
  
          channel_infos[prop] = channel_info
  
      # Generate the type signature for the encode method
      encode_signature = _create_encode_signature(channel_infos)
      contents.append(encode_signature)
      return "\n".join(contents)
  
imports: import argparse
  import copy
  import json
  import os
  import re
  import sys
  import textwrap
  from dataclasses import dataclass
  from os.path import abspath, dirname, join
  from typing import Dict, Final, List, Literal, Optional, Tuple, Type, Union
  from urllib import request
  import m2r
  from schemapi import codegen
  from schemapi.codegen import CodeSnippet
  from schemapi.utils import SchemaInfo, get_valid_identifier, resolve_references, ruff_format_str, rst_syntax_for_class, indent_docstring
label_desc: Use image node_id 12 for calling a global function with example usage: generate_vegalite_channel_wrappers(schemafile, version, imports) and returns: str