code: def test_bayer_write():
      image_shape = (128, 128)
      image = np.zeros(image_shape, dtype="uint8")
      buffer = io.BytesIO()
  
      with iio.imopen(
          buffer, "w", plugin="pyav", extension=".mp4"
      ) as file:
          image[...] = 0
          for i in range(256):
              image[::2, ::2] = i
              file.write(
                  image,
                  is_batch=False,
                  codec="h264",
                  in_pixel_format="bayer_rggb8",
              )
  
          image[...] = 0
          for i in range(256):
              image[0::2, 1::2] = i
              image[1::2, 0::2] = i
              file.write(
                  image,
                  is_batch=False,
                  codec="h264",
                  in_pixel_format="bayer_rggb8",
              )
  
          image[...] = 0
          for i in range(256):
              image[1::2, 1::2] = i
              file.write(
                  image,
                  is_batch=False,
                  codec="h264",
                  in_pixel_format="bayer_rggb8",
              )
  
      buffer.seek(0)
      img = iio.imread(buffer, plugin="pyav")
      assert img.shape == (768, 128, 128, 3)
  
imports: import io
  import warnings
  from contextlib import ExitStack
  from pathlib import Path
  import numpy
  import pytest
  from conftest import IS_PYPY
  import imageio.v3
  from av.video.format import names
  from imageio.plugins.pyav import _format_to_dtype
label_desc: Use image node_id 20 for calling a global function with example usage: test_bayer_write() without return types