code: def test_custom_series_namespace() -> None:
      @pl.api.register_series_namespace("math")
      class CustomMath:
          def __init__(self, s: pl.Series):
              self._s = s
  
          def square(self) -> pl.Series:
              return self._s * self._s
  
      s = pl.Series("n", [1.5, 31.0, 42.0, 64.5])
      assert s.math.square().to_list() == [  # type: ignore[attr-defined]
          2.25,
          961.0,
          1764.0,
          4160.25,
      ]
  
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 4 for calling a global function with example usage: test_custom_series_namespace() and returns: unknown