code: def to_values(data: DataType) -> ToValuesReturnType:
      """Replace a DataFrame by a data model with values."""
      check_data_type(data)
      if hasattr(data, "__geo_interface__"):
          if isinstance(data, pd.DataFrame):
              data = sanitize_dataframe(data)
          # Maybe the type could be further clarified here that it is
          # SupportGeoInterface and then the ignore statement is not needed?
          data_sanitized = sanitize_geo_interface(data.__geo_interface__)  # type: ignore[arg-type]
          return {"values": data_sanitized}
      elif isinstance(data, pd.DataFrame):
          data = sanitize_dataframe(data)
          return {"values": data.to_dict(orient="records")}
      elif isinstance(data, dict):
          if "values" not in data:
              raise KeyError(
                  "values expected in data dict, but not present."
              )
          return data
      elif hasattr(data, "__dataframe__"):
          # experimental interchange dataframe support
          pi = import_pyarrow_interchange()
          pa_table = sanitize_arrow_table(pi.from_dataframe(data))
          return {"values": pa_table.to_pylist()}
      else:
          # Should never reach this state as tested by check_data_type
          raise ValueError(
              "Unrecognized data type: {}".format(type(data))
          )
  
imports: import json
  import os
  import random
  import hashlib
  import warnings
  from typing import Union, MutableMapping, Optional, Dict, Sequence, TYPE_CHECKING, List
  import pandas
  from toolz import curried
  from typing import TypeVar
  from ._importers import import_pyarrow_interchange
  from .core import sanitize_dataframe, sanitize_arrow_table, DataFrameLike
  from .core import sanitize_geo_interface
  from .deprecation import AltairDeprecationWarning
  from .plugin_registry import PluginRegistry
  from typing import Protocol, TypedDict, Literal
label_desc: Use image node_id 5 for calling a global function with example usage: to_values(data) and returns: dict, dict, data, dict