code: def test_rows() -> None:
      df = pl.DataFrame({"a": [1, 2], "b": [1, 2]})
  
      # Regular rows
      assert df.rows() == [(1, 1), (2, 2)]
      assert df.reverse().rows() == [(2, 2), (1, 1)]
  
      # Named rows
      rows = df.rows(named=True)
      assert rows == [{"a": 1, "b": 1}, {"a": 2, "b": 2}]
  
      # Rows with nullarray cols
      df = df.with_columns(c=pl.lit(None))
      assert df.schema == {"a": pl.Int64, "b": pl.Int64, "c": pl.Null}
      assert df.rows() == [(1, 1, None), (2, 2, None)]
      assert df.rows(named=True) == [
          {"a": 1, "b": 1, "c": None},
          {"a": 2, "b": 2, "c": None},
      ]
  
file_path: polars/py-polars/tests/unit/test_rows.py
imports: import pytest
  import polars
  from polars.exceptions import NoRowsReturnedError, TooManyRowsReturnedError
label_desc: Use image node_id 2 for calling a global function with example usage: test_rows() without return types