code: def test_MainFunction():
      code = """
      const float pi = 3.0;  // close enough.
      
      vec4 rotate(vec4 pos) {
          return pos;  // just kidding.
      }
      
      attribute mat4 m_transform;
      attribute vec4 a_pos;
      void main() {
          gl_Position = m_transform * a_pos;
      }
      """
  
      mf = MainFunction("vertex", code)
  
      assert mf.name == "main"
      assert mf.rtype == "void"
      assert len(mf.args) == 0
      sn = set(mf.static_names())
      assert sn == set(["pi", "rotate", "pos", "m_transform", "a_pos"])
  
file_path: vispy/vispy/visuals/shaders/tests/test_function.py
imports: from vispy.visuals.shaders import Function, MainFunction, Variable, Varying, FunctionChain, StatementList
  from vispy.visuals.shaders.expression import FunctionCall, TextExpression
  from vispy.testing import assert_in, assert_not_in, assert_is, run_tests_if_main, assert_raises, assert_equal
label_desc: Use image node_id 10 for calling a global function with example usage: test_MainFunction() without return types