code: def _make_test_data(shape, input_dtype):
      data = np.random.random_sample(shape)
      if data.ndim == 3 and data.shape[-1] == 4:
          # RGBA - make alpha fully opaque
          data[..., -1] = 1.0
      max_val = max_for_dtype(input_dtype)
      if max_val != 1:
          data *= max_val
      data = data.astype(input_dtype)
      return data
  
file_path: vispy/vispy/visuals/tests/test_image.py
imports: from unittest import mock
  from vispy.scene import Image, PanZoomCamera
  from vispy.testing import requires_application, TestingCanvas, run_tests_if_main, IS_CI
  from vispy.testing.image_tester import assert_image_approved, downsample
  import numpy
  import pytest
  from vispy.testing.rendered_array_tester import compare_render, max_for_dtype
label_desc: Use image node_id 3 for calling a global function with example usage: _make_test_data(shape, input_dtype) and returns: data