code: def test_loop(util, video):
      clip = BitmapClip([["R"], ["G"], ["B"]], fps=1)
  
      clip1 = loop(clip, n=2)  # loop 2 times
      target1 = BitmapClip(
          [["R"], ["G"], ["B"], ["R"], ["G"], ["B"]], fps=1
      )
      assert clip1 == target1
  
      clip2 = loop(clip, duration=8)  # loop 8 seconds
      target2 = BitmapClip(
          [["R"], ["G"], ["B"], ["R"], ["G"], ["B"], ["R"], ["G"]],
          fps=1,
      )
      assert clip2 == target2
  
      clip3 = loop(clip).with_duration(5)  # infinite loop
      target3 = BitmapClip([["R"], ["G"], ["B"], ["R"], ["G"]], fps=1)
      assert clip3 == target3
  
      clip = video(start_time=0.2, end_time=0.3)  # 0.1 seconds long
      clip1 = loop(clip).with_duration(0.5)  # infinite looping
      clip1.write_videofile(os.path.join(util.TMP_DIR, "loop1.webm"))
  
      clip2 = loop(clip, duration=0.5)  # loop for 1 second
      clip2.write_videofile(os.path.join(util.TMP_DIR, "loop2.webm"))
  
      clip3 = loop(clip, n=3)  # loop 3 times
      clip3.write_videofile(os.path.join(util.TMP_DIR, "loop3.webm"))
  
      # Test audio looping
      clip = AudioClip(
          lambda t: np.sin(440 * 2 * np.pi * t) * (t % 1) + 0.5,
          duration=2.5,
          fps=44100,
      )
      clip1 = clip.loop(2)
  
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 13 for calling a global function with example usage: test_loop(util, video) without return types