code: def test_capability():
      """Test application capability enumeration"""
      non_default_vals = dict(
          title="foo",
          size=[100, 100],
          position=[0, 0],
          show=True,
          decorate=False,
          resizable=False,
          vsync=True,
      )  # context is tested elsewhere
      good_kwargs = dict()
      bad_kwargs = dict()
      with Canvas() as c:
          for key, val in c.app.backend_module.capability.items():
              if key in non_default_vals:
                  if val:
                      good_kwargs[key] = non_default_vals[key]
                  else:
                      bad_kwargs[key] = non_default_vals[key]
      # bug on 3.3.1
      # https://github.com/glfw/glfw/issues/1620
      if (
          c.app.backend_name == "Glfw"
          and c.app.backend_module.glfw.__version__ == (3, 3, 1)
      ):
          good_kwargs.pop("decorate")
      # ensure all settable values can be set
      with Canvas(**good_kwargs):
          # some of these are hard to test, and the ones that are easy are
          # tested elsewhere, so let's just make sure it runs here
          pass
      # ensure that *any* bad argument gets caught
      for key, val in bad_kwargs.items():
          assert_raises(RuntimeError, Canvas, **{key: val})
  
imports: import sys
  from collections import namedtuple
  from io import StringIO
  from time import sleep
  import gc
  import numpy
  from numpy.testing import assert_array_equal
  import pytest
  from vispy.app import use_app, Canvas, Timer, MouseEvent, KeyEvent
  from vispy.app.base import BaseApplicationBackend
  from vispy.testing import requires_application, SkipTest, assert_is, assert_in, run_tests_if_main, assert_equal, assert_true, assert_raises, IS_TRAVIS_CI
  from vispy.util import keys, use_log_level
  from vispy.gloo.program import Program, VertexBuffer, IndexBuffer
  from vispy.gloo.util import _screenshot
  from vispy.gloo import gl
label_desc: Use image node_id 6 for calling a global function with example usage: test_capability() without return types