class_docstr: Compiler is used to convert Function and Variable instances into
  ready-to-use GLSL code. This class handles name mangling to ensure that
  there are no name collisions amongst global objects. The final name of
  each object may be retrieved using ``Compiler.__getitem__(obj)``.
  
  Accepts multiple root Functions as keyword arguments. ``compile()`` then
  returns a dict of GLSL strings with the same keys.
  
  Example::
  
      # initialize with two main functions
      compiler = Compiler(vert=v_func, frag=f_func)
  
      # compile and extract shaders
      code = compiler.compile()
      v_code = code['vert']
      f_code = code['frag']
  
      # look up name of some object
      name = compiler[obj]
docstr: Return True if *obj* should be declared in the global namespace.
  
  Some objects need to be declared only in per-shader namespaces:
  functions, static variables, and const variables may all be given
  different definitions in each shader.
code: def _is_global(self, obj):
      """Return True if *obj* should be declared in the global namespace.
  
      Some objects need to be declared only in per-shader namespaces:
      functions, static variables, and const variables may all be given
      different definitions in each shader.
      """
      # todo: right now we assume all Variables are global, and all
      # Functions are local. Is this actually correct? Are there any
      # global functions? Are there any local variables?
      from .variable import Variable
  
      return isinstance(obj, Variable)
  
file_path: vispy/vispy/visuals/shaders/compiler.py
imports: from __future__ import division
  from ...None import gloo
label_desc: Use image node_id 6 for calling the Compiler obj's underlying member method code with example usage: obj._is_global(obj) and returns: isinstance