code: def test_rotation_flag_metadata(test_images, tmp_path):
      with iio.imopen(
          tmp_path / "test.mp4", "w", plugin="pyav"
      ) as file:
          file.init_video_stream("libx264")
          file.container_metadata[
              "comment"
          ] = "This video has a rotation flag."
          file.video_stream_metadata["rotate"] = "90"
  
          for _ in range(5):
              for frame in iio.imiter(
                  test_images / "newtonscradle.gif"
              ):
                  file.write_frame(frame)
  
      if AV_VERSION >= (10, 0, 0):
          pytest.xfail(
              "PyAV >= 10.0.0 doesn't extract the rotation flag."
          )
      else:
          meta = iio.immeta(tmp_path / "test.mp4", plugin="pyav")
          assert meta["comment"] == "This video has a rotation flag."
          assert meta["rotate"] == "90"
  
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 26 for calling a global function with example usage: test_rotation_flag_metadata(test_images, tmp_path) without return types