repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
listlengths
20
707
docstring
stringlengths
3
17.3k
docstring_tokens
listlengths
3
222
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
idx
int64
0
252k
merll/docker-map
dockermap/map/client.py
MappingDockerClient.stop
def stop(self, container, instances=None, map_name=None, **kwargs): """ Stops instances for a container configuration. :param container: Container name. :type container: unicode | str :param instances: Instance names to stop. If not specified, will stop all instances as specifie...
python
def stop(self, container, instances=None, map_name=None, **kwargs): """ Stops instances for a container configuration. :param container: Container name. :type container: unicode | str :param instances: Instance names to stop. If not specified, will stop all instances as specifie...
[ "def", "stop", "(", "self", ",", "container", ",", "instances", "=", "None", ",", "map_name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "run_actions", "(", "'stop'", ",", "container", ",", "instances", "=", "instances", ","...
Stops instances for a container configuration. :param container: Container name. :type container: unicode | str :param instances: Instance names to stop. If not specified, will stop all instances as specified in the configuration (or just one default instance). :type instances:...
[ "Stops", "instances", "for", "a", "container", "configuration", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/client.py#L294-L314
train
61,600
merll/docker-map
dockermap/map/client.py
MappingDockerClient.remove
def remove(self, container, instances=None, map_name=None, **kwargs): """ Remove instances from a container configuration. :param container: Container name. :type container: unicode | str :param instances: Instance names to remove. If not specified, will remove all instances as ...
python
def remove(self, container, instances=None, map_name=None, **kwargs): """ Remove instances from a container configuration. :param container: Container name. :type container: unicode | str :param instances: Instance names to remove. If not specified, will remove all instances as ...
[ "def", "remove", "(", "self", ",", "container", ",", "instances", "=", "None", ",", "map_name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "run_actions", "(", "'remove'", ",", "container", ",", "instances", "=", "instances", ...
Remove instances from a container configuration. :param container: Container name. :type container: unicode | str :param instances: Instance names to remove. If not specified, will remove all instances as specified in the configuration (or just one default instance). :type inst...
[ "Remove", "instances", "from", "a", "container", "configuration", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/client.py#L316-L332
train
61,601
merll/docker-map
dockermap/map/client.py
MappingDockerClient.startup
def startup(self, container, instances=None, map_name=None, **kwargs): """ Start up container instances from a container configuration. Typically this means creating and starting containers and their dependencies. Note that not all policy classes necessarily implement this method. :para...
python
def startup(self, container, instances=None, map_name=None, **kwargs): """ Start up container instances from a container configuration. Typically this means creating and starting containers and their dependencies. Note that not all policy classes necessarily implement this method. :para...
[ "def", "startup", "(", "self", ",", "container", ",", "instances", "=", "None", ",", "map_name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "run_actions", "(", "'startup'", ",", "container", ",", "instances", "=", "instances",...
Start up container instances from a container configuration. Typically this means creating and starting containers and their dependencies. Note that not all policy classes necessarily implement this method. :param container: Container name. :type container: unicode | str :param instance...
[ "Start", "up", "container", "instances", "from", "a", "container", "configuration", ".", "Typically", "this", "means", "creating", "and", "starting", "containers", "and", "their", "dependencies", ".", "Note", "that", "not", "all", "policy", "classes", "necessarily...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/client.py#L334-L350
train
61,602
merll/docker-map
dockermap/map/client.py
MappingDockerClient.shutdown
def shutdown(self, container, instances=None, map_name=None, **kwargs): """ Shut down container instances from a container configuration. Typically this means stopping and removing containers. Note that not all policy classes necessarily implement this method. :param container: Containe...
python
def shutdown(self, container, instances=None, map_name=None, **kwargs): """ Shut down container instances from a container configuration. Typically this means stopping and removing containers. Note that not all policy classes necessarily implement this method. :param container: Containe...
[ "def", "shutdown", "(", "self", ",", "container", ",", "instances", "=", "None", ",", "map_name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "run_actions", "(", "'shutdown'", ",", "container", ",", "instances", "=", "instances...
Shut down container instances from a container configuration. Typically this means stopping and removing containers. Note that not all policy classes necessarily implement this method. :param container: Container name. :type container: unicode | str :param instances: Instance names to r...
[ "Shut", "down", "container", "instances", "from", "a", "container", "configuration", ".", "Typically", "this", "means", "stopping", "and", "removing", "containers", ".", "Note", "that", "not", "all", "policy", "classes", "necessarily", "implement", "this", "method...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/client.py#L352-L368
train
61,603
merll/docker-map
dockermap/map/client.py
MappingDockerClient.update
def update(self, container, instances=None, map_name=None, **kwargs): """ Updates instances from a container configuration. Typically this means restarting or recreating containers based on detected changes in the configuration or environment. Note that not all policy classes necessarily implem...
python
def update(self, container, instances=None, map_name=None, **kwargs): """ Updates instances from a container configuration. Typically this means restarting or recreating containers based on detected changes in the configuration or environment. Note that not all policy classes necessarily implem...
[ "def", "update", "(", "self", ",", "container", ",", "instances", "=", "None", ",", "map_name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "run_actions", "(", "'update'", ",", "container", ",", "instances", "=", "instances", ...
Updates instances from a container configuration. Typically this means restarting or recreating containers based on detected changes in the configuration or environment. Note that not all policy classes necessarily implement this method. :param container: Container name. :type containe...
[ "Updates", "instances", "from", "a", "container", "configuration", ".", "Typically", "this", "means", "restarting", "or", "recreating", "containers", "based", "on", "detected", "changes", "in", "the", "configuration", "or", "environment", ".", "Note", "that", "not...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/client.py#L370-L387
train
61,604
merll/docker-map
dockermap/map/client.py
MappingDockerClient.call
def call(self, action_name, container, instances=None, map_name=None, **kwargs): """ Generic function for running container actions based on a policy. :param action_name: Action name. :type action_name: unicode | str :param container: Container name. :type container: uni...
python
def call(self, action_name, container, instances=None, map_name=None, **kwargs): """ Generic function for running container actions based on a policy. :param action_name: Action name. :type action_name: unicode | str :param container: Container name. :type container: uni...
[ "def", "call", "(", "self", ",", "action_name", ",", "container", ",", "instances", "=", "None", ",", "map_name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "run_actions", "(", "action_name", ",", "container", ",", "instances"...
Generic function for running container actions based on a policy. :param action_name: Action name. :type action_name: unicode | str :param container: Container name. :type container: unicode | str :param instances: Instance names to remove. If not specified, runs on all instance...
[ "Generic", "function", "for", "running", "container", "actions", "based", "on", "a", "policy", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/client.py#L389-L406
train
61,605
merll/docker-map
dockermap/map/client.py
MappingDockerClient.pull_images
def pull_images(self, container, instances=None, map_name=None, **kwargs): """ Pulls images for container configurations along their dependency path. :param container: Container configuration name. :type container: unicode | str :param map_name: Container map name. :type...
python
def pull_images(self, container, instances=None, map_name=None, **kwargs): """ Pulls images for container configurations along their dependency path. :param container: Container configuration name. :type container: unicode | str :param map_name: Container map name. :type...
[ "def", "pull_images", "(", "self", ",", "container", ",", "instances", "=", "None", ",", "map_name", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "run_actions", "(", "'pull_images'", ",", "container", ",", "map_name", "=", "map_...
Pulls images for container configurations along their dependency path. :param container: Container configuration name. :type container: unicode | str :param map_name: Container map name. :type map_name: unicode | str :param instances: Not applicable for images. :type ins...
[ "Pulls", "images", "for", "container", "configurations", "along", "their", "dependency", "path", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/client.py#L446-L460
train
61,606
merll/docker-map
dockermap/map/client.py
MappingDockerClient.list_persistent_containers
def list_persistent_containers(self, map_name=None): """ Lists the names of all persistent containers on the specified map or all maps. Attached containers are always considered persistent. :param map_name: Container map name. Optional, only returns persistent containers from the specif...
python
def list_persistent_containers(self, map_name=None): """ Lists the names of all persistent containers on the specified map or all maps. Attached containers are always considered persistent. :param map_name: Container map name. Optional, only returns persistent containers from the specif...
[ "def", "list_persistent_containers", "(", "self", ",", "map_name", "=", "None", ")", ":", "if", "map_name", ":", "maps", "=", "[", "self", ".", "_maps", "[", "map_name", "]", ".", "get_extended_map", "(", ")", "]", "else", ":", "maps", "=", "[", "m", ...
Lists the names of all persistent containers on the specified map or all maps. Attached containers are always considered persistent. :param map_name: Container map name. Optional, only returns persistent containers from the specified map. :type map_name: unicode | str :return: List of c...
[ "Lists", "the", "names", "of", "all", "persistent", "containers", "on", "the", "specified", "map", "or", "all", "maps", ".", "Attached", "containers", "are", "always", "considered", "persistent", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/client.py#L468-L496
train
61,607
ThiefMaster/maildump
maildump/util.py
rest
def rest(f): """Decorator for simple REST endpoints. Functions must return one of these values: - a dict to jsonify - nothing for an empty 204 response - a tuple containing a status code and a dict to jsonify """ @wraps(f) def wrapper(*args, **kwargs): ret = f(*args, **kwargs) ...
python
def rest(f): """Decorator for simple REST endpoints. Functions must return one of these values: - a dict to jsonify - nothing for an empty 204 response - a tuple containing a status code and a dict to jsonify """ @wraps(f) def wrapper(*args, **kwargs): ret = f(*args, **kwargs) ...
[ "def", "rest", "(", "f", ")", ":", "@", "wraps", "(", "f", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "f", "(", "*", "args", ",", "*", "*", "kwargs", ")", "if", "ret", "is", "None", ":", "respons...
Decorator for simple REST endpoints. Functions must return one of these values: - a dict to jsonify - nothing for an empty 204 response - a tuple containing a status code and a dict to jsonify
[ "Decorator", "for", "simple", "REST", "endpoints", "." ]
6425d44504ed28a9c927421f831ffa5da4cf2ae3
https://github.com/ThiefMaster/maildump/blob/6425d44504ed28a9c927421f831ffa5da4cf2ae3/maildump/util.py#L40-L67
train
61,608
merll/docker-map
dockermap/map/runner/image.py
ImageMixin.login
def login(self, action, registry, **kwargs): """ Logs in to a Docker registry. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param registry: Name of the registry server to login to. :type registry: unicode | str :param kwar...
python
def login(self, action, registry, **kwargs): """ Logs in to a Docker registry. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param registry: Name of the registry server to login to. :type registry: unicode | str :param kwar...
[ "def", "login", "(", "self", ",", "action", ",", "registry", ",", "*", "*", "kwargs", ")", ":", "log", ".", "info", "(", "\"Logging into registry %s.\"", ",", "registry", ")", "login_kwargs", "=", "{", "'registry'", ":", "registry", "}", "auth_config", "="...
Logs in to a Docker registry. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param registry: Name of the registry server to login to. :type registry: unicode | str :param kwargs: Additional keyword arguments to complement or override the co...
[ "Logs", "in", "to", "a", "Docker", "registry", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/image.py#L22-L49
train
61,609
merll/docker-map
dockermap/map/runner/image.py
ImageMixin.pull
def pull(self, action, image_name, **kwargs): """ Pulls an image for a container configuration :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param image_name: Image name. :type image_name: unicode | str :param kwargs: Addit...
python
def pull(self, action, image_name, **kwargs): """ Pulls an image for a container configuration :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param image_name: Image name. :type image_name: unicode | str :param kwargs: Addit...
[ "def", "pull", "(", "self", ",", "action", ",", "image_name", ",", "*", "*", "kwargs", ")", ":", "config_id", "=", "action", ".", "config_id", "registry", ",", "__", ",", "image", "=", "config_id", ".", "config_name", ".", "rpartition", "(", "'/'", ")"...
Pulls an image for a container configuration :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param image_name: Image name. :type image_name: unicode | str :param kwargs: Additional keyword arguments to complement or override the configuratio...
[ "Pulls", "an", "image", "for", "a", "container", "configuration" ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/image.py#L51-L71
train
61,610
merll/docker-map
dockermap/client/cli.py
parse_networks_output
def parse_networks_output(out): """ Parses the output of the Docker CLI 'docker network ls' and returns it in the format similar to the Docker API. :param out: CLI output. :type out: unicode | str :return: Parsed result. :rtype: list[dict] """ if not out: return [] line_iter...
python
def parse_networks_output(out): """ Parses the output of the Docker CLI 'docker network ls' and returns it in the format similar to the Docker API. :param out: CLI output. :type out: unicode | str :return: Parsed result. :rtype: list[dict] """ if not out: return [] line_iter...
[ "def", "parse_networks_output", "(", "out", ")", ":", "if", "not", "out", ":", "return", "[", "]", "line_iter", "=", "islice", "(", "out", ".", "splitlines", "(", ")", ",", "1", ",", "None", ")", "# Skip header", "return", "list", "(", "map", "(", "_...
Parses the output of the Docker CLI 'docker network ls' and returns it in the format similar to the Docker API. :param out: CLI output. :type out: unicode | str :return: Parsed result. :rtype: list[dict]
[ "Parses", "the", "output", "of", "the", "Docker", "CLI", "docker", "network", "ls", "and", "returns", "it", "in", "the", "format", "similar", "to", "the", "Docker", "API", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/cli.py#L243-L255
train
61,611
merll/docker-map
dockermap/client/cli.py
parse_volumes_output
def parse_volumes_output(out): """ Parses the output of the Docker CLI 'docker volume ls' and returns it in the format similar to the Docker API. :param out: CLI output. :type out: unicode | str :return: Parsed result. :rtype: list[dict] """ if not out: return [] line_iter =...
python
def parse_volumes_output(out): """ Parses the output of the Docker CLI 'docker volume ls' and returns it in the format similar to the Docker API. :param out: CLI output. :type out: unicode | str :return: Parsed result. :rtype: list[dict] """ if not out: return [] line_iter =...
[ "def", "parse_volumes_output", "(", "out", ")", ":", "if", "not", "out", ":", "return", "[", "]", "line_iter", "=", "islice", "(", "out", ".", "splitlines", "(", ")", ",", "1", ",", "None", ")", "# Skip header", "return", "list", "(", "map", "(", "_v...
Parses the output of the Docker CLI 'docker volume ls' and returns it in the format similar to the Docker API. :param out: CLI output. :type out: unicode | str :return: Parsed result. :rtype: list[dict]
[ "Parses", "the", "output", "of", "the", "Docker", "CLI", "docker", "volume", "ls", "and", "returns", "it", "in", "the", "format", "similar", "to", "the", "Docker", "API", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/cli.py#L258-L270
train
61,612
merll/docker-map
dockermap/client/cli.py
parse_images_output
def parse_images_output(out): """ Parses the output of the Docker CLI 'docker images'. Note this is currently incomplete and only returns the ids and tags of images, as the Docker CLI heavily modifies the output for human readability. The parent image id is also not available on the CLI, so a full API c...
python
def parse_images_output(out): """ Parses the output of the Docker CLI 'docker images'. Note this is currently incomplete and only returns the ids and tags of images, as the Docker CLI heavily modifies the output for human readability. The parent image id is also not available on the CLI, so a full API c...
[ "def", "parse_images_output", "(", "out", ")", ":", "line_iter", "=", "islice", "(", "out", ".", "splitlines", "(", ")", ",", "1", ",", "None", ")", "# Skip header", "split_lines", "=", "(", "line", ".", "split", "(", ")", "for", "line", "in", "line_it...
Parses the output of the Docker CLI 'docker images'. Note this is currently incomplete and only returns the ids and tags of images, as the Docker CLI heavily modifies the output for human readability. The parent image id is also not available on the CLI, so a full API compatibility is not possible. :param ...
[ "Parses", "the", "output", "of", "the", "Docker", "CLI", "docker", "images", ".", "Note", "this", "is", "currently", "incomplete", "and", "only", "returns", "the", "ids", "and", "tags", "of", "images", "as", "the", "Docker", "CLI", "heavily", "modifies", "...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/cli.py#L291-L307
train
61,613
merll/docker-map
dockermap/map/policy/cache.py
CachedImages.refresh
def refresh(self): """ Fetches image and their ids from the client. """ if not self._client: return current_images = self._client.images() self.clear() self._update(current_images) for image in current_images: tags = image.get('Repo...
python
def refresh(self): """ Fetches image and their ids from the client. """ if not self._client: return current_images = self._client.images() self.clear() self._update(current_images) for image in current_images: tags = image.get('Repo...
[ "def", "refresh", "(", "self", ")", ":", "if", "not", "self", ".", "_client", ":", "return", "current_images", "=", "self", ".", "_client", ".", "images", "(", ")", "self", ".", "clear", "(", ")", "self", ".", "_update", "(", "current_images", ")", "...
Fetches image and their ids from the client.
[ "Fetches", "image", "and", "their", "ids", "from", "the", "client", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/cache.py#L34-L46
train
61,614
merll/docker-map
dockermap/map/policy/cache.py
CachedContainerNames.refresh
def refresh(self): """ Fetches all current container names from the client, along with their id. """ if not self._client: return current_containers = self._client.containers(all=True) self.clear() for container in current_containers: contai...
python
def refresh(self): """ Fetches all current container names from the client, along with their id. """ if not self._client: return current_containers = self._client.containers(all=True) self.clear() for container in current_containers: contai...
[ "def", "refresh", "(", "self", ")", ":", "if", "not", "self", ".", "_client", ":", "return", "current_containers", "=", "self", ".", "_client", ".", "containers", "(", "all", "=", "True", ")", "self", ".", "clear", "(", ")", "for", "container", "in", ...
Fetches all current container names from the client, along with their id.
[ "Fetches", "all", "current", "container", "names", "from", "the", "client", "along", "with", "their", "id", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/cache.py#L55-L68
train
61,615
merll/docker-map
dockermap/map/policy/cache.py
CachedNetworkNames.refresh
def refresh(self): """ Fetches all current network names from the client, along with their id. """ if not self._client: return current_networks = self._client.networks() self.clear() self.update((net['Name'], net['Id']) for net in c...
python
def refresh(self): """ Fetches all current network names from the client, along with their id. """ if not self._client: return current_networks = self._client.networks() self.clear() self.update((net['Name'], net['Id']) for net in c...
[ "def", "refresh", "(", "self", ")", ":", "if", "not", "self", ".", "_client", ":", "return", "current_networks", "=", "self", ".", "_client", ".", "networks", "(", ")", "self", ".", "clear", "(", ")", "self", ".", "update", "(", "(", "net", "[", "'...
Fetches all current network names from the client, along with their id.
[ "Fetches", "all", "current", "network", "names", "from", "the", "client", "along", "with", "their", "id", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/cache.py#L72-L81
train
61,616
merll/docker-map
dockermap/map/policy/cache.py
CachedVolumeNames.refresh
def refresh(self): """ Fetches all current network names from the client. """ if not self._client: return current_volumes = self._client.volumes()['Volumes'] self.clear() if current_volumes: self.update(vol['Name'] for vol in current_volume...
python
def refresh(self): """ Fetches all current network names from the client. """ if not self._client: return current_volumes = self._client.volumes()['Volumes'] self.clear() if current_volumes: self.update(vol['Name'] for vol in current_volume...
[ "def", "refresh", "(", "self", ")", ":", "if", "not", "self", ".", "_client", ":", "return", "current_volumes", "=", "self", ".", "_client", ".", "volumes", "(", ")", "[", "'Volumes'", "]", "self", ".", "clear", "(", ")", "if", "current_volumes", ":", ...
Fetches all current network names from the client.
[ "Fetches", "all", "current", "network", "names", "from", "the", "client", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/cache.py#L85-L94
train
61,617
merll/docker-map
dockermap/map/policy/cache.py
DockerHostItemCache.refresh
def refresh(self, item): """ Forces a refresh of a cached item. :param item: Client name. :type item: unicode | str :return: Items in the cache. :rtype: DockerHostItemCache.item_class """ client = self._clients[item].get_client() self[item] = val ...
python
def refresh(self, item): """ Forces a refresh of a cached item. :param item: Client name. :type item: unicode | str :return: Items in the cache. :rtype: DockerHostItemCache.item_class """ client = self._clients[item].get_client() self[item] = val ...
[ "def", "refresh", "(", "self", ",", "item", ")", ":", "client", "=", "self", ".", "_clients", "[", "item", "]", ".", "get_client", "(", ")", "self", "[", "item", "]", "=", "val", "=", "self", ".", "item_class", "(", "client", ")", "return", "val" ]
Forces a refresh of a cached item. :param item: Client name. :type item: unicode | str :return: Items in the cache. :rtype: DockerHostItemCache.item_class
[ "Forces", "a", "refresh", "of", "a", "cached", "item", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/cache.py#L123-L134
train
61,618
merll/docker-map
dockermap/map/config/main.py
ContainerMap.get_image
def get_image(self, image): """ Generates a tuple of the full image name and tag, that should be used when creating a new container. This implementation applies the following rules: * If the image name starts with ``/``, the following image name is returned. * If ``/`` is found...
python
def get_image(self, image): """ Generates a tuple of the full image name and tag, that should be used when creating a new container. This implementation applies the following rules: * If the image name starts with ``/``, the following image name is returned. * If ``/`` is found...
[ "def", "get_image", "(", "self", ",", "image", ")", ":", "name", ",", "__", ",", "tag", "=", "image", ".", "rpartition", "(", "':'", ")", "if", "not", "name", ":", "name", ",", "tag", "=", "tag", ",", "name", "if", "'/'", "in", "name", ":", "if...
Generates a tuple of the full image name and tag, that should be used when creating a new container. This implementation applies the following rules: * If the image name starts with ``/``, the following image name is returned. * If ``/`` is found anywhere else in the image name, it is assumed ...
[ "Generates", "a", "tuple", "of", "the", "full", "image", "name", "and", "tag", "that", "should", "be", "used", "when", "creating", "a", "new", "container", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/main.py#L293-L330
train
61,619
merll/docker-map
dockermap/map/config/main.py
ContainerMap.get_extended
def get_extended(self, config): """ Generates a configuration that includes all inherited values. :param config: Container configuration. :type config: ContainerConfiguration :return: A merged (shallow) copy of all inherited configurations merged with the container configuration...
python
def get_extended(self, config): """ Generates a configuration that includes all inherited values. :param config: Container configuration. :type config: ContainerConfiguration :return: A merged (shallow) copy of all inherited configurations merged with the container configuration...
[ "def", "get_extended", "(", "self", ",", "config", ")", ":", "if", "not", "config", ".", "extends", "or", "self", ".", "_extended", ":", "return", "config", "extended_config", "=", "ContainerConfiguration", "(", ")", "for", "ext_name", "in", "config", ".", ...
Generates a configuration that includes all inherited values. :param config: Container configuration. :type config: ContainerConfiguration :return: A merged (shallow) copy of all inherited configurations merged with the container configuration. :rtype: ContainerConfiguration
[ "Generates", "a", "configuration", "that", "includes", "all", "inherited", "values", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/main.py#L502-L521
train
61,620
merll/docker-map
dockermap/map/config/main.py
ContainerMap.get_extended_map
def get_extended_map(self): """ Creates a copy of this map which includes all non-abstract configurations in their extended form. :return: Copy of this map. :rtype: ContainerMap """ map_copy = self.__class__(self.name) map_copy.update_from_obj(self, copy=True, up...
python
def get_extended_map(self): """ Creates a copy of this map which includes all non-abstract configurations in their extended form. :return: Copy of this map. :rtype: ContainerMap """ map_copy = self.__class__(self.name) map_copy.update_from_obj(self, copy=True, up...
[ "def", "get_extended_map", "(", "self", ")", ":", "map_copy", "=", "self", ".", "__class__", "(", "self", ".", "name", ")", "map_copy", ".", "update_from_obj", "(", "self", ",", "copy", "=", "True", ",", "update_containers", "=", "False", ")", "for", "c_...
Creates a copy of this map which includes all non-abstract configurations in their extended form. :return: Copy of this map. :rtype: ContainerMap
[ "Creates", "a", "copy", "of", "this", "map", "which", "includes", "all", "non", "-", "abstract", "configurations", "in", "their", "extended", "form", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/main.py#L523-L535
train
61,621
merll/docker-map
dockermap/map/action/simple.py
CreateActionGenerator.get_state_actions
def get_state_actions(self, state, **kwargs): """ Creates all missing containers, networks, and volumes. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and ...
python
def get_state_actions(self, state, **kwargs): """ Creates all missing containers, networks, and volumes. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and ...
[ "def", "get_state_actions", "(", "self", ",", "state", ",", "*", "*", "kwargs", ")", ":", "if", "state", ".", "base_state", "==", "State", ".", "ABSENT", ":", "if", "state", ".", "config_id", ".", "config_type", "==", "ItemType", ".", "IMAGE", ":", "re...
Creates all missing containers, networks, and volumes. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and configurations. :rtype: list[dockermap.map.action.ItemActi...
[ "Creates", "all", "missing", "containers", "networks", "and", "volumes", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/action/simple.py#L11-L27
train
61,622
merll/docker-map
dockermap/map/action/simple.py
StartActionGenerator.get_state_actions
def get_state_actions(self, state, **kwargs): """ Generally starts containers that are not running. Attached containers are skipped unless they are initial. Attached containers are also prepared with permissions. Where applicable, exec commands are run in started instance containers. ...
python
def get_state_actions(self, state, **kwargs): """ Generally starts containers that are not running. Attached containers are skipped unless they are initial. Attached containers are also prepared with permissions. Where applicable, exec commands are run in started instance containers. ...
[ "def", "get_state_actions", "(", "self", ",", "state", ",", "*", "*", "kwargs", ")", ":", "config_type", "=", "state", ".", "config_id", ".", "config_type", "if", "(", "config_type", "==", "ItemType", ".", "VOLUME", "and", "state", ".", "base_state", "==",...
Generally starts containers that are not running. Attached containers are skipped unless they are initial. Attached containers are also prepared with permissions. Where applicable, exec commands are run in started instance containers. :param state: Configuration state. :type state: dock...
[ "Generally", "starts", "containers", "that", "are", "not", "running", ".", "Attached", "containers", "are", "skipped", "unless", "they", "are", "initial", ".", "Attached", "containers", "are", "also", "prepared", "with", "permissions", ".", "Where", "applicable", ...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/action/simple.py#L31-L54
train
61,623
merll/docker-map
dockermap/map/action/simple.py
RestartActionGenerator.get_state_actions
def get_state_actions(self, state, **kwargs): """ Restarts instance containers. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and configurations. :...
python
def get_state_actions(self, state, **kwargs): """ Restarts instance containers. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and configurations. :...
[ "def", "get_state_actions", "(", "self", ",", "state", ",", "*", "*", "kwargs", ")", ":", "if", "(", "state", ".", "config_id", ".", "config_type", "==", "ItemType", ".", "CONTAINER", "and", "state", ".", "base_state", "!=", "State", ".", "ABSENT", "and"...
Restarts instance containers. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and configurations. :rtype: list[dockermap.map.action.ItemAction]
[ "Restarts", "instance", "containers", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/action/simple.py#L61-L76
train
61,624
merll/docker-map
dockermap/map/action/simple.py
StopActionGenerator.get_state_actions
def get_state_actions(self, state, **kwargs): """ Stops containers that are running. Does not check attached containers. Considers using the pre-configured ``stop_signal``. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Add...
python
def get_state_actions(self, state, **kwargs): """ Stops containers that are running. Does not check attached containers. Considers using the pre-configured ``stop_signal``. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Add...
[ "def", "get_state_actions", "(", "self", ",", "state", ",", "*", "*", "kwargs", ")", ":", "if", "(", "state", ".", "config_id", ".", "config_type", "==", "ItemType", ".", "CONTAINER", "and", "state", ".", "base_state", "!=", "State", ".", "ABSENT", "and"...
Stops containers that are running. Does not check attached containers. Considers using the pre-configured ``stop_signal``. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client,...
[ "Stops", "containers", "that", "are", "running", ".", "Does", "not", "check", "attached", "containers", ".", "Considers", "using", "the", "pre", "-", "configured", "stop_signal", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/action/simple.py#L80-L93
train
61,625
merll/docker-map
dockermap/map/action/simple.py
RemoveActionGenerator.get_state_actions
def get_state_actions(self, state, **kwargs): """ Removes containers that are stopped. Optionally skips persistent containers. Attached containers are skipped by default from removal but can optionally be included. :param state: Configuration state. :type state: dockermap.map.st...
python
def get_state_actions(self, state, **kwargs): """ Removes containers that are stopped. Optionally skips persistent containers. Attached containers are skipped by default from removal but can optionally be included. :param state: Configuration state. :type state: dockermap.map.st...
[ "def", "get_state_actions", "(", "self", ",", "state", ",", "*", "*", "kwargs", ")", ":", "config_type", "=", "state", ".", "config_id", ".", "config_type", "if", "config_type", "==", "ItemType", ".", "CONTAINER", ":", "extra_data", "=", "kwargs", "else", ...
Removes containers that are stopped. Optionally skips persistent containers. Attached containers are skipped by default from removal but can optionally be included. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword argument...
[ "Removes", "containers", "that", "are", "stopped", ".", "Optionally", "skips", "persistent", "containers", ".", "Attached", "containers", "are", "skipped", "by", "default", "from", "removal", "but", "can", "optionally", "be", "included", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/action/simple.py#L101-L129
train
61,626
merll/docker-map
dockermap/map/action/simple.py
StartupActionGenerator.get_state_actions
def get_state_actions(self, state, **kwargs): """ A combination of CreateActionGenerator and StartActionGenerator - creates and starts containers where appropriate. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional ...
python
def get_state_actions(self, state, **kwargs): """ A combination of CreateActionGenerator and StartActionGenerator - creates and starts containers where appropriate. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional ...
[ "def", "get_state_actions", "(", "self", ",", "state", ",", "*", "*", "kwargs", ")", ":", "config_type", "=", "state", ".", "config_id", ".", "config_type", "if", "config_type", "==", "ItemType", ".", "VOLUME", ":", "if", "state", ".", "base_state", "==", ...
A combination of CreateActionGenerator and StartActionGenerator - creates and starts containers where appropriate. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, an...
[ "A", "combination", "of", "CreateActionGenerator", "and", "StartActionGenerator", "-", "creates", "and", "starts", "containers", "where", "appropriate", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/action/simple.py#L133-L171
train
61,627
merll/docker-map
dockermap/map/action/simple.py
ShutdownActionGenerator.get_state_actions
def get_state_actions(self, state, **kwargs): """ A combination of StopActionGenerator and RemoveActionGenerator - stops and removes containers where appropriate. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional ke...
python
def get_state_actions(self, state, **kwargs): """ A combination of StopActionGenerator and RemoveActionGenerator - stops and removes containers where appropriate. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional ke...
[ "def", "get_state_actions", "(", "self", ",", "state", ",", "*", "*", "kwargs", ")", ":", "config_type", "=", "state", ".", "config_id", ".", "config_type", "if", "config_type", "==", "ItemType", ".", "NETWORK", ":", "if", "state", ".", "base_state", "==",...
A combination of StopActionGenerator and RemoveActionGenerator - stops and removes containers where appropriate. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and ...
[ "A", "combination", "of", "StopActionGenerator", "and", "RemoveActionGenerator", "-", "stops", "and", "removes", "containers", "where", "appropriate", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/action/simple.py#L175-L207
train
61,628
merll/docker-map
dockermap/map/action/simple.py
SignalActionGenerator.get_state_actions
def get_state_actions(self, state, **kwargs): """ Sends kill signals to running containers. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and configuration...
python
def get_state_actions(self, state, **kwargs): """ Sends kill signals to running containers. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and configuration...
[ "def", "get_state_actions", "(", "self", ",", "state", ",", "*", "*", "kwargs", ")", ":", "if", "state", ".", "config_id", ".", "config_type", "==", "ItemType", ".", "CONTAINER", "and", "state", ".", "base_state", "==", "State", ".", "RUNNING", ":", "ret...
Sends kill signals to running containers. :param state: Configuration state. :type state: dockermap.map.state.ConfigState :param kwargs: Additional keyword arguments. :return: Actions on the client, map, and configurations. :rtype: list[dockermap.map.action.ItemAction]
[ "Sends", "kill", "signals", "to", "running", "containers", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/action/simple.py#L211-L222
train
61,629
clarete/curdling
curdling/services/installer.py
get_distribution_paths
def get_distribution_paths(name): """Return target paths where the package content should be installed""" pyver = 'python' + sys.version[:3] paths = { 'prefix' : '{prefix}', 'data' : '{prefix}/lib/{pyver}/site-packages', 'purelib': '{prefix}/lib/{pyver}/site-packages', 'pl...
python
def get_distribution_paths(name): """Return target paths where the package content should be installed""" pyver = 'python' + sys.version[:3] paths = { 'prefix' : '{prefix}', 'data' : '{prefix}/lib/{pyver}/site-packages', 'purelib': '{prefix}/lib/{pyver}/site-packages', 'pl...
[ "def", "get_distribution_paths", "(", "name", ")", ":", "pyver", "=", "'python'", "+", "sys", ".", "version", "[", ":", "3", "]", "paths", "=", "{", "'prefix'", ":", "'{prefix}'", ",", "'data'", ":", "'{prefix}/lib/{pyver}/site-packages'", ",", "'purelib'", ...
Return target paths where the package content should be installed
[ "Return", "target", "paths", "where", "the", "package", "content", "should", "be", "installed" ]
27c160ea0adad2771bee12c48a57208a1a3c4d9a
https://github.com/clarete/curdling/blob/27c160ea0adad2771bee12c48a57208a1a3c4d9a/curdling/services/installer.py#L13-L35
train
61,630
merll/docker-map
dockermap/client/base.py
parse_response
def parse_response(response): """ Decodes the JSON response, simply ignoring syntax errors. Therefore it should be used for filtering visible output only. :param response: Server response as a JSON string. :type response: unicode | str :return: Decoded object from the JSON string. Returns an em...
python
def parse_response(response): """ Decodes the JSON response, simply ignoring syntax errors. Therefore it should be used for filtering visible output only. :param response: Server response as a JSON string. :type response: unicode | str :return: Decoded object from the JSON string. Returns an em...
[ "def", "parse_response", "(", "response", ")", ":", "if", "isinstance", "(", "response", ",", "six", ".", "binary_type", ")", ":", "response", "=", "response", ".", "decode", "(", "'utf-8'", ")", "try", ":", "obj", "=", "json", ".", "loads", "(", "resp...
Decodes the JSON response, simply ignoring syntax errors. Therefore it should be used for filtering visible output only. :param response: Server response as a JSON string. :type response: unicode | str :return: Decoded object from the JSON string. Returns an empty dictionary if input was invalid. :...
[ "Decodes", "the", "JSON", "response", "simply", "ignoring", "syntax", "errors", ".", "Therefore", "it", "should", "be", "used", "for", "filtering", "visible", "output", "only", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/base.py#L21-L37
train
61,631
merll/docker-map
dockermap/client/base.py
DockerClientWrapper.login
def login(self, username, password=None, email=None, registry=None, reauth=False, **kwargs): """ Login to a Docker registry server. :param username: User name for login. :type username: unicode | str :param password: Login password; may be ``None`` if blank. :type passwo...
python
def login(self, username, password=None, email=None, registry=None, reauth=False, **kwargs): """ Login to a Docker registry server. :param username: User name for login. :type username: unicode | str :param password: Login password; may be ``None`` if blank. :type passwo...
[ "def", "login", "(", "self", ",", "username", ",", "password", "=", "None", ",", "email", "=", "None", ",", "registry", "=", "None", ",", "reauth", "=", "False", ",", "*", "*", "kwargs", ")", ":", "response", "=", "super", "(", "DockerClientWrapper", ...
Login to a Docker registry server. :param username: User name for login. :type username: unicode | str :param password: Login password; may be ``None`` if blank. :type password: unicode | str :param email: Optional; email address for login. :type email: unicode | str ...
[ "Login", "to", "a", "Docker", "registry", "server", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/base.py#L131-L151
train
61,632
merll/docker-map
dockermap/client/base.py
DockerClientWrapper.push
def push(self, repository, stream=False, raise_on_error=True, **kwargs): """ Pushes an image repository to the registry. :param repository: Name of the repository (can include a tag). :type repository: unicode | str :param stream: Use the stream output format with additional sta...
python
def push(self, repository, stream=False, raise_on_error=True, **kwargs): """ Pushes an image repository to the registry. :param repository: Name of the repository (can include a tag). :type repository: unicode | str :param stream: Use the stream output format with additional sta...
[ "def", "push", "(", "self", ",", "repository", ",", "stream", "=", "False", ",", "raise_on_error", "=", "True", ",", "*", "*", "kwargs", ")", ":", "response", "=", "super", "(", "DockerClientWrapper", ",", "self", ")", ".", "push", "(", "repository", "...
Pushes an image repository to the registry. :param repository: Name of the repository (can include a tag). :type repository: unicode | str :param stream: Use the stream output format with additional status information. :type stream: bool :param raise_on_error: Raises errors in t...
[ "Pushes", "an", "image", "repository", "to", "the", "registry", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/base.py#L177-L197
train
61,633
merll/docker-map
dockermap/client/base.py
DockerClientWrapper.remove_container
def remove_container(self, container, raise_on_error=True, raise_not_found=False, **kwargs): """ Removes a container. For convenience optionally ignores API errors. :param container: Container name or id. :type container: unicode | str :param raise_on_error: Errors on stop and r...
python
def remove_container(self, container, raise_on_error=True, raise_not_found=False, **kwargs): """ Removes a container. For convenience optionally ignores API errors. :param container: Container name or id. :type container: unicode | str :param raise_on_error: Errors on stop and r...
[ "def", "remove_container", "(", "self", ",", "container", ",", "raise_on_error", "=", "True", ",", "raise_not_found", "=", "False", ",", "*", "*", "kwargs", ")", ":", "try", ":", "super", "(", "DockerClientWrapper", ",", "self", ")", ".", "remove_container",...
Removes a container. For convenience optionally ignores API errors. :param container: Container name or id. :type container: unicode | str :param raise_on_error: Errors on stop and removal may result from Docker volume problems, that may not affect further actions. Such errors are alw...
[ "Removes", "a", "container", ".", "For", "convenience", "optionally", "ignores", "API", "errors", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/base.py#L214-L239
train
61,634
merll/docker-map
dockermap/client/base.py
DockerClientWrapper.stop
def stop(self, container, raise_on_error=True, **kwargs): """ Stops a container. For convenience optionally ignores API errors. :param container: Container name. :type container: unicode | str :param raise_on_error: Errors on stop and removal may result from Docker volume proble...
python
def stop(self, container, raise_on_error=True, **kwargs): """ Stops a container. For convenience optionally ignores API errors. :param container: Container name. :type container: unicode | str :param raise_on_error: Errors on stop and removal may result from Docker volume proble...
[ "def", "stop", "(", "self", ",", "container", ",", "raise_on_error", "=", "True", ",", "*", "*", "kwargs", ")", ":", "try", ":", "super", "(", "DockerClientWrapper", ",", "self", ")", ".", "stop", "(", "container", ",", "*", "*", "kwargs", ")", "exce...
Stops a container. For convenience optionally ignores API errors. :param container: Container name. :type container: unicode | str :param raise_on_error: Errors on stop and removal may result from Docker volume problems, that may not affect further actions. Such errors are always logg...
[ "Stops", "a", "container", ".", "For", "convenience", "optionally", "ignores", "API", "errors", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/base.py#L266-L284
train
61,635
merll/docker-map
dockermap/client/docker_util.py
tag_check_function
def tag_check_function(tags): """ Generates a function that checks whether the given image has any of the listed tags. :param tags: Tags to check for. :type tags: list[unicode | str] | set[unicode | str] :return: Function that returns ``True`` if any of the given tags apply to the image, ``False`` ...
python
def tag_check_function(tags): """ Generates a function that checks whether the given image has any of the listed tags. :param tags: Tags to check for. :type tags: list[unicode | str] | set[unicode | str] :return: Function that returns ``True`` if any of the given tags apply to the image, ``False`` ...
[ "def", "tag_check_function", "(", "tags", ")", ":", "suffixes", "=", "[", "':{0}'", ".", "format", "(", "t", ")", "for", "t", "in", "tags", "]", "def", "_check_image", "(", "image", ")", ":", "repo_tags", "=", "image", "[", "'RepoTags'", "]", "if", "...
Generates a function that checks whether the given image has any of the listed tags. :param tags: Tags to check for. :type tags: list[unicode | str] | set[unicode | str] :return: Function that returns ``True`` if any of the given tags apply to the image, ``False`` otherwise. :rtype: (unicode | str) -> ...
[ "Generates", "a", "function", "that", "checks", "whether", "the", "given", "image", "has", "any", "of", "the", "listed", "tags", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/docker_util.py#L37-L54
train
61,636
merll/docker-map
dockermap/client/docker_util.py
DockerUtilityMixin.add_extra_tags
def add_extra_tags(self, image_id, main_tag, extra_tags, add_latest): """ Adds extra tags to an image after de-duplicating tag names. :param image_id: Id of the image. :type image_id: unicode | str :param main_tag: Repo / tag specification that has been used to build the image. ...
python
def add_extra_tags(self, image_id, main_tag, extra_tags, add_latest): """ Adds extra tags to an image after de-duplicating tag names. :param image_id: Id of the image. :type image_id: unicode | str :param main_tag: Repo / tag specification that has been used to build the image. ...
[ "def", "add_extra_tags", "(", "self", ",", "image_id", ",", "main_tag", ",", "extra_tags", ",", "add_latest", ")", ":", "repo", ",", "__", ",", "i_tag", "=", "main_tag", ".", "rpartition", "(", "':'", ")", "tag_set", "=", "set", "(", "extra_tags", "or", ...
Adds extra tags to an image after de-duplicating tag names. :param image_id: Id of the image. :type image_id: unicode | str :param main_tag: Repo / tag specification that has been used to build the image. If present, the tag will be removed from further arguments. :type main_ta...
[ "Adds", "extra", "tags", "to", "an", "image", "after", "de", "-", "duplicating", "tag", "names", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/docker_util.py#L81-L113
train
61,637
merll/docker-map
dockermap/client/docker_util.py
DockerUtilityMixin.push_log
def push_log(self, info, level, *args, **kwargs): """ Writes logs. To be fully implemented by subclasses. :param info: Log message content. :type info: unicode | str :param level: Logging level. :type level: int :param args: Positional arguments to pass to logger...
python
def push_log(self, info, level, *args, **kwargs): """ Writes logs. To be fully implemented by subclasses. :param info: Log message content. :type info: unicode | str :param level: Logging level. :type level: int :param args: Positional arguments to pass to logger...
[ "def", "push_log", "(", "self", ",", "info", ",", "level", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "log", ".", "log", "(", "level", ",", "info", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Writes logs. To be fully implemented by subclasses. :param info: Log message content. :type info: unicode | str :param level: Logging level. :type level: int :param args: Positional arguments to pass to logger. :param kwargs: Keyword arguments to pass to logger.
[ "Writes", "logs", ".", "To", "be", "fully", "implemented", "by", "subclasses", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/docker_util.py#L115-L126
train
61,638
merll/docker-map
dockermap/client/docker_util.py
DockerUtilityMixin.build_from_context
def build_from_context(self, ctx, tag, **kwargs): """ Builds a docker image from the given docker context with a `Dockerfile` file object. :param ctx: An instance of :class:`~.context.DockerContext`. :type ctx: dockermap.build.context.DockerContext :param tag: New image tag. ...
python
def build_from_context(self, ctx, tag, **kwargs): """ Builds a docker image from the given docker context with a `Dockerfile` file object. :param ctx: An instance of :class:`~.context.DockerContext`. :type ctx: dockermap.build.context.DockerContext :param tag: New image tag. ...
[ "def", "build_from_context", "(", "self", ",", "ctx", ",", "tag", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "build", "(", "fileobj", "=", "ctx", ".", "fileobj", ",", "tag", "=", "tag", ",", "custom_context", "=", "True", ",", "encodin...
Builds a docker image from the given docker context with a `Dockerfile` file object. :param ctx: An instance of :class:`~.context.DockerContext`. :type ctx: dockermap.build.context.DockerContext :param tag: New image tag. :type tag: unicode | str :param kwargs: See :meth:`docker...
[ "Builds", "a", "docker", "image", "from", "the", "given", "docker", "context", "with", "a", "Dockerfile", "file", "object", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/docker_util.py#L128-L140
train
61,639
merll/docker-map
dockermap/client/docker_util.py
DockerUtilityMixin.cleanup_containers
def cleanup_containers(self, include_initial=False, exclude=None, raise_on_error=False, list_only=False): """ Finds all stopped containers and removes them; by default does not remove containers that have never been started. :param include_initial: Consider containers that have never be...
python
def cleanup_containers(self, include_initial=False, exclude=None, raise_on_error=False, list_only=False): """ Finds all stopped containers and removes them; by default does not remove containers that have never been started. :param include_initial: Consider containers that have never be...
[ "def", "cleanup_containers", "(", "self", ",", "include_initial", "=", "False", ",", "exclude", "=", "None", ",", "raise_on_error", "=", "False", ",", "list_only", "=", "False", ")", ":", "exclude_names", "=", "set", "(", "exclude", "or", "(", ")", ")", ...
Finds all stopped containers and removes them; by default does not remove containers that have never been started. :param include_initial: Consider containers that have never been started. :type include_initial: bool :param exclude: Container names to exclude from the cleanup process. ...
[ "Finds", "all", "stopped", "containers", "and", "removes", "them", ";", "by", "default", "does", "not", "remove", "containers", "that", "have", "never", "been", "started", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/docker_util.py#L158-L199
train
61,640
merll/docker-map
dockermap/client/docker_util.py
DockerUtilityMixin.cleanup_images
def cleanup_images(self, remove_old=False, keep_tags=None, force=False, raise_on_error=False, list_only=False): """ Finds all images that are neither used by any container nor another image, and removes them; by default does not remove repository images. :param remove_old: Also removes ...
python
def cleanup_images(self, remove_old=False, keep_tags=None, force=False, raise_on_error=False, list_only=False): """ Finds all images that are neither used by any container nor another image, and removes them; by default does not remove repository images. :param remove_old: Also removes ...
[ "def", "cleanup_images", "(", "self", ",", "remove_old", "=", "False", ",", "keep_tags", "=", "None", ",", "force", "=", "False", ",", "raise_on_error", "=", "False", ",", "list_only", "=", "False", ")", ":", "used_images", "=", "set", "(", "self", ".", ...
Finds all images that are neither used by any container nor another image, and removes them; by default does not remove repository images. :param remove_old: Also removes images that have repository names, but no `latest` tag. :type remove_old: bool :param keep_tags: List of tags to not...
[ "Finds", "all", "images", "that", "are", "neither", "used", "by", "any", "container", "nor", "another", "image", "and", "removes", "them", ";", "by", "default", "does", "not", "remove", "repository", "images", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/docker_util.py#L201-L257
train
61,641
merll/docker-map
dockermap/client/docker_util.py
DockerUtilityMixin.get_container_names
def get_container_names(self): """ Fetches names of all present containers from Docker. :return: All container names. :rtype: set """ current_containers = self.containers(all=True) return set(c_name[1:] for c in current_containers for c_name in c['Names'])
python
def get_container_names(self): """ Fetches names of all present containers from Docker. :return: All container names. :rtype: set """ current_containers = self.containers(all=True) return set(c_name[1:] for c in current_containers for c_name in c['Names'])
[ "def", "get_container_names", "(", "self", ")", ":", "current_containers", "=", "self", ".", "containers", "(", "all", "=", "True", ")", "return", "set", "(", "c_name", "[", "1", ":", "]", "for", "c", "in", "current_containers", "for", "c_name", "in", "c...
Fetches names of all present containers from Docker. :return: All container names. :rtype: set
[ "Fetches", "names", "of", "all", "present", "containers", "from", "Docker", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/client/docker_util.py#L303-L311
train
61,642
merll/docker-map
dockermap/functional.py
resolve_value
def resolve_value(value, types=type_registry): """ Returns the actual value for the given object, if it is a late-resolving object type. If not, the value itself is simply returned. :param value: Lazy object, registered type in :attr:`type_registry`, or a simple value. In the latter case, the valu...
python
def resolve_value(value, types=type_registry): """ Returns the actual value for the given object, if it is a late-resolving object type. If not, the value itself is simply returned. :param value: Lazy object, registered type in :attr:`type_registry`, or a simple value. In the latter case, the valu...
[ "def", "resolve_value", "(", "value", ",", "types", "=", "type_registry", ")", ":", "if", "value", "is", "None", ":", "return", "None", "elif", "isinstance", "(", "value", ",", "lazy_type", ")", ":", "return", "value", ".", "get", "(", ")", "elif", "ty...
Returns the actual value for the given object, if it is a late-resolving object type. If not, the value itself is simply returned. :param value: Lazy object, registered type in :attr:`type_registry`, or a simple value. In the latter case, the value is returned as-is. :type value: str | unicode | int |...
[ "Returns", "the", "actual", "value", "for", "the", "given", "object", "if", "it", "is", "a", "late", "-", "resolving", "object", "type", ".", "If", "not", "the", "value", "itself", "is", "simply", "returned", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/functional.py#L169-L187
train
61,643
merll/docker-map
dockermap/functional.py
resolve_deep
def resolve_deep(values, max_depth=5, types=None): """ Resolves all late-resolving types into their current values to a certain depth in a dictionary or list. :param values: Values to resolve of any type. :param max_depth: Maximum depth to recurse into nested lists, tuples and dictionaries. Below that ...
python
def resolve_deep(values, max_depth=5, types=None): """ Resolves all late-resolving types into their current values to a certain depth in a dictionary or list. :param values: Values to resolve of any type. :param max_depth: Maximum depth to recurse into nested lists, tuples and dictionaries. Below that ...
[ "def", "resolve_deep", "(", "values", ",", "max_depth", "=", "5", ",", "types", "=", "None", ")", ":", "def", "_resolve_sub", "(", "v", ",", "level", ")", ":", "l1", "=", "level", "+", "1", "res_val", "=", "resolve_value", "(", "v", ",", "all_types",...
Resolves all late-resolving types into their current values to a certain depth in a dictionary or list. :param values: Values to resolve of any type. :param max_depth: Maximum depth to recurse into nested lists, tuples and dictionaries. Below that depth values are returned as they are. :type max_depth...
[ "Resolves", "all", "late", "-", "resolving", "types", "into", "their", "current", "values", "to", "a", "certain", "depth", "in", "a", "dictionary", "or", "list", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/functional.py#L190-L217
train
61,644
merll/docker-map
dockermap/functional.py
LazyOnceObject.get
def get(self): """ Resolves and returns the object value. Re-uses an existing previous evaluation, if applicable. :return: The result of evaluating the object. """ if not self._evaluated: self._val = self._func(*self._args, **self._kwargs) self._evaluated...
python
def get(self): """ Resolves and returns the object value. Re-uses an existing previous evaluation, if applicable. :return: The result of evaluating the object. """ if not self._evaluated: self._val = self._func(*self._args, **self._kwargs) self._evaluated...
[ "def", "get", "(", "self", ")", ":", "if", "not", "self", ".", "_evaluated", ":", "self", ".", "_val", "=", "self", ".", "_func", "(", "*", "self", ".", "_args", ",", "*", "*", "self", ".", "_kwargs", ")", "self", ".", "_evaluated", "=", "True", ...
Resolves and returns the object value. Re-uses an existing previous evaluation, if applicable. :return: The result of evaluating the object.
[ "Resolves", "and", "returns", "the", "object", "value", ".", "Re", "-", "uses", "an", "existing", "previous", "evaluation", "if", "applicable", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/functional.py#L124-L133
train
61,645
merll/docker-map
dockermap/map/state/utils.py
merge_dependency_paths
def merge_dependency_paths(item_paths): """ Utility function that merges multiple dependency paths, as far as they share dependencies. Paths are evaluated and merged in the incoming order. Later paths that are independent, but share some dependencies, are shortened by these dependencies. Paths that are ...
python
def merge_dependency_paths(item_paths): """ Utility function that merges multiple dependency paths, as far as they share dependencies. Paths are evaluated and merged in the incoming order. Later paths that are independent, but share some dependencies, are shortened by these dependencies. Paths that are ...
[ "def", "merge_dependency_paths", "(", "item_paths", ")", ":", "merged_paths", "=", "[", "]", "for", "item", ",", "path", "in", "item_paths", ":", "sub_path_idx", "=", "[", "]", "path_set", "=", "set", "(", "path", ")", "for", "index", ",", "(", "merged_i...
Utility function that merges multiple dependency paths, as far as they share dependencies. Paths are evaluated and merged in the incoming order. Later paths that are independent, but share some dependencies, are shortened by these dependencies. Paths that are contained in another entirely are discarded. :p...
[ "Utility", "function", "that", "merges", "multiple", "dependency", "paths", "as", "far", "as", "they", "share", "dependencies", ".", "Paths", "are", "evaluated", "and", "merged", "in", "the", "incoming", "order", ".", "Later", "paths", "that", "are", "independ...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/state/utils.py#L5-L35
train
61,646
merll/docker-map
dockermap/map/config/__init__.py
ConfigurationObject.update_from_dict
def update_from_dict(self, dct): """ Updates this configuration object from a dictionary. See :meth:`ConfigurationObject.update` for details. :param dct: Values to update the ConfigurationObject with. :type dct: dict """ if not dct: return al...
python
def update_from_dict(self, dct): """ Updates this configuration object from a dictionary. See :meth:`ConfigurationObject.update` for details. :param dct: Values to update the ConfigurationObject with. :type dct: dict """ if not dct: return al...
[ "def", "update_from_dict", "(", "self", ",", "dct", ")", ":", "if", "not", "dct", ":", "return", "all_props", "=", "self", ".", "__class__", ".", "CONFIG_PROPERTIES", "for", "key", ",", "value", "in", "six", ".", "iteritems", "(", "dct", ")", ":", "att...
Updates this configuration object from a dictionary. See :meth:`ConfigurationObject.update` for details. :param dct: Values to update the ConfigurationObject with. :type dct: dict
[ "Updates", "this", "configuration", "object", "from", "a", "dictionary", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/__init__.py#L140-L157
train
61,647
merll/docker-map
dockermap/map/config/__init__.py
ConfigurationObject.update_from_obj
def update_from_obj(self, obj, copy=False): """ Updates this configuration object from another. See :meth:`ConfigurationObject.update` for details. :param obj: Values to update the ConfigurationObject with. :type obj: ConfigurationObject :param copy: Copies lists and di...
python
def update_from_obj(self, obj, copy=False): """ Updates this configuration object from another. See :meth:`ConfigurationObject.update` for details. :param obj: Values to update the ConfigurationObject with. :type obj: ConfigurationObject :param copy: Copies lists and di...
[ "def", "update_from_obj", "(", "self", ",", "obj", ",", "copy", "=", "False", ")", ":", "obj", ".", "clean", "(", ")", "obj_config", "=", "obj", ".", "_config", "all_props", "=", "self", ".", "__class__", ".", "CONFIG_PROPERTIES", "if", "copy", ":", "f...
Updates this configuration object from another. See :meth:`ConfigurationObject.update` for details. :param obj: Values to update the ConfigurationObject with. :type obj: ConfigurationObject :param copy: Copies lists and dictionaries. :type copy: bool
[ "Updates", "this", "configuration", "object", "from", "another", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/__init__.py#L159-L191
train
61,648
merll/docker-map
dockermap/map/config/__init__.py
ConfigurationObject.merge_from_dict
def merge_from_dict(self, dct, lists_only=False): """ Merges a dictionary into this configuration object. See :meth:`ConfigurationObject.merge` for details. :param dct: Values to update the ConfigurationObject with. :type dct: dict :param lists_only: Ignore single-value...
python
def merge_from_dict(self, dct, lists_only=False): """ Merges a dictionary into this configuration object. See :meth:`ConfigurationObject.merge` for details. :param dct: Values to update the ConfigurationObject with. :type dct: dict :param lists_only: Ignore single-value...
[ "def", "merge_from_dict", "(", "self", ",", "dct", ",", "lists_only", "=", "False", ")", ":", "if", "not", "dct", ":", "return", "self", ".", "clean", "(", ")", "all_props", "=", "self", ".", "__class__", ".", "CONFIG_PROPERTIES", "for", "key", ",", "v...
Merges a dictionary into this configuration object. See :meth:`ConfigurationObject.merge` for details. :param dct: Values to update the ConfigurationObject with. :type dct: dict :param lists_only: Ignore single-value attributes and update dictionary options. :type lists_only: b...
[ "Merges", "a", "dictionary", "into", "this", "configuration", "object", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/__init__.py#L193-L218
train
61,649
merll/docker-map
dockermap/map/config/__init__.py
ConfigurationObject.merge_from_obj
def merge_from_obj(self, obj, lists_only=False): """ Merges a configuration object into this one. See :meth:`ConfigurationObject.merge` for details. :param obj: Values to update the ConfigurationObject with. :type obj: ConfigurationObject :param lists_only: Ignore singl...
python
def merge_from_obj(self, obj, lists_only=False): """ Merges a configuration object into this one. See :meth:`ConfigurationObject.merge` for details. :param obj: Values to update the ConfigurationObject with. :type obj: ConfigurationObject :param lists_only: Ignore singl...
[ "def", "merge_from_obj", "(", "self", ",", "obj", ",", "lists_only", "=", "False", ")", ":", "self", ".", "clean", "(", ")", "obj", ".", "clean", "(", ")", "obj_config", "=", "obj", ".", "_config", "all_props", "=", "self", ".", "__class__", ".", "CO...
Merges a configuration object into this one. See :meth:`ConfigurationObject.merge` for details. :param obj: Values to update the ConfigurationObject with. :type obj: ConfigurationObject :param lists_only: Ignore single-value attributes and update dictionary options. :type lists...
[ "Merges", "a", "configuration", "object", "into", "this", "one", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/__init__.py#L220-L240
train
61,650
merll/docker-map
dockermap/map/config/__init__.py
ConfigurationObject.update
def update(self, values, copy_instance=False): """ Updates the configuration with the contents of the given configuration object or dictionary. In case of a dictionary, only valid attributes for this class are considered. Existing attributes are replaced with the new values. The object ...
python
def update(self, values, copy_instance=False): """ Updates the configuration with the contents of the given configuration object or dictionary. In case of a dictionary, only valid attributes for this class are considered. Existing attributes are replaced with the new values. The object ...
[ "def", "update", "(", "self", ",", "values", ",", "copy_instance", "=", "False", ")", ":", "if", "isinstance", "(", "values", ",", "self", ".", "__class__", ")", ":", "self", ".", "update_from_obj", "(", "values", ",", "copy", "=", "copy_instance", ")", ...
Updates the configuration with the contents of the given configuration object or dictionary. In case of a dictionary, only valid attributes for this class are considered. Existing attributes are replaced with the new values. The object is not cleaned before or after, i.e. may accept invalid input. ...
[ "Updates", "the", "configuration", "with", "the", "contents", "of", "the", "given", "configuration", "object", "or", "dictionary", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/__init__.py#L242-L263
train
61,651
merll/docker-map
dockermap/map/config/__init__.py
ConfigurationObject.merge
def merge(self, values, lists_only=False): """ Merges list-based attributes into one list including unique elements from both lists. When ``lists_only`` is set to ``False``, updates dictionaries and overwrites single-value attributes. The resulting configuration is 'clean', i.e. input va...
python
def merge(self, values, lists_only=False): """ Merges list-based attributes into one list including unique elements from both lists. When ``lists_only`` is set to ``False``, updates dictionaries and overwrites single-value attributes. The resulting configuration is 'clean', i.e. input va...
[ "def", "merge", "(", "self", ",", "values", ",", "lists_only", "=", "False", ")", ":", "if", "isinstance", "(", "values", ",", "self", ".", "__class__", ")", ":", "self", ".", "merge_from_obj", "(", "values", ",", "lists_only", "=", "lists_only", ")", ...
Merges list-based attributes into one list including unique elements from both lists. When ``lists_only`` is set to ``False``, updates dictionaries and overwrites single-value attributes. The resulting configuration is 'clean', i.e. input values converted and validated. If the conversion is not possible...
[ "Merges", "list", "-", "based", "attributes", "into", "one", "list", "including", "unique", "elements", "from", "both", "lists", ".", "When", "lists_only", "is", "set", "to", "False", "updates", "dictionaries", "and", "overwrites", "single", "-", "value", "att...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/__init__.py#L265-L283
train
61,652
merll/docker-map
dockermap/map/config/__init__.py
ConfigurationObject.clean
def clean(self): """ Cleans the input values of this configuration object. Fields that have gotten updated through properties are converted to configuration values that match the format needed by functions using them. For example, for list-like values it means that input of single strin...
python
def clean(self): """ Cleans the input values of this configuration object. Fields that have gotten updated through properties are converted to configuration values that match the format needed by functions using them. For example, for list-like values it means that input of single strin...
[ "def", "clean", "(", "self", ")", ":", "all_props", "=", "self", ".", "__class__", ".", "CONFIG_PROPERTIES", "for", "prop_name", "in", "self", ".", "_modified", ":", "attr_config", "=", "all_props", ".", "get", "(", "prop_name", ")", "if", "attr_config", "...
Cleans the input values of this configuration object. Fields that have gotten updated through properties are converted to configuration values that match the format needed by functions using them. For example, for list-like values it means that input of single strings is transformed into a sing...
[ "Cleans", "the", "input", "values", "of", "this", "configuration", "object", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/__init__.py#L294-L307
train
61,653
merll/docker-map
dockermap/map/config/__init__.py
ConfigurationObject.as_dict
def as_dict(self): """ Returns a copy of the configuration dictionary. Changes in this should not reflect on the original object. :return: Configuration dictionary. :rtype: dict """ self.clean() d = OrderedDict() all_props = self.__class__.CONFIG_...
python
def as_dict(self): """ Returns a copy of the configuration dictionary. Changes in this should not reflect on the original object. :return: Configuration dictionary. :rtype: dict """ self.clean() d = OrderedDict() all_props = self.__class__.CONFIG_...
[ "def", "as_dict", "(", "self", ")", ":", "self", ".", "clean", "(", ")", "d", "=", "OrderedDict", "(", ")", "all_props", "=", "self", ".", "__class__", ".", "CONFIG_PROPERTIES", "for", "attr_name", ",", "attr_config", "in", "six", ".", "iteritems", "(", ...
Returns a copy of the configuration dictionary. Changes in this should not reflect on the original object. :return: Configuration dictionary. :rtype: dict
[ "Returns", "a", "copy", "of", "the", "configuration", "dictionary", ".", "Changes", "in", "this", "should", "not", "reflect", "on", "the", "original", "object", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/__init__.py#L319-L344
train
61,654
merll/docker-map
dockermap/dep.py
BaseDependencyResolver.get_dependencies
def get_dependencies(self, item): """ Performs a dependency check on the given item. :param item: Node to start the dependency check with. :return: The result on merged dependencies down the hierarchy. """ def _get_sub_dependency(sub_item): e = self._deps.get...
python
def get_dependencies(self, item): """ Performs a dependency check on the given item. :param item: Node to start the dependency check with. :return: The result on merged dependencies down the hierarchy. """ def _get_sub_dependency(sub_item): e = self._deps.get...
[ "def", "get_dependencies", "(", "self", ",", "item", ")", ":", "def", "_get_sub_dependency", "(", "sub_item", ")", ":", "e", "=", "self", ".", "_deps", ".", "get", "(", "sub_item", ")", "if", "e", "is", "None", ":", "return", "self", ".", "get_default"...
Performs a dependency check on the given item. :param item: Node to start the dependency check with. :return: The result on merged dependencies down the hierarchy.
[ "Performs", "a", "dependency", "check", "on", "the", "given", "item", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/dep.py#L108-L124
train
61,655
merll/docker-map
dockermap/dep.py
BaseDependencyResolver.get
def get(self, item): """ Returns the direct dependencies or dependents of a single item. Does not follow the entire dependency path. :param item: Node to return dependencies for. :return: Immediate dependencies or dependents. """ e = self._deps.get(item) if e is ...
python
def get(self, item): """ Returns the direct dependencies or dependents of a single item. Does not follow the entire dependency path. :param item: Node to return dependencies for. :return: Immediate dependencies or dependents. """ e = self._deps.get(item) if e is ...
[ "def", "get", "(", "self", ",", "item", ")", ":", "e", "=", "self", ".", "_deps", ".", "get", "(", "item", ")", "if", "e", "is", "None", ":", "return", "self", ".", "get_default", "(", ")", "return", "e", ".", "parent" ]
Returns the direct dependencies or dependents of a single item. Does not follow the entire dependency path. :param item: Node to return dependencies for. :return: Immediate dependencies or dependents.
[ "Returns", "the", "direct", "dependencies", "or", "dependents", "of", "a", "single", "item", ".", "Does", "not", "follow", "the", "entire", "dependency", "path", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/dep.py#L126-L136
train
61,656
merll/docker-map
dockermap/dep.py
ImageDependentsResolver.merge_dependency
def merge_dependency(self, item, resolve_parent, parents): """ Merge dependencies of element with further dependencies. First parent dependencies are checked, and then immediate dependencies of the current element should be added to the list, but without duplicating any entries. :param ...
python
def merge_dependency(self, item, resolve_parent, parents): """ Merge dependencies of element with further dependencies. First parent dependencies are checked, and then immediate dependencies of the current element should be added to the list, but without duplicating any entries. :param ...
[ "def", "merge_dependency", "(", "self", ",", "item", ",", "resolve_parent", ",", "parents", ")", ":", "dep", "=", "[", "]", "for", "parent_key", "in", "parents", ":", "if", "item", "==", "parent_key", ":", "raise", "CircularDependency", "(", "item", ",", ...
Merge dependencies of element with further dependencies. First parent dependencies are checked, and then immediate dependencies of the current element should be added to the list, but without duplicating any entries. :param item: Item. :param resolve_parent: Function to resolve parent dependenc...
[ "Merge", "dependencies", "of", "element", "with", "further", "dependencies", ".", "First", "parent", "dependencies", "are", "checked", "and", "then", "immediate", "dependencies", "of", "the", "current", "element", "should", "be", "added", "to", "the", "list", "b...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/dep.py#L159-L181
train
61,657
merll/docker-map
dockermap/dep.py
MultiForwardDependencyResolver.update
def update(self, items): """ Updates the dependencies with the given items. Note that this does not reset all previously-evaluated and cached nodes. :param items: Iterable or dictionary in the format `(dependent_item, dependencies)`. :type items: collections.Iterable """...
python
def update(self, items): """ Updates the dependencies with the given items. Note that this does not reset all previously-evaluated and cached nodes. :param items: Iterable or dictionary in the format `(dependent_item, dependencies)`. :type items: collections.Iterable """...
[ "def", "update", "(", "self", ",", "items", ")", ":", "for", "item", ",", "parents", "in", "_iterate_dependencies", "(", "items", ")", ":", "dep", "=", "self", ".", "_deps", "[", "item", "]", "merge_list", "(", "dep", ".", "parent", ",", "parents", "...
Updates the dependencies with the given items. Note that this does not reset all previously-evaluated and cached nodes. :param items: Iterable or dictionary in the format `(dependent_item, dependencies)`. :type items: collections.Iterable
[ "Updates", "the", "dependencies", "with", "the", "given", "items", ".", "Note", "that", "this", "does", "not", "reset", "all", "previously", "-", "evaluated", "and", "cached", "nodes", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/dep.py#L206-L216
train
61,658
merll/docker-map
dockermap/map/runner/signal_stop.py
SignalMixin.signal_stop
def signal_stop(self, action, c_name, **kwargs): """ Stops a container, either using the default client stop method, or sending a custom signal and waiting for the container to stop. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :pa...
python
def signal_stop(self, action, c_name, **kwargs): """ Stops a container, either using the default client stop method, or sending a custom signal and waiting for the container to stop. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :pa...
[ "def", "signal_stop", "(", "self", ",", "action", ",", "c_name", ",", "*", "*", "kwargs", ")", ":", "client", "=", "action", ".", "client", "sig", "=", "action", ".", "config", ".", "stop_signal", "stop_kwargs", "=", "self", ".", "get_container_stop_kwargs...
Stops a container, either using the default client stop method, or sending a custom signal and waiting for the container to stop. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param c_name: Container name. :type c_name: unicode | str ...
[ "Stops", "a", "container", "either", "using", "the", "default", "client", "stop", "method", "or", "sending", "a", "custom", "signal", "and", "waiting", "for", "the", "container", "to", "stop", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/signal_stop.py#L20-L47
train
61,659
merll/docker-map
dockermap/build/context.py
preprocess_matches
def preprocess_matches(input_items): """ Converts, as far as possible, Go filepath.Match patterns into Python regular expression patterns. Blank lines are ignored. This is a generator of two-element-tuples, with the first item as the compiled regular expression. Items prefixed with an exclamation m...
python
def preprocess_matches(input_items): """ Converts, as far as possible, Go filepath.Match patterns into Python regular expression patterns. Blank lines are ignored. This is a generator of two-element-tuples, with the first item as the compiled regular expression. Items prefixed with an exclamation m...
[ "def", "preprocess_matches", "(", "input_items", ")", ":", "for", "i", "in", "input_items", ":", "s", "=", "i", ".", "strip", "(", ")", "if", "not", "s", ":", "continue", "if", "s", "[", "0", "]", "==", "'!'", ":", "is_negative", "=", "True", "matc...
Converts, as far as possible, Go filepath.Match patterns into Python regular expression patterns. Blank lines are ignored. This is a generator of two-element-tuples, with the first item as the compiled regular expression. Items prefixed with an exclamation mark are considered negative exclusions, i.e. exem...
[ "Converts", "as", "far", "as", "possible", "Go", "filepath", ".", "Match", "patterns", "into", "Python", "regular", "expression", "patterns", ".", "Blank", "lines", "are", "ignored", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/build/context.py#L17-L42
train
61,660
merll/docker-map
dockermap/build/context.py
get_exclusions
def get_exclusions(path): """ Generates exclusion patterns from a ``.dockerignore`` file located in the given path. Returns ``None`` if the file does not exist. :param path: Path to look up the ``.dockerignore`` in. :type path: unicode | str :return: List of patterns, that can be passed into :f...
python
def get_exclusions(path): """ Generates exclusion patterns from a ``.dockerignore`` file located in the given path. Returns ``None`` if the file does not exist. :param path: Path to look up the ``.dockerignore`` in. :type path: unicode | str :return: List of patterns, that can be passed into :f...
[ "def", "get_exclusions", "(", "path", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "return", "None", "dockerignore_file", "=", "os", ".", "path", ".", "join", "(", "path", ",", "'.dockerignore'", ")", "if", "not", "o...
Generates exclusion patterns from a ``.dockerignore`` file located in the given path. Returns ``None`` if the file does not exist. :param path: Path to look up the ``.dockerignore`` in. :type path: unicode | str :return: List of patterns, that can be passed into :func:`get_filter_func`. :rtype: lis...
[ "Generates", "exclusion", "patterns", "from", "a", ".", "dockerignore", "file", "located", "in", "the", "given", "path", ".", "Returns", "None", "if", "the", "file", "does", "not", "exist", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/build/context.py#L45-L61
train
61,661
merll/docker-map
dockermap/build/context.py
DockerContext.add
def add(self, name, arcname=None, **kwargs): """ Add a file or directory to the context tarball. :param name: File or directory path. :type name: unicode | str :param args: Additional args for :meth:`tarfile.TarFile.add`. :param kwargs: Additional kwargs for :meth:`tarfi...
python
def add(self, name, arcname=None, **kwargs): """ Add a file or directory to the context tarball. :param name: File or directory path. :type name: unicode | str :param args: Additional args for :meth:`tarfile.TarFile.add`. :param kwargs: Additional kwargs for :meth:`tarfi...
[ "def", "add", "(", "self", ",", "name", ",", "arcname", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "name", ")", ":", "exclusions", "=", "get_exclusions", "(", "name", ")", "if", "exclusions", ":", ...
Add a file or directory to the context tarball. :param name: File or directory path. :type name: unicode | str :param args: Additional args for :meth:`tarfile.TarFile.add`. :param kwargs: Additional kwargs for :meth:`tarfile.TarFile.add`.
[ "Add", "a", "file", "or", "directory", "to", "the", "context", "tarball", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/build/context.py#L144-L158
train
61,662
merll/docker-map
dockermap/build/context.py
DockerContext.save
def save(self, name): """ Saves the entire Docker context tarball to a separate file. :param name: File path to save the tarball into. :type name: unicode | str """ with open(name, 'wb+') as f: while True: buf = self._fileobj.read() ...
python
def save(self, name): """ Saves the entire Docker context tarball to a separate file. :param name: File path to save the tarball into. :type name: unicode | str """ with open(name, 'wb+') as f: while True: buf = self._fileobj.read() ...
[ "def", "save", "(", "self", ",", "name", ")", ":", "with", "open", "(", "name", ",", "'wb+'", ")", "as", "f", ":", "while", "True", ":", "buf", "=", "self", ".", "_fileobj", ".", "read", "(", ")", "if", "not", "buf", ":", "break", "f", ".", "...
Saves the entire Docker context tarball to a separate file. :param name: File path to save the tarball into. :type name: unicode | str
[ "Saves", "the", "entire", "Docker", "context", "tarball", "to", "a", "separate", "file", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/build/context.py#L242-L254
train
61,663
merll/docker-map
dockermap/map/runner/utils.py
get_volumes
def get_volumes(container_map, config, default_volume_paths, include_named): """ Generates volume paths for the ``volumes`` argument during container creation. :param container_map: Container map. :type container_map: dockermap.map.config.main.ContainerMap :param config: Container configuration. ...
python
def get_volumes(container_map, config, default_volume_paths, include_named): """ Generates volume paths for the ``volumes`` argument during container creation. :param container_map: Container map. :type container_map: dockermap.map.config.main.ContainerMap :param config: Container configuration. ...
[ "def", "get_volumes", "(", "container_map", ",", "config", ",", "default_volume_paths", ",", "include_named", ")", ":", "def", "_bind_volume_path", "(", "vol", ")", ":", "if", "isinstance", "(", "vol", ",", "HostVolume", ")", ":", "return", "resolve_value", "(...
Generates volume paths for the ``volumes`` argument during container creation. :param container_map: Container map. :type container_map: dockermap.map.config.main.ContainerMap :param config: Container configuration. :type config: dockermap.map.config.container.ContainerConfiguration :param default_...
[ "Generates", "volume", "paths", "for", "the", "volumes", "argument", "during", "container", "creation", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/utils.py#L65-L109
train
61,664
merll/docker-map
dockermap/map/runner/utils.py
get_volumes_from
def get_volumes_from(container_map, config_name, config, policy, include_volumes): """ Generates volume paths for the host config ``volumes_from`` argument during container creation. :param container_map: Container map. :type container_map: dockermap.map.config.main.ContainerMap :param config_name:...
python
def get_volumes_from(container_map, config_name, config, policy, include_volumes): """ Generates volume paths for the host config ``volumes_from`` argument during container creation. :param container_map: Container map. :type container_map: dockermap.map.config.main.ContainerMap :param config_name:...
[ "def", "get_volumes_from", "(", "container_map", ",", "config_name", ",", "config", ",", "policy", ",", "include_volumes", ")", ":", "aname", "=", "policy", ".", "aname", "cname", "=", "policy", ".", "cname", "map_name", "=", "container_map", ".", "name", "v...
Generates volume paths for the host config ``volumes_from`` argument during container creation. :param container_map: Container map. :type container_map: dockermap.map.config.main.ContainerMap :param config_name: Container configuration name. :type config_name: unicode | str :param config: Containe...
[ "Generates", "volume", "paths", "for", "the", "host", "config", "volumes_from", "argument", "during", "container", "creation", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/utils.py#L112-L167
train
61,665
merll/docker-map
dockermap/map/runner/utils.py
get_port_bindings
def get_port_bindings(container_config, client_config): """ Generates the input dictionary contents for the ``port_bindings`` argument. :param container_config: Container configuration. :type container_config: dockermap.map.config.container.ContainerConfiguration :param client_config: Client config...
python
def get_port_bindings(container_config, client_config): """ Generates the input dictionary contents for the ``port_bindings`` argument. :param container_config: Container configuration. :type container_config: dockermap.map.config.container.ContainerConfiguration :param client_config: Client config...
[ "def", "get_port_bindings", "(", "container_config", ",", "client_config", ")", ":", "port_bindings", "=", "{", "}", "if_ipv4", "=", "client_config", ".", "interfaces", "if_ipv6", "=", "client_config", ".", "interfaces_ipv6", "for", "exposed_port", ",", "ex_port_bin...
Generates the input dictionary contents for the ``port_bindings`` argument. :param container_config: Container configuration. :type container_config: dockermap.map.config.container.ContainerConfiguration :param client_config: Client configuration. :type client_config: dockermap.map.config.client.Client...
[ "Generates", "the", "input", "dictionary", "contents", "for", "the", "port_bindings", "argument", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/utils.py#L244-L263
train
61,666
merll/docker-map
dockermap/map/runner/utils.py
get_preparation_cmd
def get_preparation_cmd(user, permissions, path): """ Generates the command lines for adjusting a volume's ownership and permission flags. Returns an empty list if there is nothing to adjust. :param user: User to set ownership for on the path via ``chown``. :type user: unicode | str | int | dockerm...
python
def get_preparation_cmd(user, permissions, path): """ Generates the command lines for adjusting a volume's ownership and permission flags. Returns an empty list if there is nothing to adjust. :param user: User to set ownership for on the path via ``chown``. :type user: unicode | str | int | dockerm...
[ "def", "get_preparation_cmd", "(", "user", ",", "permissions", ",", "path", ")", ":", "r_user", "=", "resolve_value", "(", "user", ")", "r_permissions", "=", "resolve_value", "(", "permissions", ")", "if", "user", ":", "yield", "chown", "(", "r_user", ",", ...
Generates the command lines for adjusting a volume's ownership and permission flags. Returns an empty list if there is nothing to adjust. :param user: User to set ownership for on the path via ``chown``. :type user: unicode | str | int | dockermap.functional.AbstractLazyObject :param permissions: Permi...
[ "Generates", "the", "command", "lines", "for", "adjusting", "a", "volume", "s", "ownership", "and", "permission", "flags", ".", "Returns", "an", "empty", "list", "if", "there", "is", "nothing", "to", "adjust", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/utils.py#L266-L285
train
61,667
clarete/curdling
curdling/index.py
Index.get_urlhash
def get_urlhash(self, url, fmt): """Returns the hash of the file of an internal url """ with self.open(os.path.basename(url)) as f: return {'url': fmt(url), 'sha256': filehash(f, 'sha256')}
python
def get_urlhash(self, url, fmt): """Returns the hash of the file of an internal url """ with self.open(os.path.basename(url)) as f: return {'url': fmt(url), 'sha256': filehash(f, 'sha256')}
[ "def", "get_urlhash", "(", "self", ",", "url", ",", "fmt", ")", ":", "with", "self", ".", "open", "(", "os", ".", "path", ".", "basename", "(", "url", ")", ")", "as", "f", ":", "return", "{", "'url'", ":", "fmt", "(", "url", ")", ",", "'sha256'...
Returns the hash of the file of an internal url
[ "Returns", "the", "hash", "of", "the", "file", "of", "an", "internal", "url" ]
27c160ea0adad2771bee12c48a57208a1a3c4d9a
https://github.com/clarete/curdling/blob/27c160ea0adad2771bee12c48a57208a1a3c4d9a/curdling/index.py#L108-L112
train
61,668
clarete/curdling
curdling/index.py
Index.package_releases
def package_releases(self, package, url_fmt=lambda u: u): """List all versions of a package Along with the version, the caller also receives the file list with all the available formats. """ return [{ 'name': package, 'version': version, 'urls...
python
def package_releases(self, package, url_fmt=lambda u: u): """List all versions of a package Along with the version, the caller also receives the file list with all the available formats. """ return [{ 'name': package, 'version': version, 'urls...
[ "def", "package_releases", "(", "self", ",", "package", ",", "url_fmt", "=", "lambda", "u", ":", "u", ")", ":", "return", "[", "{", "'name'", ":", "package", ",", "'version'", ":", "version", ",", "'urls'", ":", "[", "self", ".", "get_urlhash", "(", ...
List all versions of a package Along with the version, the caller also receives the file list with all the available formats.
[ "List", "all", "versions", "of", "a", "package" ]
27c160ea0adad2771bee12c48a57208a1a3c4d9a
https://github.com/clarete/curdling/blob/27c160ea0adad2771bee12c48a57208a1a3c4d9a/curdling/index.py#L114-L124
train
61,669
merll/docker-map
dockermap/map/state/base.py
ContainerBaseState.inspect
def inspect(self): """ Fetches information about the container from the client. """ policy = self.policy config_id = self.config_id if self.config_id.config_type == ItemType.VOLUME: if self.container_map.use_attached_parent_name: container_name...
python
def inspect(self): """ Fetches information about the container from the client. """ policy = self.policy config_id = self.config_id if self.config_id.config_type == ItemType.VOLUME: if self.container_map.use_attached_parent_name: container_name...
[ "def", "inspect", "(", "self", ")", ":", "policy", "=", "self", ".", "policy", "config_id", "=", "self", ".", "config_id", "if", "self", ".", "config_id", ".", "config_type", "==", "ItemType", ".", "VOLUME", ":", "if", "self", ".", "container_map", ".", ...
Fetches information about the container from the client.
[ "Fetches", "information", "about", "the", "container", "from", "the", "client", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/state/base.py#L107-L125
train
61,670
merll/docker-map
dockermap/map/state/base.py
ImageBaseState.inspect
def inspect(self): """ Fetches image information from the client. """ policy = self.policy image_name = format_image_tag((self.config_id.config_name, self.config_id.instance_name)) image_id = policy.images[self.client_name].get(image_name) if image_id: ...
python
def inspect(self): """ Fetches image information from the client. """ policy = self.policy image_name = format_image_tag((self.config_id.config_name, self.config_id.instance_name)) image_id = policy.images[self.client_name].get(image_name) if image_id: ...
[ "def", "inspect", "(", "self", ")", ":", "policy", "=", "self", ".", "policy", "image_name", "=", "format_image_tag", "(", "(", "self", ".", "config_id", ".", "config_name", ",", "self", ".", "config_id", ".", "instance_name", ")", ")", "image_id", "=", ...
Fetches image information from the client.
[ "Fetches", "image", "information", "from", "the", "client", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/state/base.py#L268-L278
train
61,671
merll/docker-map
dockermap/map/state/base.py
AbstractStateGenerator.generate_config_states
def generate_config_states(self, config_id, config_flags=ConfigFlags.NONE): """ Generates the actions on a single item, which can be either a dependency or a explicitly selected container. :param config_id: Configuration id tuple. :type config_id: dockermap.map.input.MapConfigId...
python
def generate_config_states(self, config_id, config_flags=ConfigFlags.NONE): """ Generates the actions on a single item, which can be either a dependency or a explicitly selected container. :param config_id: Configuration id tuple. :type config_id: dockermap.map.input.MapConfigId...
[ "def", "generate_config_states", "(", "self", ",", "config_id", ",", "config_flags", "=", "ConfigFlags", ".", "NONE", ")", ":", "c_map", "=", "self", ".", "_policy", ".", "container_maps", "[", "config_id", ".", "map_name", "]", "clients", "=", "c_map", ".",...
Generates the actions on a single item, which can be either a dependency or a explicitly selected container. :param config_id: Configuration id tuple. :type config_id: dockermap.map.input.MapConfigId :param config_flags: Optional configuration flags. :type config_flags: dockerma...
[ "Generates", "the", "actions", "on", "a", "single", "item", "which", "can", "be", "either", "a", "dependency", "or", "a", "explicitly", "selected", "container", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/state/base.py#L313-L348
train
61,672
merll/docker-map
dockermap/map/state/base.py
SingleStateGenerator.get_states
def get_states(self, config_ids): """ Generates state information for the selected containers. :param config_ids: List of MapConfigId tuples. :type config_ids: list[dockermap.map.input.MapConfigId] :return: Iterable of configuration states. :rtype: collections.Iterable[d...
python
def get_states(self, config_ids): """ Generates state information for the selected containers. :param config_ids: List of MapConfigId tuples. :type config_ids: list[dockermap.map.input.MapConfigId] :return: Iterable of configuration states. :rtype: collections.Iterable[d...
[ "def", "get_states", "(", "self", ",", "config_ids", ")", ":", "return", "itertools", ".", "chain", ".", "from_iterable", "(", "self", ".", "generate_config_states", "(", "config_id", ")", "for", "config_id", "in", "config_ids", ")" ]
Generates state information for the selected containers. :param config_ids: List of MapConfigId tuples. :type config_ids: list[dockermap.map.input.MapConfigId] :return: Iterable of configuration states. :rtype: collections.Iterable[dockermap.map.state.ConfigState]
[ "Generates", "state", "information", "for", "the", "selected", "containers", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/state/base.py#L378-L388
train
61,673
merll/docker-map
dockermap/map/runner/attached.py
AttachedConfigMixin.get_attached_preparation_wait_kwargs
def get_attached_preparation_wait_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for waiting for a container when preparing a volume. The container name may be the container being prepared, or the id of the container calling preparation commands. :par...
python
def get_attached_preparation_wait_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for waiting for a container when preparing a volume. The container name may be the container being prepared, or the id of the container calling preparation commands. :par...
[ "def", "get_attached_preparation_wait_kwargs", "(", "self", ",", "action", ",", "container_name", ",", "kwargs", "=", "None", ")", ":", "c_kwargs", "=", "dict", "(", "container", "=", "container_name", ")", "client_config", "=", "action", ".", "client_config", "...
Generates keyword arguments for waiting for a container when preparing a volume. The container name may be the container being prepared, or the id of the container calling preparation commands. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param c...
[ "Generates", "keyword", "arguments", "for", "waiting", "for", "a", "container", "when", "preparing", "a", "volume", ".", "The", "container", "name", "may", "be", "the", "container", "being", "prepared", "or", "the", "id", "of", "the", "container", "calling", ...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/attached.py#L91-L112
train
61,674
merll/docker-map
dockermap/map/runner/attached.py
AttachedPreparationMixin._prepare_container
def _prepare_container(self, client, action, volume_container, volume_alias): """ Runs a temporary container for preparing an attached volume for a container configuration. :param client: Docker client. :type client: docker.Client :param action: Action configuration. :ty...
python
def _prepare_container(self, client, action, volume_container, volume_alias): """ Runs a temporary container for preparing an attached volume for a container configuration. :param client: Docker client. :type client: docker.Client :param action: Action configuration. :ty...
[ "def", "_prepare_container", "(", "self", ",", "client", ",", "action", ",", "volume_container", ",", "volume_alias", ")", ":", "apc_kwargs", "=", "self", ".", "get_attached_preparation_create_kwargs", "(", "action", ",", "volume_container", ",", "volume_alias", ")"...
Runs a temporary container for preparing an attached volume for a container configuration. :param client: Docker client. :type client: docker.Client :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param volume_container: Name of the containe...
[ "Runs", "a", "temporary", "container", "for", "preparing", "an", "attached", "volume", "for", "a", "container", "configuration", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/attached.py#L125-L154
train
61,675
merll/docker-map
dockermap/map/runner/attached.py
AttachedPreparationMixin.prepare_attached
def prepare_attached(self, action, a_name, **kwargs): """ Prepares an attached volume for a container configuration. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param a_name: The full name or id of the container sharing the volume. ...
python
def prepare_attached(self, action, a_name, **kwargs): """ Prepares an attached volume for a container configuration. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param a_name: The full name or id of the container sharing the volume. ...
[ "def", "prepare_attached", "(", "self", ",", "action", ",", "a_name", ",", "*", "*", "kwargs", ")", ":", "client", "=", "action", ".", "client", "config_id", "=", "action", ".", "config_id", "policy", "=", "self", ".", "_policy", "if", "action", ".", "...
Prepares an attached volume for a container configuration. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param a_name: The full name or id of the container sharing the volume. :type a_name: unicode | str
[ "Prepares", "an", "attached", "volume", "for", "a", "container", "configuration", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/attached.py#L156-L191
train
61,676
merll/docker-map
dockermap/map/policy/utils.py
get_shared_volume_path
def get_shared_volume_path(container_map, vol, instance=None): """ Resolves a volume alias of a container configuration or a tuple of two paths to the host and container paths. :param container_map: Container map. :type container_map: dockermap.map.config.main.ContainerMap :param vol: SharedVolume ...
python
def get_shared_volume_path(container_map, vol, instance=None): """ Resolves a volume alias of a container configuration or a tuple of two paths to the host and container paths. :param container_map: Container map. :type container_map: dockermap.map.config.main.ContainerMap :param vol: SharedVolume ...
[ "def", "get_shared_volume_path", "(", "container_map", ",", "vol", ",", "instance", "=", "None", ")", ":", "if", "isinstance", "(", "vol", ",", "HostVolume", ")", ":", "c_path", "=", "resolve_value", "(", "vol", ".", "path", ")", "if", "is_path", "(", "c...
Resolves a volume alias of a container configuration or a tuple of two paths to the host and container paths. :param container_map: Container map. :type container_map: dockermap.map.config.main.ContainerMap :param vol: SharedVolume or HostVolume tuple. :type vol: dockermap.map.input.HostVolume | docker...
[ "Resolves", "a", "volume", "alias", "of", "a", "container", "configuration", "or", "a", "tuple", "of", "two", "paths", "to", "the", "host", "and", "container", "paths", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/utils.py#L54-L78
train
61,677
merll/docker-map
dockermap/map/policy/utils.py
get_instance_volumes
def get_instance_volumes(instance_detail, check_names): """ Extracts the mount points and mapped directories or names of a Docker container. :param instance_detail: Result from a container inspection. :type instance_detail: dict :param check_names: Whether to check for named volumes. :type chec...
python
def get_instance_volumes(instance_detail, check_names): """ Extracts the mount points and mapped directories or names of a Docker container. :param instance_detail: Result from a container inspection. :type instance_detail: dict :param check_names: Whether to check for named volumes. :type chec...
[ "def", "get_instance_volumes", "(", "instance_detail", ",", "check_names", ")", ":", "if", "'Mounts'", "in", "instance_detail", ":", "if", "check_names", ":", "return", "{", "m", "[", "'Destination'", "]", ":", "m", ".", "get", "(", "'Name'", ")", "or", "m...
Extracts the mount points and mapped directories or names of a Docker container. :param instance_detail: Result from a container inspection. :type instance_detail: dict :param check_names: Whether to check for named volumes. :type check_names: bool :return: Dictionary of volumes, with the destinati...
[ "Extracts", "the", "mount", "points", "and", "mapped", "directories", "or", "names", "of", "a", "Docker", "container", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/utils.py#L81-L99
train
61,678
merll/docker-map
dockermap/utils.py
merge_list
def merge_list(merged_list, items): """ Merges items into a list, appends ignoring duplicates but retaining the original order. This modifies the list and does not return anything. :param merged_list: List to append de-duplicated items to. :type merged_list: list :param items: Items to merge in...
python
def merge_list(merged_list, items): """ Merges items into a list, appends ignoring duplicates but retaining the original order. This modifies the list and does not return anything. :param merged_list: List to append de-duplicated items to. :type merged_list: list :param items: Items to merge in...
[ "def", "merge_list", "(", "merged_list", ",", "items", ")", ":", "if", "not", "items", ":", "return", "merged_set", "=", "set", "(", "merged_list", ")", "merged_add", "=", "merged_set", ".", "add", "merged_list", ".", "extend", "(", "item", "for", "item", ...
Merges items into a list, appends ignoring duplicates but retaining the original order. This modifies the list and does not return anything. :param merged_list: List to append de-duplicated items to. :type merged_list: list :param items: Items to merge into the list. :type items: collections.Iterab...
[ "Merges", "items", "into", "a", "list", "appends", "ignoring", "duplicates", "but", "retaining", "the", "original", "order", ".", "This", "modifies", "the", "list", "and", "does", "not", "return", "anything", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/utils.py#L13-L29
train
61,679
merll/docker-map
dockermap/map/runner/network.py
NetworkUtilMixin.disconnect_all_containers
def disconnect_all_containers(self, action, network_name, containers, **kwargs): """ Disconnects all containers from a network. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param network_name: Network name or id. :type network_nam...
python
def disconnect_all_containers(self, action, network_name, containers, **kwargs): """ Disconnects all containers from a network. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param network_name: Network name or id. :type network_nam...
[ "def", "disconnect_all_containers", "(", "self", ",", "action", ",", "network_name", ",", "containers", ",", "*", "*", "kwargs", ")", ":", "client", "=", "action", ".", "client", "for", "c_name", "in", "containers", ":", "disconnect_kwargs", "=", "self", "."...
Disconnects all containers from a network. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param network_name: Network name or id. :type network_name: unicode | str :param containers: Container names or ids. :type containers: collect...
[ "Disconnects", "all", "containers", "from", "a", "network", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/network.py#L19-L35
train
61,680
merll/docker-map
dockermap/map/runner/network.py
NetworkUtilMixin.connect_networks
def connect_networks(self, action, container_name, endpoints, skip_first=False, **kwargs): """ Connects a container to a set of configured networks. By default this assumes the container has just been created, so it will skip the first network that is already considered during creation. ...
python
def connect_networks(self, action, container_name, endpoints, skip_first=False, **kwargs): """ Connects a container to a set of configured networks. By default this assumes the container has just been created, so it will skip the first network that is already considered during creation. ...
[ "def", "connect_networks", "(", "self", ",", "action", ",", "container_name", ",", "endpoints", ",", "skip_first", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "not", "endpoints", "or", "(", "skip_first", "and", "len", "(", "endpoints", ")", "<...
Connects a container to a set of configured networks. By default this assumes the container has just been created, so it will skip the first network that is already considered during creation. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param co...
[ "Connects", "a", "container", "to", "a", "set", "of", "configured", "networks", ".", "By", "default", "this", "assumes", "the", "container", "has", "just", "been", "created", "so", "it", "will", "skip", "the", "first", "network", "that", "is", "already", "...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/network.py#L37-L65
train
61,681
merll/docker-map
dockermap/map/runner/network.py
NetworkUtilMixin.disconnect_networks
def disconnect_networks(self, action, container_name, networks, **kwargs): """ Disconnects a container from a set of networks. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param container_name: Container names or id. :type contain...
python
def disconnect_networks(self, action, container_name, networks, **kwargs): """ Disconnects a container from a set of networks. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param container_name: Container names or id. :type contain...
[ "def", "disconnect_networks", "(", "self", ",", "action", ",", "container_name", ",", "networks", ",", "*", "*", "kwargs", ")", ":", "client", "=", "action", ".", "client", "for", "n_name", "in", "networks", ":", "disconnect_kwargs", "=", "self", ".", "get...
Disconnects a container from a set of networks. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param container_name: Container names or id. :type container_name: unicode | str :param networks: List of network names or ids. :type net...
[ "Disconnects", "a", "container", "from", "a", "set", "of", "networks", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/network.py#L67-L83
train
61,682
merll/docker-map
dockermap/map/runner/network.py
NetworkUtilMixin.connect_all_networks
def connect_all_networks(self, action, container_name, **kwargs): """ Connects a container to all of its configured networks. Assuming that this is typically used after container creation, where teh first endpoint is already defined, this skips the first configuration. Pass ``skip_first`` ...
python
def connect_all_networks(self, action, container_name, **kwargs): """ Connects a container to all of its configured networks. Assuming that this is typically used after container creation, where teh first endpoint is already defined, this skips the first configuration. Pass ``skip_first`` ...
[ "def", "connect_all_networks", "(", "self", ",", "action", ",", "container_name", ",", "*", "*", "kwargs", ")", ":", "kwargs", ".", "setdefault", "(", "'skip_first'", ",", "True", ")", "self", ".", "connect_networks", "(", "action", ",", "container_name", ",...
Connects a container to all of its configured networks. Assuming that this is typically used after container creation, where teh first endpoint is already defined, this skips the first configuration. Pass ``skip_first`` as ``False`` to change this. :param action: Action configuration. :...
[ "Connects", "a", "container", "to", "all", "of", "its", "configured", "networks", ".", "Assuming", "that", "this", "is", "typically", "used", "after", "container", "creation", "where", "teh", "first", "endpoint", "is", "already", "defined", "this", "skips", "t...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/network.py#L85-L99
train
61,683
merll/docker-map
dockermap/build/buffer.py
DockerStringBuffer.save
def save(self, name): """ Save the string buffer to a file. Finalizes prior to saving. :param name: File path. :type name: unicode | str """ self.finalize() with open(name, 'wb+') as f: if six.PY3: f.write(self.fileobj.getbuffer()) ...
python
def save(self, name): """ Save the string buffer to a file. Finalizes prior to saving. :param name: File path. :type name: unicode | str """ self.finalize() with open(name, 'wb+') as f: if six.PY3: f.write(self.fileobj.getbuffer()) ...
[ "def", "save", "(", "self", ",", "name", ")", ":", "self", ".", "finalize", "(", ")", "with", "open", "(", "name", ",", "'wb+'", ")", "as", "f", ":", "if", "six", ".", "PY3", ":", "f", ".", "write", "(", "self", ".", "fileobj", ".", "getbuffer"...
Save the string buffer to a file. Finalizes prior to saving. :param name: File path. :type name: unicode | str
[ "Save", "the", "string", "buffer", "to", "a", "file", ".", "Finalizes", "prior", "to", "saving", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/build/buffer.py#L102-L114
train
61,684
merll/docker-map
dockermap/build/buffer.py
DockerTempFile.save
def save(self, name): """ Copy the contents of the temporary file somewhere else. Finalizes prior to saving. :param name: File path. :type name: unicode | str """ self.finalize() with open(name, 'wb+') as f: buf = self._fileobj.read() whil...
python
def save(self, name): """ Copy the contents of the temporary file somewhere else. Finalizes prior to saving. :param name: File path. :type name: unicode | str """ self.finalize() with open(name, 'wb+') as f: buf = self._fileobj.read() whil...
[ "def", "save", "(", "self", ",", "name", ")", ":", "self", ".", "finalize", "(", ")", "with", "open", "(", "name", ",", "'wb+'", ")", "as", "f", ":", "buf", "=", "self", ".", "_fileobj", ".", "read", "(", ")", "while", "buf", ":", "f", ".", "...
Copy the contents of the temporary file somewhere else. Finalizes prior to saving. :param name: File path. :type name: unicode | str
[ "Copy", "the", "contents", "of", "the", "temporary", "file", "somewhere", "else", ".", "Finalizes", "prior", "to", "saving", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/build/buffer.py#L124-L136
train
61,685
merll/docker-map
dockermap/map/input.py
is_path
def is_path(value): """ Checks whether the given value represents a path, i.e. a string which starts with an indicator for absolute or relative paths. :param value: Value to check. :return: ``True``, if the value appears to be representing a path. :rtype: bool """ return value and isins...
python
def is_path(value): """ Checks whether the given value represents a path, i.e. a string which starts with an indicator for absolute or relative paths. :param value: Value to check. :return: ``True``, if the value appears to be representing a path. :rtype: bool """ return value and isins...
[ "def", "is_path", "(", "value", ")", ":", "return", "value", "and", "isinstance", "(", "value", ",", "six", ".", "string_types", ")", "and", "(", "value", "[", "0", "]", "==", "posixpath", ".", "sep", "or", "value", "[", ":", "2", "]", "==", "CURRE...
Checks whether the given value represents a path, i.e. a string which starts with an indicator for absolute or relative paths. :param value: Value to check. :return: ``True``, if the value appears to be representing a path. :rtype: bool
[ "Checks", "whether", "the", "given", "value", "represents", "a", "path", "i", ".", "e", ".", "a", "string", "which", "starts", "with", "an", "indicator", "for", "absolute", "or", "relative", "paths", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/input.py#L229-L238
train
61,686
merll/docker-map
dockermap/map/input.py
get_list
def get_list(value): """ Wraps the given value in a list. ``None`` returns an empty list. Lists and tuples are returned as lists. Single strings and registered types are wrapped in a list. :param value: Value to return as a list. :return: List with the provided value(s). :rtype: list """ ...
python
def get_list(value): """ Wraps the given value in a list. ``None`` returns an empty list. Lists and tuples are returned as lists. Single strings and registered types are wrapped in a list. :param value: Value to return as a list. :return: List with the provided value(s). :rtype: list """ ...
[ "def", "get_list", "(", "value", ")", ":", "if", "value", "is", "None", ":", "return", "[", "]", "elif", "value", "is", "NotSet", ":", "return", "NotSet", "elif", "isinstance", "(", "value", ",", "(", "list", ",", "tuple", ")", ")", ":", "return", ...
Wraps the given value in a list. ``None`` returns an empty list. Lists and tuples are returned as lists. Single strings and registered types are wrapped in a list. :param value: Value to return as a list. :return: List with the provided value(s). :rtype: list
[ "Wraps", "the", "given", "value", "in", "a", "list", ".", "None", "returns", "an", "empty", "list", ".", "Lists", "and", "tuples", "are", "returned", "as", "lists", ".", "Single", "strings", "and", "registered", "types", "are", "wrapped", "in", "a", "lis...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/input.py#L266-L284
train
61,687
merll/docker-map
dockermap/map/input.py
get_network_mode
def get_network_mode(value): """ Generates input for the ``network_mode`` of a Docker host configuration. If it points at a container, the configuration of the container is returned. :param value: Network mode input. :type value: unicode | str | tuple | list | NoneType :return: Network mode or ...
python
def get_network_mode(value): """ Generates input for the ``network_mode`` of a Docker host configuration. If it points at a container, the configuration of the container is returned. :param value: Network mode input. :type value: unicode | str | tuple | list | NoneType :return: Network mode or ...
[ "def", "get_network_mode", "(", "value", ")", ":", "if", "not", "value", "or", "value", "==", "'disabled'", ":", "return", "'none'", "if", "isinstance", "(", "value", ",", "(", "tuple", ",", "list", ")", ")", ":", "if", "len", "(", "value", ")", "=="...
Generates input for the ``network_mode`` of a Docker host configuration. If it points at a container, the configuration of the container is returned. :param value: Network mode input. :type value: unicode | str | tuple | list | NoneType :return: Network mode or container to re-use the network stack of....
[ "Generates", "input", "for", "the", "network_mode", "of", "a", "Docker", "host", "configuration", ".", "If", "it", "points", "at", "a", "container", "the", "configuration", "of", "the", "container", "is", "returned", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/input.py#L339-L362
train
61,688
merll/docker-map
dockermap/map/input.py
AttachedVolumeList.get_type_item
def get_type_item(self, value): """ Converts the given value to a ``UsedVolume`` or ``SharedVolume`` tuple for attached volumes. It accepts strings, lists, tuples, and dicts as input. For strings and collections of a single element, the first item is considered to be an alias for lookup...
python
def get_type_item(self, value): """ Converts the given value to a ``UsedVolume`` or ``SharedVolume`` tuple for attached volumes. It accepts strings, lists, tuples, and dicts as input. For strings and collections of a single element, the first item is considered to be an alias for lookup...
[ "def", "get_type_item", "(", "self", ",", "value", ")", ":", "if", "isinstance", "(", "value", ",", "(", "UsedVolume", ",", "SharedVolume", ")", ")", ":", "if", "value", ".", "readonly", ":", "raise", "ValueError", "(", "\"Attached volumes should not be read-o...
Converts the given value to a ``UsedVolume`` or ``SharedVolume`` tuple for attached volumes. It accepts strings, lists, tuples, and dicts as input. For strings and collections of a single element, the first item is considered to be an alias for lookup on the map. It is converted to a ``SharedVo...
[ "Converts", "the", "given", "value", "to", "a", "UsedVolume", "or", "SharedVolume", "tuple", "for", "attached", "volumes", ".", "It", "accepts", "strings", "lists", "tuples", "and", "dicts", "as", "input", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/input.py#L438-L480
train
61,689
merll/docker-map
dockermap/map/config/utils.py
expand_groups
def expand_groups(config_ids, maps): """ Iterates over a list of container configuration ids, expanding groups of container configurations. :param config_ids: List of container configuration ids. :type config_ids: collections.Iterable[dockermap.map.input.InputConfigId | dockermap.map.input.MapConfigId]...
python
def expand_groups(config_ids, maps): """ Iterates over a list of container configuration ids, expanding groups of container configurations. :param config_ids: List of container configuration ids. :type config_ids: collections.Iterable[dockermap.map.input.InputConfigId | dockermap.map.input.MapConfigId]...
[ "def", "expand_groups", "(", "config_ids", ",", "maps", ")", ":", "for", "config_id", "in", "config_ids", ":", "if", "config_id", ".", "map_name", "==", "'__all__'", ":", "c_maps", "=", "six", ".", "iteritems", "(", "maps", ")", "else", ":", "c_maps", "=...
Iterates over a list of container configuration ids, expanding groups of container configurations. :param config_ids: List of container configuration ids. :type config_ids: collections.Iterable[dockermap.map.input.InputConfigId | dockermap.map.input.MapConfigId] :param maps: Extended container maps. :t...
[ "Iterates", "over", "a", "list", "of", "container", "configuration", "ids", "expanding", "groups", "of", "container", "configurations", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/utils.py#L42-L83
train
61,690
merll/docker-map
dockermap/map/config/utils.py
expand_instances
def expand_instances(config_ids, ext_maps): """ Iterates over a list of input configuration ids, expanding configured instances if ``None`` is specified. Otherwise where instance names are specified as a tuple, they are expanded. :param config_ids: Iterable of container configuration ids or (map, confi...
python
def expand_instances(config_ids, ext_maps): """ Iterates over a list of input configuration ids, expanding configured instances if ``None`` is specified. Otherwise where instance names are specified as a tuple, they are expanded. :param config_ids: Iterable of container configuration ids or (map, confi...
[ "def", "expand_instances", "(", "config_ids", ",", "ext_maps", ")", ":", "for", "type_map_config", ",", "items", "in", "itertools", ".", "groupby", "(", "sorted", "(", "config_ids", ",", "key", "=", "get_map_config", ")", ",", "get_map_config", ")", ":", "co...
Iterates over a list of input configuration ids, expanding configured instances if ``None`` is specified. Otherwise where instance names are specified as a tuple, they are expanded. :param config_ids: Iterable of container configuration ids or (map, config, instance names) tuples. :type config_ids: collect...
[ "Iterates", "over", "a", "list", "of", "input", "configuration", "ids", "expanding", "configured", "instances", "if", "None", "is", "specified", ".", "Otherwise", "where", "instance", "names", "are", "specified", "as", "a", "tuple", "they", "are", "expanded", ...
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/config/utils.py#L86-L111
train
61,691
merll/docker-map
dockermap/map/runner/base.py
DockerBaseRunnerMixin.create_network
def create_network(self, action, n_name, **kwargs): """ Creates a configured network. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param n_name: Network name. :type n_name: unicode | str :param kwargs: Additional keyword a...
python
def create_network(self, action, n_name, **kwargs): """ Creates a configured network. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param n_name: Network name. :type n_name: unicode | str :param kwargs: Additional keyword a...
[ "def", "create_network", "(", "self", ",", "action", ",", "n_name", ",", "*", "*", "kwargs", ")", ":", "c_kwargs", "=", "self", ".", "get_network_create_kwargs", "(", "action", ",", "n_name", ",", "*", "*", "kwargs", ")", "res", "=", "action", ".", "cl...
Creates a configured network. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param n_name: Network name. :type n_name: unicode | str :param kwargs: Additional keyword arguments to complement or override the configuration-based values. ...
[ "Creates", "a", "configured", "network", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L48-L62
train
61,692
merll/docker-map
dockermap/map/runner/base.py
DockerBaseRunnerMixin.remove_network
def remove_network(self, action, n_name, **kwargs): """ Removes a network. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param n_name: Network name or id. :type n_name: unicode | str :param kwargs: Additional keyword argume...
python
def remove_network(self, action, n_name, **kwargs): """ Removes a network. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param n_name: Network name or id. :type n_name: unicode | str :param kwargs: Additional keyword argume...
[ "def", "remove_network", "(", "self", ",", "action", ",", "n_name", ",", "*", "*", "kwargs", ")", ":", "c_kwargs", "=", "self", ".", "get_network_remove_kwargs", "(", "action", ",", "n_name", ",", "*", "*", "kwargs", ")", "res", "=", "action", ".", "cl...
Removes a network. :param action: Action configuration. :type action: dockermap.map.runner.ActionConfig :param n_name: Network name or id. :type n_name: unicode | str :param kwargs: Additional keyword arguments. :type kwargs: dict
[ "Removes", "a", "network", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L64-L78
train
61,693
merll/docker-map
dockermap/map/runner/base.py
DockerConfigMixin.get_container_create_kwargs
def get_container_create_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to create a container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name. :type container...
python
def get_container_create_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to create a container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name. :type container...
[ "def", "get_container_create_kwargs", "(", "self", ",", "action", ",", "container_name", ",", "kwargs", "=", "None", ")", ":", "policy", "=", "self", ".", "_policy", "client_config", "=", "action", ".", "client_config", "container_map", "=", "action", ".", "co...
Generates keyword arguments for the Docker client to create a container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name. :type container_name: unicode | str :param kwargs: Additional keyword arguments to complement or overri...
[ "Generates", "keyword", "arguments", "for", "the", "Docker", "client", "to", "create", "a", "container", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L161-L216
train
61,694
merll/docker-map
dockermap/map/runner/base.py
DockerConfigMixin.get_attached_container_create_kwargs
def get_attached_container_create_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to create an attached container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name. ...
python
def get_attached_container_create_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to create an attached container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name. ...
[ "def", "get_attached_container_create_kwargs", "(", "self", ",", "action", ",", "container_name", ",", "kwargs", "=", "None", ")", ":", "client_config", "=", "action", ".", "client_config", "policy", "=", "self", ".", "_policy", "config_id", "=", "action", ".", ...
Generates keyword arguments for the Docker client to create an attached container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name. :type container_name: unicode | str :param kwargs: Additional keyword arguments to complement...
[ "Generates", "keyword", "arguments", "for", "the", "Docker", "client", "to", "create", "an", "attached", "container", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L259-L294
train
61,695
merll/docker-map
dockermap/map/runner/base.py
DockerConfigMixin.get_attached_container_host_config_kwargs
def get_attached_container_host_config_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to set up the HostConfig or start an attached container. :param action: Action configuration. :type action: ActionConfig :param contain...
python
def get_attached_container_host_config_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to set up the HostConfig or start an attached container. :param action: Action configuration. :type action: ActionConfig :param contain...
[ "def", "get_attached_container_host_config_kwargs", "(", "self", ",", "action", ",", "container_name", ",", "kwargs", "=", "None", ")", ":", "if", "container_name", ":", "c_kwargs", "=", "{", "'container'", ":", "container_name", "}", "else", ":", "c_kwargs", "=...
Generates keyword arguments for the Docker client to set up the HostConfig or start an attached container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name or id. Set ``None`` when included in kwargs for ``create_container``. :type co...
[ "Generates", "keyword", "arguments", "for", "the", "Docker", "client", "to", "set", "up", "the", "HostConfig", "or", "start", "an", "attached", "container", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L296-L314
train
61,696
merll/docker-map
dockermap/map/runner/base.py
DockerConfigMixin.get_container_update_kwargs
def get_container_update_kwargs(self, action, container_name, update_values, kwargs=None): """ Generates keyword arguments for the Docker client to update the HostConfig of an existing container. :param action: Action configuration. :type action: ActionConfig :param container_na...
python
def get_container_update_kwargs(self, action, container_name, update_values, kwargs=None): """ Generates keyword arguments for the Docker client to update the HostConfig of an existing container. :param action: Action configuration. :type action: ActionConfig :param container_na...
[ "def", "get_container_update_kwargs", "(", "self", ",", "action", ",", "container_name", ",", "update_values", ",", "kwargs", "=", "None", ")", ":", "c_kwargs", "=", "dict", "(", "container", "=", "container_name", ")", "update_kwargs", "(", "c_kwargs", ",", "...
Generates keyword arguments for the Docker client to update the HostConfig of an existing container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name or id. :type container_name: unicode | str :param update_values: Dictionary ...
[ "Generates", "keyword", "arguments", "for", "the", "Docker", "client", "to", "update", "the", "HostConfig", "of", "an", "existing", "container", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L316-L333
train
61,697
merll/docker-map
dockermap/map/runner/base.py
DockerConfigMixin.get_container_wait_kwargs
def get_container_wait_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to wait for a container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name or id. :type con...
python
def get_container_wait_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to wait for a container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name or id. :type con...
[ "def", "get_container_wait_kwargs", "(", "self", ",", "action", ",", "container_name", ",", "kwargs", "=", "None", ")", ":", "c_kwargs", "=", "dict", "(", "container", "=", "container_name", ")", "timeout", "=", "action", ".", "client_config", ".", "get", "(...
Generates keyword arguments for the Docker client to wait for a container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name or id. :type container_name: unicode | str :param kwargs: Additional keyword arguments to complement o...
[ "Generates", "keyword", "arguments", "for", "the", "Docker", "client", "to", "wait", "for", "a", "container", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L359-L377
train
61,698
merll/docker-map
dockermap/map/runner/base.py
DockerConfigMixin.get_container_stop_kwargs
def get_container_stop_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to stop a container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name or id. :type contain...
python
def get_container_stop_kwargs(self, action, container_name, kwargs=None): """ Generates keyword arguments for the Docker client to stop a container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name or id. :type contain...
[ "def", "get_container_stop_kwargs", "(", "self", ",", "action", ",", "container_name", ",", "kwargs", "=", "None", ")", ":", "c_kwargs", "=", "dict", "(", "container", "=", "container_name", ",", ")", "stop_timeout", "=", "action", ".", "config", ".", "stop_...
Generates keyword arguments for the Docker client to stop a container. :param action: Action configuration. :type action: ActionConfig :param container_name: Container name or id. :type container_name: unicode | str :param kwargs: Additional keyword arguments to complement or ov...
[ "Generates", "keyword", "arguments", "for", "the", "Docker", "client", "to", "stop", "a", "container", "." ]
e14fe86a6ff5c33d121eb2f9157e9359cb80dd02
https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L379-L403
train
61,699