<commit_before>package main

import (
	"fmt"
	"os"
	"os/exec"
	"os/signal"
	"regexp"
	"strings"

	"github.com/ninjasphere/gatt"
	"github.com/ninjasphere/go-ninja/logger"
	"github.com/ninjasphere/go-ninja/support"
)

var log = logger.GetLogger("driver-go-blecombined")
var fpDriver *FlowerPowerDriver
var wpDriver *WaypointDriver
var tagDriver *BLETagDriver
var client *gatt.Client //kill me
var sent = false

func main() {

	log.Infof("BLE Driver Starting")

	// reset BLE layer
	out, err := exec.Command("/opt/ninjablocks/bin/sphere-ble-reset status").Output()
	if err != nil {
		log.Errorf(fmt.Sprintf("error: while checking status of BLE connection: %s. ignoring reset logic.", err))
	} else {
		log.Errorf("error: detected case where BLE stack could not be started properly. signalling need for reset...")
		out, err = exec.Command("/opt/ninjablocks/bin/sphere-ble-reset signal-reset").Output()
		if err == nil {
			log.Errorf("signalling successful. blocking until stopped by reset logic.")
			support.WaitUntilSignal()
		} else {
			log.Errorf("signalling unsuccessful. continuing without waiting.")
		}
	}

	// use hciconfig to the get the mac address
	out, err = exec.Command("hciconfig").Output()
	if err != nil {
		log.Errorf(fmt.Sprintf("Error: %s", err))
	}
	re := regexp.MustCompile("([0-9A-F]{2}\\:{0,1}){6}")
	mac := strings.Replace(re.FindString(string(out)), ":", "", -1)
	log.Infof("The local mac is %s\n", mac)<commit_msg>fix: use separate arguments to exec.Command.<commit_after>package main

import (
	"fmt"
	"os"
	"os/exec"
	"os/signal"
	"regexp"
	"strings"

	"github.com/ninjasphere/gatt"
	"github.com/ninjasphere/go-ninja/logger"
	"github.com/ninjasphere/go-ninja/support"
)

var log = logger.GetLogger("driver-go-blecombined")
var fpDriver *FlowerPowerDriver
var wpDriver *WaypointDriver
var tagDriver *BLETagDriver
var client *gatt.Client //kill me
var sent = false

func main() {

	log.Infof("BLE Driver Starting")

	// reset BLE layer
	out, err := exec.Command("/opt/ninjablocks/bin/sphere-ble-reset", "status").Output()
	if err != nil {
		log.Errorf(fmt.Sprintf("error: while checking status of BLE connection: %s. ignoring reset logic.", err))
	} else {
		log.Errorf("error: detected case where BLE stack could not be started properly. signalling need for reset...")
		out, err = exec.Command("/opt/ninjablocks/bin/sphere-ble-reset", "signal-reset").Output()
		if err == nil {
			log.Errorf("signalling successful. blocking until stopped by reset logic.")
			support.WaitUntilSignal()
		} else {
			log.Errorf("signalling unsuccessful. continuing without waiting.")
		}
	}

	// use hciconfig to the get the mac address
	out, err = exec.Command("hciconfig").Output()
	if err != nil {
		log.Errorf(fmt.Sprintf("Error: %s", err))
	}
	re := regexp.MustCompile("([0-9A-F]{2}\\:{0,1}){6}")
	mac := strings.Replace(re.FindString(string(out)), ":", "", -1)
	log.Infof("The local mac is %s\n", mac)
{'fraction_non_alphanumeric': 0.1593011305241521, 'fraction_numerical': 0.004796163069544364, 'mean_word_length': 4.214285714285714, 'pattern_counts': {'":': 2, '<': 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': '427360', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1003, 'n_words': 254}