<commit_before>package main

import (
	"log"
	"os"
	"os/exec"
	"syscall"

	"github.com/dotcloud/docker/pkg/user"
)

const VERSION = "1.0"

func main() {
	log.SetFlags(0) // no timestamps on our logs

	if len(os.Args) <= 2 {
		log.Printf("Usage: %s user-spec command [args]", os.Args[0])
		log.Printf("   ie: %s tianon bash", os.Args[0])
		log.Printf("       %s nobody:root bash -c 'whoami && id'", os.Args[0])
		log.Printf("       %s 1000:1 id", os.Args[0])
		log.Printf("%s version: %s", os.Args[0], VERSION)
		os.Exit(1)
	}
<commit_msg>add LockOSThread and explicit GOMAXPROCS to ensure even more explicitly that we're running in the same thread for the duration<commit_after>package main

import (
	"log"
	"os"
	"os/exec"
	"runtime"
	"syscall"

	"github.com/dotcloud/docker/pkg/user"
)

const VERSION = "1.0"

func init() {
	// make sure we only have one process and that it runs on the main thread (so that ideally, when we Exec, we keep our user switches and stuff)
	runtime.GOMAXPROCS(1)
	runtime.LockOSThread()
}

func main() {
	log.SetFlags(0) // no timestamps on our logs

	if len(os.Args) <= 2 {
		log.Printf("Usage: %s user-spec command [args]", os.Args[0])
		log.Printf("   ie: %s tianon bash", os.Args[0])
		log.Printf("       %s nobody:root bash -c 'whoami && id'", os.Args[0])
		log.Printf("       %s 1000:1 id", os.Args[0])
		log.Printf("%s version: %s", os.Args[0], VERSION)
		os.Exit(1)
	}

{'fraction_non_alphanumeric': 0.1669034090909091, 'fraction_numerical': 0.022017045454545456, 'mean_word_length': 3.473015873015873, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2686050', 'n_tokens_mistral': 585, 'n_tokens_neox': 560, 'n_words': 158}