code: def test_array_xd_with_none():
      # Fixed shape
      features = datasets.Features(
          {"foo": datasets.Array2D(dtype="int32", shape=(2, 2))}
      )
      dummy_array = np.array([[1, 2], [3, 4]], dtype="int32")
      dataset = datasets.Dataset.from_dict(
          {"foo": [dummy_array, None, dummy_array, None]},
          features=features,
      )
      arr = NumpyArrowExtractor().extract_column(dataset._data)
      assert (
          isinstance(arr, np.ndarray)
          and arr.dtype == np.float64
          and arr.shape == (4, 2, 2)
      )
      assert np.allclose(arr[0], dummy_array) and np.allclose(
          arr[2], dummy_array
      )
      assert np.all(np.isnan(arr[1])) and np.all(
          np.isnan(arr[3])
      )  # broadcasted np.nan - use np.all
  
      # Dynamic shape
      features = datasets.Features(
          {"foo": datasets.Array2D(dtype="int32", shape=(None, 2))}
      )
      dummy_array = np.array([[1, 2], [3, 4]], dtype="int32")
      dataset = datasets.Dataset.from_dict(
          {"foo": [dummy_array, None, dummy_array, None]},
          features=features,
      )
      arr = NumpyArrowExtractor().extract_column(dataset._data)
      assert (
          isinstance(arr, np.ndarray)
          and arr.dtype == object
          and arr.shape == (4,)
      )
      np.testing.assert_equal(arr[0], dummy_array)
      np.testing.assert_equal(arr[2], dummy_array)
      assert np.isnan(arr[1]) and np.isnan(arr[3])
  
imports: import os
  import random
  import tempfile
  import unittest
  import numpy
  import pandas
  import pyarrow
  import pytest
  from absl.testing import parameterized
  import datasets
  from datasets.arrow_writer import ArrowWriter
  from datasets.features import Array2D, Array3D, Array4D, Array5D, Value
  from datasets.features.features import Array3DExtensionType, PandasArrayExtensionDtype, _ArrayXD
  from datasets.formatting.formatting import NumpyArrowExtractor, SimpleArrowExtractor
label_desc: Use image node_id 5 for calling a global function with example usage: test_array_xd_with_none() without return types