code: def test_metadata(test_images: Path):
      with iio.imopen(
          str(test_images / "cockatoo.mp4"), "r", plugin="pyav"
      ) as plugin:
          if AV_VERSION >= (10, 0, 0):
              with warnings.catch_warnings(record=True):
                  meta = plugin.metadata()
          else:
              meta = plugin.metadata()
  
          assert meta["profile"] == "High 4:4:4 Predictive"
          assert meta["codec"] == "h264"
          assert meta["encoder"] == "Lavf56.4.101"
          assert meta["duration"] == 14
          assert meta["fps"] == 20.0
  
          if AV_VERSION >= (10, 0, 0):
              with warnings.catch_warnings(record=True):
                  meta = plugin.metadata(index=4)
          else:
              meta = plugin.metadata(index=4)
  
          assert meta["time"] == 0.2
          assert meta["key_frame"] is False
  
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 4 for calling a global function with example usage: test_metadata(test_images) without return types