<commit_before>#!/usr/bin/env node
/**
 * Usage:
 * ./get-issues.js "project" "milestone ID"
 *
 * Example:
 *  ./get-issues.js macbre/phantomas 7
 */
var api = require('github'),
	log = require('npmlog'),
	format = require('util').format,
	github;

var argv = process.argv.slice(2),
	user = argv[0].split('/')[0],
	project = argv[0].split('/')[1],
	milestone = parseInt(argv[1], 10);

log.info('GIT', 'Getting closed issues from %s/%s for milestone #%d', user, project, milestone);

github = new api({
	version: "3.0.0",
});

github.issues.repoIssues({
	user: user,
	repo: project,
	milestone: milestone,
	state: 'closed',
	direction: 'asc'
}, function(err, issues) {
	if (err) {
		log.error('API', '#%d: %s', err.code, err.message);
		return;
	}

	var ret = [];

	issues.forEach(function(issue) {
		ret.push(format('* #%d - %s%s',
			issue.number,
			issue.title,
			(issue.user.login !== user ? (' (by @' + issue.user.login + ')') : '')
		));
	});

	console.log(ret.join("\n"));
});<commit_msg>get-issues: update API call<commit_after>#!/usr/bin/env node
/**
 * Usage:
 * ./get-issues.js "project" "milestone ID"
 *
 * Example:
 *  ./get-issues.js macbre/phantomas 7
 */
var api = require('github'),
	log = require('npmlog'),
	format = require('util').format,
	github;

var argv = process.argv.slice(2),
	user = argv[0].split('/')[0],
	project = argv[0].split('/')[1],
	milestone = parseInt(argv[1], 10);

log.info('GIT', 'Getting closed issues from %s/%s for milestone #%d', user, project, milestone);

github = new api({
	version: "3.0.0",
});

github.issues.getForRepo({
	owner: user,
	repo: project,
	milestone: milestone,
	state: 'closed',
	direction: 'asc'
}, function(err, issues) {
	if (err) {
		log.error('API', '#%d: %s', err.code, err.message);
		return;
	}


	var ret = [];

	issues.forEach(function(issue) {
		var type = issue.labels[0].name; // .reduce((label, acc) => label.name);
		ret.push(format('* #%d [%s] - %s%s',
			issue.number,
			type,
			issue.title,
			(issue.user.login !== user ? (' (by @' + issue.user.login + ')') : '')
		));
	});

	console.log(ret.join("\n"));
});
{'fraction_non_alphanumeric': 0.23249166269652216, 'fraction_numerical': 0.011910433539780848, 'mean_word_length': 3.772727272727273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5644933', 'n_tokens_mistral': 849, 'n_tokens_neox': 803, 'n_words': 171}