code: def _check_models_or_docs(
      models: ModelLike | ModelLikeCollection,
  ) -> ModelLikeCollection:
      """ """
      input_type_valid = False
  
      # Check for single item
      if isinstance(models, (Model, Document)):
          models = [models]
  
      # Check for sequence
      if isinstance(models, Sequence) and all(
          isinstance(x, (Model, Document)) for x in models
      ):
          input_type_valid = True
  
      if (
          isinstance(models, dict)
          and all(isinstance(x, str) for x in models.keys())
          and all(
              isinstance(x, (Model, Document)) for x in models.values()
          )
      ):
          input_type_valid = True
  
      if not input_type_valid:
          raise ValueError(
              "Input must be a Model, a Document, a Sequence of Models and Document, or a dictionary from string to Model and Document",
          )
  
      return models
  
imports: from __future__ import annotations
  import logging
  from typing import TYPE_CHECKING, Any, Literal, Sequence, TypedDict, Union, cast, overload
  from ..None import __version__
  from ..core.templates import AUTOLOAD_JS, AUTOLOAD_TAG, FILE, MACROS, ROOT_DIV
  from ..document.document import DEFAULT_TITLE, Document
  from ..model import Model
  from ..resources import Resources, ResourcesLike
  from ..themes import Theme
  from .bundle import Script, bundle_for_objs_and_resources
  from .elements import html_page_for_render_items, script_for_render_items
  from .util import FromCurdoc, OutputDocumentFor, RenderRoot, standalone_docs_json, standalone_docs_json_and_render_items
  from .wrappers import wrap_in_onload
label_desc: Use image node_id 11 for calling a global function with example usage: _check_models_or_docs(models) and returns: models