code: def test_struct_for_field(key, expect):
      sr = cudf.Series([{"a": 1, "b": 2}, {"a": 3, "b": 4}])
      expect = cudf.Series(expect)
      got = sr.struct.field(key)
      assert_eq(expect, got)
  
imports: import numpy
  import pandas
  import pyarrow
  import pytest
  import cudf
  from cudf.core.dtypes import StructDtype
  from cudf.testing._utils import DATETIME_TYPES, TIMEDELTA_TYPES, assert_eq
label_desc: Use image node_id 4 for calling a global function with example usage: test_struct_for_field(key, expect) without return types