code: def set_current_canvas(canvas):
      """Make a canvas active. Used primarily by the canvas itself."""
      # Notify glir
      canvas.context._do_CURRENT_command = True
      # Try to be quick
      if canvasses and canvasses[-1]() is canvas:
          return
      # Make this the current
      cc = [c() for c in canvasses if c() is not None]
      while canvas in cc:
          cc.remove(canvas)
      cc.append(canvas)
      canvasses[:] = [weakref.ref(c) for c in cc]
  
imports: from copy import deepcopy
  import weakref
  from .glir import GlirQueue, BaseGlirParser, GlirParser, glir_logger
  from .wrappers import BaseGlooFunctions
  from ..None import config
label_desc: Use image node_id 3 for calling a global function with example usage: set_current_canvas(canvas) without return types