<commit_before>// Package cpdf contains methods to manipulate pdf files using cpdf.
package cpdf

import (
	"log"
	"os/exec"
)

// Given a slice of documents, construct an args slice suitable for
// passing to 'cpdf merge'.
func cpdfMergeArgs(doclist []string) (args []string) {
	args = []string{"merge"}
	for _, doc := range doclist {
		args = append(args, doc)
	}
	args = append(args, "-o", "combined.pdf")
	return
}

// Combine the files located at the specified paths into a single pdf.
func Merge(doclist []string) {
	cpdf, err := exec.LookPath("cpdf")
	if err != nil {
		log.Fatal("no cpdf")
	}
	combine_cmd := exec.Command(cpdf)
	combine_cmd.Dir = "/tmp"
	combine_cmd.Args = cpdfMergeArgs(doclist)
	out, err := combine_cmd.Output()
	log.Println("stdout of command:", string(out))
}<commit_msg>exported first<commit_after>// Package cpdf contains methods to manipulate pdf files using cpdf.
package cpdf

import (
	"log"
	"os/exec"
)

// Combine the files located at the specified paths into a single pdf.
func Merge(doclist []string) {
	cpdf, err := exec.LookPath("cpdf")
	if err != nil {
		log.Fatal("no cpdf")
	}
	combine_cmd := exec.Command(cpdf)
	combine_cmd.Dir = "/tmp"
	combine_cmd.Args = cpdfMergeArgs(doclist)
	out, err := combine_cmd.Output()
	log.Println("stdout of command:", string(out))
}

// Given a slice of documents, construct an args slice suitable for
// passing to 'cpdf merge'.
func cpdfMergeArgs(doclist []string) (args []string) {
	args = []string{"merge"}
	for _, doc := range doclist {
		args = append(args, doc)
	}
	args = append(args, "-o", "combined.pdf")
	return
}
{'fraction_non_alphanumeric': 0.14116177389131793, 'fraction_numerical': 0.0, 'mean_word_length': 4.201298701298701, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1008323', 'n_tokens_mistral': 561, 'n_tokens_neox': 549, 'n_words': 173}