<commit_before>'use strict';
var exec = require('child_process').exec;
var path = require('path');
var fs = require('fs');
var platform = process.platform;

var copyRecursiveSync = function(src, dest) {
	var exists = fs.existsSync(src);
	var stats = exists && fs.statSync(src);
	var isDirectory = exists && stats.isDirectory();
	if (exists && isDirectory) {
		if(!fs.existsSync(dest)) {
			fs.mkdirSync(dest);
		}
		fs.readdirSync(src).forEach(function(childItemName) {
			copyRecursiveSync(path.join(src, childItemName),
			            path.join(dest, childItemName));
		});
	} else {
		var data = fs.readFileSync(src);
		fs.writeFileSync(dest, data);
	}
};

var Module = {
	flash : function(firmware, port, baudRate, callBack) {
		var appPath = '';
		if(__dirname.indexOf('app.asar') >= 0) {
			var asarPath = __dirname;
			copyRecursiveSync(asarPath, path.join(__dirname, '..', '..', '..', 'flasher'));
			appPath = path.join(__dirname, '..', '..', '..');
		} else {
			appPath = path.join(__dirname, '..');
		}

		var rate = baudRate || '115200';
		var avrName;
		var avrConf;
		var portPrefix;<commit_msg>flasher update<commit_after>'use strict';
var exec = require('child_process').exec;
var path = require('path');
var fs = require('fs');
var platform = process.platform;

var copyRecursiveSync = function(src, dest) {
	var exists = fs.existsSync(src);
	var stats = exists && fs.statSync(src);
	var isDirectory = exists && stats.isDirectory();
	if (exists && isDirectory) {
		if(!fs.existsSync(dest)) {
			fs.mkdirSync(dest);
		}
		fs.readdirSync(src).forEach(function(childItemName) {
			copyRecursiveSync(path.join(src, childItemName),
			            path.join(dest, childItemName));
		});
	} else {
		var data = fs.readFileSync(src);
		fs.writeFileSync(dest, data);
	}
};

var Module = {
	flash : function(firmware, port, baudRate, callBack) {
		var appPath = '';
		var asarIndex = __dirname.indexOf('app.asar');
		if(asarIndex > -1) {
			var asarPath = __dirname.substr(0, asarIndex);
			copyRecursiveSync(__dirname, path.join(asarPath, 'flasher'));
			appPath = asarPath;
		} else {
			appPath = path.join(__dirname, '..');
		}

		var rate = baudRate || '115200';
		var avrName;
		var avrConf;
		var portPrefix;
{'fraction_non_alphanumeric': 0.16779127305443095, 'fraction_numerical': 0.006747638326585695, 'mean_word_length': 4.054545454545455, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3382658', 'n_tokens_mistral': 856, 'n_tokens_neox': 780, 'n_words': 158}