code: def test_gl_context():
      # Render triangle
      gl.glClear(gl.GL_COLOR_BUFFER_BIT)
      gl.glBegin(gl.GL_TRIANGLES)
      gl.glColor3f(1, 0, 0)
      gl.glVertex2f(0, 1)
  
      gl.glColor3f(0, 1, 0)
      gl.glVertex2f(-1, -1)
  
      gl.glColor3f(0, 0, 1)
      gl.glVertex2f(1, -1)
      gl.glEnd()
  
      # Read result
      img_buf = gl.glReadPixels(
          0, 0, WIDTH, HEIGHT, gl.GL_RGB, gl.GL_UNSIGNED_BYTE
      )
      img = np.frombuffer(img_buf, np.uint8).reshape(HEIGHT, WIDTH, 3)[
          ::-1
      ]
  
      assert all(img[0, 0] == 0)  # black corner
      assert all(img[0, -1] == 0)  # black corner
      assert img[10, WIDTH // 2].argmax() == 0  # red corner
      assert img[-1, 10].argmax() == 1  # green corner
      assert img[-1, -10].argmax() == 2
  
imports: from __future__ import absolute_import, division, print_function
  import pytest
  import os
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: test_gl_context() without return types