class_docstr: Subclass that generates GLSL code to call Function list in order
  
  Functions may be called independently, or composed such that the
  output of each function provides the input to the next.
  
  Parameters
  ----------
  name : str
      The name of the generated function
  funcs : list of Functions
      The list of Functions that will be called by the generated GLSL code.
  
  Examples
  --------
  This creates a function chain::
  
      >>> func1 = Function('void my_func_1() {}')
      >>> func2 = Function('void my_func_2() {}')
      >>> chain = FunctionChain('my_func_chain', [func1, func2])
  
  If *chain* is included in a ModularProgram, it will generate the following
  output::
  
      void my_func_1() {}
      void my_func_2() {}
  
      void my_func_chain() {
          my_func_1();
          my_func_2();
      }
  
  The return type of the generated function is the same as the return type
  of the last function in the chain. Likewise, the arguments for the
  generated function are the same as the first function in the chain.
  
  If the return type is not 'void', then the return value of each function
  will be used to supply the first input argument of the next function in
  the chain. For example::
  
      vec3 my_func_1(vec3 input) {return input + vec3(1, 0, 0);}
      void my_func_2(vec3 input) {return input + vec3(0, 1, 0);}
  
      vec3 my_func_chain(vec3 input) {
          return my_func_2(my_func_1(input));
      }
class_docstr_tok: ["Subclass","that","generates","GLSL","code","to","call","Function","list","in","order","Functions","may","be","called","independently",",","or","composed","such","that","the","output","of","each","function","provides","the","input","to","the","next",".","Parameters","--","--","--","--","--","name",":","str","The","name","of","the","generated","function","funcs",":","list","of","Functions","The","list","of","Functions","that","will","be","called","by","the","generated","GLSL","code",".","Examples","--","--","--","--","This","creates","a","function","chain",":",":",">",">",">","func1","=","Function","(","'void","my_func_1","(",")","{","}","'",")",">",">",">","func2","=","Function","(","'void","my_func_2","(",")","{","}","'",")",">",">",">","chain","=","FunctionChain","(","'my_func_chain","'",",","[","func1",",","func2","]",")","If","*","chain","*","is","included","in","a","ModularProgram",",","it","will","generate","the","following","output",":",":","void","my_func_1","(",")","{","}","void","my_func_2","(",")","{","}","void","my_func_chain","(",")","{","my_func_1","(",")",";","my_func_2","(",")",";","}","The","return","type","of","the","generated","function","is","the","same","as","the","return","type","of","the","last","function","in","the","chain",".","Likewise",",","the","arguments","for","the","generated","function","are","the","same","as","the","first","function","in","the","chain",".","If","the","return","type","is","not","'void","'",",","then","the","return","value","of","each","function","will","be","used","to","supply","the","first","input","argument","of","the","next","function","in","the","chain",".","For","example",":",":","vec3","my_func_1","(","vec3","input",")","{","return","input","+","vec3","(","1",",","0",",","0",")",";","}","void","my_func_2","(","vec3","input",")","{","return","input","+","vec3","(","0",",","1",",","0",")",";","}","vec3","my_func_chain","(","vec3","input",")","{","return","my_func_2","(","my_func_1","(","input",")",")",";","}"]
docstr: Insert a new function into the chain at *index*.
docstr_tok: ["Insert","a","new","function","into","the","chain","at","*","index","*","."]
code: def insert(self, index, function, update=True):
      """Insert a new function into the chain at *index*."""
      self._funcs.insert(index, function)
      self._add_dep(function)
      if update:
          self._update()
  
imports: from collections import OrderedDict
  import logging
  import re
  import numpy
  from ...util.eq import eq
  from ...util import logger
  from .None import parsing
  from .shader_object import ShaderObject
  from .variable import Variable, Varying
  from .expression import TextExpression, FunctionCall
label_desc: Use image node_id 12 for calling the FunctionChain obj's underlying member method code with example usage: obj.insert(index, function, update) without return types