code: def test_lazy_functions() -> None:
      df = pl.DataFrame(
          {
              "a": ["foo", "bar", "2"],
              "b": [1, 2, 3],
              "c": [1.0, 2.0, 3.0],
          }
      )
      out = df.select(pl.count("a"))
      assert list(out["a"]) == [3]
      out = df.select(
          [
              pl.var("b").alias("1"),
              pl.std("b").alias("2"),
              pl.max("b").alias("3"),
              pl.min("b").alias("4"),
              pl.sum("b").alias("5"),
              pl.mean("b").alias("6"),
              pl.median("b").alias("7"),
              pl.n_unique("b").alias("8"),
              pl.first("b").alias("9"),
              pl.last("b").alias("10"),
          ]
      )
      expected = 1.0
      assert np.isclose(out.to_series(0), expected)
      assert np.isclose(df["b"].var(), expected)  # type: ignore[arg-type]
  
      expected = 1.0
      assert np.isclose(out.to_series(1), expected)
      assert np.isclose(df["b"].std(), expected)  # type: ignore[arg-type]
  
      expected = 3
      assert np.isclose(out.to_series(2), expected)
      assert np.isclose(df["b"].max(), expected)  # type: ignore[arg-type]
  
      expected = 1
      assert np.isclose(out.to_series(3), expected)
      assert np.isclose(df["b"].min(), expected)  # type: ignore[arg-type]
  
      expected = 6
      assert np.isclose(out.to_series(4), expected)
      assert np.isclose(df["b"].sum(), expected)
  
      expected = 2
      assert np.isclose(out.to_series(5), expected)
      assert np.isclose(df["b"].mean(), expected)  # type: ignore[arg-type]
  
      expected = 2
      assert np.isclose(out.to_series(6), expected)
      assert np.isclose(df["b"].median(), expected)  # type: ignore[arg-type]
  
      expected = 3
      assert np.isclose(out.to_series(7), expected)
      assert np.isclose(df["b"].n_unique(), expected)
  
      expected = 1
      assert np.isclose(out.to_series(8), expected)
      assert np.isclose(df["b"][0], expected)
  
      expected = 3
      assert np.isclose(out.to_series(9), expected)
      assert np.isclose(df["b"][-1], expected)
  
      # regex selection
      out = df.select(
          [
              pl.struct(pl.max("^a|b$")).alias("x"),
              pl.struct(pl.min("^.*[bc]$")).alias("y"),
              pl.struct(pl.sum("^[^b]$")).alias("z"),
          ]
      )
      assert out.rows() == [
          (
              {"a": "foo", "b": 3},
              {"b": 1, "c": 1.0},
              {"a": None, "c": 6.0},
          )
      ]
  
imports: from __future__ import annotations
  from datetime import timedelta
  from typing import TYPE_CHECKING
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 16 for calling a global function with example usage: test_lazy_functions() without return types