code: def pydantic_v1_components_schema(
      pydantic_model: type[pydantic.BaseModel],
  ):
      flat_models = schema.get_flat_models_from_model(pydantic_model)
      model_name_map = schema.get_model_name_map(flat_models)
  
      # gets model definitions
      definitions: dict[str, dict[str, t.Any]] = {}
      for model in flat_models:
          m_schema, m_definitions, _ = schema.model_process_schema(
              model,
              model_name_map=model_name_map,
              ref_prefix=REF_PREFIX,
          )
          definitions.update(m_definitions)
          model_name = model_name_map[model]
          definitions[model_name] = m_schema
      return {k: Schema(**definitions[k]) for k in sorted(definitions)}
  
file_path: BentoML/grpc-client/bentoml/_internal/service/openapi/utils.py
imports: from __future__ import annotations
  import typing
  from functools import lru_cache
  from typing import TYPE_CHECKING
  from bentoml.exceptions import InternalServerError
  from bentoml.exceptions import InvalidArgument
  from bentoml.exceptions import NotFound
  from ...utils import LazyLoader
  from ...utils.pkg import pkg_version_info
  from .specification import Schema
label_desc: Use image node_id 3 for calling a global function with example usage: pydantic_v1_components_schema(pydantic_model) and returns: unknown