<commit_before>package main

import (
	"fmt"
	"github.com/docker/swarmd/backends"
	"github.com/dotcloud/docker/api/server"
	"github.com/dotcloud/docker/engine"
	"os"
	"time"
)

func main() {
	eng := engine.New()
	eng.Logging = false
	if err := backends.Debug().Install(eng); err != nil {
		Fatalf("%v", err)
	}
	eng.Register(os.Args[0], server.ServeApi)

	// Register the entrypoint job as the current proces command name,
	// to get matching usage straight from the job.
	go func() {
		serve := eng.Job(os.Args[0], os.Args[1:]...)
		serve.Stdout.Add(os.Stdout)
		serve.Stderr.Add(os.Stderr)
		if err := serve.Run(); err != nil {
			Fatalf("%v", err)
		}
	}()
	// There is a race condition in engine.ServeApi.
	// As a workaround we sleep to give it time to register 'acceptconnections'.
	time.Sleep(1)
	// Notify that we're ready to receive connections
	if err := eng.Job("acceptconnections").Run(); err != nil {
		Fatalf("%v", err)
	}
	// Inifinite loop
	<-make(chan struct{})
}

func Fatalf(msg string, args ...interface{}) {
	fmt.Fprintf(os.Stderr, msg, args...)
	os.Exit(1)
}<commit_msg>Sleep 1 full second at startup to workaround a race condition in api/server<commit_after>package main

import (
	"fmt"
	"github.com/docker/swarmd/backends"
	"github.com/dotcloud/docker/api/server"
	"github.com/dotcloud/docker/engine"
	"os"
	"time"
)

func main() {
	eng := engine.New()
	eng.Logging = false
	if err := backends.Debug().Install(eng); err != nil {
		Fatalf("%v", err)
	}
	eng.Register(os.Args[0], server.ServeApi)

	// Register the entrypoint job as the current proces command name,
	// to get matching usage straight from the job.
	go func() {
		serve := eng.Job(os.Args[0], os.Args[1:]...)
		serve.Stdout.Add(os.Stdout)
		serve.Stderr.Add(os.Stderr)
		if err := serve.Run(); err != nil {
			Fatalf("%v", err)
		}
	}()
	// There is a race condition in engine.ServeApi.
	// As a workaround we sleep to give it time to register 'acceptconnections'.
	time.Sleep(1 * time.Second)
	// Notify that we're ready to receive connections
	if err := eng.Job("acceptconnections").Run(); err != nil {
		Fatalf("%v", err)
	}
	// Inifinite loop
	<-make(chan struct{})
}

func Fatalf(msg string, args ...interface{}) {
	fmt.Fprintf(os.Stderr, msg, args...)
	os.Exit(1)
}
{'fraction_non_alphanumeric': 0.16769911504424778, 'fraction_numerical': 0.0048672566371681415, 'mean_word_length': 3.5676767676767676, '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': '460261', 'n_tokens_mistral': 854, 'n_tokens_neox': 813, 'n_words': 219}