code: def test_list_arr_empty() -> None:
      df = pl.DataFrame({"cars": [[1, 2, 3], [2, 3], [4], []]})
  
      out = df.select(
          [
              pl.col("cars").list.first().alias("cars_first"),
              pl.when(pl.col("cars").list.first() == 2)
              .then(1)
              .when(pl.col("cars").list.contains(2))
              .then(2)
              .otherwise(3)
              .alias("cars_literal"),
          ]
      )
      expected = pl.DataFrame(
          {"cars_first": [1, 2, 4, None], "cars_literal": [2, 1, 3, 3]},
          schema_overrides={
              "cars_literal": pl.Int32
          },  # Literals default to Int32
      )
      assert_frame_equal(out, expected)
  
imports: from __future__ import annotations
  from datetime import date, datetime
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 5 for calling a global function with example usage: test_list_arr_empty() without return types