code: def test_custom_lazy_namespace() -> None:
      @pl.api.register_lazyframe_namespace("split")
      class SplitFrame:
          def __init__(self, ldf: pl.LazyFrame):
              self._ldf = ldf
  
          def by_column_dtypes(self) -> list[pl.LazyFrame]:
              return [
                  self._ldf.select(pl.col(tp))
                  for tp in dict.fromkeys(self._ldf.dtypes)
              ]
  
      ldf = pl.DataFrame(
          data=[
              ["xx", 2, 3, 4],
              ["xy", 4, 5, 6],
              ["yy", 5, 6, 7],
              ["yz", 6, 7, 8],
          ],
          schema=["a1", "a2", "b1", "b2"],
          orient="row",
      ).lazy()
  
      df1, df2 = (d.collect() for d in ldf.split.by_column_dtypes())  # type: ignore[attr-defined]
      assert_frame_equal(
          df1,
          pl.DataFrame(
              [("xx",), ("xy",), ("yy",), ("yz",)], schema=["a1"]
          ),
      )
      assert_frame_equal(
          df2,
          pl.DataFrame(
              [(2, 3, 4), (4, 5, 6), (5, 6, 7), (6, 7, 8)],
              schema=["a2", "b1", "b2"],
          ),
      )
  
file_path: polars/py-polars/tests/unit/test_api.py
imports: from __future__ import annotations
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_custom_lazy_namespace() and returns: unknown