nodes: 0, module; 1, function_definition; 2, function_name:incrementName; 3, parameters; 4, block; 5, identifier:nameList; 6, identifier:name; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:"""
      return a name that is unique in a given nameList through
      attaching a number to it
  
      >>> l = []
  
      now we will add 3xfoo 2xbar and one klaus to our list:
  
      >>> l.append( incrementName(l,'foo') )
      >>> l.append( incrementName(l,'bar') )
      >>> l.append( incrementName(l,'foo') )
      >>> l.append( incrementName(l,'foo') )
      >>> l.append( incrementName(l,'bar') )
      >>> l.append( incrementName(l,'klaus') )
  
      >>> print sorted(l)
      ['bar', 'bar2', 'foo', 'foo2', 'foo3', 'klaus']
      """; 13, comparison_operator:name not in nameList; 14, block; 15, assignment; 16, identifier:n; 17, call; 18, block; 19, identifier:newName; 20, identifier:name; 21, identifier:nameList; 22, return_statement; 23, identifier:newName; 24, binary_operator:name + str(1); 25, identifier:range; 26, argument_list; 27, expression_statement; 28, for_statement; 29, if_statement; 30, identifier:name; 31, identifier:name; 32, call; 33, integer:1; 34, binary_operator:len(nameList) + 2; 35, assignment; 36, identifier:b; 37, identifier:nameList; 38, block; 39, not_operator; 40, block; 41, identifier:str; 42, argument_list; 43, call; 44, integer:2; 45, identifier:found; 46, False; 47, expression_statement; 48, if_statement; 49, identifier:found; 50, break_statement; 51, integer:1; 52, identifier:len; 53, argument_list; 54, assignment; 55, comparison_operator:b == newName; 56, block; 57, identifier:nameList; 58, identifier:newName; 59, binary_operator:name + str(n); 60, identifier:b; 61, identifier:newName; 62, expression_statement; 63, identifier:name; 64, call; 65, assignment; 66, identifier:str; 67, argument_list; 68, identifier:found; 69, True; 70, identifier:n
code: def incrementName(nameList, name):
      """
      return a name that is unique in a given nameList through
      attaching a number to it
  
      >>> l = []
  
      now we will add 3xfoo 2xbar and one klaus to our list:
  
      >>> l.append( incrementName(l,'foo') )
      >>> l.append( incrementName(l,'bar') )
      >>> l.append( incrementName(l,'foo') )
      >>> l.append( incrementName(l,'foo') )
      >>> l.append( incrementName(l,'bar') )
      >>> l.append( incrementName(l,'klaus') )
  
      >>> print sorted(l)
      ['bar', 'bar2', 'foo', 'foo2', 'foo3', 'klaus']
      """
      if name not in nameList:
          return name
      newName = name + str(1)
      for n in range(1, len(nameList) + 2):
          found = False
          for b in nameList:
              newName = name + str(n)
              if b == newName:
                  found = True
          if not found:
              break
      return newName