code: def test_rolling_min_periods(
      dates: list[date], closed: ClosedInterval, expected: list[int]
  ) -> None:
      df = pl.DataFrame({"date": dates, "value": [1, 2, 3]}).sort(
          "date"
      )
      result = df.select(
          pl.col("value").rolling_sum(
              window_size="2d", by="date", min_periods=2, closed=closed
          )
      )["value"]
      assert_series_equal(
          result, pl.Series("value", expected, pl.Int64)
      )
  
imports: from __future__ import annotations
  from datetime import date, datetime, timedelta
  from typing import TYPE_CHECKING
  import numpy
  import pytest
  from numpy import nan
  import polars
  from polars.exceptions import ComputeError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 30 for calling a global function with example usage: test_rolling_min_periods(dates, closed, expected) without return types