nodes: 0, module; 1, function_definition; 2, function_name:merge; 3, parameters; 4, block; 5, identifier:filehandle_1; 6, identifier:filehandle_2; 7, identifier:output_filehandle; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, while_statement; 12, comment:"""Merges together two files maintaining sorted order.
      """; 13, assignment; 14, identifier:line1; 15, call; 16, block; 17, comparison_operator:line2 != ''; 18, block; 19, identifier:line2; 20, call; 21, attribute; 22, argument_list; 23, while_statement; 24, expression_statement; 25, identifier:line2; 26, string; 27, expression_statement; 28, expression_statement; 29, attribute; 30, argument_list; 31, identifier:filehandle_1; 32, identifier:readlines; 33, boolean_operator; 34, block; 35, call; 36, call; 37, assignment; 38, identifier:filehandle_2; 39, identifier:readline; 40, comparison_operator:line2 != ''; 41, comparison_operator:line2 <= line1; 42, expression_statement; 43, expression_statement; 44, attribute; 45, argument_list; 46, attribute; 47, argument_list; 48, identifier:line2; 49, call; 50, identifier:line2; 51, string; 52, identifier:line2; 53, identifier:line1; 54, call; 55, assignment; 56, identifier:output_filehandle; 57, identifier:write; 58, identifier:line1; 59, identifier:output_filehandle; 60, identifier:write; 61, identifier:line2; 62, attribute; 63, argument_list; 64, attribute; 65, argument_list; 66, identifier:line2; 67, call; 68, identifier:filehandle_2; 69, identifier:readline; 70, identifier:output_filehandle; 71, identifier:write; 72, identifier:line2; 73, attribute; 74, argument_list; 75, identifier:filehandle_2; 76, identifier:readline
code: def merge(filehandle_1, filehandle_2, output_filehandle):
      """Merges together two files maintaining sorted order.
      """
      line2 = filehandle_2.readline()
      for line1 in filehandle_1.readlines():
          while line2 != '' and line2 <= line1:
              output_filehandle.write(line2)
              line2 = filehandle_2.readline()
          output_filehandle.write(line1)
      while line2 != '':
          output_filehandle.write(line2)
          line2 = filehandle_2.readline()