code: def test_multi_block_clean(rectilinear, uniform, ant):
      # now test a clean of the null values
      multi = MultiBlock()
      multi.n_blocks = 6
      multi[1] = rectilinear
      multi.set_block_name(1, "rect")
      multi[2] = PolyData()
      multi.set_block_name(2, "empty")
      multi[3] = MultiBlock()
      multi.set_block_name(3, "mempty")
      multi[5] = uniform
      multi.set_block_name(5, "uni")
      # perform the clean to remove all Null elements
      multi.clean()
      assert multi.n_blocks == 2
      assert multi.GetNumberOfBlocks() == 2
      assert isinstance(multi[0], RectilinearGrid)
      assert isinstance(multi[1], ImageData)
      assert multi.get_block_name(0) == "rect"
      assert multi.get_block_name(1) == "uni"
      # Test a nested data struct
      foo = MultiBlock()
      foo.n_blocks = 4
      foo[3] = ant
      assert foo.n_blocks == 4
      multi = MultiBlock()
      multi.n_blocks = 6
      multi[1] = rectilinear
      multi.set_block_name(1, "rect")
      multi[5] = foo
      multi.set_block_name(5, "multi")
      # perform the clean to remove all Null elements
      assert multi.n_blocks == 6
      multi.clean()
      assert multi.n_blocks == 2
      assert multi.GetNumberOfBlocks() == 2
      assert isinstance(multi[0], RectilinearGrid)
      assert isinstance(multi[1], MultiBlock)
      assert multi.get_block_name(0) == "rect"
      assert multi.get_block_name(1) == "multi"
      assert foo.n_blocks == 1
  
imports: import pathlib
  import platform
  import weakref
  import numpy
  import pytest
  import vtk
  import pyvista
  from pyvista import ImageData, MultiBlock, PolyData, RectilinearGrid, StructuredGrid, examples
label_desc: Use image node_id 15 for calling a global function with example usage: test_multi_block_clean(rectilinear, uniform, ant) without return types