code: def test_close_keys():
      """Test close keys"""
      c = Canvas(keys="interactive")
      x = list()
  
      @c.events.close.connect
      def closer(event):
          x.append("done")
  
      c.events.key_press(key=keys.ESCAPE, text="", modifiers=[])
      assert_equal(len(x), 1)  # ensure the close event was sent
      c.app.process_events()
  
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 9 for calling a global function with example usage: test_close_keys() without return types