<commit_before>

from numpy import array

import pyglet
from pyglet.window import key, Window
try:
    import OpenGL
except ImportError:
    raise Exception('OpenGL pacakge needs to be isntalled to run this example')

from enthought.kiva.backend_gl import GraphicsContext
from enthought.kiva.constants import FILL, STROKE, FILL_STROKE

class TestWindow(Window):
    """ Press Q or Escape to exit
    """<commit_msg>Example now checks for pygarrayimage installation and exits if it's not present. However, the real problem seems to be in requiring it in Enable/enthought/kiva/backend_gl.py, but not provinding the package.<commit_after>

from numpy import array

import pyglet
from pyglet.window import key, Window
try:
    import OpenGL
except ImportError:
    raise Exception('OpenGL pacakge needs to be isntalled to run this example.')

try:
    from enthought.kiva.backend_gl import GraphicsContext
except ImportError:
    raise Exception('pygarrayimage needs to be installed to run this example.')
from enthought.kiva.constants import FILL, STROKE, FILL_STROKE

class TestWindow(Window):
    """ Press Q or Escape to exit
    """
{'fraction_non_alphanumeric': 0.06090026478375993, 'fraction_numerical': 0.0, 'mean_word_length': 4.6138613861386135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1329888', 'n_tokens_mistral': 334, 'n_tokens_neox': 331, 'n_words': 133}