code: def test_video_format_to_dtype():
      # technically not fake, but mostly hwaccel formats which are unsupported in
      # pyAV at the time of writing (2022/03/06). PyAV can instantiate them, but
      # they have no components. Therefore we can't deduce an appropriate dtype
      # from these so we have to raise instead.
      fake_formats = [
          "vdpau",
          "dxva2_vld",
          "vaapi_moco",
          "drm_prime",
          "mediacodec",
          "qsv",
          "mmal",
          "vulkan",
          "vaapi_vld",
          "d3d11",
          "d3d11va_vld",
          "videotoolbox_vld",
          "vaapi",
          "vaapi_idct",
          "opencl",
          "cuda",
          "xvmc",
      ]
  
      for name in video_format_names:
          format = av.VideoFormat(name)
  
          if name in fake_formats:
              # should fail
              with pytest.raises(ValueError):
                  _format_to_dtype(format)
          else:
              # should succseed
              _format_to_dtype(format)
  
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 6 for calling a global function with example usage: test_video_format_to_dtype() without return types