code: def test_set_active_scalars_mixed(multiblock_poly):
      for block in multiblock_poly:
          block.clear_data()
          block.point_data.set_array(range(block.n_points), "data")
          block.cell_data.set_array(range(block.n_cells), "data")
  
      # remove data from the last block
      del multiblock_poly[-1].point_data["data"]
      del multiblock_poly[-1].cell_data["data"]
  
      multiblock_poly.set_active_scalars(
          "data", preference="cell", allow_missing=True
      )
  
      for block in multiblock_poly:
          if "data" in block.cell_data:
              assert block.cell_data.active_scalars_name == "data"
  
      multiblock_poly.set_active_scalars(
          "data", preference="point", allow_missing=True
      )
  
      for block in multiblock_poly:
          if "data" in block.point_data:
              assert block.point_data.active_scalars_name == "data"
  
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 38 for calling a global function with example usage: test_set_active_scalars_mixed(multiblock_poly) without return types