nodes: 0, module; 1, function_definition; 2, function_name:_split; 3, parameters; 4, block; 5, identifier:self; 6, identifier:iterator; 7, identifier:tmp_dir; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:"""
          Splits the file into several chunks.
  
          If the original file is too big to fit in the allocated space, the sorting will be split into several chunks,
          then merged.
          :param tmp_dir: Where to put the intermediate sorted results.
          :param orig_lines: The lines read before running out of space.
          :return: The names of the intermediate files.
          """; 13, assignment; 14, pattern_list; 15, call; 16, block; 17, identifier:fnames; 18, identifier:fnames; 19, list; 20, identifier:i; 21, identifier:lines; 22, identifier:enumerate; 23, argument_list; 24, expression_statement; 25, expression_statement; 26, expression_statement; 27, expression_statement; 28, if_statement; 29, identifier:iterator; 30, assignment; 31, assignment; 32, call; 33, call; 34, comparison_operator:len(lines) < self.max_lines; 35, block; 36, identifier:lines; 37, call; 38, identifier:out_fname; 39, call; 40, attribute; 41, argument_list; 42, attribute; 43, argument_list; 44, call; 45, attribute; 46, break_statement; 47, identifier:list; 48, argument_list; 49, attribute; 50, argument_list; 51, identifier:self; 52, identifier:_write; 53, identifier:lines; 54, identifier:out_fname; 55, identifier:fnames; 56, identifier:append; 57, identifier:out_fname; 58, identifier:len; 59, argument_list; 60, identifier:self; 61, identifier:max_lines; 62, identifier:lines; 63, attribute; 64, identifier:join; 65, identifier:tmp_dir; 66, call; 67, identifier:lines; 68, identifier:os; 69, identifier:path; 70, attribute; 71, argument_list; 72, attribute; 73, identifier:format; 74, binary_operator:i + 1; 75, identifier:self; 76, identifier:TMP_FNAME; 77, identifier:i; 78, integer:1
code: def _split(self, iterator, tmp_dir):
          """
          Splits the file into several chunks.
  
          If the original file is too big to fit in the allocated space, the sorting will be split into several chunks,
          then merged.
          :param tmp_dir: Where to put the intermediate sorted results.
          :param orig_lines: The lines read before running out of space.
          :return: The names of the intermediate files.
          """
          fnames = []
          for i, lines in enumerate(iterator):
              lines = list(lines)
              out_fname = os.path.join(tmp_dir, self.TMP_FNAME.format(i + 1))
              self._write(lines, out_fname)
              fnames.append(out_fname)
              if len(lines) < self.max_lines:
                  break
          return fnames