code: def test_color_gradient(
      size,
      p1,
      p2,
      vector,
      radius,
      color_1,
      color_2,
      shape,
      offset,
      expected_result,
  ):
      if isinstance(expected_result, np.ndarray):
          result = color_gradient(
              size,
              p1,
              p2=p2,
              vector=vector,
              radius=radius,
              color_1=color_1,
              color_2=color_2,
              shape=shape,
              offset=offset,
          )
  
          assert expected_result.shape == result.shape
          assert np.array_equal(result, expected_result)
  
          if shape == "radial":
              circle_result = circle(
                  size,
                  p1,
                  radius,
                  color=color_1,
                  bg_color=color_2,
              )
              assert np.array_equal(result, circle_result)
      else:
          if isinstance(expected_result, (list, tuple)):
              expected_error, expected_message = expected_result
          else:
              expected_error, expected_message = (expected_result, None)
  
          with pytest.raises(expected_error) as exc:
              color_gradient(
                  size,
                  p1,
                  p2=p2,
                  vector=vector,
                  radius=radius,
                  color_1=color_1,
                  color_2=color_2,
                  shape=shape,
                  offset=offset,
              )
          if expected_message is not None:
              assert str(exc.value) == expected_message
  
imports: import importlib
  import math
  import os
  import shutil
  import sys
  import numpy
  import pytest
  from moviepy.audio.AudioClip import AudioClip, CompositeAudioClip
  from moviepy.audio.fx.multiply_volume import multiply_volume
  from moviepy.audio.tools.cuts import find_audio_period
  from moviepy.video.compositing.concatenate import concatenate_videoclips
  from moviepy.video.fx.loop import loop
  from moviepy.video.fx.time_mirror import time_mirror
  from moviepy.video.io.VideoFileClip import VideoFileClip
  from moviepy.video.tools.credits import CreditsClip
  from moviepy.video.tools.cuts import FramesMatch, FramesMatches, detect_scenes, find_video_period
  from moviepy.video.tools.drawing import circle, color_gradient, color_split
  from moviepy.video.tools.interpolators import Interpolator, Trajectory
  from moviepy.video.VideoClip import BitmapClip, ColorClip, ImageClip, VideoClip
label_desc: Use image node_id 10 for calling a global function with example usage: test_color_gradient(size, p1, p2, vector, radius, color_1, color_2, shape, offset, expected_result) without return types