id int32 0 252k | 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 list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
44,700 | 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 |
44,701 | 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 |
44,702 | 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 |
44,703 | 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 |
44,704 | 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 |
44,705 | 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 |
44,706 | 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 |
44,707 | 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 |
44,708 | 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 |
44,709 | 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 |
44,710 | 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 |
44,711 | 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 |
44,712 | 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 |
44,713 | 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 |
44,714 | 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 |
44,715 | 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 |
44,716 | 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 |
44,717 | 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 |
44,718 | 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 |
44,719 | 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 |
44,720 | 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 |
44,721 | 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 |
44,722 | 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 |
44,723 | 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 |
44,724 | 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 |
44,725 | 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 |
44,726 | 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 |
44,727 | 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 |
44,728 | 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 |
44,729 | 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 |
44,730 | 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 |
44,731 | 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 |
44,732 | 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 |
44,733 | 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 |
44,734 | 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 |
44,735 | 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 |
44,736 | 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 |
44,737 | 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 |
44,738 | 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 |
44,739 | 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 |
44,740 | 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 |
44,741 | 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 |
44,742 | 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 |
44,743 | 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 |
44,744 | 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 |
44,745 | 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 |
44,746 | 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 |
44,747 | 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 |
44,748 | 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 |
44,749 | 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 |
44,750 | 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 |
44,751 | 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 |
44,752 | 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 |
44,753 | 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 |
44,754 | 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 |
44,755 | 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 |
44,756 | 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 |
44,757 | 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 |
44,758 | 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 |
44,759 | 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 |
44,760 | 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 |
44,761 | 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 |
44,762 | 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 |
44,763 | merll/docker-map | dockermap/map/runner/base.py | DockerConfigMixin.get_container_remove_kwargs | def get_container_remove_kwargs(self, action, container_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to remove a container.
:param action: Action configuration.
:type action: ActionConfig
:param container_name: Container name or id.
:type con... | python | def get_container_remove_kwargs(self, action, container_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to remove a container.
:param action: Action configuration.
:type action: ActionConfig
:param container_name: Container name or id.
:type con... | [
"def",
"get_container_remove_kwargs",
"(",
"self",
",",
"action",
",",
"container_name",
",",
"kwargs",
"=",
"None",
")",
":",
"c_kwargs",
"=",
"dict",
"(",
"container",
"=",
"container_name",
")",
"update_kwargs",
"(",
"c_kwargs",
",",
"kwargs",
")",
"return"... | Generates keyword arguments for the Docker client to remove 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 ... | [
"Generates",
"keyword",
"arguments",
"for",
"the",
"Docker",
"client",
"to",
"remove",
"a",
"container",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L405-L420 |
44,764 | merll/docker-map | dockermap/map/runner/base.py | DockerConfigMixin.get_network_create_kwargs | def get_network_create_kwargs(self, action, network_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to create a network.
:param action: Action configuration.
:type action: ActionConfig
:param network_name: Network name or id.
:type network_name:... | python | def get_network_create_kwargs(self, action, network_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to create a network.
:param action: Action configuration.
:type action: ActionConfig
:param network_name: Network name or id.
:type network_name:... | [
"def",
"get_network_create_kwargs",
"(",
"self",
",",
"action",
",",
"network_name",
",",
"kwargs",
"=",
"None",
")",
":",
"config",
"=",
"action",
".",
"config",
"c_kwargs",
"=",
"dict",
"(",
"name",
"=",
"network_name",
",",
"driver",
"=",
"config",
".",... | Generates keyword arguments for the Docker client to create a network.
:param action: Action configuration.
:type action: ActionConfig
:param network_name: Network name or id.
:type network_name: unicode | str
:param kwargs: Additional keyword arguments to complement or override... | [
"Generates",
"keyword",
"arguments",
"for",
"the",
"Docker",
"client",
"to",
"create",
"a",
"network",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L422-L448 |
44,765 | merll/docker-map | dockermap/map/runner/base.py | DockerConfigMixin.get_network_remove_kwargs | def get_network_remove_kwargs(self, action, network_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to remove a network.
:param action: Action configuration.
:type action: ActionConfig
:param network_name: Network name or id.
:type network_name:... | python | def get_network_remove_kwargs(self, action, network_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to remove a network.
:param action: Action configuration.
:type action: ActionConfig
:param network_name: Network name or id.
:type network_name:... | [
"def",
"get_network_remove_kwargs",
"(",
"self",
",",
"action",
",",
"network_name",
",",
"kwargs",
"=",
"None",
")",
":",
"c_kwargs",
"=",
"dict",
"(",
"net_id",
"=",
"network_name",
")",
"update_kwargs",
"(",
"c_kwargs",
",",
"kwargs",
")",
"return",
"c_kw... | Generates keyword arguments for the Docker client to remove a network.
:param action: Action configuration.
:type action: ActionConfig
:param network_name: Network name or id.
:type network_name: unicode | str
:param kwargs: Additional keyword arguments to complement or override... | [
"Generates",
"keyword",
"arguments",
"for",
"the",
"Docker",
"client",
"to",
"remove",
"a",
"network",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L450-L465 |
44,766 | merll/docker-map | dockermap/map/runner/base.py | DockerConfigMixin.get_network_connect_kwargs | def get_network_connect_kwargs(self, action, network_name, container_name, endpoint_config=None, kwargs=None):
"""
Generates keyword arguments for the Docker client to add a container to a network.
:param action: Action configuration.
:type action: ActionConfig
:param network_na... | python | def get_network_connect_kwargs(self, action, network_name, container_name, endpoint_config=None, kwargs=None):
"""
Generates keyword arguments for the Docker client to add a container to a network.
:param action: Action configuration.
:type action: ActionConfig
:param network_na... | [
"def",
"get_network_connect_kwargs",
"(",
"self",
",",
"action",
",",
"network_name",
",",
"container_name",
",",
"endpoint_config",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"c_kwargs",
"=",
"dict",
"(",
"container",
"=",
"container_name",
",",
"net_... | Generates keyword arguments for the Docker client to add a container to a network.
:param action: Action configuration.
:type action: ActionConfig
:param network_name: Network name or id.
:type network_name: unicode | str
:param container_name: Container name or id.
:typ... | [
"Generates",
"keyword",
"arguments",
"for",
"the",
"Docker",
"client",
"to",
"add",
"a",
"container",
"to",
"a",
"network",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L497-L521 |
44,767 | merll/docker-map | dockermap/map/runner/base.py | DockerConfigMixin.get_network_disconnect_kwargs | def get_network_disconnect_kwargs(self, action, network_name, container_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to remove a container from a network.
:param action: Action configuration.
:type action: ActionConfig
:param container_name: Containe... | python | def get_network_disconnect_kwargs(self, action, network_name, container_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to remove a container from a network.
:param action: Action configuration.
:type action: ActionConfig
:param container_name: Containe... | [
"def",
"get_network_disconnect_kwargs",
"(",
"self",
",",
"action",
",",
"network_name",
",",
"container_name",
",",
"kwargs",
"=",
"None",
")",
":",
"c_kwargs",
"=",
"dict",
"(",
"container",
"=",
"container_name",
",",
"net_id",
"=",
"network_name",
",",
")"... | Generates keyword arguments for the Docker client to remove a container from a network.
:param action: Action configuration.
:type action: ActionConfig
:param container_name: Container name or id.
:type container_name: unicode | str
:param network_name: Network name or id.
... | [
"Generates",
"keyword",
"arguments",
"for",
"the",
"Docker",
"client",
"to",
"remove",
"a",
"container",
"from",
"a",
"network",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L523-L543 |
44,768 | merll/docker-map | dockermap/map/runner/base.py | DockerConfigMixin.get_volume_create_kwargs | def get_volume_create_kwargs(self, action, volume_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to create a volume.
:param action: Action configuration.
:type action: ActionConfig
:param volume_name: Volume name.
:type volume_name: unicode | s... | python | def get_volume_create_kwargs(self, action, volume_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to create a volume.
:param action: Action configuration.
:type action: ActionConfig
:param volume_name: Volume name.
:type volume_name: unicode | s... | [
"def",
"get_volume_create_kwargs",
"(",
"self",
",",
"action",
",",
"volume_name",
",",
"kwargs",
"=",
"None",
")",
":",
"config",
"=",
"action",
".",
"config",
"c_kwargs",
"=",
"dict",
"(",
"name",
"=",
"volume_name",
")",
"if",
"config",
":",
"c_kwargs",... | Generates keyword arguments for the Docker client to create a volume.
:param action: Action configuration.
:type action: ActionConfig
:param volume_name: Volume name.
:type volume_name: unicode | str
:param kwargs: Additional keyword arguments to complement or override the confi... | [
"Generates",
"keyword",
"arguments",
"for",
"the",
"Docker",
"client",
"to",
"create",
"a",
"volume",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L597-L621 |
44,769 | merll/docker-map | dockermap/map/runner/base.py | DockerConfigMixin.get_volume_remove_kwargs | def get_volume_remove_kwargs(self, action, volume_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to remove a volume.
:param action: Action configuration.
:type action: ActionConfig
:param volume_name: Volume name.
:type volume_name: unicode | s... | python | def get_volume_remove_kwargs(self, action, volume_name, kwargs=None):
"""
Generates keyword arguments for the Docker client to remove a volume.
:param action: Action configuration.
:type action: ActionConfig
:param volume_name: Volume name.
:type volume_name: unicode | s... | [
"def",
"get_volume_remove_kwargs",
"(",
"self",
",",
"action",
",",
"volume_name",
",",
"kwargs",
"=",
"None",
")",
":",
"c_kwargs",
"=",
"dict",
"(",
"name",
"=",
"volume_name",
")",
"update_kwargs",
"(",
"c_kwargs",
",",
"kwargs",
")",
"return",
"c_kwargs"... | Generates keyword arguments for the Docker client to remove a volume.
:param action: Action configuration.
:type action: ActionConfig
:param volume_name: Volume name.
:type volume_name: unicode | str
:param kwargs: Additional keyword arguments to complement or override the confi... | [
"Generates",
"keyword",
"arguments",
"for",
"the",
"Docker",
"client",
"to",
"remove",
"a",
"volume",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/runner/base.py#L623-L638 |
44,770 | merll/docker-map | dockermap/map/policy/base.py | BasePolicy.cname | def cname(cls, map_name, container, instance=None):
"""
Generates a container name that should be used for creating new containers and checking the status of existing
containers.
In this implementation, the format will be ``<map name>.<container name>.<instance>``. If no instance is
... | python | def cname(cls, map_name, container, instance=None):
"""
Generates a container name that should be used for creating new containers and checking the status of existing
containers.
In this implementation, the format will be ``<map name>.<container name>.<instance>``. If no instance is
... | [
"def",
"cname",
"(",
"cls",
",",
"map_name",
",",
"container",
",",
"instance",
"=",
"None",
")",
":",
"if",
"instance",
":",
"return",
"'{0}.{1}.{2}'",
".",
"format",
"(",
"map_name",
",",
"container",
",",
"instance",
")",
"return",
"'{0}.{1}'",
".",
"... | Generates a container name that should be used for creating new containers and checking the status of existing
containers.
In this implementation, the format will be ``<map name>.<container name>.<instance>``. If no instance is
provided, it is just ``<map name>.<container name>``.
:par... | [
"Generates",
"a",
"container",
"name",
"that",
"should",
"be",
"used",
"for",
"creating",
"new",
"containers",
"and",
"checking",
"the",
"status",
"of",
"existing",
"containers",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/base.py#L85-L104 |
44,771 | merll/docker-map | dockermap/map/policy/base.py | BasePolicy.aname | def aname(cls, map_name, attached_name, parent_name=None):
"""
Generates a container name that should be used for creating new attached volume containers and checking the
status of existing containers.
In this implementation, the format will be ``<map name>.<attached>``, or ``<map name>... | python | def aname(cls, map_name, attached_name, parent_name=None):
"""
Generates a container name that should be used for creating new attached volume containers and checking the
status of existing containers.
In this implementation, the format will be ``<map name>.<attached>``, or ``<map name>... | [
"def",
"aname",
"(",
"cls",
",",
"map_name",
",",
"attached_name",
",",
"parent_name",
"=",
"None",
")",
":",
"if",
"parent_name",
":",
"return",
"'{0}.{1}.{2}'",
".",
"format",
"(",
"map_name",
",",
"parent_name",
",",
"attached_name",
")",
"return",
"'{0}.... | Generates a container name that should be used for creating new attached volume containers and checking the
status of existing containers.
In this implementation, the format will be ``<map name>.<attached>``, or ``<map name>.<parent name>.<attached>``
if the parent container configuration name ... | [
"Generates",
"a",
"container",
"name",
"that",
"should",
"be",
"used",
"for",
"creating",
"new",
"attached",
"volume",
"containers",
"and",
"checking",
"the",
"status",
"of",
"existing",
"containers",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/base.py#L107-L126 |
44,772 | merll/docker-map | dockermap/map/policy/base.py | BasePolicy.nname | def nname(cls, map_name, network_name):
"""
Generates a network name that should be used for creating new networks and checking the status of existing
networks on the client.
In this implementation, the format will be ``<map name>.<network name>``.
:param map_name: Container ma... | python | def nname(cls, map_name, network_name):
"""
Generates a network name that should be used for creating new networks and checking the status of existing
networks on the client.
In this implementation, the format will be ``<map name>.<network name>``.
:param map_name: Container ma... | [
"def",
"nname",
"(",
"cls",
",",
"map_name",
",",
"network_name",
")",
":",
"if",
"network_name",
"in",
"DEFAULT_PRESET_NETWORKS",
":",
"return",
"network_name",
"return",
"'{0}.{1}'",
".",
"format",
"(",
"map_name",
",",
"network_name",
")"
] | Generates a network name that should be used for creating new networks and checking the status of existing
networks on the client.
In this implementation, the format will be ``<map name>.<network name>``.
:param map_name: Container map name.
:type map_name: unicode | str
:param... | [
"Generates",
"a",
"network",
"name",
"that",
"should",
"be",
"used",
"for",
"creating",
"new",
"networks",
"and",
"checking",
"the",
"status",
"of",
"existing",
"networks",
"on",
"the",
"client",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/base.py#L129-L145 |
44,773 | merll/docker-map | dockermap/map/policy/base.py | BasePolicy.get_hostname | def get_hostname(cls, container_name, client_name=None):
"""
Determines the host name of a container. In this implementation, replaces all dots and underscores of a
container name with a dash; then attaches another dash with the client name, unless there is just one default
client.
... | python | def get_hostname(cls, container_name, client_name=None):
"""
Determines the host name of a container. In this implementation, replaces all dots and underscores of a
container name with a dash; then attaches another dash with the client name, unless there is just one default
client.
... | [
"def",
"get_hostname",
"(",
"cls",
",",
"container_name",
",",
"client_name",
"=",
"None",
")",
":",
"base_name",
"=",
"container_name",
"for",
"old",
",",
"new",
"in",
"cls",
".",
"hostname_replace",
":",
"base_name",
"=",
"base_name",
".",
"replace",
"(",
... | Determines the host name of a container. In this implementation, replaces all dots and underscores of a
container name with a dash; then attaches another dash with the client name, unless there is just one default
client.
:param container_name: Name of the container.
:type container_nam... | [
"Determines",
"the",
"host",
"name",
"of",
"a",
"container",
".",
"In",
"this",
"implementation",
"replaces",
"all",
"dots",
"and",
"underscores",
"of",
"a",
"container",
"name",
"with",
"a",
"dash",
";",
"then",
"attaches",
"another",
"dash",
"with",
"the",... | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/map/policy/base.py#L148-L169 |
44,774 | merll/docker-map | dockermap/shortcuts.py | adduser | def adduser(username, uid=None, system=False, no_login=True, no_password=False, group=False, gecos=None, **kwargs):
"""
Formats an ``adduser`` command.
:param username: User name.
:type username: unicode | str
:param uid: Optional user id to use.
:type uid: long | int
:param system: Create ... | python | def adduser(username, uid=None, system=False, no_login=True, no_password=False, group=False, gecos=None, **kwargs):
"""
Formats an ``adduser`` command.
:param username: User name.
:type username: unicode | str
:param uid: Optional user id to use.
:type uid: long | int
:param system: Create ... | [
"def",
"adduser",
"(",
"username",
",",
"uid",
"=",
"None",
",",
"system",
"=",
"False",
",",
"no_login",
"=",
"True",
",",
"no_password",
"=",
"False",
",",
"group",
"=",
"False",
",",
"gecos",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"retu... | Formats an ``adduser`` command.
:param username: User name.
:type username: unicode | str
:param uid: Optional user id to use.
:type uid: long | int
:param system: Create a system user account.
:type system: bool
:param no_login: Disable the login for this user. Not compatible with CentOS. ... | [
"Formats",
"an",
"adduser",
"command",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/shortcuts.py#L48-L75 |
44,775 | merll/docker-map | dockermap/shortcuts.py | mkdir | def mkdir(path, create_parent=True, check_if_exists=False):
"""
Generates a unix command line for creating a directory.
:param path: Directory path.
:type path: unicode | str
:param create_parent: Create parent directories, if necessary. Default is ``True``.
:type create_parent: bool
:param... | python | def mkdir(path, create_parent=True, check_if_exists=False):
"""
Generates a unix command line for creating a directory.
:param path: Directory path.
:type path: unicode | str
:param create_parent: Create parent directories, if necessary. Default is ``True``.
:type create_parent: bool
:param... | [
"def",
"mkdir",
"(",
"path",
",",
"create_parent",
"=",
"True",
",",
"check_if_exists",
"=",
"False",
")",
":",
"cmd",
"=",
"_format_cmd",
"(",
"'mkdir'",
",",
"path",
",",
"_p",
"=",
"create_parent",
")",
"if",
"check_if_exists",
":",
"return",
"'if [[ ! ... | Generates a unix command line for creating a directory.
:param path: Directory path.
:type path: unicode | str
:param create_parent: Create parent directories, if necessary. Default is ``True``.
:type create_parent: bool
:param check_if_exists: Prepend a check if the directory exists; in that case,... | [
"Generates",
"a",
"unix",
"command",
"line",
"for",
"creating",
"a",
"directory",
"."
] | e14fe86a6ff5c33d121eb2f9157e9359cb80dd02 | https://github.com/merll/docker-map/blob/e14fe86a6ff5c33d121eb2f9157e9359cb80dd02/dockermap/shortcuts.py#L132-L149 |
44,776 | django-parler/django-parler-rest | parler_rest/fields.py | TranslatedFieldsField.bind | def bind(self, field_name, parent):
"""
Create translation serializer dynamically.
Takes translatable model class (shared_model) from parent serializer and it
may create a serializer class on the fly if no custom class was specified.
"""
super(TranslatedFieldsField, self... | python | def bind(self, field_name, parent):
"""
Create translation serializer dynamically.
Takes translatable model class (shared_model) from parent serializer and it
may create a serializer class on the fly if no custom class was specified.
"""
super(TranslatedFieldsField, self... | [
"def",
"bind",
"(",
"self",
",",
"field_name",
",",
"parent",
")",
":",
"super",
"(",
"TranslatedFieldsField",
",",
"self",
")",
".",
"bind",
"(",
"field_name",
",",
"parent",
")",
"# Expect 1-on-1 for now. Allow using source as alias,",
"# but it should not be a dott... | Create translation serializer dynamically.
Takes translatable model class (shared_model) from parent serializer and it
may create a serializer class on the fly if no custom class was specified. | [
"Create",
"translation",
"serializer",
"dynamically",
"."
] | 9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5 | https://github.com/django-parler/django-parler-rest/blob/9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5/parler_rest/fields.py#L37-L75 |
44,777 | django-parler/django-parler-rest | parler_rest/fields.py | TranslatedFieldsField.to_representation | def to_representation(self, value):
"""
Serialize translated fields.
Simply iterate over available translations and, for each language,
delegate serialization logic to the translation model serializer.
Output languages can be selected by passing a list of language codes,
... | python | def to_representation(self, value):
"""
Serialize translated fields.
Simply iterate over available translations and, for each language,
delegate serialization logic to the translation model serializer.
Output languages can be selected by passing a list of language codes,
... | [
"def",
"to_representation",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"return",
"# Only need one serializer to create the native objects",
"serializer",
"=",
"self",
".",
"serializer_class",
"(",
"instance",
"=",
"self",
".",
"parent",
... | Serialize translated fields.
Simply iterate over available translations and, for each language,
delegate serialization logic to the translation model serializer.
Output languages can be selected by passing a list of language codes,
`languages`, within the serialization context. | [
"Serialize",
"translated",
"fields",
"."
] | 9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5 | https://github.com/django-parler/django-parler-rest/blob/9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5/parler_rest/fields.py#L81-L116 |
44,778 | django-parler/django-parler-rest | parler_rest/fields.py | TranslatedFieldsField.to_internal_value | def to_internal_value(self, data):
"""
Deserialize data from translations fields.
For each received language, delegate validation logic to
the translation model serializer.
"""
if data is None:
return
if not isinstance(data, dict):
self.f... | python | def to_internal_value(self, data):
"""
Deserialize data from translations fields.
For each received language, delegate validation logic to
the translation model serializer.
"""
if data is None:
return
if not isinstance(data, dict):
self.f... | [
"def",
"to_internal_value",
"(",
"self",
",",
"data",
")",
":",
"if",
"data",
"is",
"None",
":",
"return",
"if",
"not",
"isinstance",
"(",
"data",
",",
"dict",
")",
":",
"self",
".",
"fail",
"(",
"'invalid'",
")",
"if",
"not",
"self",
".",
"allow_emp... | Deserialize data from translations fields.
For each received language, delegate validation logic to
the translation model serializer. | [
"Deserialize",
"data",
"from",
"translations",
"fields",
"."
] | 9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5 | https://github.com/django-parler/django-parler-rest/blob/9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5/parler_rest/fields.py#L118-L143 |
44,779 | art1415926535/yandex_speech | yandex_speech/nlu.py | NLU.parse | def parse(self, text, layers=None):
"""Parsing passed text to json.
Args:
text: Text to parse.
layers (optional): Special fields. Only one string
or iterable object (e.g "Data", ("Data", "Fio")).
Only these fields will be returned.
Retur... | python | def parse(self, text, layers=None):
"""Parsing passed text to json.
Args:
text: Text to parse.
layers (optional): Special fields. Only one string
or iterable object (e.g "Data", ("Data", "Fio")).
Only these fields will be returned.
Retur... | [
"def",
"parse",
"(",
"self",
",",
"text",
",",
"layers",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"text\"",
":",
"text",
",",
"\"key\"",
":",
"self",
".",
"key",
",",
"}",
"if",
"layers",
"is",
"not",
"None",
":",
"# if it's string",
"if",
"isi... | Parsing passed text to json.
Args:
text: Text to parse.
layers (optional): Special fields. Only one string
or iterable object (e.g "Data", ("Data", "Fio")).
Only these fields will be returned.
Returns:
The parsed text into a json obj... | [
"Parsing",
"passed",
"text",
"to",
"json",
"."
] | 24820608b921e6ec3567a76a1ae6f3598a5b400b | https://github.com/art1415926535/yandex_speech/blob/24820608b921e6ec3567a76a1ae6f3598a5b400b/yandex_speech/nlu.py#L32-L60 |
44,780 | art1415926535/yandex_speech | yandex_speech/tts.py | TTS.generate | def generate(self, text):
"""Try to get the generated file.
Args:
text: The text that you want to generate.
"""
if not text:
raise Exception("No text to speak")
if len(text) >= self.MAX_CHARS:
raise Exception("Number of characters must be les... | python | def generate(self, text):
"""Try to get the generated file.
Args:
text: The text that you want to generate.
"""
if not text:
raise Exception("No text to speak")
if len(text) >= self.MAX_CHARS:
raise Exception("Number of characters must be les... | [
"def",
"generate",
"(",
"self",
",",
"text",
")",
":",
"if",
"not",
"text",
":",
"raise",
"Exception",
"(",
"\"No text to speak\"",
")",
"if",
"len",
"(",
"text",
")",
">=",
"self",
".",
"MAX_CHARS",
":",
"raise",
"Exception",
"(",
"\"Number of characters ... | Try to get the generated file.
Args:
text: The text that you want to generate. | [
"Try",
"to",
"get",
"the",
"generated",
"file",
"."
] | 24820608b921e6ec3567a76a1ae6f3598a5b400b | https://github.com/art1415926535/yandex_speech/blob/24820608b921e6ec3567a76a1ae6f3598a5b400b/yandex_speech/tts.py#L30-L45 |
44,781 | art1415926535/yandex_speech | yandex_speech/tts.py | TTS.save | def save(self, path="speech"):
"""Save data in file.
Args:
path (optional): A path to save file. Defaults to "speech".
File extension is optional. Absolute path is allowed.
Returns:
The path to the saved file.
"""
if self._data is None:
... | python | def save(self, path="speech"):
"""Save data in file.
Args:
path (optional): A path to save file. Defaults to "speech".
File extension is optional. Absolute path is allowed.
Returns:
The path to the saved file.
"""
if self._data is None:
... | [
"def",
"save",
"(",
"self",
",",
"path",
"=",
"\"speech\"",
")",
":",
"if",
"self",
".",
"_data",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"There's nothing to save\"",
")",
"extension",
"=",
"\".\"",
"+",
"self",
".",
"__params",
"[",
"\"format\"",
... | Save data in file.
Args:
path (optional): A path to save file. Defaults to "speech".
File extension is optional. Absolute path is allowed.
Returns:
The path to the saved file. | [
"Save",
"data",
"in",
"file",
"."
] | 24820608b921e6ec3567a76a1ae6f3598a5b400b | https://github.com/art1415926535/yandex_speech/blob/24820608b921e6ec3567a76a1ae6f3598a5b400b/yandex_speech/tts.py#L47-L68 |
44,782 | django-parler/django-parler-rest | parler_rest/utils.py | create_translated_fields_serializer | def create_translated_fields_serializer(shared_model, meta=None, related_name=None, **fields):
"""
Create a Rest Framework serializer class for a translated fields model.
:param shared_model: The shared model.
:type shared_model: :class:`parler.models.TranslatableModel`
"""
if not related_name:... | python | def create_translated_fields_serializer(shared_model, meta=None, related_name=None, **fields):
"""
Create a Rest Framework serializer class for a translated fields model.
:param shared_model: The shared model.
:type shared_model: :class:`parler.models.TranslatableModel`
"""
if not related_name:... | [
"def",
"create_translated_fields_serializer",
"(",
"shared_model",
",",
"meta",
"=",
"None",
",",
"related_name",
"=",
"None",
",",
"*",
"*",
"fields",
")",
":",
"if",
"not",
"related_name",
":",
"translated_model",
"=",
"shared_model",
".",
"_parler_meta",
".",... | Create a Rest Framework serializer class for a translated fields model.
:param shared_model: The shared model.
:type shared_model: :class:`parler.models.TranslatableModel` | [
"Create",
"a",
"Rest",
"Framework",
"serializer",
"class",
"for",
"a",
"translated",
"fields",
"model",
"."
] | 9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5 | https://github.com/django-parler/django-parler-rest/blob/9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5/parler_rest/utils.py#L8-L32 |
44,783 | django-parler/django-parler-rest | parler_rest/serializers.py | TranslatableModelSerializer.save | def save(self, **kwargs):
"""
Extract the translations and save them after main object save.
By default all translations will be saved no matter if creating
or updating an object. Users with more complex needs might define
their own save and handle translation saving themselves.... | python | def save(self, **kwargs):
"""
Extract the translations and save them after main object save.
By default all translations will be saved no matter if creating
or updating an object. Users with more complex needs might define
their own save and handle translation saving themselves.... | [
"def",
"save",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"translated_data",
"=",
"self",
".",
"_pop_translated_data",
"(",
")",
"instance",
"=",
"super",
"(",
"TranslatableModelSerializer",
",",
"self",
")",
".",
"save",
"(",
"*",
"*",
"kwargs",
")... | Extract the translations and save them after main object save.
By default all translations will be saved no matter if creating
or updating an object. Users with more complex needs might define
their own save and handle translation saving themselves. | [
"Extract",
"the",
"translations",
"and",
"save",
"them",
"after",
"main",
"object",
"save",
"."
] | 9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5 | https://github.com/django-parler/django-parler-rest/blob/9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5/parler_rest/serializers.py#L17-L28 |
44,784 | django-parler/django-parler-rest | parler_rest/serializers.py | TranslatableModelSerializer._pop_translated_data | def _pop_translated_data(self):
"""
Separate data of translated fields from other data.
"""
translated_data = {}
for meta in self.Meta.model._parler_meta:
translations = self.validated_data.pop(meta.rel_name, {})
if translations:
translated... | python | def _pop_translated_data(self):
"""
Separate data of translated fields from other data.
"""
translated_data = {}
for meta in self.Meta.model._parler_meta:
translations = self.validated_data.pop(meta.rel_name, {})
if translations:
translated... | [
"def",
"_pop_translated_data",
"(",
"self",
")",
":",
"translated_data",
"=",
"{",
"}",
"for",
"meta",
"in",
"self",
".",
"Meta",
".",
"model",
".",
"_parler_meta",
":",
"translations",
"=",
"self",
".",
"validated_data",
".",
"pop",
"(",
"meta",
".",
"r... | Separate data of translated fields from other data. | [
"Separate",
"data",
"of",
"translated",
"fields",
"from",
"other",
"data",
"."
] | 9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5 | https://github.com/django-parler/django-parler-rest/blob/9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5/parler_rest/serializers.py#L30-L39 |
44,785 | django-parler/django-parler-rest | parler_rest/serializers.py | TranslatableModelSerializer.save_translations | def save_translations(self, instance, translated_data):
"""
Save translation data into translation objects.
"""
for meta in self.Meta.model._parler_meta:
translations = translated_data.get(meta.rel_name, {})
for lang_code, model_fields in translations.items():
... | python | def save_translations(self, instance, translated_data):
"""
Save translation data into translation objects.
"""
for meta in self.Meta.model._parler_meta:
translations = translated_data.get(meta.rel_name, {})
for lang_code, model_fields in translations.items():
... | [
"def",
"save_translations",
"(",
"self",
",",
"instance",
",",
"translated_data",
")",
":",
"for",
"meta",
"in",
"self",
".",
"Meta",
".",
"model",
".",
"_parler_meta",
":",
"translations",
"=",
"translated_data",
".",
"get",
"(",
"meta",
".",
"rel_name",
... | Save translation data into translation objects. | [
"Save",
"translation",
"data",
"into",
"translation",
"objects",
"."
] | 9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5 | https://github.com/django-parler/django-parler-rest/blob/9f9d469ece38aaf4e0e3d2152bb9e7824bb3d9f5/parler_rest/serializers.py#L41-L54 |
44,786 | dhocker/udmx-pyusb | uDMX.py | load_conf | def load_conf(cfg_path):
"""
Try to load the given conf file.
"""
global config
try:
cfg = open(cfg_path, 'r')
except Exception as ex:
if verbose:
print("Unable to open {0}".format(cfg_path))
print(str(ex))
return False
# Read the entire conte... | python | def load_conf(cfg_path):
"""
Try to load the given conf file.
"""
global config
try:
cfg = open(cfg_path, 'r')
except Exception as ex:
if verbose:
print("Unable to open {0}".format(cfg_path))
print(str(ex))
return False
# Read the entire conte... | [
"def",
"load_conf",
"(",
"cfg_path",
")",
":",
"global",
"config",
"try",
":",
"cfg",
"=",
"open",
"(",
"cfg_path",
",",
"'r'",
")",
"except",
"Exception",
"as",
"ex",
":",
"if",
"verbose",
":",
"print",
"(",
"\"Unable to open {0}\"",
".",
"format",
"(",... | Try to load the given conf file. | [
"Try",
"to",
"load",
"the",
"given",
"conf",
"file",
"."
] | ee7d10604ecd83857154ed6739793de3b7bd5fc1 | https://github.com/dhocker/udmx-pyusb/blob/ee7d10604ecd83857154ed6739793de3b7bd5fc1/uDMX.py#L37-L64 |
44,787 | dhocker/udmx-pyusb | uDMX.py | translate_message_tokens | def translate_message_tokens(message_tokens):
"""
Translates alias references to their defined values.
The first token is a channel alias.
The remaining tokens are value aliases.
"""
trans_tokens = []
if message_tokens[0] in cv_dict[channels_key]:
trans_tokens.append(cv_dict[channels... | python | def translate_message_tokens(message_tokens):
"""
Translates alias references to their defined values.
The first token is a channel alias.
The remaining tokens are value aliases.
"""
trans_tokens = []
if message_tokens[0] in cv_dict[channels_key]:
trans_tokens.append(cv_dict[channels... | [
"def",
"translate_message_tokens",
"(",
"message_tokens",
")",
":",
"trans_tokens",
"=",
"[",
"]",
"if",
"message_tokens",
"[",
"0",
"]",
"in",
"cv_dict",
"[",
"channels_key",
"]",
":",
"trans_tokens",
".",
"append",
"(",
"cv_dict",
"[",
"channels_key",
"]",
... | Translates alias references to their defined values.
The first token is a channel alias.
The remaining tokens are value aliases. | [
"Translates",
"alias",
"references",
"to",
"their",
"defined",
"values",
".",
"The",
"first",
"token",
"is",
"a",
"channel",
"alias",
".",
"The",
"remaining",
"tokens",
"are",
"value",
"aliases",
"."
] | ee7d10604ecd83857154ed6739793de3b7bd5fc1 | https://github.com/dhocker/udmx-pyusb/blob/ee7d10604ecd83857154ed6739793de3b7bd5fc1/uDMX.py#L237-L255 |
44,788 | codingjoe/ssdp | ssdp/__init__.py | SSDPMessage.parse_headers | def parse_headers(cls, msg):
"""
Parse HTTP headers.
Args:
msg (str): HTTP message.
Returns:
(List[Tuple[str, str]): List of header tuples.
"""
return list(email.parser.Parser().parsestr(msg).items()) | python | def parse_headers(cls, msg):
"""
Parse HTTP headers.
Args:
msg (str): HTTP message.
Returns:
(List[Tuple[str, str]): List of header tuples.
"""
return list(email.parser.Parser().parsestr(msg).items()) | [
"def",
"parse_headers",
"(",
"cls",
",",
"msg",
")",
":",
"return",
"list",
"(",
"email",
".",
"parser",
".",
"Parser",
"(",
")",
".",
"parsestr",
"(",
"msg",
")",
".",
"items",
"(",
")",
")"
] | Parse HTTP headers.
Args:
msg (str): HTTP message.
Returns:
(List[Tuple[str, str]): List of header tuples. | [
"Parse",
"HTTP",
"headers",
"."
] | 84ff667c792608b221aa726cfd106b554884063d | https://github.com/codingjoe/ssdp/blob/84ff667c792608b221aa726cfd106b554884063d/ssdp/__init__.py#L39-L50 |
44,789 | codingjoe/ssdp | ssdp/__init__.py | SSDPResponse.parse | def parse(cls, msg):
"""Parse message string to response object."""
lines = msg.splitlines()
version, status_code, reason = lines[0].split()
headers = cls.parse_headers('\r\n'.join(lines[1:]))
return cls(version=version, status_code=status_code,
reason=reason, ... | python | def parse(cls, msg):
"""Parse message string to response object."""
lines = msg.splitlines()
version, status_code, reason = lines[0].split()
headers = cls.parse_headers('\r\n'.join(lines[1:]))
return cls(version=version, status_code=status_code,
reason=reason, ... | [
"def",
"parse",
"(",
"cls",
",",
"msg",
")",
":",
"lines",
"=",
"msg",
".",
"splitlines",
"(",
")",
"version",
",",
"status_code",
",",
"reason",
"=",
"lines",
"[",
"0",
"]",
".",
"split",
"(",
")",
"headers",
"=",
"cls",
".",
"parse_headers",
"(",... | Parse message string to response object. | [
"Parse",
"message",
"string",
"to",
"response",
"object",
"."
] | 84ff667c792608b221aa726cfd106b554884063d | https://github.com/codingjoe/ssdp/blob/84ff667c792608b221aa726cfd106b554884063d/ssdp/__init__.py#L70-L76 |
44,790 | codingjoe/ssdp | ssdp/__init__.py | SSDPRequest.parse | def parse(cls, msg):
"""Parse message string to request object."""
lines = msg.splitlines()
method, uri, version = lines[0].split()
headers = cls.parse_headers('\r\n'.join(lines[1:]))
return cls(version=version, uri=uri, method=method, headers=headers) | python | def parse(cls, msg):
"""Parse message string to request object."""
lines = msg.splitlines()
method, uri, version = lines[0].split()
headers = cls.parse_headers('\r\n'.join(lines[1:]))
return cls(version=version, uri=uri, method=method, headers=headers) | [
"def",
"parse",
"(",
"cls",
",",
"msg",
")",
":",
"lines",
"=",
"msg",
".",
"splitlines",
"(",
")",
"method",
",",
"uri",
",",
"version",
"=",
"lines",
"[",
"0",
"]",
".",
"split",
"(",
")",
"headers",
"=",
"cls",
".",
"parse_headers",
"(",
"'\\r... | Parse message string to request object. | [
"Parse",
"message",
"string",
"to",
"request",
"object",
"."
] | 84ff667c792608b221aa726cfd106b554884063d | https://github.com/codingjoe/ssdp/blob/84ff667c792608b221aa726cfd106b554884063d/ssdp/__init__.py#L98-L103 |
44,791 | codingjoe/ssdp | ssdp/__init__.py | SSDPRequest.sendto | def sendto(self, transport, addr):
"""
Send request to a given address via given transport.
Args:
transport (asyncio.DatagramTransport):
Write transport to send the message on.
addr (Tuple[str, int]):
IP address and port pair to send the m... | python | def sendto(self, transport, addr):
"""
Send request to a given address via given transport.
Args:
transport (asyncio.DatagramTransport):
Write transport to send the message on.
addr (Tuple[str, int]):
IP address and port pair to send the m... | [
"def",
"sendto",
"(",
"self",
",",
"transport",
",",
"addr",
")",
":",
"msg",
"=",
"bytes",
"(",
"self",
")",
"+",
"b'\\r\\n'",
"logger",
".",
"debug",
"(",
"\"%s:%s < %s\"",
",",
"*",
"(",
"addr",
"+",
"(",
"self",
",",
")",
")",
")",
"transport",... | Send request to a given address via given transport.
Args:
transport (asyncio.DatagramTransport):
Write transport to send the message on.
addr (Tuple[str, int]):
IP address and port pair to send the message to. | [
"Send",
"request",
"to",
"a",
"given",
"address",
"via",
"given",
"transport",
"."
] | 84ff667c792608b221aa726cfd106b554884063d | https://github.com/codingjoe/ssdp/blob/84ff667c792608b221aa726cfd106b554884063d/ssdp/__init__.py#L105-L118 |
44,792 | dhocker/udmx-pyusb | example.py | send_rgb | def send_rgb(dev, red, green, blue, dimmer):
"""
Send a set of RGB values to the light
"""
cv = [0 for v in range(0, 512)]
cv[0] = red
cv[1] = green
cv[2] = blue
cv[6] = dimmer
sent = dev.send_multi_value(1, cv)
return sent | python | def send_rgb(dev, red, green, blue, dimmer):
"""
Send a set of RGB values to the light
"""
cv = [0 for v in range(0, 512)]
cv[0] = red
cv[1] = green
cv[2] = blue
cv[6] = dimmer
sent = dev.send_multi_value(1, cv)
return sent | [
"def",
"send_rgb",
"(",
"dev",
",",
"red",
",",
"green",
",",
"blue",
",",
"dimmer",
")",
":",
"cv",
"=",
"[",
"0",
"for",
"v",
"in",
"range",
"(",
"0",
",",
"512",
")",
"]",
"cv",
"[",
"0",
"]",
"=",
"red",
"cv",
"[",
"1",
"]",
"=",
"gre... | Send a set of RGB values to the light | [
"Send",
"a",
"set",
"of",
"RGB",
"values",
"to",
"the",
"light"
] | ee7d10604ecd83857154ed6739793de3b7bd5fc1 | https://github.com/dhocker/udmx-pyusb/blob/ee7d10604ecd83857154ed6739793de3b7bd5fc1/example.py#L26-L36 |
44,793 | dhocker/udmx-pyusb | example.py | main | def main():
"""
How to control a DMX light through an Anyma USB controller
"""
# Channel value list for channels 1-512
cv = [0 for v in range(0, 512)]
# Create an instance of the DMX controller and open it
print("Opening DMX controller...")
dev = pyudmx.uDMXDevice()
# This will... | python | def main():
"""
How to control a DMX light through an Anyma USB controller
"""
# Channel value list for channels 1-512
cv = [0 for v in range(0, 512)]
# Create an instance of the DMX controller and open it
print("Opening DMX controller...")
dev = pyudmx.uDMXDevice()
# This will... | [
"def",
"main",
"(",
")",
":",
"# Channel value list for channels 1-512",
"cv",
"=",
"[",
"0",
"for",
"v",
"in",
"range",
"(",
"0",
",",
"512",
")",
"]",
"# Create an instance of the DMX controller and open it ",
"print",
"(",
"\"Opening DMX controller...\"",
")",
... | How to control a DMX light through an Anyma USB controller | [
"How",
"to",
"control",
"a",
"DMX",
"light",
"through",
"an",
"Anyma",
"USB",
"controller"
] | ee7d10604ecd83857154ed6739793de3b7bd5fc1 | https://github.com/dhocker/udmx-pyusb/blob/ee7d10604ecd83857154ed6739793de3b7bd5fc1/example.py#L39-L96 |
44,794 | snobear/ezmomi | ezmomi/ezmomi.py | EZMomi.connect | def connect(self):
"""Connect to vCenter server"""
try:
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
if self.config['no_ssl_verify']:
requests.packages.urllib3.disable_warnings()
context.verify_mode = ssl.CERT_NONE
self.si = Smart... | python | def connect(self):
"""Connect to vCenter server"""
try:
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
if self.config['no_ssl_verify']:
requests.packages.urllib3.disable_warnings()
context.verify_mode = ssl.CERT_NONE
self.si = Smart... | [
"def",
"connect",
"(",
"self",
")",
":",
"try",
":",
"context",
"=",
"ssl",
".",
"SSLContext",
"(",
"ssl",
".",
"PROTOCOL_TLSv1_2",
")",
"if",
"self",
".",
"config",
"[",
"'no_ssl_verify'",
"]",
":",
"requests",
".",
"packages",
".",
"urllib3",
".",
"d... | Connect to vCenter server | [
"Connect",
"to",
"vCenter",
"server"
] | c98e26dc2d32cd5c92134fdcbcb8353540ac0208 | https://github.com/snobear/ezmomi/blob/c98e26dc2d32cd5c92134fdcbcb8353540ac0208/ezmomi/ezmomi.py#L109-L142 |
44,795 | snobear/ezmomi | ezmomi/ezmomi.py | EZMomi.status | def status(self):
"""Check power status"""
vm = self.get_vm_failfast(self.config['name'])
extra = self.config['extra']
parserFriendly = self.config['parserFriendly']
status_to_print = []
if extra:
status_to_print = \
[["vmname", "powerstate", ... | python | def status(self):
"""Check power status"""
vm = self.get_vm_failfast(self.config['name'])
extra = self.config['extra']
parserFriendly = self.config['parserFriendly']
status_to_print = []
if extra:
status_to_print = \
[["vmname", "powerstate", ... | [
"def",
"status",
"(",
"self",
")",
":",
"vm",
"=",
"self",
".",
"get_vm_failfast",
"(",
"self",
".",
"config",
"[",
"'name'",
"]",
")",
"extra",
"=",
"self",
".",
"config",
"[",
"'extra'",
"]",
"parserFriendly",
"=",
"self",
".",
"config",
"[",
"'par... | Check power status | [
"Check",
"power",
"status"
] | c98e26dc2d32cd5c92134fdcbcb8353540ac0208 | https://github.com/snobear/ezmomi/blob/c98e26dc2d32cd5c92134fdcbcb8353540ac0208/ezmomi/ezmomi.py#L522-L546 |
44,796 | snobear/ezmomi | ezmomi/ezmomi.py | EZMomi.shutdown | def shutdown(self):
"""
Shutdown guest
fallback to power off if guest tools aren't installed
"""
vm = self.get_vm_failfast(self.config['name'])
if vm.runtime.powerState == vim.VirtualMachinePowerState.poweredOff:
print("%s already poweredOff" % vm.name)
... | python | def shutdown(self):
"""
Shutdown guest
fallback to power off if guest tools aren't installed
"""
vm = self.get_vm_failfast(self.config['name'])
if vm.runtime.powerState == vim.VirtualMachinePowerState.poweredOff:
print("%s already poweredOff" % vm.name)
... | [
"def",
"shutdown",
"(",
"self",
")",
":",
"vm",
"=",
"self",
".",
"get_vm_failfast",
"(",
"self",
".",
"config",
"[",
"'name'",
"]",
")",
"if",
"vm",
".",
"runtime",
".",
"powerState",
"==",
"vim",
".",
"VirtualMachinePowerState",
".",
"poweredOff",
":",... | Shutdown guest
fallback to power off if guest tools aren't installed | [
"Shutdown",
"guest",
"fallback",
"to",
"power",
"off",
"if",
"guest",
"tools",
"aren",
"t",
"installed"
] | c98e26dc2d32cd5c92134fdcbcb8353540ac0208 | https://github.com/snobear/ezmomi/blob/c98e26dc2d32cd5c92134fdcbcb8353540ac0208/ezmomi/ezmomi.py#L548-L577 |
44,797 | snobear/ezmomi | ezmomi/ezmomi.py | EZMomi.get_resource_pool | def get_resource_pool(self, cluster, pool_name):
"""
Find a resource pool given a pool name for desired cluster
"""
pool_obj = None
# get a list of all resource pools in this cluster
cluster_pools_list = cluster.resourcePool.resourcePool
# get list of all resour... | python | def get_resource_pool(self, cluster, pool_name):
"""
Find a resource pool given a pool name for desired cluster
"""
pool_obj = None
# get a list of all resource pools in this cluster
cluster_pools_list = cluster.resourcePool.resourcePool
# get list of all resour... | [
"def",
"get_resource_pool",
"(",
"self",
",",
"cluster",
",",
"pool_name",
")",
":",
"pool_obj",
"=",
"None",
"# get a list of all resource pools in this cluster",
"cluster_pools_list",
"=",
"cluster",
".",
"resourcePool",
".",
"resourcePool",
"# get list of all resource po... | Find a resource pool given a pool name for desired cluster | [
"Find",
"a",
"resource",
"pool",
"given",
"a",
"pool",
"name",
"for",
"desired",
"cluster"
] | c98e26dc2d32cd5c92134fdcbcb8353540ac0208 | https://github.com/snobear/ezmomi/blob/c98e26dc2d32cd5c92134fdcbcb8353540ac0208/ezmomi/ezmomi.py#L778-L801 |
44,798 | snobear/ezmomi | ezmomi/ezmomi.py | EZMomi.get_obj | def get_obj(self, vimtype, name, return_all=False, path=""):
"""Get the vsphere object associated with a given text name or MOID"""
obj = list()
if path:
obj_folder = self.content.searchIndex.FindByInventoryPath(path)
container = self.content.viewManager.CreateContainerVi... | python | def get_obj(self, vimtype, name, return_all=False, path=""):
"""Get the vsphere object associated with a given text name or MOID"""
obj = list()
if path:
obj_folder = self.content.searchIndex.FindByInventoryPath(path)
container = self.content.viewManager.CreateContainerVi... | [
"def",
"get_obj",
"(",
"self",
",",
"vimtype",
",",
"name",
",",
"return_all",
"=",
"False",
",",
"path",
"=",
"\"\"",
")",
":",
"obj",
"=",
"list",
"(",
")",
"if",
"path",
":",
"obj_folder",
"=",
"self",
".",
"content",
".",
"searchIndex",
".",
"F... | Get the vsphere object associated with a given text name or MOID | [
"Get",
"the",
"vsphere",
"object",
"associated",
"with",
"a",
"given",
"text",
"name",
"or",
"MOID"
] | c98e26dc2d32cd5c92134fdcbcb8353540ac0208 | https://github.com/snobear/ezmomi/blob/c98e26dc2d32cd5c92134fdcbcb8353540ac0208/ezmomi/ezmomi.py#L803-L827 |
44,799 | snobear/ezmomi | ezmomi/ezmomi.py | EZMomi.get_host_system_failfast | def get_host_system_failfast(
self,
name,
verbose=False,
host_system_term='HS'
):
"""
Get a HostSystem object
fail fast if the object isn't a valid reference
"""
if verbose:
print("Finding HostSystem named %s..." % n... | python | def get_host_system_failfast(
self,
name,
verbose=False,
host_system_term='HS'
):
"""
Get a HostSystem object
fail fast if the object isn't a valid reference
"""
if verbose:
print("Finding HostSystem named %s..." % n... | [
"def",
"get_host_system_failfast",
"(",
"self",
",",
"name",
",",
"verbose",
"=",
"False",
",",
"host_system_term",
"=",
"'HS'",
")",
":",
"if",
"verbose",
":",
"print",
"(",
"\"Finding HostSystem named %s...\"",
"%",
"name",
")",
"hs",
"=",
"self",
".",
"ge... | Get a HostSystem object
fail fast if the object isn't a valid reference | [
"Get",
"a",
"HostSystem",
"object",
"fail",
"fast",
"if",
"the",
"object",
"isn",
"t",
"a",
"valid",
"reference"
] | c98e26dc2d32cd5c92134fdcbcb8353540ac0208 | https://github.com/snobear/ezmomi/blob/c98e26dc2d32cd5c92134fdcbcb8353540ac0208/ezmomi/ezmomi.py#L832-L854 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.