nodes: 0, module; 1, function_definition; 2, function_name:followingPrefix; 3, parameters; 4, block; 5, identifier:prefix; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, while_statement; 10, if_statement; 11, expression_statement; 12, expression_statement; 13, return_statement; 14, comment:"""Returns a String that sorts just after all Strings beginning with a prefix"""; 15, assignment; 16, assignment; 17, parenthesized_expression; 18, block; 19, parenthesized_expression; 20, block; 21, assignment; 22, assignment; 23, call; 24, identifier:prefixBytes; 25, call; 26, identifier:changeIndex; 27, binary_operator:len(prefixBytes) - 1; 28, boolean_operator; 29, expression_statement; 30, comparison_operator:changeIndex < 0; 31, return_statement; 32, identifier:newBytes; 33, call; 34, subscript; 35, binary_operator:newBytes[changeIndex] + 1; 36, attribute; 37, argument_list; 38, identifier:array; 39, argument_list; 40, call; 41, integer:1; 42, comparison_operator:changeIndex >= 0; 43, comparison_operator:prefixBytes[changeIndex] == 0xff; 44, assignment; 45, identifier:changeIndex; 46, integer:0; 47, None; 48, identifier:array; 49, argument_list; 50, identifier:newBytes; 51, identifier:changeIndex; 52, subscript; 53, integer:1; 54, identifier:newBytes; 55, identifier:tostring; 56, string; 57, identifier:prefix; 58, identifier:len; 59, argument_list; 60, identifier:changeIndex; 61, integer:0; 62, subscript; 63, integer:0xff; 64, identifier:changeIndex; 65, binary_operator:changeIndex - 1; 66, string; 67, subscript; 68, identifier:newBytes; 69, identifier:changeIndex; 70, string_content:B; 71, identifier:prefixBytes; 72, identifier:prefixBytes; 73, identifier:changeIndex; 74, identifier:changeIndex; 75, integer:1; 76, string_content:B; 77, identifier:prefix; 78, slice; 79, integer:0; 80, binary_operator:changeIndex + 1; 81, identifier:changeIndex; 82, integer:1
code: def followingPrefix(prefix):
          """Returns a String that sorts just after all Strings beginning with a prefix"""
          prefixBytes = array('B', prefix)
  
          changeIndex = len(prefixBytes) - 1
          while (changeIndex >= 0 and prefixBytes[changeIndex] == 0xff ):
              changeIndex = changeIndex - 1;
          if(changeIndex < 0):
              return None
          newBytes = array('B', prefix[0:changeIndex + 1])
          newBytes[changeIndex] = newBytes[changeIndex] + 1
          return newBytes.tostring()