code: def test_rotate(
      PIL_installed,
      angle_offset,
      angle,
      unit,
      resample,
      translate,
      center,
      bg_color,
      expected_frames,
      monkeypatch,
  ):
      """Check ``rotate`` FX behaviour against possible combinations of arguments."""
      original_frames = [
          ["AAAA", "BBBB", "CCCC"],
          ["ABCD", "BCDE", "CDEA"],
      ]
  
      # angles are defined in degrees, so convert to radians testing ``unit="rad"``
      if unit == "rad":
          if hasattr(angle, "__call__"):
              _angle = lambda t: math.radians(angle(0))
          else:
              _angle = math.radians(angle)
      else:
          _angle = angle
      clip = BitmapClip(original_frames, fps=1)
  
      kwargs = {
          "unit": unit,
          "resample": resample,
          "translate": translate,
          "center": center,
          "bg_color": bg_color,
      }
      if resample not in ["bilinear", "nearest", "bicubic"]:
          with pytest.raises(ValueError) as exc:
              clip.rotate(_angle, **kwargs)
          assert (
              "'resample' argument must be either 'bilinear', 'nearest' or 'bicubic'"
          ) == str(exc.value)
          return
  
      # if the scenario implies that PIL is not installed, monkeypatch the
      # module in which 'rotate' function resides
      if not PIL_installed:
          rotate_module = importlib.import_module(
              "moviepy.video.fx.rotate"
          )
          monkeypatch.setattr(rotate_module, "Image", None)
          rotate_func = rotate_module.rotate
      else:
          rotate_func = rotate
  
      # resolve the angle, because if it is a multiple of 90, the rotation
      # can be computed event without an available PIL installation
      if hasattr(_angle, "__call__"):
          _resolved_angle = _angle(0)
      else:
          _resolved_angle = _angle
      if unit == "rad":
          _resolved_angle = math.degrees(_resolved_angle)
  
      if not PIL_installed and (
          (_resolved_angle % 90 != 0) or center or translate or bg_color
      ):
          with pytest.raises(ValueError) as exc:
              rotated_clip = clip.fx(rotate_func, _angle, **kwargs)
  
          assert (
              'Without "Pillow" installed, only angles that are a multiple of 90'
          ) in str(exc.value)
  
      else:
          rotated_clip = clip.fx(rotate_func, _angle, **kwargs)
          expected_clip = BitmapClip(expected_frames, fps=1)
  
          assert rotated_clip.to_bitmap() == expected_clip.to_bitmap()
  
imports: import decimal
  import importlib
  import math
  import numbers
  import os
  import random
  import sys
  import numpy
  import pytest
  from moviepy import AudioClip, AudioFileClip, BitmapClip, ColorClip, VideoClip, VideoFileClip
  from moviepy.audio.fx import audio_delay, audio_fadein, audio_fadeout, audio_normalize, multiply_stereo_volume, multiply_volume
  from moviepy.tools import convert_to_seconds
  from moviepy.video.fx import blackwhite, crop, even_size, fadein, fadeout, freeze, freeze_region, invert_colors, loop, lum_contrast, make_loopable, margin, mask_and, mask_or, mirror_x, mirror_y, multiply_color, multiply_speed, resize, rotate, time_mirror, time_symmetrize
label_desc: Use image node_id 24 for calling a global function with example usage: test_rotate(PIL_installed, angle_offset, angle, unit, resample, translate, center, bg_color, expected_frames, monkeypatch) without return types