code: def test_frame_from_pydecimal_and_ints(
      permutations_int_dec_none: list[tuple[D | int | None, ...]],
      monkeypatch: Any,
  ) -> None:
      monkeypatch.setenv("POLARS_ACTIVATE_DECIMAL", "1")
  
      class X(NamedTuple):
          a: int | D | None
  
      @dataclass
      class Y:
          a: int | D | None
  
      for data in permutations_int_dec_none:
          row_data = [(d,) for d in data]
          for cls in (X, Y):
              for ctor in (pl.DataFrame, pl.from_records):
                  df = ctor(data=list(map(cls, data)))  # type: ignore[operator]
                  assert df.schema == {
                      "a": pl.Decimal(scale=7),
                  }
                  assert df.rows() == row_data
  
imports: from __future__ import annotations
  import io
  import itertools
  from dataclasses import dataclass
  from decimal import Decimal
  from typing import Any, NamedTuple
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_frame_from_pydecimal_and_ints(permutations_int_dec_none, monkeypatch) without return types