code: def mangle_mako_loop(node, printer):
      
      loop_variable = LoopVariable()
      node.accept_visitor(loop_variable)
      if loop_variable.detected:
          node.nodes[-1].has_loop_context = True
          match = _FOR_LOOP.match(node.text)
          if match:
              printer.writelines(
                      'loop = __M_loop._enter(%s)' % match.group(2),
                      'try:'
                      #'with __M_loop(%s) as loop:' % match.group(2)
              )
              text = 'for %s in loop:' % match.group(1)
          else:
              raise SyntaxError("Couldn't apply loop context: %s" % node.text)
      else:
          text = node.text
      return text
docs: converts a for loop into a context manager wrapped around a for loop
      when access to the `loop` variable has been detected in the for loop body