code: def test_check_meta():
      df = pd.DataFrame(
          {
              "a": ["x", "y", "z"],
              "b": [True, False, True],
              "c": [1, 2.5, 3.5],
              "d": [1, 2, 3],
              "e": pd.Categorical(["x", "y", "z"]),
              "f": pd.Series([1, 2, 3], dtype=np.uint64),
          }
      )
      meta = df.iloc[:0]
  
      # DataFrame metadata passthrough if correct
      assert check_meta(df, meta) is df
      # Series metadata passthrough if correct
      e = df.e
      assert check_meta(e, meta.e) is e
      # numeric_equal means floats and ints are equivalent
      d = df.d
      f = df.f
      assert check_meta(d, meta.d.astype("f8"), numeric_equal=True) is d
      assert check_meta(f, meta.f.astype("f8"), numeric_equal=True) is f
      assert check_meta(f, meta.f.astype("i8"), numeric_equal=True) is f
  
      # Series metadata error
      with pytest.raises(ValueError) as err:
          check_meta(d, meta.d.astype("f8"), numeric_equal=False)
      assert str(err.value) == (
          "Metadata mismatch found.\n"
          "\n"
          "Partition type: `pandas.core.series.Series`\n"
          "+----------+---------+\n"
          "|          | dtype   |\n"
          "+----------+---------+\n"
          "| Found    | int64   |\n"
          "| Expected | float64 |\n"
          "+----------+---------+"
      )
  
      # DataFrame metadata error
      meta2 = meta.astype({"a": "category", "d": "f8"})[
          ["a", "b", "c", "d"]
      ]
      df2 = df[["a", "b", "d", "e"]]
      with pytest.raises(ValueError) as err:
          check_meta(df2, meta2, funcname="from_delayed")
  
      exp = (
          "Metadata mismatch found in `from_delayed`.\n"
          "\n"
          "Partition type: `pandas.core.frame.DataFrame`\n"
          "+--------+----------+----------+\n"
          "| Column | Found    | Expected |\n"
          "+--------+----------+----------+\n"
          "| 'a'    | object   | category |\n"
          "| 'c'    | -        | float64  |\n"
          "| 'e'    | category | -        |\n"
          "+--------+----------+----------+"
      )
      assert str(err.value) == exp
  
      # pandas dtype metadata error
      with pytest.raises(ValueError) as err:
          check_meta(
              df.a, pd.Series([], dtype="string"), numeric_equal=False
          )
      assert str(err.value) == (
          "Metadata mismatch found.\n"
          "\n"
          "Partition type: `pandas.core.series.Series`\n"
          "+----------+--------+\n"
          "|          | dtype  |\n"
          "+----------+--------+\n"
          "| Found    | object |\n"
          "| Expected | string |\n"
          "+----------+--------+"
      )
  
imports: from __future__ import annotations
  import re
  import warnings
  from collections.abc import Iterable
  import numpy
  import pandas
  import pytest
  from packaging.version import Version
  import dask
  import dask.dataframe
  from dask.dataframe._compat import PANDAS_GE_200, tm
  from dask.dataframe.core import apply_and_enforce
  from dask.dataframe.utils import UNKNOWN_CATEGORIES, assert_eq, check_matching_columns, check_meta, is_dataframe_like, is_index_like, is_series_like, make_meta, meta_frame_constructor, meta_nonempty, meta_series_constructor, pyarrow_strings_enabled, raise_on_meta_error, shard_df_on_index, valid_divisions
  from dask.local import get_sync
label_desc: Use image node_id 10 for calling a global function with example usage: test_check_meta() without return types