<commit_before>package main

// Example Docker Wrapper Run Module
//
// looks at some environment variables and flags and adds some options
//

import (
	"fmt"
	"log"
)

type ExampleRunModule struct {
	DefaultRunModule
}

// HandleRun implements the WrapperRunModule interface
func (m *ExampleRunModule) HandleRun(flags DockerFlags, runFlags DockerRunCommandFlags) []string {
	log.Println("INFO: ExampleRunModule.HandleRun(...)")

	// look for a few 'standard' vars and craft our own
	// (run_cmd.go already looks for MESOS_TASK_ID and pals)

	ports := singleEnvValueLike(runFlags.Env, "PORTS")

	// we are combining a few pieces of data into a new env var flag
	newflags := []string{"-e", fmt.Sprintf("SAMPLE_RUN_MODULE=%s-%s", mesosTaskId, ports)}

	return newflags
}

// init calls RegisterRunModule
func init() {
	RegisterRunModule(&ExampleRunModule{})<commit_msg>More Sample -> Example<commit_after>package main

// Example Docker Wrapper Run Module
//
// looks at some environment variables and flags and adds some options
//

import (
	"fmt"
	"log"
)

type ExampleRunModule struct {
	DefaultRunModule
}

// HandleRun implements the WrapperRunModule interface
func (m *ExampleRunModule) HandleRun(flags DockerFlags, runFlags DockerRunCommandFlags) []string {
	log.Println("INFO: ExampleRunModule.HandleRun(...)")

	// look for a few 'standard' vars and craft our own
	// (run_cmd.go already looks for MESOS_TASK_ID and pals)

	ports := singleEnvValueLike(runFlags.Env, "PORTS")

	// we are combining a few pieces of data into a new env var flag
	newflags := []string{"-e", fmt.Sprintf("EXAMPLE_RUN_MODULE=%s-%s", mesosTaskId, ports)}

	return newflags
}

// init calls RegisterRunModule
func init() {
	RegisterRunModule(&ExampleRunModule{})
{'fraction_non_alphanumeric': 0.10767468499427263, 'fraction_numerical': 0.0, 'mean_word_length': 4.6537216828478964, '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': '6052674', 'n_tokens_mistral': 539, 'n_tokens_neox': 521, 'n_words': 175}