class_docstr: Makes a copy of a template tree while doing substitutions.
  
  A dictionary "substitutions" should be passed in when calling
  the transform; mapping names to replacement nodes. Then replacement
  happens like this:
   - If an ExprStatNode contains a single NameNode, whose name is
     a key in the substitutions dictionary, the ExprStatNode is
     replaced with a copy of the tree given in the dictionary.
     It is the responsibility of the caller that the replacement
     node is a valid statement.
   - If a single NameNode is otherwise encountered, it is replaced
     if its name is listed in the substitutions dictionary in the
     same way. It is the responsibility of the caller to make sure
     that the replacement nodes is a valid expression.
  
  Also a list "temps" should be passed. Any names listed will
  be transformed into anonymous, temporary names.
  
  Currently supported for tempnames is:
  NameNode
  (various function and class definition nodes etc. should be added to this)
  
  Each replacement node gets the position of the substituted node
  recursively applied to every member node.
class_docstr_tok: ["Makes","a","copy","of","a","template","tree","while","doing","substitutions",".","A","dictionary","``","substitutions","''","should","be","passed","in","when","calling","the","transform",";","mapping","names","to","replacement","nodes",".","Then","replacement","happens","like","this",":","-","If","an","ExprStatNode","contains","a","single","NameNode",",","whose","name","is","a","key","in","the","substitutions","dictionary",",","the","ExprStatNode","is","replaced","with","a","copy","of","the","tree","given","in","the","dictionary",".","It","is","the","responsibility","of","the","caller","that","the","replacement","node","is","a","valid","statement",".","-","If","a","single","NameNode","is","otherwise","encountered",",","it","is","replaced","if","its","name","is","listed","in","the","substitutions","dictionary","in","the","same","way",".","It","is","the","responsibility","of","the","caller","to","make","sure","that","the","replacement","nodes","is","a","valid","expression",".","Also","a","list","``","temps","''","should","be","passed",".","Any","names","listed","will","be","transformed","into","anonymous",",","temporary","names",".","Currently","supported","for","tempnames","is",":","NameNode","(","various","function","and","class","definition","nodes","etc",".","should","be","added","to","this",")","Each","replacement","node","gets","the","position","of","the","substituted","node","recursively","applied","to","every","member","node","."]
code: def __call__(self, node, substitutions, temps, pos):
      self.substitutions = substitutions
      self.pos = pos
      tempmap = {}
      temphandles = []
      for temp in temps:
          TemplateTransform.temp_name_counter += 1
          handle = UtilNodes.TempHandle(PyrexTypes.py_object_type)
          tempmap[temp] = handle
          temphandles.append(handle)
      self.tempmap = tempmap
      result = super(TemplateTransform, self).__call__(node)
      if temps:
          result = UtilNodes.TempsBlockNode(
              self.get_pos(node), temps=temphandles, body=result
          )
      return result
  
imports: from __future__ import absolute_import
  import re
  from io import StringIO
  from .Scanning import PyrexScanner, StringSourceDescriptor
  from .Symtab import ModuleScope
  from .None import PyrexTypes
  from .Visitor import VisitorTransform
  from .Nodes import Node, StatListNode
  from .ExprNodes import NameNode
  from .StringEncoding import _unicode
  from .None import Parsing
  from .None import Main
  from .None import UtilNodes
label_desc: Use image node_id 1 for calling the TemplateTransform obj's underlying member method code with example usage: obj.__call__(node, substitutions, temps, pos) and returns: result