<commit_before>// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package docker

import (
	"fmt"
	"strings"
)

// PortAssignment describes a port mapping between the host
// and the container.
type PortAssignment struct {
	// External is the port on the host.
	External int
	// Internal is the port on the container.
	Internal int
	// Protocol is the network protocol for the mapping (e.g. tcp, udp).
	Protocol string
}

// String returns a docker-friendly string representation of the mapping.
func (pa PortAssignment) String() string {
	return fmt.Sprintf("%d:%d/%s", pa.External, pa.Internal, pa.Protocol)
}

// MountAssignment describes a volume mount mapping between the host
// and the container.
type MountAssignment struct {
	// External is the volume mount point on the host.
	External string
	// Internal is the volume mount point on the container.
	Internal string
	// Mode is the docker-recognized access mode (e.g. rw, ro).
	Mode string
}

// String returns a docker-friendly string representation of the mapping.
func (ma MountAssignment) String() string {
	return fmt.Sprintf("%s:%s:%s", ma.External, ma.Internal, ma.Mode)
}

// RunArgs contains the data passed to the Run function.
type RunArgs struct {
	// Name is the unique name to assign to the container (optional).
	Name string
	// Image is the container image to use.
	Image string
	// Command is the command to run in the container (optional).
	Command string
	// EnvVars are environment variables to use in the container,
	// if any.
	EnvVars map[string]string
	// Ports is the list of ports to map into the container from
	// the host, if any.
	Ports []PortAssignment
	// Mounts is the list of volumes to map into the container from
	// the host, if any.
	Mounts []MountAssignment
}

// CommandlineArgs converts the RunArgs into a list of strings that may
// be passed to exec.Command as the command args.
func (ra RunArgs) CommandlineArgs() []string {
	args := []string{
		"--detach",
		"--name", ra.Name,
	}
<commit_msg>Clean up doc comments.<commit_after>// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package docker

import (
	"fmt"
	"strings"
)

// PortAssignment describes a port mapping between the host
// and the container.
type PortAssignment struct {
	// External is the port on the host.
	External int
	// Internal is the port on the container.
	Internal int
	// Protocol is the network protocol for the mapping (e.g. tcp, udp).
	Protocol string
}

// String returns a docker-friendly string representation of the mapping.
func (pa PortAssignment) String() string {
	return fmt.Sprintf("%d:%d/%s", pa.External, pa.Internal, pa.Protocol)
}

// MountAssignment describes a volume mount mapping between the host
// and the container.
type MountAssignment struct {
	// External is the volume mount point on the host.
	External string
	// Internal is the volume mount point on the container.
	Internal string
	// Mode is the docker-recognized access mode (e.g. rw, ro).
	Mode string
}

// String returns a docker-friendly string representation of the mapping.
func (ma MountAssignment) String() string {
	return fmt.Sprintf("%s:%s:%s", ma.External, ma.Internal, ma.Mode)
}

// RunArgs contains the data passed to the Run function.
type RunArgs struct {
	// Name is the unique name to assign to the container (optional).
	Name string
	// Image is the container image to use.
	Image string
	// Command is the command to run in the container (optional).
	Command string
	// EnvVars holds the environment variables to use in the container,
	// if any.
	EnvVars map[string]string
	// Ports holds the ports info to map into the container from the
	// host, if any.
	Ports []PortAssignment
	// Mounts holds the volumes info to map into the container from the
	// host, if any.
	Mounts []MountAssignment
}

// CommandlineArgs converts the RunArgs into a list of strings that may
// be passed to exec.Command as the command args.
func (ra RunArgs) CommandlineArgs() []string {
	args := []string{
		"--detach",
		"--name", ra.Name,
	}

{'fraction_non_alphanumeric': 0.09002195657477434, 'fraction_numerical': 0.0024396194193705783, 'mean_word_length': 3.5054945054945055, 'pattern_counts': {'":': 0, '<': 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': '6113444', 'n_tokens_mistral': 1165, 'n_tokens_neox': 1152, 'n_words': 550}