code: def test_set_alpha_for_array():
      art = martist.Artist()
      with pytest.raises(
          TypeError, match="^alpha must be numeric or None"
      ):
          art._set_alpha_for_array("string")
      with pytest.raises(ValueError, match="outside 0-1 range"):
          art._set_alpha_for_array(1.1)
      with pytest.raises(ValueError, match="outside 0-1 range"):
          art._set_alpha_for_array(np.nan)
      with pytest.raises(
          ValueError, match="alpha must be between 0 and 1"
      ):
          art._set_alpha_for_array([0.5, 1.1])
      with pytest.raises(
          ValueError, match="alpha must be between 0 and 1"
      ):
          art._set_alpha_for_array([0.5, np.nan])
  
imports: import io
  from itertools import chain
  import numpy
  import pytest
  import matplotlib.colors
  import matplotlib.pyplot
  import matplotlib.patches
  import matplotlib.lines
  import matplotlib.path
  import matplotlib.transforms
  import matplotlib.collections
  import matplotlib.artist
  import matplotlib.backend_bases
  import matplotlib
  from matplotlib.testing.decorators import check_figures_equal, image_comparison
label_desc: Use image node_id 15 for calling a global function with example usage: test_set_alpha_for_array() without return types