code: def test_data_to_sprite():
      # Simulate data and turn into sprite
      data = np.zeros([8, 8, 8])
      data[2:6, 2:6, 2:6] = 1
      sprite = html_stat_map._data_to_sprite(data)
  
      # Generate ground truth for the sprite
      Z = np.zeros([8, 8])
      Zr = np.zeros([2, 8])
      Cr = np.tile(np.array([[0, 0, 1, 1, 1, 1, 0, 0]]), [4, 1])
      C = np.concatenate((Zr, Cr, Zr), axis=0)
      gtruth = np.concatenate(
          (
              np.concatenate((Z, Z, C), axis=1),
              np.concatenate((C, C, C), axis=1),
              np.concatenate((Z, Z, Z), axis=1),
          ),
          axis=0,
      )
  
      assert (
          sprite.shape == gtruth.shape
      ), "shape of sprite not as expected"
      assert (
          sprite == gtruth
      ).all(), "simulated sprite not as expected"
  
imports: import base64
  import warnings
  from io import BytesIO
  import numpy
  import pytest
  from matplotlib import pyplot
  from nibabel import Nifti1Image
  from nilearn import datasets, image
  from nilearn.image import get_data, new_img_like
  from nilearn.plotting import html_stat_map
  from ..js_plotting_utils import colorscale
label_desc: Use image node_id 4 for calling a global function with example usage: test_data_to_sprite() without return types