parameters: (cxxthing, namespaces)
return_statement: return outerns
docstring: |namespaces| is in order [ outer, ..., inner ]
docstring_summary: |namespaces| is in order [ outer, ..., inner ]
docstring_tokens: |namespaces| is in order [ outer ... inner ]
function: def _putInNamespaces(cxxthing, namespaces):
      """|namespaces| is in order [ outer, ..., inner ]"""
      if 0 == len(namespaces):  return cxxthing
  
      outerns = Namespace(namespaces[0].name)
      innerns = outerns
      for ns in namespaces[1:]:
          newns = Namespace(ns.name)
          innerns.addstmt(newns)
          innerns = newns
      innerns.addstmt(cxxthing)
      return outerns
function_tokens: def _putInNamespaces ( cxxthing , namespaces ) : if 0 == len ( namespaces ) : return cxxthing outerns = Namespace ( namespaces [ 0 ] . name ) innerns = outerns for ns in namespaces [ 1 : ] : newns = Namespace ( ns . name ) innerns . addstmt ( newns ) innerns = newns innerns . addstmt ( cxxthing ) return outerns