code: def test_setitem_structured():
      # Check to value is properly broadcast for `setitem` on complex record dtype arrays.
      rec_type = np.dtype(
          [
              ("a", np.int32),
              ("b", np.double),
              ("c", np.dtype([("a", np.int16), ("b", np.int64)])),
          ]
      )
  
      t = ones((4, 5), dtype=rec_type, chunk_size=3)
  
      # assign tuple to record
      t[1:4, 1] = (3, 4.0, (5, 6))
      tt = tile(t)
      assert tt.cix[0, 0].op.value == (3, 4.0, (5, 6))
  
      # assign scalar to record
      t[1:4, 2] = 8
      tt = tile(t)
      assert tt.cix[0, 0].op.value == 8
  
      # assign scalar array to record array with broadcast
      t[1:3] = np.arange(5)
      tt = tile(t)
      slices_op = tt.cix[0, 0].op.value.op
      assert slices_op.slices == [
          slice(None, None, None),
          slice(0, 3, None),
      ]
      broadcast_op = slices_op.inputs[0].op.inputs[0].op
      assert isinstance(broadcast_op, TensorBroadcastTo)
      assert broadcast_op.shape == (2, 5)
      np.testing.assert_array_equal(
          broadcast_op.inputs[0].op.data, np.arange(5)
      )
  
      # assign scalar array to record array of same shape, no broadcast
      t[2:4] = np.arange(10).reshape(2, 5)
      tt = tile(t)
      slices_op = tt.cix[0, 0].op.value.op
      assert slices_op.slices == [slice(0, 1, None), slice(0, 3, None)]
      np.testing.assert_array_equal(
          slices_op.inputs[0].op.inputs[0].op.data,
          np.arange(10).reshape(2, 5),
      )
  
imports: import numpy
  import pytest
  from ....config import option_context
  from ....core import tile
  from ...base.broadcast_to import TensorBroadcastTo
  from ...datasource import ones, tensor, array, empty
  from ...datasource.ones import TensorOnes
  from ...merge.concatenate import TensorConcatenate
  from ..None import choose, unravel_index, nonzero, compress, fill_diagonal
  from ..setitem import TensorIndexSetValue
label_desc: Use image node_id 10 for calling a global function with example usage: test_setitem_structured() without return types