code: def test_struct_getitem() -> None:
      assert pl.Series([{"a": 1, "b": 2}]).struct["b"].name == "b"
      assert pl.Series([{"a": 1, "b": 2}]).struct[0].name == "a"
      assert pl.Series([{"a": 1, "b": 2}]).struct[1].name == "b"
      assert pl.Series([{"a": 1, "b": 2}]).struct[-1].name == "b"
      assert pl.Series([{"a": 1, "b": 2}]).to_frame().select(
          [pl.col("").struct[0]]
      ).to_dict(as_series=False) == {"a": [1]}
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from datetime import datetime, time
  from typing import TYPE_CHECKING
  import pandas
  import pyarrow
  import pytest
  import polars
  import polars.selectors
  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_struct_getitem() without return types