code: def test_example2():
      """Demonstrate how a transform would work."""
      vert_template = Function(
          """
      void main(void)
      {
          gl_Position = $position;
      }
      """
      )
  
      transformScale = Function(
          """
      vec4 transform_scale(vec4 pos)
      {
          pos.xyz *= $scale;
          return pos;
      }
      """
      )
  
      class Transform(object):
          def __init__(self):
              # Equivalent methods to create new function object
              self.func = Function(transformScale)
              self.func["scale"] = "uniform float"
              # self.func = Function(transformScale)
  
          def set_scale(self, scale):
              self.func["scale"].value = scale
  
      transforms = [Transform(), Transform(), Transform()]
  
      code = Function(vert_template)
      ob = Variable("attribute vec3 a_position")
      for trans in transforms:
          ob = trans.func(ob)
      code["position"] = ob
      print(code)
  
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 2 for calling a global function with example usage: test_example2() without return types