hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_check_env_path_valid
null
def _check_env_path_valid(path): """ Raises an InvalidEnvironmentPathError if the path has a leading or trailing slash. :param path: A directory path :type path: str :raises: sceptre.exceptions.InvalidEnvironmentPathError """ if path.endswith("/") or path...
Raises an InvalidEnvironmentPathError if the path has a leading or trailing slash. :param path: A directory path :type path: str :raises: sceptre.exceptions.InvalidEnvironmentPathError
Raises an InvalidEnvironmentPathError if the path has a leading or trailing slash.
[ "Raises", "an", "InvalidEnvironmentPathError", "if", "the", "path", "has", "a", "leading", "or", "trailing", "slash", "." ]
def _check_env_path_valid(path): if path.endswith("/") or path.startswith("/"): raise InvalidEnvironmentPathError( "'{0}' is an invalid path string. Environment paths should " "not have leading or trailing slashes.".format(path) )
[ "def", "_check_env_path_valid", "(", "path", ")", ":", "if", "path", ".", "endswith", "(", "\"/\"", ")", "or", "path", ".", "startswith", "(", "\"/\"", ")", ":", "raise", "InvalidEnvironmentPathError", "(", "\"'{0}' is an invalid path string. Environment paths should ...
Raises an InvalidEnvironmentPathError if the path has a leading or trailing slash.
[ "Raises", "an", "InvalidEnvironmentPathError", "if", "the", "path", "has", "a", "leading", "or", "trailing", "slash", "." ]
[ "\"\"\"\n Raises an InvalidEnvironmentPathError if the path has a leading or\n trailing slash.\n\n :param path: A directory path\n :type path: str\n :raises: sceptre.exceptions.InvalidEnvironmentPathError\n \"\"\"" ]
[ { "param": "path", "type": null } ]
{ "returns": [], "raises": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "params": [ { "identifier": "path", "type": null, "docstring": "A directory path", "docstring_tokens": [ "A", "directory", ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
is_leaf
<not_specific>
def is_leaf(self): """ Returns a boolean indicating if this environment is a leaf environment. The environment is a leaf environment if all items in the environent's directory are files (i.e. there are no sub-environments). :returns: A boolean indicating whether the environment...
Returns a boolean indicating if this environment is a leaf environment. The environment is a leaf environment if all items in the environent's directory are files (i.e. there are no sub-environments). :returns: A boolean indicating whether the environment is a leaf environ...
Returns a boolean indicating if this environment is a leaf environment. The environment is a leaf environment if all items in the environent's directory are files .
[ "Returns", "a", "boolean", "indicating", "if", "this", "environment", "is", "a", "leaf", "environment", ".", "The", "environment", "is", "a", "leaf", "environment", "if", "all", "items", "in", "the", "environent", "'", "s", "directory", "are", "files", "." ]
def is_leaf(self): if self._is_leaf is None: self._is_leaf = all([ os.path.isfile(path) for path in glob(os.path.join( self.sceptre_dir, "config", self.path, "*" )) ]) return self._is_leaf
[ "def", "is_leaf", "(", "self", ")", ":", "if", "self", ".", "_is_leaf", "is", "None", ":", "self", ".", "_is_leaf", "=", "all", "(", "[", "os", ".", "path", ".", "isfile", "(", "path", ")", "for", "path", "in", "glob", "(", "os", ".", "path", "...
Returns a boolean indicating if this environment is a leaf environment.
[ "Returns", "a", "boolean", "indicating", "if", "this", "environment", "is", "a", "leaf", "environment", "." ]
[ "\"\"\"\n Returns a boolean indicating if this environment is a leaf environment.\n\n The environment is a leaf environment if all items in the environent's\n directory are files (i.e. there are no sub-environments).\n\n :returns: A boolean indicating whether the environment is a leaf\n ...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A boolean indicating whether the environment is a leaf\nenvironment or not.", "docstring_tokens": [ "A", "boolean", "indicating", "whether", "the", "environment", "is", "a", "leaf", "environm...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
launch
<not_specific>
def launch(self): """ Creates or updates all stacks in the environment. :returns: dict """ self.logger.debug("Launching environment '%s'", self.path) threading_events = self._get_threading_events() stack_statuses = self._get_stack_statuses() launch_depend...
Creates or updates all stacks in the environment. :returns: dict
Creates or updates all stacks in the environment.
[ "Creates", "or", "updates", "all", "stacks", "in", "the", "environment", "." ]
def launch(self): self.logger.debug("Launching environment '%s'", self.path) threading_events = self._get_threading_events() stack_statuses = self._get_stack_statuses() launch_dependencies = self._get_launch_dependencies(self.path) self._check_for_circular_dependencies(launch_dep...
[ "def", "launch", "(", "self", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Launching environment '%s'\"", ",", "self", ".", "path", ")", "threading_events", "=", "self", ".", "_get_threading_events", "(", ")", "stack_statuses", "=", "self", ".", "_...
Creates or updates all stacks in the environment.
[ "Creates", "or", "updates", "all", "stacks", "in", "the", "environment", "." ]
[ "\"\"\"\n Creates or updates all stacks in the environment.\n\n :returns: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
delete
<not_specific>
def delete(self): """ Deletes all stacks in the environment. :returns: dict """ self.logger.debug("Deleting environment '%s'", self.path) threading_events = self._get_threading_events() stack_statuses = self._get_stack_statuses() delete_dependencies = sel...
Deletes all stacks in the environment. :returns: dict
Deletes all stacks in the environment.
[ "Deletes", "all", "stacks", "in", "the", "environment", "." ]
def delete(self): self.logger.debug("Deleting environment '%s'", self.path) threading_events = self._get_threading_events() stack_statuses = self._get_stack_statuses() delete_dependencies = self._get_delete_dependencies() self._check_for_circular_dependencies(delete_dependencies)...
[ "def", "delete", "(", "self", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Deleting environment '%s'\"", ",", "self", ".", "path", ")", "threading_events", "=", "self", ".", "_get_threading_events", "(", ")", "stack_statuses", "=", "self", ".", "_g...
Deletes all stacks in the environment.
[ "Deletes", "all", "stacks", "in", "the", "environment", "." ]
[ "\"\"\"\n Deletes all stacks in the environment.\n\n :returns: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
describe
<not_specific>
def describe(self): """ Returns each stack's status. :returns: The stack status of each stack, keyed by the stack's name. :rtype: dict """ response = {} for stack in self.stacks.values(): try: status = stack.get_status() ex...
Returns each stack's status. :returns: The stack status of each stack, keyed by the stack's name. :rtype: dict
Returns each stack's status.
[ "Returns", "each", "stack", "'", "s", "status", "." ]
def describe(self): response = {} for stack in self.stacks.values(): try: status = stack.get_status() except StackDoesNotExistError: status = "PENDING" response.update({stack.name: status}) return response
[ "def", "describe", "(", "self", ")", ":", "response", "=", "{", "}", "for", "stack", "in", "self", ".", "stacks", ".", "values", "(", ")", ":", "try", ":", "status", "=", "stack", ".", "get_status", "(", ")", "except", "StackDoesNotExistError", ":", ...
Returns each stack's status.
[ "Returns", "each", "stack", "'", "s", "status", "." ]
[ "\"\"\"\n Returns each stack's status.\n\n :returns: The stack status of each stack, keyed by the stack's name.\n :rtype: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "The stack status of each stack, keyed by the stack's name.", "docstring_tokens": [ "The", "stack", "status", "of", "each", "stack", "keyed", "by", "the", "stack", "'", "s", ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
describe_resources
<not_specific>
def describe_resources(self): """ Describes the resources of each stack in the environment. :returns: A description of each stack's resources, keyed by the stack's name. :rtype: dict """ response = {} for stack in self.stacks.values(): try...
Describes the resources of each stack in the environment. :returns: A description of each stack's resources, keyed by the stack's name. :rtype: dict
Describes the resources of each stack in the environment.
[ "Describes", "the", "resources", "of", "each", "stack", "in", "the", "environment", "." ]
def describe_resources(self): response = {} for stack in self.stacks.values(): try: resources = stack.describe_resources() response.update({stack.name: resources}) except(botocore.exceptions.ClientError) as exp: if exp.response["Err...
[ "def", "describe_resources", "(", "self", ")", ":", "response", "=", "{", "}", "for", "stack", "in", "self", ".", "stacks", ".", "values", "(", ")", ":", "try", ":", "resources", "=", "stack", ".", "describe_resources", "(", ")", "response", ".", "upda...
Describes the resources of each stack in the environment.
[ "Describes", "the", "resources", "of", "each", "stack", "in", "the", "environment", "." ]
[ "\"\"\"\n Describes the resources of each stack in the environment.\n\n :returns: A description of each stack's resources, keyed by the stack's\n name.\n :rtype: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A description of each stack's resources, keyed by the stack's\nname.", "docstring_tokens": [ "A", "description", "of", "each", "stack", "'", "s", "resources", "keyed", "by", "the", ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_build
null
def _build(self, command, threading_events, stack_statuses, dependencies): """ Launches or deletes all stacks in the environment. Whether the stack is launched or delete depends on the value of <command>. It does this by calling stack.<command>() for each stack in the environmen...
Launches or deletes all stacks in the environment. Whether the stack is launched or delete depends on the value of <command>. It does this by calling stack.<command>() for each stack in the environment. Stack.<command>() is blocking, because it waits for the stack to be built, ...
Launches or deletes all stacks in the environment. Whether the stack is launched or delete depends on the value of . It does this by calling stack.() for each stack in the environment. Stack.() is blocking, because it waits for the stack to be built, so each command is run on a separate thread. As some stacks need to b...
[ "Launches", "or", "deletes", "all", "stacks", "in", "the", "environment", ".", "Whether", "the", "stack", "is", "launched", "or", "delete", "depends", "on", "the", "value", "of", ".", "It", "does", "this", "by", "calling", "stack", ".", "()", "for", "eac...
def _build(self, command, threading_events, stack_statuses, dependencies): num_stacks = len(self.stacks) with ThreadPoolExecutor(max_workers=num_stacks) as executor: futures = [ executor.submit( self._manage_stack_build, stack, command,...
[ "def", "_build", "(", "self", ",", "command", ",", "threading_events", ",", "stack_statuses", ",", "dependencies", ")", ":", "num_stacks", "=", "len", "(", "self", ".", "stacks", ")", "with", "ThreadPoolExecutor", "(", "max_workers", "=", "num_stacks", ")", ...
Launches or deletes all stacks in the environment.
[ "Launches", "or", "deletes", "all", "stacks", "in", "the", "environment", "." ]
[ "\"\"\"\n Launches or deletes all stacks in the environment.\n\n Whether the stack is launched or delete depends on the value of\n <command>. It does this by calling stack.<command>() for\n each stack in the environment. Stack.<command>() is blocking, because\n it waits for the st...
[ { "param": "self", "type": null }, { "param": "command", "type": null }, { "param": "threading_events", "type": null }, { "param": "stack_statuses", "type": null }, { "param": "dependencies", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "command", "type": null, "docstring": "The stack command to run. Can...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_get_threading_events
<not_specific>
def _get_threading_events(self): """ Returns a threading.Event() for each stack in every sub-environment. :returns: A threading.Event object for each stack, keyed by the stack's name. :rtype: dict """ return { stack.name: threading.Event() ...
Returns a threading.Event() for each stack in every sub-environment. :returns: A threading.Event object for each stack, keyed by the stack's name. :rtype: dict
Returns a threading.Event() for each stack in every sub-environment.
[ "Returns", "a", "threading", ".", "Event", "()", "for", "each", "stack", "in", "every", "sub", "-", "environment", "." ]
def _get_threading_events(self): return { stack.name: threading.Event() for stack in self.stacks.values() }
[ "def", "_get_threading_events", "(", "self", ")", ":", "return", "{", "stack", ".", "name", ":", "threading", ".", "Event", "(", ")", "for", "stack", "in", "self", ".", "stacks", ".", "values", "(", ")", "}" ]
Returns a threading.Event() for each stack in every sub-environment.
[ "Returns", "a", "threading", ".", "Event", "()", "for", "each", "stack", "in", "every", "sub", "-", "environment", "." ]
[ "\"\"\"\n Returns a threading.Event() for each stack in every sub-environment.\n\n :returns: A threading.Event object for each stack, keyed by the\n stack's name.\n :rtype: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A threading.Event object for each stack, keyed by the\nstack's name.", "docstring_tokens": [ "A", "threading", ".", "Event", "object", "for", "each", "stack", "keyed", "by", "the", ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_get_stack_statuses
<not_specific>
def _get_stack_statuses(self): """ Returns a "pending" sceptre.stack_status.StackStatus for each stack in every sub-environment. :returns: A "pending" stack status for each stack, keyed by the stack's name. :rtype: dict """ return { stack....
Returns a "pending" sceptre.stack_status.StackStatus for each stack in every sub-environment. :returns: A "pending" stack status for each stack, keyed by the stack's name. :rtype: dict
Returns a "pending" sceptre.stack_status.StackStatus for each stack in every sub-environment.
[ "Returns", "a", "\"", "pending", "\"", "sceptre", ".", "stack_status", ".", "StackStatus", "for", "each", "stack", "in", "every", "sub", "-", "environment", "." ]
def _get_stack_statuses(self): return { stack.name: StackStatus.PENDING for stack in self.stacks.values() }
[ "def", "_get_stack_statuses", "(", "self", ")", ":", "return", "{", "stack", ".", "name", ":", "StackStatus", ".", "PENDING", "for", "stack", "in", "self", ".", "stacks", ".", "values", "(", ")", "}" ]
Returns a "pending" sceptre.stack_status.StackStatus for each stack in every sub-environment.
[ "Returns", "a", "\"", "pending", "\"", "sceptre", ".", "stack_status", ".", "StackStatus", "for", "each", "stack", "in", "every", "sub", "-", "environment", "." ]
[ "\"\"\"\n Returns a \"pending\" sceptre.stack_status.StackStatus for each stack\n in every sub-environment.\n\n :returns: A \"pending\" stack status for each stack, keyed by the\n stack's name.\n :rtype: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A \"pending\" stack status for each stack, keyed by the\nstack's name.", "docstring_tokens": [ "A", "\"", "pending", "\"", "stack", "status", "for", "each", "stack", "keyed", "by", ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_get_launch_dependencies
<not_specific>
def _get_launch_dependencies(self, top_level_environment_path): """ Returns a dict of each stack's launch dependencies. :returns: A list of the stacks that a particular stack depends on while launching, keyed by that stack's name. :rtype: dict """ all_depende...
Returns a dict of each stack's launch dependencies. :returns: A list of the stacks that a particular stack depends on while launching, keyed by that stack's name. :rtype: dict
Returns a dict of each stack's launch dependencies.
[ "Returns", "a", "dict", "of", "each", "stack", "'", "s", "launch", "dependencies", "." ]
def _get_launch_dependencies(self, top_level_environment_path): all_dependencies = { stack.name: stack.dependencies for stack in self.stacks.values() } launch_dependencies = { stack_name: [ dependency for dependency in dependenc...
[ "def", "_get_launch_dependencies", "(", "self", ",", "top_level_environment_path", ")", ":", "all_dependencies", "=", "{", "stack", ".", "name", ":", "stack", ".", "dependencies", "for", "stack", "in", "self", ".", "stacks", ".", "values", "(", ")", "}", "la...
Returns a dict of each stack's launch dependencies.
[ "Returns", "a", "dict", "of", "each", "stack", "'", "s", "launch", "dependencies", "." ]
[ "\"\"\"\n Returns a dict of each stack's launch dependencies.\n\n :returns: A list of the stacks that a particular stack depends on\n while launching, keyed by that stack's name.\n :rtype: dict\n \"\"\"", "# Filter out dependencies which aren't under the top level environmne...
[ { "param": "self", "type": null }, { "param": "top_level_environment_path", "type": null } ]
{ "returns": [ { "docstring": "A list of the stacks that a particular stack depends on\nwhile launching, keyed by that stack's name.", "docstring_tokens": [ "A", "list", "of", "the", "stacks", "that", "a", "particular", "stack", ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_check_for_circular_dependencies
null
def _check_for_circular_dependencies(self, dependencies): """ Checks to make sure that no stacks are dependent on stacks which are dependent on the first stack. :raises: sceptre.workplan.CircularDependenciesException """ self.logger.debug("Checking for circular dependenc...
Checks to make sure that no stacks are dependent on stacks which are dependent on the first stack. :raises: sceptre.workplan.CircularDependenciesException
Checks to make sure that no stacks are dependent on stacks which are dependent on the first stack.
[ "Checks", "to", "make", "sure", "that", "no", "stacks", "are", "dependent", "on", "stacks", "which", "are", "dependent", "on", "the", "first", "stack", "." ]
def _check_for_circular_dependencies(self, dependencies): self.logger.debug("Checking for circular dependencies...") for stack_name, stack_dependencies in dependencies.items(): for dependency in stack_dependencies: if stack_name in dependencies[dependency]: ...
[ "def", "_check_for_circular_dependencies", "(", "self", ",", "dependencies", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Checking for circular dependencies...\"", ")", "for", "stack_name", ",", "stack_dependencies", "in", "dependencies", ".", "items", "(", ...
Checks to make sure that no stacks are dependent on stacks which are dependent on the first stack.
[ "Checks", "to", "make", "sure", "that", "no", "stacks", "are", "dependent", "on", "stacks", "which", "are", "dependent", "on", "the", "first", "stack", "." ]
[ "\"\"\"\n Checks to make sure that no stacks are dependent on stacks which are\n dependent on the first stack.\n\n :raises: sceptre.workplan.CircularDependenciesException\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "dependencies", "type": null } ]
{ "returns": [], "raises": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_get_available_stacks
<not_specific>
def _get_available_stacks(self): """ Returns all the stacks contained in the environment. :returns: A list of the environment's stacks. :rtype: list """ config_files = glob(os.path.join( self.sceptre_dir, "config", self.path, "*.yaml" )) base_...
Returns all the stacks contained in the environment. :returns: A list of the environment's stacks. :rtype: list
Returns all the stacks contained in the environment.
[ "Returns", "all", "the", "stacks", "contained", "in", "the", "environment", "." ]
def _get_available_stacks(self): config_files = glob(os.path.join( self.sceptre_dir, "config", self.path, "*.yaml" )) base_config_file_names = [ os.path.basename(config_file).split(".")[0] for config_file in config_files ] stack_basenames = [ ...
[ "def", "_get_available_stacks", "(", "self", ")", ":", "config_files", "=", "glob", "(", "os", ".", "path", ".", "join", "(", "self", ".", "sceptre_dir", ",", "\"config\"", ",", "self", ".", "path", ",", "\"*.yaml\"", ")", ")", "base_config_file_names", "=...
Returns all the stacks contained in the environment.
[ "Returns", "all", "the", "stacks", "contained", "in", "the", "environment", "." ]
[ "\"\"\"\n Returns all the stacks contained in the environment.\n\n :returns: A list of the environment's stacks.\n :rtype: list\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A list of the environment's stacks.", "docstring_tokens": [ "A", "list", "of", "the", "environment", "'", "s", "stacks", "." ], "type": "list" } ], "raises": [], "params": [ ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_load_stacks
<not_specific>
def _load_stacks(self): """ Initialises and returns all of the environment's stacks. :returns: A dictionary of the stacks, keyed by the stack's name :rtype: dict """ config = self._get_config() connection_manager = ConnectionManager( region=config["re...
Initialises and returns all of the environment's stacks. :returns: A dictionary of the stacks, keyed by the stack's name :rtype: dict
Initialises and returns all of the environment's stacks.
[ "Initialises", "and", "returns", "all", "of", "the", "environment", "'", "s", "stacks", "." ]
def _load_stacks(self): config = self._get_config() connection_manager = ConnectionManager( region=config["region"], iam_role=config.get("iam_role") ) stacks = {} for stack_name in self._get_available_stacks(): self.logger.debug("Initialising s...
[ "def", "_load_stacks", "(", "self", ")", ":", "config", "=", "self", ".", "_get_config", "(", ")", "connection_manager", "=", "ConnectionManager", "(", "region", "=", "config", "[", "\"region\"", "]", ",", "iam_role", "=", "config", ".", "get", "(", "\"iam...
Initialises and returns all of the environment's stacks.
[ "Initialises", "and", "returns", "all", "of", "the", "environment", "'", "s", "stacks", "." ]
[ "\"\"\"\n Initialises and returns all of the environment's stacks.\n\n :returns: A dictionary of the stacks, keyed by the stack's name\n :rtype: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A dictionary of the stacks, keyed by the stack's name", "docstring_tokens": [ "A", "dictionary", "of", "the", "stacks", "keyed", "by", "the", "stack", "'", "s", "name" ]...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_get_available_environments
<not_specific>
def _get_available_environments(self): """ Returns all the sub-environments contained in the environment. :returns: A list of the environment's sub-environments. :rtype: list """ items_in_dir = glob(os.path.join( self.sceptre_dir, "config", self.path, "*" ...
Returns all the sub-environments contained in the environment. :returns: A list of the environment's sub-environments. :rtype: list
Returns all the sub-environments contained in the environment.
[ "Returns", "all", "the", "sub", "-", "environments", "contained", "in", "the", "environment", "." ]
def _get_available_environments(self): items_in_dir = glob(os.path.join( self.sceptre_dir, "config", self.path, "*" )) dirs = [ item for item in items_in_dir if os.path.isdir(item) ] available_environments = [ os.path.relpath(d, os....
[ "def", "_get_available_environments", "(", "self", ")", ":", "items_in_dir", "=", "glob", "(", "os", ".", "path", ".", "join", "(", "self", ".", "sceptre_dir", ",", "\"config\"", ",", "self", ".", "path", ",", "\"*\"", ")", ")", "dirs", "=", "[", "item...
Returns all the sub-environments contained in the environment.
[ "Returns", "all", "the", "sub", "-", "environments", "contained", "in", "the", "environment", "." ]
[ "\"\"\"\n Returns all the sub-environments contained in the environment.\n\n :returns: A list of the environment's sub-environments.\n :rtype: list\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A list of the environment's sub-environments.", "docstring_tokens": [ "A", "list", "of", "the", "environment", "'", "s", "sub", "-", "environments", "." ], "type": "list" ...
ae621c6669dc7307ae68455363adc18242cf381d
rootifera/sceptre
sceptre/environment.py
[ "Apache-2.0" ]
Python
_load_environments
<not_specific>
def _load_environments(self): """ Initialises and returns all of the environment's sub-environments. :returns: A dict of sub-environments, keyed by the environment's names :returns: dict """ environments = {} for environment_name in self._get_available_environme...
Initialises and returns all of the environment's sub-environments. :returns: A dict of sub-environments, keyed by the environment's names :returns: dict
Initialises and returns all of the environment's sub-environments.
[ "Initialises", "and", "returns", "all", "of", "the", "environment", "'", "s", "sub", "-", "environments", "." ]
def _load_environments(self): environments = {} for environment_name in self._get_available_environments(): self.logger.debug( "Initialising '%s' environment...", environment_name ) environment = Environment( sceptre_dir=self.sceptre_di...
[ "def", "_load_environments", "(", "self", ")", ":", "environments", "=", "{", "}", "for", "environment_name", "in", "self", ".", "_get_available_environments", "(", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Initialising '%s' environment...\"", ",", ...
Initialises and returns all of the environment's sub-environments.
[ "Initialises", "and", "returns", "all", "of", "the", "environment", "'", "s", "sub", "-", "environments", "." ]
[ "\"\"\"\n Initialises and returns all of the environment's sub-environments.\n\n :returns: A dict of sub-environments, keyed by the environment's names\n :returns: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A dict of sub-environments, keyed by the environment's names", "docstring_tokens": [ "A", "dict", "of", "sub", "-", "environments", "keyed", "by", "the", "environment", "'", "...
50b4fc1811320a399cf8a7010a83f6d796af7ece
rootifera/sceptre
sceptre/config.py
[ "Apache-2.0" ]
Python
read
<not_specific>
def read(self, user_variables=None): """ Reads in configuration from files. Traverses the environment path, from top to bottom, reading in all relevant config files. If config items appear in files lower down the environment tree, they overwrite items from further up. Jinja2 is ...
Reads in configuration from files. Traverses the environment path, from top to bottom, reading in all relevant config files. If config items appear in files lower down the environment tree, they overwrite items from further up. Jinja2 is used to template in variables from user_...
Reads in configuration from files. Traverses the environment path, from top to bottom, reading in all relevant config files. If config items appear in files lower down the environment tree, they overwrite items from further up. Jinja2 is used to template in variables from user_variables, environment variables, and the ...
[ "Reads", "in", "configuration", "from", "files", ".", "Traverses", "the", "environment", "path", "from", "top", "to", "bottom", "reading", "in", "all", "relevant", "config", "files", ".", "If", "config", "items", "appear", "in", "files", "lower", "down", "th...
def read(self, user_variables=None): path = os.path.join("config", self.environment_path) file_name = ".".join([self.name, "yaml"]) self.logger.debug("Reading in '%s' files...", file_name) def get_config(path): if not path: return {} else: ...
[ "def", "read", "(", "self", ",", "user_variables", "=", "None", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "\"config\"", ",", "self", ".", "environment_path", ")", "file_name", "=", "\".\"", ".", "join", "(", "[", "self", ".", "name"...
Reads in configuration from files.
[ "Reads", "in", "configuration", "from", "files", "." ]
[ "\"\"\"\n Reads in configuration from files.\n\n Traverses the environment path, from top to bottom, reading in all\n relevant config files. If config items appear in files lower down the\n environment tree, they overwrite items from further up. Jinja2 is used\n to template in var...
[ { "param": "self", "type": null }, { "param": "user_variables", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "user_variables", "type": null, "docstring": "A dict of key value pa...
50b4fc1811320a399cf8a7010a83f6d796af7ece
rootifera/sceptre
sceptre/config.py
[ "Apache-2.0" ]
Python
_check_env_path_exists
null
def _check_env_path_exists(path): """ Raises an EnvironmentPathNotFoundError if ``path`` is not a directory. :param path: A directory path. :type path: str :raises: sceptre.exceptions.EnvironmentPathNotFoundError """ if not os.path.isdir(path): raise ...
Raises an EnvironmentPathNotFoundError if ``path`` is not a directory. :param path: A directory path. :type path: str :raises: sceptre.exceptions.EnvironmentPathNotFoundError
Raises an EnvironmentPathNotFoundError if ``path`` is not a directory.
[ "Raises", "an", "EnvironmentPathNotFoundError", "if", "`", "`", "path", "`", "`", "is", "not", "a", "directory", "." ]
def _check_env_path_exists(path): if not os.path.isdir(path): raise EnvironmentPathNotFoundError( "The environment '{0}' does not exist.".format(path) )
[ "def", "_check_env_path_exists", "(", "path", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "raise", "EnvironmentPathNotFoundError", "(", "\"The environment '{0}' does not exist.\"", ".", "format", "(", "path", ")", ")" ]
Raises an EnvironmentPathNotFoundError if ``path`` is not a directory.
[ "Raises", "an", "EnvironmentPathNotFoundError", "if", "`", "`", "path", "`", "`", "is", "not", "a", "directory", "." ]
[ "\"\"\"\n Raises an EnvironmentPathNotFoundError if ``path`` is not a directory.\n\n :param path: A directory path.\n :type path: str\n :raises: sceptre.exceptions.EnvironmentPathNotFoundError\n \"\"\"" ]
[ { "param": "path", "type": null } ]
{ "returns": [], "raises": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "params": [ { "identifier": "path", "type": null, "docstring": "A directory path.", "docstring_tokens": [ "A", "directory", ...
50b4fc1811320a399cf8a7010a83f6d796af7ece
rootifera/sceptre
sceptre/config.py
[ "Apache-2.0" ]
Python
_check_version
null
def _check_version(self): """ Raises a VersionIncompatibleException when the current sceptre version does not comply with the configured version requirement. :raises: sceptre.exceptions.VersionIncompatibleException """ sceptre_version = __version__ if self.name =...
Raises a VersionIncompatibleException when the current sceptre version does not comply with the configured version requirement. :raises: sceptre.exceptions.VersionIncompatibleException
Raises a VersionIncompatibleException when the current sceptre version does not comply with the configured version requirement.
[ "Raises", "a", "VersionIncompatibleException", "when", "the", "current", "sceptre", "version", "does", "not", "comply", "with", "the", "configured", "version", "requirement", "." ]
def _check_version(self): sceptre_version = __version__ if self.name == 'config' and 'require_version' in self: require_version = self['require_version'] if Version(sceptre_version) not in SpecifierSet(require_version): raise VersionIncompatibleError( ...
[ "def", "_check_version", "(", "self", ")", ":", "sceptre_version", "=", "__version__", "if", "self", ".", "name", "==", "'config'", "and", "'require_version'", "in", "self", ":", "require_version", "=", "self", "[", "'require_version'", "]", "if", "Version", "...
Raises a VersionIncompatibleException when the current sceptre version does not comply with the configured version requirement.
[ "Raises", "a", "VersionIncompatibleException", "when", "the", "current", "sceptre", "version", "does", "not", "comply", "with", "the", "configured", "version", "requirement", "." ]
[ "\"\"\"\n Raises a VersionIncompatibleException when the current sceptre version\n does not comply with the configured version requirement.\n\n :raises: sceptre.exceptions.VersionIncompatibleException\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
2d4cf173c550c2b7e403c515986ea4b57593ed0c
rootifera/sceptre
sceptre/template.py
[ "Apache-2.0" ]
Python
_get_cfn
<not_specific>
def _get_cfn(self): """ Reads in a CloudFormation template directly from a file or as a string from an external Python script (such as Troposphere). External Python scripts have arbitrary dictionary of data (sceptre_user_data) passed to them. :returns: A CloudFormation ...
Reads in a CloudFormation template directly from a file or as a string from an external Python script (such as Troposphere). External Python scripts have arbitrary dictionary of data (sceptre_user_data) passed to them. :returns: A CloudFormation template :rtype: str ...
Reads in a CloudFormation template directly from a file or as a string from an external Python script (such as Troposphere). External Python scripts have arbitrary dictionary of data (sceptre_user_data) passed to them.
[ "Reads", "in", "a", "CloudFormation", "template", "directly", "from", "a", "file", "or", "as", "a", "string", "from", "an", "external", "Python", "script", "(", "such", "as", "Troposphere", ")", ".", "External", "Python", "scripts", "have", "arbitrary", "dic...
def _get_cfn(self): relpath = os.path.relpath(self.path, os.getcwd()).split(os.path.sep) relpaths_to_add = [ os.path.sep.join(relpath[:i+1]) for i in range(len(relpath[:-1])) ] to the python path for directory in relpaths_to_add: sys.path.appe...
[ "def", "_get_cfn", "(", "self", ")", ":", "relpath", "=", "os", ".", "path", ".", "relpath", "(", "self", ".", "path", ",", "os", ".", "getcwd", "(", ")", ")", ".", "split", "(", "os", ".", "path", ".", "sep", ")", "relpaths_to_add", "=", "[", ...
Reads in a CloudFormation template directly from a file or as a string from an external Python script (such as Troposphere).
[ "Reads", "in", "a", "CloudFormation", "template", "directly", "from", "a", "file", "or", "as", "a", "string", "from", "an", "external", "Python", "script", "(", "such", "as", "Troposphere", ")", "." ]
[ "\"\"\"\n Reads in a CloudFormation template directly from a file or as a string\n from an external Python script (such as Troposphere).\n\n External Python scripts have arbitrary dictionary of data\n (sceptre_user_data) passed to them.\n\n :returns: A CloudFormation template\n ...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A CloudFormation template", "docstring_tokens": [ "A", "CloudFormation", "template" ], "type": "str" } ], "raises": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null }, ...
2d4cf173c550c2b7e403c515986ea4b57593ed0c
rootifera/sceptre
sceptre/template.py
[ "Apache-2.0" ]
Python
_get_time_stamp
<not_specific>
def _get_time_stamp(): # pragma: no cover """ Return UTC date and time formatted as a string. :returns: str """ # Used for unit tests - datetime.datetime is a C struct and so utcnow() # cannot be mocked out. return datetime.utcnow().strftime("%Y-%m-%d-%H-%M-%S-%fZ")
Return UTC date and time formatted as a string. :returns: str
Return UTC date and time formatted as a string.
[ "Return", "UTC", "date", "and", "time", "formatted", "as", "a", "string", "." ]
def _get_time_stamp(): return datetime.utcnow().strftime("%Y-%m-%d-%H-%M-%S-%fZ")
[ "def", "_get_time_stamp", "(", ")", ":", "return", "datetime", ".", "utcnow", "(", ")", ".", "strftime", "(", "\"%Y-%m-%d-%H-%M-%S-%fZ\"", ")" ]
Return UTC date and time formatted as a string.
[ "Return", "UTC", "date", "and", "time", "formatted", "as", "a", "string", "." ]
[ "# pragma: no cover", "\"\"\"\n Return UTC date and time formatted as a string.\n\n :returns: str\n \"\"\"", "# Used for unit tests - datetime.datetime is a C struct and so utcnow()", "# cannot be mocked out." ]
[]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [], "outlier_params": [], "others": [] }
8bb526b967b3a8381e45b9ab3041ce802a9905b6
rootifera/sceptre
sceptre/helpers.py
[ "Apache-2.0" ]
Python
exponential_backoff
<not_specific>
def exponential_backoff(func): """ Retries a Boto3 call up to 5 times if request rate limits are hit. The time waited between retries increases exponentially. If rate limits are hit 5 times, exponential_backoff raises a :py:class:sceptre.exceptions.RetryLimitExceededException(). :param func: a...
Retries a Boto3 call up to 5 times if request rate limits are hit. The time waited between retries increases exponentially. If rate limits are hit 5 times, exponential_backoff raises a :py:class:sceptre.exceptions.RetryLimitExceededException(). :param func: a function that uses boto calls :ty...
Retries a Boto3 call up to 5 times if request rate limits are hit. The time waited between retries increases exponentially. If rate limits are hit 5 times, exponential_backoff raises a
[ "Retries", "a", "Boto3", "call", "up", "to", "5", "times", "if", "request", "rate", "limits", "are", "hit", ".", "The", "time", "waited", "between", "retries", "increases", "exponentially", ".", "If", "rate", "limits", "are", "hit", "5", "times", "exponent...
def exponential_backoff(func): logger = logging.getLogger(__name__) @wraps(func) def decorated(*args, **kwargs): max_retries = 5 attempts = 0 while attempts < max_retries: try: return func(*args, **kwargs) except ClientError as e: ...
[ "def", "exponential_backoff", "(", "func", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "__name__", ")", "@", "wraps", "(", "func", ")", "def", "decorated", "(", "*", "args", ",", "**", "kwargs", ")", ":", "max_retries", "=", "5", "attemp...
Retries a Boto3 call up to 5 times if request rate limits are hit.
[ "Retries", "a", "Boto3", "call", "up", "to", "5", "times", "if", "request", "rate", "limits", "are", "hit", "." ]
[ "\"\"\"\n Retries a Boto3 call up to 5 times if request rate limits are hit.\n\n The time waited between retries increases exponentially. If rate limits are\n hit 5 times, exponential_backoff raises a\n :py:class:sceptre.exceptions.RetryLimitExceededException().\n\n :param func: a function that uses ...
[ { "param": "func", "type": null } ]
{ "returns": [ { "docstring": "The decorated function.", "docstring_tokens": [ "The", "decorated", "function", "." ], "type": "func" } ], "raises": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": nul...
8bb526b967b3a8381e45b9ab3041ce802a9905b6
rootifera/sceptre
sceptre/helpers.py
[ "Apache-2.0" ]
Python
execution_protection
<not_specific>
def execution_protection(func): """ Raises an exception if a stack func is called with protection enabled. :param func: The function to protect. :type func: func :returns: The execution protected function. :rtype: func :raises: sceptre.exceptions.ProtectedStackError """ logger = log...
Raises an exception if a stack func is called with protection enabled. :param func: The function to protect. :type func: func :returns: The execution protected function. :rtype: func :raises: sceptre.exceptions.ProtectedStackError
Raises an exception if a stack func is called with protection enabled.
[ "Raises", "an", "exception", "if", "a", "stack", "func", "is", "called", "with", "protection", "enabled", "." ]
def execution_protection(func): logger = logging.getLogger(__name__) @wraps(func) def decorated(self, *args, **kwargs): if self.config.get("protect", False): logger.error( "%s Stack protected, action skipped", self.full_stack_name ) raise Protected...
[ "def", "execution_protection", "(", "func", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "__name__", ")", "@", "wraps", "(", "func", ")", "def", "decorated", "(", "self", ",", "*", "args", ",", "**", "kwargs", ")", ":", "if", "self", "....
Raises an exception if a stack func is called with protection enabled.
[ "Raises", "an", "exception", "if", "a", "stack", "func", "is", "called", "with", "protection", "enabled", "." ]
[ "\"\"\"\n Raises an exception if a stack func is called with protection enabled.\n\n :param func: The function to protect.\n :type func: func\n :returns: The execution protected function.\n :rtype: func\n :raises: sceptre.exceptions.ProtectedStackError\n \"\"\"" ]
[ { "param": "func", "type": null } ]
{ "returns": [ { "docstring": "The execution protected function.", "docstring_tokens": [ "The", "execution", "protected", "function", "." ], "type": "func" } ], "raises": [ { "docstring": null, "docstring_tokens": [ "N...
8bb526b967b3a8381e45b9ab3041ce802a9905b6
rootifera/sceptre
sceptre/helpers.py
[ "Apache-2.0" ]
Python
camel_to_snake_case
<not_specific>
def camel_to_snake_case(string): """ Converts a string from camel case to snake case. :param string: The string to be converted from camel to snake case. :type string: str :returns: The string, in snake case. :rtype: str """ s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', string) return r...
Converts a string from camel case to snake case. :param string: The string to be converted from camel to snake case. :type string: str :returns: The string, in snake case. :rtype: str
Converts a string from camel case to snake case.
[ "Converts", "a", "string", "from", "camel", "case", "to", "snake", "case", "." ]
def camel_to_snake_case(string): s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', string) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
[ "def", "camel_to_snake_case", "(", "string", ")", ":", "s1", "=", "re", ".", "sub", "(", "'(.)([A-Z][a-z]+)'", ",", "r'\\1_\\2'", ",", "string", ")", "return", "re", ".", "sub", "(", "'([a-z0-9])([A-Z])'", ",", "r'\\1_\\2'", ",", "s1", ")", ".", "lower", ...
Converts a string from camel case to snake case.
[ "Converts", "a", "string", "from", "camel", "case", "to", "snake", "case", "." ]
[ "\"\"\"\n Converts a string from camel case to snake case.\n\n :param string: The string to be converted from camel to snake case.\n :type string: str\n :returns: The string, in snake case.\n :rtype: str\n \"\"\"" ]
[ { "param": "string", "type": null } ]
{ "returns": [ { "docstring": "The string, in snake case.", "docstring_tokens": [ "The", "string", "in", "snake", "case", "." ], "type": "str" } ], "raises": [], "params": [ { "identifier": "string", "type": null, ...
8bb526b967b3a8381e45b9ab3041ce802a9905b6
rootifera/sceptre
sceptre/helpers.py
[ "Apache-2.0" ]
Python
recurse_into_sub_environments
<not_specific>
def recurse_into_sub_environments(func): """ Two types of Environments exist, non-leaf and leaf. Non-leaf environments contain sub-environments, while leaf environments contain stacks. If a command is executed by a leaf environment, it should execute that command on the stacks it contains. If a comm...
Two types of Environments exist, non-leaf and leaf. Non-leaf environments contain sub-environments, while leaf environments contain stacks. If a command is executed by a leaf environment, it should execute that command on the stacks it contains. If a command is executed by a non-leaf environment, i...
Two types of Environments exist, non-leaf and leaf. Non-leaf environments contain sub-environments, while leaf environments contain stacks. If a command is executed by a leaf environment, it should execute that command on the stacks it contains. If a command is executed by a non-leaf environment, it should invoke that ...
[ "Two", "types", "of", "Environments", "exist", "non", "-", "leaf", "and", "leaf", ".", "Non", "-", "leaf", "environments", "contain", "sub", "-", "environments", "while", "leaf", "environments", "contain", "stacks", ".", "If", "a", "command", "is", "executed...
def recurse_into_sub_environments(func): @wraps(func) def decorated(self, *args, **kwargs): if self.is_leaf: return func(self, *args, **kwargs) else: function_name = func.__name__ responses = {} num_environments = len(self.environments) ...
[ "def", "recurse_into_sub_environments", "(", "func", ")", ":", "@", "wraps", "(", "func", ")", "def", "decorated", "(", "self", ",", "*", "args", ",", "**", "kwargs", ")", ":", "if", "self", ".", "is_leaf", ":", "return", "func", "(", "self", ",", "*...
Two types of Environments exist, non-leaf and leaf.
[ "Two", "types", "of", "Environments", "exist", "non", "-", "leaf", "and", "leaf", "." ]
[ "\"\"\"\n Two types of Environments exist, non-leaf and leaf. Non-leaf environments\n contain sub-environments, while leaf environments contain stacks. If a\n command is executed by a leaf environment, it should execute that command\n on the stacks it contains. If a command is executed by a non-leaf\n ...
[ { "param": "func", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "func", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8bb526b967b3a8381e45b9ab3041ce802a9905b6
rootifera/sceptre
sceptre/helpers.py
[ "Apache-2.0" ]
Python
resolve_stack_name
<not_specific>
def resolve_stack_name(source_stack_name, destination_stack_path): """ Returns a stack's full name. A dependancy stack's name can be provided as either a full stack name, or as the file base name of a stack from the same environment. resolve_stack_name calculates the dependency's stack's full name ...
Returns a stack's full name. A dependancy stack's name can be provided as either a full stack name, or as the file base name of a stack from the same environment. resolve_stack_name calculates the dependency's stack's full name from this. :param source_stack_name: The name of the stack with the p...
Returns a stack's full name. A dependancy stack's name can be provided as either a full stack name, or as the file base name of a stack from the same environment. resolve_stack_name calculates the dependency's stack's full name from this.
[ "Returns", "a", "stack", "'", "s", "full", "name", ".", "A", "dependancy", "stack", "'", "s", "name", "can", "be", "provided", "as", "either", "a", "full", "stack", "name", "or", "as", "the", "file", "base", "name", "of", "a", "stack", "from", "the",...
def resolve_stack_name(source_stack_name, destination_stack_path): if "/" in destination_stack_path: return destination_stack_path else: source_stack_base_name = source_stack_name.rsplit("/", 1)[0] return "/".join([source_stack_base_name, destination_stack_path])
[ "def", "resolve_stack_name", "(", "source_stack_name", ",", "destination_stack_path", ")", ":", "if", "\"/\"", "in", "destination_stack_path", ":", "return", "destination_stack_path", "else", ":", "source_stack_base_name", "=", "source_stack_name", ".", "rsplit", "(", "...
Returns a stack's full name.
[ "Returns", "a", "stack", "'", "s", "full", "name", "." ]
[ "\"\"\"\n Returns a stack's full name.\n\n A dependancy stack's name can be provided as either a full stack name, or\n as the file base name of a stack from the same environment.\n resolve_stack_name calculates the dependency's stack's full name from this.\n\n :param source_stack_name: The name of th...
[ { "param": "source_stack_name", "type": null }, { "param": "destination_stack_path", "type": null } ]
{ "returns": [ { "docstring": "The stack's full name.", "docstring_tokens": [ "The", "stack", "'", "s", "full", "name", "." ], "type": "str" } ], "raises": [], "params": [ { "identifier": "source_stack_name", ...
c552305b71bd92b7fcc5a2589c0ebaf456d7368e
rootifera/sceptre
sceptre/stack.py
[ "Apache-2.0" ]
Python
dependencies
<not_specific>
def dependencies(self): """ Returns a list of stacks that this stack depends on. A list of stacks that need to exist in AWS to allow the creation of this stack. :returns: The dependent stacks. :rtype: list """ if self._dependencies is None: s...
Returns a list of stacks that this stack depends on. A list of stacks that need to exist in AWS to allow the creation of this stack. :returns: The dependent stacks. :rtype: list
Returns a list of stacks that this stack depends on. A list of stacks that need to exist in AWS to allow the creation of this stack.
[ "Returns", "a", "list", "of", "stacks", "that", "this", "stack", "depends", "on", ".", "A", "list", "of", "stacks", "that", "need", "to", "exist", "in", "AWS", "to", "allow", "the", "creation", "of", "this", "stack", "." ]
def dependencies(self): if self._dependencies is None: self.logger.debug( "%s - Loading dependencies...", self.name ) self._dependencies = set( self.config.get("dependencies", []) ) self.logger.debug( "%s...
[ "def", "dependencies", "(", "self", ")", ":", "if", "self", ".", "_dependencies", "is", "None", ":", "self", ".", "logger", ".", "debug", "(", "\"%s - Loading dependencies...\"", ",", "self", ".", "name", ")", "self", ".", "_dependencies", "=", "set", "(",...
Returns a list of stacks that this stack depends on.
[ "Returns", "a", "list", "of", "stacks", "that", "this", "stack", "depends", "on", "." ]
[ "\"\"\"\n Returns a list of stacks that this stack depends on.\n\n A list of stacks that need to exist in AWS to allow the creation of\n this stack.\n\n :returns: The dependent stacks.\n :rtype: list\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "The dependent stacks.", "docstring_tokens": [ "The", "dependent", "stacks", "." ], "type": "list" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "do...
c552305b71bd92b7fcc5a2589c0ebaf456d7368e
rootifera/sceptre
sceptre/stack.py
[ "Apache-2.0" ]
Python
hooks
<not_specific>
def hooks(self): """ Returns the stack's hooks. Hooks are arbitraty pieces of code which are run before/after a stack create/update/delete. :returns: The stack's hooks. :rtype: dict """ if self._hooks is None: self.logger.debug("%s - Loading ...
Returns the stack's hooks. Hooks are arbitraty pieces of code which are run before/after a stack create/update/delete. :returns: The stack's hooks. :rtype: dict
Returns the stack's hooks. Hooks are arbitraty pieces of code which are run before/after a stack create/update/delete.
[ "Returns", "the", "stack", "'", "s", "hooks", ".", "Hooks", "are", "arbitraty", "pieces", "of", "code", "which", "are", "run", "before", "/", "after", "a", "stack", "create", "/", "update", "/", "delete", "." ]
def hooks(self): if self._hooks is None: self.logger.debug("%s - Loading hooks...", self._hooks) self._hooks = self.config.get("hooks", {}) self.logger.debug("%s - Hooks: %s", self.name, self._hooks) return self._hooks
[ "def", "hooks", "(", "self", ")", ":", "if", "self", ".", "_hooks", "is", "None", ":", "self", ".", "logger", ".", "debug", "(", "\"%s - Loading hooks...\"", ",", "self", ".", "_hooks", ")", "self", ".", "_hooks", "=", "self", ".", "config", ".", "ge...
Returns the stack's hooks.
[ "Returns", "the", "stack", "'", "s", "hooks", "." ]
[ "\"\"\"\n Returns the stack's hooks.\n\n Hooks are arbitraty pieces of code which are run before/after a stack\n create/update/delete.\n\n :returns: The stack's hooks.\n :rtype: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "The stack's hooks.", "docstring_tokens": [ "The", "stack", "'", "s", "hooks", "." ], "type": "dict" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring...
c552305b71bd92b7fcc5a2589c0ebaf456d7368e
rootifera/sceptre
sceptre/stack.py
[ "Apache-2.0" ]
Python
template
<not_specific>
def template(self): """ Returns the CloudFormation template used to create the stack. :returns: The stack's template. :rtype: str """ if self._template is None: abs_template_path = os.path.join( self.environment_config.sceptre_dir, ...
Returns the CloudFormation template used to create the stack. :returns: The stack's template. :rtype: str
Returns the CloudFormation template used to create the stack.
[ "Returns", "the", "CloudFormation", "template", "used", "to", "create", "the", "stack", "." ]
def template(self): if self._template is None: abs_template_path = os.path.join( self.environment_config.sceptre_dir, self.config["template_path"], ) self._template = Template( path=abs_template_path, sceptre_use...
[ "def", "template", "(", "self", ")", ":", "if", "self", ".", "_template", "is", "None", ":", "abs_template_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "environment_config", ".", "sceptre_dir", ",", "self", ".", "config", "[", "\"templat...
Returns the CloudFormation template used to create the stack.
[ "Returns", "the", "CloudFormation", "template", "used", "to", "create", "the", "stack", "." ]
[ "\"\"\"\n Returns the CloudFormation template used to create the stack.\n\n :returns: The stack's template.\n :rtype: str\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "The stack's template.", "docstring_tokens": [ "The", "stack", "'", "s", "template", "." ], "type": "str" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docs...
c552305b71bd92b7fcc5a2589c0ebaf456d7368e
rootifera/sceptre
sceptre/stack.py
[ "Apache-2.0" ]
Python
launch
<not_specific>
def launch(self): """ Launches the stack. If the stack status is create_complete or rollback_complete, the stack is deleted. Launch thena tries to create or update the stack, depending if it already exists. If there are no updates to be performed, launch exits gracefully...
Launches the stack. If the stack status is create_complete or rollback_complete, the stack is deleted. Launch thena tries to create or update the stack, depending if it already exists. If there are no updates to be performed, launch exits gracefully. :returns: The stac...
Launches the stack. If the stack status is create_complete or rollback_complete, the stack is deleted. Launch thena tries to create or update the stack, depending if it already exists. If there are no updates to be performed, launch exits gracefully.
[ "Launches", "the", "stack", ".", "If", "the", "stack", "status", "is", "create_complete", "or", "rollback_complete", "the", "stack", "is", "deleted", ".", "Launch", "thena", "tries", "to", "create", "or", "update", "the", "stack", "depending", "if", "it", "a...
def launch(self): self.logger.info("%s - Launching stack", self.name) try: existing_status = self.get_status() except StackDoesNotExistError: existing_status = "PENDING" self.logger.info( "%s - Stack is in the %s state", self.name, existing_status ...
[ "def", "launch", "(", "self", ")", ":", "self", ".", "logger", ".", "info", "(", "\"%s - Launching stack\"", ",", "self", ".", "name", ")", "try", ":", "existing_status", "=", "self", ".", "get_status", "(", ")", "except", "StackDoesNotExistError", ":", "e...
Launches the stack.
[ "Launches", "the", "stack", "." ]
[ "\"\"\"\n Launches the stack.\n\n If the stack status is create_complete or rollback_complete, the\n stack is deleted. Launch thena tries to create or update the stack,\n depending if it already exists. If there are no updates to be\n performed, launch exits gracefully.\n\n ...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "The stack's status.", "docstring_tokens": [ "The", "stack", "'", "s", "status", "." ], "type": "sceptre.stack_status.StackStatus" } ], "raises": [], "params": [ { "identifier": "self", ...
c552305b71bd92b7fcc5a2589c0ebaf456d7368e
rootifera/sceptre
sceptre/stack.py
[ "Apache-2.0" ]
Python
validate_template
<not_specific>
def validate_template(self): """ Validates the stack's CloudFormation template. Raises an error if the template is invalid. :returns: Information about the template. :rtype: dict :raises: botocore.exceptions.ClientError """ self.logger.debug("%s - Valida...
Validates the stack's CloudFormation template. Raises an error if the template is invalid. :returns: Information about the template. :rtype: dict :raises: botocore.exceptions.ClientError
Validates the stack's CloudFormation template. Raises an error if the template is invalid.
[ "Validates", "the", "stack", "'", "s", "CloudFormation", "template", ".", "Raises", "an", "error", "if", "the", "template", "is", "invalid", "." ]
def validate_template(self): self.logger.debug("%s - Validating template", self.name) response = self.connection_manager.call( service="cloudformation", command="validate_template", kwargs=self._get_template_details() ) self.logger.debug( "...
[ "def", "validate_template", "(", "self", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"%s - Validating template\"", ",", "self", ".", "name", ")", "response", "=", "self", ".", "connection_manager", ".", "call", "(", "service", "=", "\"cloudformation\...
Validates the stack's CloudFormation template.
[ "Validates", "the", "stack", "'", "s", "CloudFormation", "template", "." ]
[ "\"\"\"\n Validates the stack's CloudFormation template.\n\n Raises an error if the template is invalid.\n\n :returns: Information about the template.\n :rtype: dict\n :raises: botocore.exceptions.ClientError\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "Information about the template.", "docstring_tokens": [ "Information", "about", "the", "template", "." ], "type": "dict" } ], "raises": [ { "docstring": null, "docstring_tokens": [ "None"...
c552305b71bd92b7fcc5a2589c0ebaf456d7368e
rootifera/sceptre
sceptre/stack.py
[ "Apache-2.0" ]
Python
_format_parameters
<not_specific>
def _format_parameters(self, parameters): """ Converts CloudFormation parameters to the format used by Boto3. :param parameters: A dictionary of parameters. :type parameters: dict :returns: A list of the formatted parameters. :rtype: list """ return [{"Pa...
Converts CloudFormation parameters to the format used by Boto3. :param parameters: A dictionary of parameters. :type parameters: dict :returns: A list of the formatted parameters. :rtype: list
Converts CloudFormation parameters to the format used by Boto3.
[ "Converts", "CloudFormation", "parameters", "to", "the", "format", "used", "by", "Boto3", "." ]
def _format_parameters(self, parameters): return [{"ParameterKey": name, "ParameterValue": value} for name, value in parameters.items() if value is not None]
[ "def", "_format_parameters", "(", "self", ",", "parameters", ")", ":", "return", "[", "{", "\"ParameterKey\"", ":", "name", ",", "\"ParameterValue\"", ":", "value", "}", "for", "name", ",", "value", "in", "parameters", ".", "items", "(", ")", "if", "value"...
Converts CloudFormation parameters to the format used by Boto3.
[ "Converts", "CloudFormation", "parameters", "to", "the", "format", "used", "by", "Boto3", "." ]
[ "\"\"\"\n Converts CloudFormation parameters to the format used by Boto3.\n\n :param parameters: A dictionary of parameters.\n :type parameters: dict\n :returns: A list of the formatted parameters.\n :rtype: list\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "parameters", "type": null } ]
{ "returns": [ { "docstring": "A list of the formatted parameters.", "docstring_tokens": [ "A", "list", "of", "the", "formatted", "parameters", "." ], "type": "list" } ], "raises": [], "params": [ { "identifier": "...
c552305b71bd92b7fcc5a2589c0ebaf456d7368e
rootifera/sceptre
sceptre/stack.py
[ "Apache-2.0" ]
Python
_get_template_details
<not_specific>
def _get_template_details(self): """ Returns the CloudFormation template location. Uploads the template to S3 and returns the object's URL, or returns the template itself. :returns: The location of the template. :rtype: dict """ if "template_bucket_name"...
Returns the CloudFormation template location. Uploads the template to S3 and returns the object's URL, or returns the template itself. :returns: The location of the template. :rtype: dict
Returns the CloudFormation template location. Uploads the template to S3 and returns the object's URL, or returns the template itself.
[ "Returns", "the", "CloudFormation", "template", "location", ".", "Uploads", "the", "template", "to", "S3", "and", "returns", "the", "object", "'", "s", "URL", "or", "returns", "the", "template", "itself", "." ]
def _get_template_details(self): if "template_bucket_name" in self.environment_config: template_url = self.template.upload_to_s3( self.region, self.environment_config["template_bucket_name"], self.environment_config.get("template_key_prefix", ""), ...
[ "def", "_get_template_details", "(", "self", ")", ":", "if", "\"template_bucket_name\"", "in", "self", ".", "environment_config", ":", "template_url", "=", "self", ".", "template", ".", "upload_to_s3", "(", "self", ".", "region", ",", "self", ".", "environment_c...
Returns the CloudFormation template location.
[ "Returns", "the", "CloudFormation", "template", "location", "." ]
[ "\"\"\"\n Returns the CloudFormation template location.\n\n Uploads the template to S3 and returns the object's URL, or returns\n the template itself.\n\n :returns: The location of the template.\n :rtype: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "The location of the template.", "docstring_tokens": [ "The", "location", "of", "the", "template", "." ], "type": "dict" } ], "raises": [], "params": [ { "identifier": "self", "type": nu...
c552305b71bd92b7fcc5a2589c0ebaf456d7368e
rootifera/sceptre
sceptre/stack.py
[ "Apache-2.0" ]
Python
_get_role_arn
<not_specific>
def _get_role_arn(self): """ Returns the role arn assumed by CloudFormation when building a stack. Returns an empty dict if no role is to be assumed. :returns: the a role arn :rtype: dict """ if "role_arn" in self.config: return { "Ro...
Returns the role arn assumed by CloudFormation when building a stack. Returns an empty dict if no role is to be assumed. :returns: the a role arn :rtype: dict
Returns the role arn assumed by CloudFormation when building a stack. Returns an empty dict if no role is to be assumed.
[ "Returns", "the", "role", "arn", "assumed", "by", "CloudFormation", "when", "building", "a", "stack", ".", "Returns", "an", "empty", "dict", "if", "no", "role", "is", "to", "be", "assumed", "." ]
def _get_role_arn(self): if "role_arn" in self.config: return { "RoleARN": self.config["role_arn"] } else: return {}
[ "def", "_get_role_arn", "(", "self", ")", ":", "if", "\"role_arn\"", "in", "self", ".", "config", ":", "return", "{", "\"RoleARN\"", ":", "self", ".", "config", "[", "\"role_arn\"", "]", "}", "else", ":", "return", "{", "}" ]
Returns the role arn assumed by CloudFormation when building a stack.
[ "Returns", "the", "role", "arn", "assumed", "by", "CloudFormation", "when", "building", "a", "stack", "." ]
[ "\"\"\"\n Returns the role arn assumed by CloudFormation when building a stack.\n\n Returns an empty dict if no role is to be assumed.\n\n :returns: the a role arn\n :rtype: dict\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "the a role arn", "docstring_tokens": [ "the", "a", "role", "arn" ], "type": "dict" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens"...
c552305b71bd92b7fcc5a2589c0ebaf456d7368e
rootifera/sceptre
sceptre/stack.py
[ "Apache-2.0" ]
Python
_wait_for_completion
<not_specific>
def _wait_for_completion(self): """ Waits for a stack operation to finish. Prints CloudFormation events while it waits. :returns: The final stack status. :rtype: sceptre.stack_status.StackStatus """ status = StackStatus.IN_PROGRESS self.most_recent_event...
Waits for a stack operation to finish. Prints CloudFormation events while it waits. :returns: The final stack status. :rtype: sceptre.stack_status.StackStatus
Waits for a stack operation to finish. Prints CloudFormation events while it waits.
[ "Waits", "for", "a", "stack", "operation", "to", "finish", ".", "Prints", "CloudFormation", "events", "while", "it", "waits", "." ]
def _wait_for_completion(self): status = StackStatus.IN_PROGRESS self.most_recent_event_datetime = ( datetime.datetime.now(tzutc()) - datetime.timedelta(seconds=3) ) while status == StackStatus.IN_PROGRESS: status = self._get_simplified_status(self.get_status()) ...
[ "def", "_wait_for_completion", "(", "self", ")", ":", "status", "=", "StackStatus", ".", "IN_PROGRESS", "self", ".", "most_recent_event_datetime", "=", "(", "datetime", ".", "datetime", ".", "now", "(", "tzutc", "(", ")", ")", "-", "datetime", ".", "timedelt...
Waits for a stack operation to finish.
[ "Waits", "for", "a", "stack", "operation", "to", "finish", "." ]
[ "\"\"\"\n Waits for a stack operation to finish. Prints CloudFormation events\n while it waits.\n\n :returns: The final stack status.\n :rtype: sceptre.stack_status.StackStatus\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "The final stack status.", "docstring_tokens": [ "The", "final", "stack", "status", "." ], "type": "sceptre.stack_status.StackStatus" } ], "raises": [], "params": [ { "identifier": "self", "type...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
environment_options
<not_specific>
def environment_options(func): """ environment_options is a decorator which adds the environment argument to the click function ``func``. :param func: The click function to add the arguments to. :type func: function :returns: function """ func = click.argument("environment")(func) r...
environment_options is a decorator which adds the environment argument to the click function ``func``. :param func: The click function to add the arguments to. :type func: function :returns: function
environment_options is a decorator which adds the environment argument to the click function ``func``.
[ "environment_options", "is", "a", "decorator", "which", "adds", "the", "environment", "argument", "to", "the", "click", "function", "`", "`", "func", "`", "`", "." ]
def environment_options(func): func = click.argument("environment")(func) return func
[ "def", "environment_options", "(", "func", ")", ":", "func", "=", "click", ".", "argument", "(", "\"environment\"", ")", "(", "func", ")", "return", "func" ]
environment_options is a decorator which adds the environment argument to the click function ``func``.
[ "environment_options", "is", "a", "decorator", "which", "adds", "the", "environment", "argument", "to", "the", "click", "function", "`", "`", "func", "`", "`", "." ]
[ "\"\"\"\n environment_options is a decorator which adds the environment argument to\n the click function ``func``.\n\n :param func: The click function to add the arguments to.\n :type func: function\n :returns: function\n \"\"\"" ]
[ { "param": "func", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "func", "type": null, "docstring": "The click function to add the arguments to.", "docstring_tokens": [ "The...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
stack_options
<not_specific>
def stack_options(func): """ stack_options is a decorator which adds the stack and environment arguments to the click function ``func``. :param func: The click function to add the arguments to. :type func: function :returns: function """ func = click.argument("stack")(func) func = c...
stack_options is a decorator which adds the stack and environment arguments to the click function ``func``. :param func: The click function to add the arguments to. :type func: function :returns: function
stack_options is a decorator which adds the stack and environment arguments to the click function ``func``.
[ "stack_options", "is", "a", "decorator", "which", "adds", "the", "stack", "and", "environment", "arguments", "to", "the", "click", "function", "`", "`", "func", "`", "`", "." ]
def stack_options(func): func = click.argument("stack")(func) func = click.argument("environment")(func) return func
[ "def", "stack_options", "(", "func", ")", ":", "func", "=", "click", ".", "argument", "(", "\"stack\"", ")", "(", "func", ")", "func", "=", "click", ".", "argument", "(", "\"environment\"", ")", "(", "func", ")", "return", "func" ]
stack_options is a decorator which adds the stack and environment arguments to the click function ``func``.
[ "stack_options", "is", "a", "decorator", "which", "adds", "the", "stack", "and", "environment", "arguments", "to", "the", "click", "function", "`", "`", "func", "`", "`", "." ]
[ "\"\"\"\n stack_options is a decorator which adds the stack and environment arguments\n to the click function ``func``.\n\n :param func: The click function to add the arguments to.\n :type func: function\n :returns: function\n \"\"\"" ]
[ { "param": "func", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "func", "type": null, "docstring": "The click function to add the arguments to.", "docstring_tokens": [ "The...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
change_set_options
<not_specific>
def change_set_options(func): """ change_set_options is a decorator which adds the environment, stack and change set name arguments to the click function ``func``. :param func: The click function to add the arguments to. :type func: function :returns: function """ func = click.argument(...
change_set_options is a decorator which adds the environment, stack and change set name arguments to the click function ``func``. :param func: The click function to add the arguments to. :type func: function :returns: function
change_set_options is a decorator which adds the environment, stack and change set name arguments to the click function ``func``.
[ "change_set_options", "is", "a", "decorator", "which", "adds", "the", "environment", "stack", "and", "change", "set", "name", "arguments", "to", "the", "click", "function", "`", "`", "func", "`", "`", "." ]
def change_set_options(func): func = click.argument("change_set_name")(func) func = click.argument("stack")(func) func = click.argument("environment")(func) return func
[ "def", "change_set_options", "(", "func", ")", ":", "func", "=", "click", ".", "argument", "(", "\"change_set_name\"", ")", "(", "func", ")", "func", "=", "click", ".", "argument", "(", "\"stack\"", ")", "(", "func", ")", "func", "=", "click", ".", "ar...
change_set_options is a decorator which adds the environment, stack and change set name arguments to the click function ``func``.
[ "change_set_options", "is", "a", "decorator", "which", "adds", "the", "environment", "stack", "and", "change", "set", "name", "arguments", "to", "the", "click", "function", "`", "`", "func", "`", "`", "." ]
[ "\"\"\"\n change_set_options is a decorator which adds the environment, stack and\n change set name arguments to the click function ``func``.\n\n :param func: The click function to add the arguments to.\n :type func: function\n :returns: function\n \"\"\"" ]
[ { "param": "func", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "func", "type": null, "docstring": "The click function to add the arguments to.", "docstring_tokens": [ "The...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
cli
null
def cli( ctx, debug, directory, no_colour, output, var, var_file ): # pragma: no cover """ Implements sceptre's CLI. """ setup_logging(debug, no_colour) colorama.init() ctx.obj = { "options": {}, "output_format": output, "sceptre_dir": directory if directory else...
Implements sceptre's CLI.
Implements sceptre's CLI.
[ "Implements", "sceptre", "'", "s", "CLI", "." ]
def cli( ctx, debug, directory, no_colour, output, var, var_file ): setup_logging(debug, no_colour) colorama.init() ctx.obj = { "options": {}, "output_format": output, "sceptre_dir": directory if directory else os.getcwd() } user_variables = {} if var_file: ...
[ "def", "cli", "(", "ctx", ",", "debug", ",", "directory", ",", "no_colour", ",", "output", ",", "var", ",", "var_file", ")", ":", "setup_logging", "(", "debug", ",", "no_colour", ")", "colorama", ".", "init", "(", ")", "ctx", ".", "obj", "=", "{", ...
Implements sceptre's CLI.
[ "Implements", "sceptre", "'", "s", "CLI", "." ]
[ "# pragma: no cover", "\"\"\"\n Implements sceptre's CLI.\n \"\"\"", "# --var options overwrite --var-file options" ]
[ { "param": "ctx", "type": null }, { "param": "debug", "type": null }, { "param": "directory", "type": null }, { "param": "no_colour", "type": null }, { "param": "output", "type": null }, { "param": "var", "type": null }, { "param": "var_fil...
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "debug", "type": null, "docstring": null, "docstring_tokens": [...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
validate_template
null
def validate_template(ctx, environment, stack): """ Validates the template. Validates ENVIRONMENT/STACK's template. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) result = env.stacks[stack].validate_template() write(result, ctx.obj["output_format"])
Validates the template. Validates ENVIRONMENT/STACK's template.
Validates the template. Validates ENVIRONMENT/STACK's template.
[ "Validates", "the", "template", ".", "Validates", "ENVIRONMENT", "/", "STACK", "'", "s", "template", "." ]
def validate_template(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) result = env.stacks[stack].validate_template() write(result, ctx.obj["output_format"])
[ "def", "validate_template", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "result", "=", "en...
Validates the template.
[ "Validates", "the", "template", "." ]
[ "\"\"\"\n Validates the template.\n\n Validates ENVIRONMENT/STACK's template.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
generate_template
null
def generate_template(ctx, environment, stack): """ Displays the template used. Prints ENVIRONMENT/STACK's template. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) template_output = env.stacks[stack].template.cfn write(template_output)
Displays the template used. Prints ENVIRONMENT/STACK's template.
Displays the template used. Prints ENVIRONMENT/STACK's template.
[ "Displays", "the", "template", "used", ".", "Prints", "ENVIRONMENT", "/", "STACK", "'", "s", "template", "." ]
def generate_template(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) template_output = env.stacks[stack].template.cfn write(template_output)
[ "def", "generate_template", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "template_output", "...
Displays the template used.
[ "Displays", "the", "template", "used", "." ]
[ "\"\"\"\n Displays the template used.\n\n Prints ENVIRONMENT/STACK's template.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
lock_stack
null
def lock_stack(ctx, environment, stack): """ Prevents stack updates. Applies a stack policy to ENVIRONMENT/STACK which prevents updates. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].lock()
Prevents stack updates. Applies a stack policy to ENVIRONMENT/STACK which prevents updates.
Prevents stack updates. Applies a stack policy to ENVIRONMENT/STACK which prevents updates.
[ "Prevents", "stack", "updates", ".", "Applies", "a", "stack", "policy", "to", "ENVIRONMENT", "/", "STACK", "which", "prevents", "updates", "." ]
def lock_stack(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].lock()
[ "def", "lock_stack", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "env", ".", "stacks", "...
Prevents stack updates.
[ "Prevents", "stack", "updates", "." ]
[ "\"\"\"\n Prevents stack updates.\n\n Applies a stack policy to ENVIRONMENT/STACK which prevents updates.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
unlock_stack
null
def unlock_stack(ctx, environment, stack): """ Allows stack updates. Applies a stack policy to ENVIRONMENT/STACK which allows updates. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].unlock()
Allows stack updates. Applies a stack policy to ENVIRONMENT/STACK which allows updates.
Allows stack updates. Applies a stack policy to ENVIRONMENT/STACK which allows updates.
[ "Allows", "stack", "updates", ".", "Applies", "a", "stack", "policy", "to", "ENVIRONMENT", "/", "STACK", "which", "allows", "updates", "." ]
def unlock_stack(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].unlock()
[ "def", "unlock_stack", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "env", ".", "stacks", ...
Allows stack updates.
[ "Allows", "stack", "updates", "." ]
[ "\"\"\"\n Allows stack updates.\n\n Applies a stack policy to ENVIRONMENT/STACK which allows updates.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
describe_env_resources
null
def describe_env_resources(ctx, environment): """ Describes the env's resources. Prints ENVIRONMENT's resources. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) responses = env.describe_resources() write(responses, ctx.obj["output_format"])
Describes the env's resources. Prints ENVIRONMENT's resources.
Describes the env's resources. Prints ENVIRONMENT's resources.
[ "Describes", "the", "env", "'", "s", "resources", ".", "Prints", "ENVIRONMENT", "'", "s", "resources", "." ]
def describe_env_resources(ctx, environment): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) responses = env.describe_resources() write(responses, ctx.obj["output_format"])
[ "def", "describe_env_resources", "(", "ctx", ",", "environment", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "responses", "=", "env", ".",...
Describes the env's resources.
[ "Describes", "the", "env", "'", "s", "resources", "." ]
[ "\"\"\"\n Describes the env's resources.\n\n Prints ENVIRONMENT's resources.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
describe_stack_resources
null
def describe_stack_resources(ctx, environment, stack): """ Describes the stack's resources. Prints ENVIRONMENT/STACK's resources. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].describe_resources() write(response, ctx.obj["output_for...
Describes the stack's resources. Prints ENVIRONMENT/STACK's resources.
Describes the stack's resources. Prints ENVIRONMENT/STACK's resources.
[ "Describes", "the", "stack", "'", "s", "resources", ".", "Prints", "ENVIRONMENT", "/", "STACK", "'", "s", "resources", "." ]
def describe_stack_resources(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].describe_resources() write(response, ctx.obj["output_format"])
[ "def", "describe_stack_resources", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "response", "...
Describes the stack's resources.
[ "Describes", "the", "stack", "'", "s", "resources", "." ]
[ "\"\"\"\n Describes the stack's resources.\n\n Prints ENVIRONMENT/STACK's resources.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
create_stack
null
def create_stack(ctx, environment, stack): """ Creates the stack. Creates ENVIRONMENT/STACK. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].create() if response != StackStatus.COMPLETE: exit(1)
Creates the stack. Creates ENVIRONMENT/STACK.
Creates the stack. Creates ENVIRONMENT/STACK.
[ "Creates", "the", "stack", ".", "Creates", "ENVIRONMENT", "/", "STACK", "." ]
def create_stack(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].create() if response != StackStatus.COMPLETE: exit(1)
[ "def", "create_stack", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "response", "=", "env",...
Creates the stack.
[ "Creates", "the", "stack", "." ]
[ "\"\"\"\n Creates the stack.\n\n Creates ENVIRONMENT/STACK.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
delete_stack
null
def delete_stack(ctx, environment, stack): """Deletes the stack. Deletes ENVIRONMENT/STACK.""" env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].delete() if response != StackStatus.COMPLETE: exit(1)
Deletes the stack. Deletes ENVIRONMENT/STACK.
Deletes the stack. Deletes ENVIRONMENT/STACK.
[ "Deletes", "the", "stack", ".", "Deletes", "ENVIRONMENT", "/", "STACK", "." ]
def delete_stack(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].delete() if response != StackStatus.COMPLETE: exit(1)
[ "def", "delete_stack", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "response", "=", "env",...
Deletes the stack.
[ "Deletes", "the", "stack", "." ]
[ "\"\"\"Deletes the stack.\n\n Deletes ENVIRONMENT/STACK.\"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
update_stack
null
def update_stack(ctx, environment, stack): """ Updates the stack. Updates ENVIRONMENT/STACK. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].update() if response != StackStatus.COMPLETE: exit(1)
Updates the stack. Updates ENVIRONMENT/STACK.
Updates the stack. Updates ENVIRONMENT/STACK.
[ "Updates", "the", "stack", ".", "Updates", "ENVIRONMENT", "/", "STACK", "." ]
def update_stack(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].update() if response != StackStatus.COMPLETE: exit(1)
[ "def", "update_stack", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "response", "=", "env",...
Updates the stack.
[ "Updates", "the", "stack", "." ]
[ "\"\"\"\n Updates the stack.\n\n Updates ENVIRONMENT/STACK.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
launch_stack
null
def launch_stack(ctx, environment, stack): """ Creates or updates the stack. Creates or updates ENVIRONMENT/STACK. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].launch() if response != StackStatus.COMPLETE: exit(1)
Creates or updates the stack. Creates or updates ENVIRONMENT/STACK.
Creates or updates the stack. Creates or updates ENVIRONMENT/STACK.
[ "Creates", "or", "updates", "the", "stack", ".", "Creates", "or", "updates", "ENVIRONMENT", "/", "STACK", "." ]
def launch_stack(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].launch() if response != StackStatus.COMPLETE: exit(1)
[ "def", "launch_stack", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "response", "=", "env",...
Creates or updates the stack.
[ "Creates", "or", "updates", "the", "stack", "." ]
[ "\"\"\"\n Creates or updates the stack.\n\n Creates or updates ENVIRONMENT/STACK.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
launch_env
null
def launch_env(ctx, environment): """ Creates or updates all stacks. Creates or updates all the stacks in ENVIRONMENT. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.launch() if not all(status == StackStatus.COMPLETE for status in response.values()...
Creates or updates all stacks. Creates or updates all the stacks in ENVIRONMENT.
Creates or updates all stacks. Creates or updates all the stacks in ENVIRONMENT.
[ "Creates", "or", "updates", "all", "stacks", ".", "Creates", "or", "updates", "all", "the", "stacks", "in", "ENVIRONMENT", "." ]
def launch_env(ctx, environment): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.launch() if not all(status == StackStatus.COMPLETE for status in response.values()): exit(1)
[ "def", "launch_env", "(", "ctx", ",", "environment", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "response", "=", "env", ".", "launch", ...
Creates or updates all stacks.
[ "Creates", "or", "updates", "all", "stacks", "." ]
[ "\"\"\"\n Creates or updates all stacks.\n\n Creates or updates all the stacks in ENVIRONMENT.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
delete_env
null
def delete_env(ctx, environment): """ Deletes all stacks. Deletes all the stacks in ENVIRONMENT. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.delete() if not all(status == StackStatus.COMPLETE for status in response.values()): exit(1)
Deletes all stacks. Deletes all the stacks in ENVIRONMENT.
Deletes all stacks. Deletes all the stacks in ENVIRONMENT.
[ "Deletes", "all", "stacks", ".", "Deletes", "all", "the", "stacks", "in", "ENVIRONMENT", "." ]
def delete_env(ctx, environment): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.delete() if not all(status == StackStatus.COMPLETE for status in response.values()): exit(1)
[ "def", "delete_env", "(", "ctx", ",", "environment", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "response", "=", "env", ".", "delete", ...
Deletes all stacks.
[ "Deletes", "all", "stacks", "." ]
[ "\"\"\"\n Deletes all stacks.\n\n Deletes all the stacks in ENVIRONMENT.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
continue_update_rollback
null
def continue_update_rollback(ctx, environment, stack): """ Rolls stack back to working state. If ENVIRONMENT/STACK is in the state UPDATE_ROLLBACK_FAILED, roll it back to the UPDATE_ROLLBACK_COMPLETE state. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stack...
Rolls stack back to working state. If ENVIRONMENT/STACK is in the state UPDATE_ROLLBACK_FAILED, roll it back to the UPDATE_ROLLBACK_COMPLETE state.
Rolls stack back to working state. If ENVIRONMENT/STACK is in the state UPDATE_ROLLBACK_FAILED, roll it back to the UPDATE_ROLLBACK_COMPLETE state.
[ "Rolls", "stack", "back", "to", "working", "state", ".", "If", "ENVIRONMENT", "/", "STACK", "is", "in", "the", "state", "UPDATE_ROLLBACK_FAILED", "roll", "it", "back", "to", "the", "UPDATE_ROLLBACK_COMPLETE", "state", "." ]
def continue_update_rollback(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].continue_update_rollback()
[ "def", "continue_update_rollback", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "env", ".", ...
Rolls stack back to working state.
[ "Rolls", "stack", "back", "to", "working", "state", "." ]
[ "\"\"\"\n Rolls stack back to working state.\n\n If ENVIRONMENT/STACK is in the state UPDATE_ROLLBACK_FAILED, roll it\n back to the UPDATE_ROLLBACK_COMPLETE state.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
create_change_set
null
def create_change_set(ctx, environment, stack, change_set_name): """ Creates a change set. Create a change set for ENVIRONMENT/STACK with the name CHANGE_SET_NAME. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].create_change_set(change_set_name)
Creates a change set. Create a change set for ENVIRONMENT/STACK with the name CHANGE_SET_NAME.
Creates a change set. Create a change set for ENVIRONMENT/STACK with the name CHANGE_SET_NAME.
[ "Creates", "a", "change", "set", ".", "Create", "a", "change", "set", "for", "ENVIRONMENT", "/", "STACK", "with", "the", "name", "CHANGE_SET_NAME", "." ]
def create_change_set(ctx, environment, stack, change_set_name): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].create_change_set(change_set_name)
[ "def", "create_change_set", "(", "ctx", ",", "environment", ",", "stack", ",", "change_set_name", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", "...
Creates a change set.
[ "Creates", "a", "change", "set", "." ]
[ "\"\"\"\n Creates a change set.\n\n Create a change set for ENVIRONMENT/STACK with the name\n CHANGE_SET_NAME.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null }, { "param": "change_set_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
delete_change_set
null
def delete_change_set(ctx, environment, stack, change_set_name): """ Deletes the change set. Deletes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].delete_change_set(change_set_name)
Deletes the change set. Deletes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME.
Deletes the change set. Deletes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME.
[ "Deletes", "the", "change", "set", ".", "Deletes", "ENVIRONMENT", "/", "STACK", "'", "s", "change", "set", "with", "name", "CHANGE_SET_NAME", "." ]
def delete_change_set(ctx, environment, stack, change_set_name): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].delete_change_set(change_set_name)
[ "def", "delete_change_set", "(", "ctx", ",", "environment", ",", "stack", ",", "change_set_name", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", "...
Deletes the change set.
[ "Deletes", "the", "change", "set", "." ]
[ "\"\"\"\n Deletes the change set.\n\n Deletes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null }, { "param": "change_set_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
describe_change_set
null
def describe_change_set(ctx, environment, stack, change_set_name, verbose): """ Describes the change set. Describes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) description = env.stacks[stack].describe_chang...
Describes the change set. Describes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME.
Describes the change set. Describes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME.
[ "Describes", "the", "change", "set", ".", "Describes", "ENVIRONMENT", "/", "STACK", "'", "s", "change", "set", "with", "name", "CHANGE_SET_NAME", "." ]
def describe_change_set(ctx, environment, stack, change_set_name, verbose): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) description = env.stacks[stack].describe_change_set(change_set_name) if not verbose: description = _simplify_change_set_description(description) writ...
[ "def", "describe_change_set", "(", "ctx", ",", "environment", ",", "stack", ",", "change_set_name", ",", "verbose", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"...
Describes the change set.
[ "Describes", "the", "change", "set", "." ]
[ "\"\"\"\n Describes the change set.\n\n Describes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null }, { "param": "change_set_name", "type": null }, { "param": "verbose", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
execute_change_set
null
def execute_change_set(ctx, environment, stack, change_set_name): """ Executes the change set. Executes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].execute_change_set(change_set_name)
Executes the change set. Executes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME.
Executes the change set. Executes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME.
[ "Executes", "the", "change", "set", ".", "Executes", "ENVIRONMENT", "/", "STACK", "'", "s", "change", "set", "with", "name", "CHANGE_SET_NAME", "." ]
def execute_change_set(ctx, environment, stack, change_set_name): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) env.stacks[stack].execute_change_set(change_set_name)
[ "def", "execute_change_set", "(", "ctx", ",", "environment", ",", "stack", ",", "change_set_name", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ...
Executes the change set.
[ "Executes", "the", "change", "set", "." ]
[ "\"\"\"\n Executes the change set.\n\n Executes ENVIRONMENT/STACK's change set with name CHANGE_SET_NAME.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null }, { "param": "change_set_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
list_change_sets
null
def list_change_sets(ctx, environment, stack): """ Lists change sets. Lists ENVIRONMENT/STACK's change sets. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].list_change_sets() formatted_response = { k: v for k, v in res...
Lists change sets. Lists ENVIRONMENT/STACK's change sets.
Lists change sets. Lists ENVIRONMENT/STACK's change sets.
[ "Lists", "change", "sets", ".", "Lists", "ENVIRONMENT", "/", "STACK", "'", "s", "change", "sets", "." ]
def list_change_sets(ctx, environment, stack): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].list_change_sets() formatted_response = { k: v for k, v in response.items() if k != "ResponseMetadata" } write(formatted_response...
[ "def", "list_change_sets", "(", "ctx", ",", "environment", ",", "stack", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "response", "=", "e...
Lists change sets.
[ "Lists", "change", "sets", "." ]
[ "\"\"\"\n Lists change sets.\n\n Lists ENVIRONMENT/STACK's change sets.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
update_with_change_set
null
def update_with_change_set(ctx, environment, stack, verbose): """ Updates the stack via change set. Updates ENVIRONMENT/STACK with prompt via change set and description. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) change_set_name = "-".join(["change-set", uuid...
Updates the stack via change set. Updates ENVIRONMENT/STACK with prompt via change set and description.
Updates the stack via change set. Updates ENVIRONMENT/STACK with prompt via change set and description.
[ "Updates", "the", "stack", "via", "change", "set", ".", "Updates", "ENVIRONMENT", "/", "STACK", "with", "prompt", "via", "change", "set", "and", "description", "." ]
def update_with_change_set(ctx, environment, stack, verbose): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) change_set_name = "-".join(["change-set", uuid1().hex]) with change_set(env.stacks[stack], change_set_name): status = env.stacks[stack].wait_for_cs_completion(change_s...
[ "def", "update_with_change_set", "(", "ctx", ",", "environment", ",", "stack", ",", "verbose", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")",...
Updates the stack via change set.
[ "Updates", "the", "stack", "via", "change", "set", "." ]
[ "\"\"\"\n Updates the stack via change set.\n\n Updates ENVIRONMENT/STACK with prompt via change set and\n description.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null }, { "param": "verbose", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
change_set
null
def change_set(stack, name): """ Creates and yields and deletes a change set. :param stack: The stack to create the change set for. :type stack: sceptre.stack.Stack :param name: The name of the change set. :type name: str """ stack.create_change_set(name) try: yield fina...
Creates and yields and deletes a change set. :param stack: The stack to create the change set for. :type stack: sceptre.stack.Stack :param name: The name of the change set. :type name: str
Creates and yields and deletes a change set.
[ "Creates", "and", "yields", "and", "deletes", "a", "change", "set", "." ]
def change_set(stack, name): stack.create_change_set(name) try: yield finally: stack.delete_change_set(name)
[ "def", "change_set", "(", "stack", ",", "name", ")", ":", "stack", ".", "create_change_set", "(", "name", ")", "try", ":", "yield", "finally", ":", "stack", ".", "delete_change_set", "(", "name", ")" ]
Creates and yields and deletes a change set.
[ "Creates", "and", "yields", "and", "deletes", "a", "change", "set", "." ]
[ "\"\"\"\n Creates and yields and deletes a change set.\n\n :param stack: The stack to create the change set for.\n :type stack: sceptre.stack.Stack\n :param name: The name of the change set.\n :type name: str\n \"\"\"" ]
[ { "param": "stack", "type": null }, { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "stack", "type": null, "docstring": "The stack to create the change set for.", "docstring_tokens": [ "The", "stack", "to", "create", "the", "change", "set", "for",...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
describe_stack_outputs
null
def describe_stack_outputs(ctx, environment, stack, export): """ Describes stack outputs. Describes ENVIRONMENT/STACK's stack outputs. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].describe_outputs() if export == "envvar": w...
Describes stack outputs. Describes ENVIRONMENT/STACK's stack outputs.
Describes stack outputs. Describes ENVIRONMENT/STACK's stack outputs.
[ "Describes", "stack", "outputs", ".", "Describes", "ENVIRONMENT", "/", "STACK", "'", "s", "stack", "outputs", "." ]
def describe_stack_outputs(ctx, environment, stack, export): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) response = env.stacks[stack].describe_outputs() if export == "envvar": write("\n".join( [ "export SCEPTRE_{0}={1}".format( ...
[ "def", "describe_stack_outputs", "(", "ctx", ",", "environment", ",", "stack", ",", "export", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", ...
Describes stack outputs.
[ "Describes", "stack", "outputs", "." ]
[ "\"\"\"\n Describes stack outputs.\n\n Describes ENVIRONMENT/STACK's stack outputs.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null }, { "param": "stack", "type": null }, { "param": "export", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
2b1d1e23c1fd658541766083c8bca925541319ec
rootifera/sceptre
sceptre/cli.py
[ "Apache-2.0" ]
Python
describe_env
null
def describe_env(ctx, environment): """ Describes the stack statuses. Describes ENVIRONMENT stack statuses. """ env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) responses = env.describe() write(responses, ctx.obj["output_format"])
Describes the stack statuses. Describes ENVIRONMENT stack statuses.
Describes the stack statuses. Describes ENVIRONMENT stack statuses.
[ "Describes", "the", "stack", "statuses", ".", "Describes", "ENVIRONMENT", "stack", "statuses", "." ]
def describe_env(ctx, environment): env = get_env(ctx.obj["sceptre_dir"], environment, ctx.obj["options"]) responses = env.describe() write(responses, ctx.obj["output_format"])
[ "def", "describe_env", "(", "ctx", ",", "environment", ")", ":", "env", "=", "get_env", "(", "ctx", ".", "obj", "[", "\"sceptre_dir\"", "]", ",", "environment", ",", "ctx", ".", "obj", "[", "\"options\"", "]", ")", "responses", "=", "env", ".", "descri...
Describes the stack statuses.
[ "Describes", "the", "stack", "statuses", "." ]
[ "\"\"\"\n Describes the stack statuses.\n\n Describes ENVIRONMENT stack statuses.\n \"\"\"" ]
[ { "param": "ctx", "type": null }, { "param": "environment", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_toke...
4faa998b7c90d3aa581e73836c0cd344b0a2a16e
rootifera/sceptre
integration-tests/environment.py
[ "Apache-2.0" ]
Python
before_all
null
def before_all(context): """ before_all is an Behave environmental control. This function is run before the integration tests start. It appends a UUID to the project_code that is used by Sceptre when creating resources. This ensures that the integration tests can be run in parallel without stack nam...
before_all is an Behave environmental control. This function is run before the integration tests start. It appends a UUID to the project_code that is used by Sceptre when creating resources. This ensures that the integration tests can be run in parallel without stack name clashes.
before_all is an Behave environmental control. This function is run before the integration tests start. It appends a UUID to the project_code that is used by Sceptre when creating resources. This ensures that the integration tests can be run in parallel without stack name clashes.
[ "before_all", "is", "an", "Behave", "environmental", "control", ".", "This", "function", "is", "run", "before", "the", "integration", "tests", "start", ".", "It", "appends", "a", "UUID", "to", "the", "project_code", "that", "is", "used", "by", "Sceptre", "wh...
def before_all(context): build_uuid = uuid.uuid1().hex context.environment_path_a = "test-env-a" context.environment_path_b = "test-env-b" context.project_code = "sceptre-integration-tests-{0}".format( build_uuid ) print("The UUID for this build is '{0}'.".format(build_uuid)) config_...
[ "def", "before_all", "(", "context", ")", ":", "build_uuid", "=", "uuid", ".", "uuid1", "(", ")", ".", "hex", "context", ".", "environment_path_a", "=", "\"test-env-a\"", "context", ".", "environment_path_b", "=", "\"test-env-b\"", "context", ".", "project_code"...
before_all is an Behave environmental control.
[ "before_all", "is", "an", "Behave", "environmental", "control", "." ]
[ "\"\"\"\n before_all is an Behave environmental control. This function is run before\n the integration tests start. It appends a UUID to the project_code that\n is used by Sceptre when creating resources. This ensures that the\n integration tests can be run in parallel without stack name clashes.\n \...
[ { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4faa998b7c90d3aa581e73836c0cd344b0a2a16e
rootifera/sceptre
integration-tests/environment.py
[ "Apache-2.0" ]
Python
after_all
null
def after_all(context): """ after_all is an Behave environmental control. This function is run after the integration tests end. It changes the project code stored at `sceptre/integration-tests/config.yaml` is returned to its non-UUID-appended value. """ config_file = os.path.abspath(os.path....
after_all is an Behave environmental control. This function is run after the integration tests end. It changes the project code stored at `sceptre/integration-tests/config.yaml` is returned to its non-UUID-appended value.
after_all is an Behave environmental control. This function is run after the integration tests end. It changes the project code stored at `sceptre/integration-tests/config.yaml` is returned to its non-UUID-appended value.
[ "after_all", "is", "an", "Behave", "environmental", "control", ".", "This", "function", "is", "run", "after", "the", "integration", "tests", "end", ".", "It", "changes", "the", "project", "code", "stored", "at", "`", "sceptre", "/", "integration", "-", "test...
def after_all(context): config_file = os.path.abspath(os.path.join( os.path.dirname(__file__), "config", "config.yaml" )) with open(config_file, "r+") as f: config = yaml.load(f) config["project_code"] = "sceptre-integration-tests" with open(config_file, "w") as f: ...
[ "def", "after_all", "(", "context", ")", ":", "config_file", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "\"config\"", ",", "\"config.yaml\"", ")", ")...
after_all is an Behave environmental control.
[ "after_all", "is", "an", "Behave", "environmental", "control", "." ]
[ "\"\"\"\n after_all is an Behave environmental control. This function is run after\n the integration tests end. It changes the project code stored at\n `sceptre/integration-tests/config.yaml` is returned to its\n non-UUID-appended value.\n \"\"\"" ]
[ { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4faa998b7c90d3aa581e73836c0cd344b0a2a16e
rootifera/sceptre
integration-tests/environment.py
[ "Apache-2.0" ]
Python
before_feature
null
def before_feature(context, feature): """ Delete any stacks remaining from the previous feature. """ delete_all_integration_test_stacks(context.project_code)
Delete any stacks remaining from the previous feature.
Delete any stacks remaining from the previous feature.
[ "Delete", "any", "stacks", "remaining", "from", "the", "previous", "feature", "." ]
def before_feature(context, feature): delete_all_integration_test_stacks(context.project_code)
[ "def", "before_feature", "(", "context", ",", "feature", ")", ":", "delete_all_integration_test_stacks", "(", "context", ".", "project_code", ")" ]
Delete any stacks remaining from the previous feature.
[ "Delete", "any", "stacks", "remaining", "from", "the", "previous", "feature", "." ]
[ "\"\"\"\n Delete any stacks remaining from the previous feature.\n \"\"\"" ]
[ { "param": "context", "type": null }, { "param": "feature", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "feature", "type": null, "docstring": null, "docstring_toke...
4faa998b7c90d3aa581e73836c0cd344b0a2a16e
rootifera/sceptre
integration-tests/environment.py
[ "Apache-2.0" ]
Python
after_feature
null
def after_feature(context, feature): """ Delete any stacks remaining after a feature. """ delete_all_integration_test_stacks(context.project_code)
Delete any stacks remaining after a feature.
Delete any stacks remaining after a feature.
[ "Delete", "any", "stacks", "remaining", "after", "a", "feature", "." ]
def after_feature(context, feature): delete_all_integration_test_stacks(context.project_code)
[ "def", "after_feature", "(", "context", ",", "feature", ")", ":", "delete_all_integration_test_stacks", "(", "context", ".", "project_code", ")" ]
Delete any stacks remaining after a feature.
[ "Delete", "any", "stacks", "remaining", "after", "a", "feature", "." ]
[ "\"\"\"\n Delete any stacks remaining after a feature.\n \"\"\"" ]
[ { "param": "context", "type": null }, { "param": "feature", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "feature", "type": null, "docstring": null, "docstring_toke...
4faa998b7c90d3aa581e73836c0cd344b0a2a16e
rootifera/sceptre
integration-tests/environment.py
[ "Apache-2.0" ]
Python
after_scenario
null
def after_scenario(context, scenario): """ Perform additional cleanup after certain scenarios. """ clean_vpc_scenario_names = [ "check sceptre updates a stack", "check sceptre creates change set" ] if scenario.name in clean_vpc_scenario_names: clean_vpc_yaml()
Perform additional cleanup after certain scenarios.
Perform additional cleanup after certain scenarios.
[ "Perform", "additional", "cleanup", "after", "certain", "scenarios", "." ]
def after_scenario(context, scenario): clean_vpc_scenario_names = [ "check sceptre updates a stack", "check sceptre creates change set" ] if scenario.name in clean_vpc_scenario_names: clean_vpc_yaml()
[ "def", "after_scenario", "(", "context", ",", "scenario", ")", ":", "clean_vpc_scenario_names", "=", "[", "\"check sceptre updates a stack\"", ",", "\"check sceptre creates change set\"", "]", "if", "scenario", ".", "name", "in", "clean_vpc_scenario_names", ":", "clean_vp...
Perform additional cleanup after certain scenarios.
[ "Perform", "additional", "cleanup", "after", "certain", "scenarios", "." ]
[ "\"\"\"\n Perform additional cleanup after certain scenarios.\n \"\"\"" ]
[ { "param": "context", "type": null }, { "param": "scenario", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "scenario", "type": null, "docstring": null, "docstring_tok...
4faa998b7c90d3aa581e73836c0cd344b0a2a16e
rootifera/sceptre
integration-tests/environment.py
[ "Apache-2.0" ]
Python
clean_vpc_yaml
null
def clean_vpc_yaml(): """ Certain scenarios require a stack update. This is done by changing a value in the vpc stack's config file. clean_vpc_yaml returns the value to its default value. """ vpc_config_file = os.path.abspath(os.path.join( os.path.dirname(__file__), "config", ...
Certain scenarios require a stack update. This is done by changing a value in the vpc stack's config file. clean_vpc_yaml returns the value to its default value.
Certain scenarios require a stack update. This is done by changing a value in the vpc stack's config file. clean_vpc_yaml returns the value to its default value.
[ "Certain", "scenarios", "require", "a", "stack", "update", ".", "This", "is", "done", "by", "changing", "a", "value", "in", "the", "vpc", "stack", "'", "s", "config", "file", ".", "clean_vpc_yaml", "returns", "the", "value", "to", "its", "default", "value"...
def clean_vpc_yaml(): vpc_config_file = os.path.abspath(os.path.join( os.path.dirname(__file__), "config", "test-env", "a", "vpc.yaml" )) with open(vpc_config_file, "r+") as f: config = f.read() config = config.replace("updated_vpc.py", "vpc.py") with ...
[ "def", "clean_vpc_yaml", "(", ")", ":", "vpc_config_file", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "\"config\"", ",", "\"test-env\"", ",", "\"a\"", ...
Certain scenarios require a stack update.
[ "Certain", "scenarios", "require", "a", "stack", "update", "." ]
[ "\"\"\"\n Certain scenarios require a stack update. This is done by changing a value\n in the vpc stack's config file. clean_vpc_yaml returns the value to its\n default value.\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
c8c7e10d5c606f0a7a807f25ceede73f6590e7a9
FlorisFok/DataVisualisation
dockers/API/restV1.py
[ "MIT" ]
Python
index
<not_specific>
def index(): ''' Just return allllll data and test with jsons ''' if (request.method == 'POST'): some_json = request.get_json() return jsonify({"you sent":some_json}), 201 else: return jsonify({"data":get_full_json()}), 200
Just return allllll data and test with jsons
Just return allllll data and test with jsons
[ "Just", "return", "allllll", "data", "and", "test", "with", "jsons" ]
def index(): if (request.method == 'POST'): some_json = request.get_json() return jsonify({"you sent":some_json}), 201 else: return jsonify({"data":get_full_json()}), 200
[ "def", "index", "(", ")", ":", "if", "(", "request", ".", "method", "==", "'POST'", ")", ":", "some_json", "=", "request", ".", "get_json", "(", ")", "return", "jsonify", "(", "{", "\"you sent\"", ":", "some_json", "}", ")", ",", "201", "else", ":", ...
Just return allllll data and test with jsons
[ "Just", "return", "allllll", "data", "and", "test", "with", "jsons" ]
[ "'''\n Just return allllll data and test with jsons\n '''" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
c8c7e10d5c606f0a7a807f25ceede73f6590e7a9
FlorisFok/DataVisualisation
dockers/API/restV1.py
[ "MIT" ]
Python
where_command
<not_specific>
def where_command(commands): ''' Execute Where commands using my own made up syntax ''' calls = commands_parser(commands) data = get_where_json(calls) return jsonify({"data": data}), 200
Execute Where commands using my own made up syntax
Execute Where commands using my own made up syntax
[ "Execute", "Where", "commands", "using", "my", "own", "made", "up", "syntax" ]
def where_command(commands): calls = commands_parser(commands) data = get_where_json(calls) return jsonify({"data": data}), 200
[ "def", "where_command", "(", "commands", ")", ":", "calls", "=", "commands_parser", "(", "commands", ")", "data", "=", "get_where_json", "(", "calls", ")", "return", "jsonify", "(", "{", "\"data\"", ":", "data", "}", ")", ",", "200" ]
Execute Where commands using my own made up syntax
[ "Execute", "Where", "commands", "using", "my", "own", "made", "up", "syntax" ]
[ "'''\n Execute Where commands using my own made up syntax\n '''" ]
[ { "param": "commands", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "commands", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8c7e10d5c606f0a7a807f25ceede73f6590e7a9
FlorisFok/DataVisualisation
dockers/API/restV1.py
[ "MIT" ]
Python
location
<not_specific>
def location(range, commands): ''' returns only rooms that are within a certain range (km) circle from CENTER ''' calls = commands_parser(commands) data = get_where_json(calls) new_data = [] for piece in data: dinstance = ((abs(piece['lat'] - CENTER[0]))**2 + (...
returns only rooms that are within a certain range (km) circle from CENTER
returns only rooms that are within a certain range (km) circle from CENTER
[ "returns", "only", "rooms", "that", "are", "within", "a", "certain", "range", "(", "km", ")", "circle", "from", "CENTER" ]
def location(range, commands): calls = commands_parser(commands) data = get_where_json(calls) new_data = [] for piece in data: dinstance = ((abs(piece['lat'] - CENTER[0]))**2 + (abs(piece['lon']-CENTER[1]))**2)**0.5 if (int(range) > dinstance*111): new_da...
[ "def", "location", "(", "range", ",", "commands", ")", ":", "calls", "=", "commands_parser", "(", "commands", ")", "data", "=", "get_where_json", "(", "calls", ")", "new_data", "=", "[", "]", "for", "piece", "in", "data", ":", "dinstance", "=", "(", "(...
returns only rooms that are within a certain range (km) circle from CENTER
[ "returns", "only", "rooms", "that", "are", "within", "a", "certain", "range", "(", "km", ")", "circle", "from", "CENTER" ]
[ "'''\n returns only rooms that are within a certain range (km) circle from CENTER\n '''", "# 111 is the differnence between 1 km and 1 degree +-" ]
[ { "param": "range", "type": null }, { "param": "commands", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "range", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "commands", "type": null, "docstring": null, "docstring_token...
c8c7e10d5c606f0a7a807f25ceede73f6590e7a9
FlorisFok/DataVisualisation
dockers/API/restV1.py
[ "MIT" ]
Python
price_predict
<not_specific>
def price_predict(commands): ''' Very bad prediction of the price, but fun to make ''' vars = commands.split("&") vars = [float(i.replace('+','.')) for i in vars] # help: vars = [lat, lon, size, tijd] # this makes a prediction price = predict_price(vars[0], vars[1], vars[2], vars[3]) ...
Very bad prediction of the price, but fun to make
Very bad prediction of the price, but fun to make
[ "Very", "bad", "prediction", "of", "the", "price", "but", "fun", "to", "make" ]
def price_predict(commands): vars = commands.split("&") vars = [float(i.replace('+','.')) for i in vars] price = predict_price(vars[0], vars[1], vars[2], vars[3]) return jsonify({"price": list(price)[0]}), 200
[ "def", "price_predict", "(", "commands", ")", ":", "vars", "=", "commands", ".", "split", "(", "\"&\"", ")", "vars", "=", "[", "float", "(", "i", ".", "replace", "(", "'+'", ",", "'.'", ")", ")", "for", "i", "in", "vars", "]", "price", "=", "pred...
Very bad prediction of the price, but fun to make
[ "Very", "bad", "prediction", "of", "the", "price", "but", "fun", "to", "make" ]
[ "'''\n Very bad prediction of the price, but fun to make\n '''", "# help: vars = [lat, lon, size, tijd]", "# this makes a prediction" ]
[ { "param": "commands", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "commands", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c8c7e10d5c606f0a7a807f25ceede73f6590e7a9
FlorisFok/DataVisualisation
dockers/API/restV1.py
[ "MIT" ]
Python
due_dates
<not_specific>
def due_dates(): ''' Returns all the due dates for the calander ''' conn = connect() mycursor = conn.cursor() mycursor.execute("Select count(*), due_date from kamernet group by due_date") raw_data = mycursor.fetchall() data = [] for raw in raw_data: # Only 2019 support ...
Returns all the due dates for the calander
Returns all the due dates for the calander
[ "Returns", "all", "the", "due", "dates", "for", "the", "calander" ]
def due_dates(): conn = connect() mycursor = conn.cursor() mycursor.execute("Select count(*), due_date from kamernet group by due_date") raw_data = mycursor.fetchall() data = [] for raw in raw_data: if raw[1].strftime("%Y") != '2019': continue data.append({'date':raw[...
[ "def", "due_dates", "(", ")", ":", "conn", "=", "connect", "(", ")", "mycursor", "=", "conn", ".", "cursor", "(", ")", "mycursor", ".", "execute", "(", "\"Select count(*), due_date from kamernet group by due_date\"", ")", "raw_data", "=", "mycursor", ".", "fetch...
Returns all the due dates for the calander
[ "Returns", "all", "the", "due", "dates", "for", "the", "calander" ]
[ "'''\n Returns all the due dates for the calander\n '''", "# Only 2019 support", "# Parse data in usable format" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
c8c7e10d5c606f0a7a807f25ceede73f6590e7a9
FlorisFok/DataVisualisation
dockers/API/restV1.py
[ "MIT" ]
Python
hour_histogram
<not_specific>
def hour_histogram(): ''' Returns the data for the hour histogram ''' conn = connect() mycursor = conn.cursor() mycursor.execute("SELECT * FROM kamernet_log") all_data = mycursor.fetchall() # Make hour avarage d_hour = {} for i in all_data: if i[1] > 30: cont...
Returns the data for the hour histogram
Returns the data for the hour histogram
[ "Returns", "the", "data", "for", "the", "hour", "histogram" ]
def hour_histogram(): conn = connect() mycursor = conn.cursor() mycursor.execute("SELECT * FROM kamernet_log") all_data = mycursor.fetchall() d_hour = {} for i in all_data: if i[1] > 30: continue hour = i[2].hour if hour in d_hour: d_hour[hour][0] ...
[ "def", "hour_histogram", "(", ")", ":", "conn", "=", "connect", "(", ")", "mycursor", "=", "conn", ".", "cursor", "(", ")", "mycursor", ".", "execute", "(", "\"SELECT * FROM kamernet_log\"", ")", "all_data", "=", "mycursor", ".", "fetchall", "(", ")", "d_h...
Returns the data for the hour histogram
[ "Returns", "the", "data", "for", "the", "hour", "histogram" ]
[ "'''\n Returns the data for the hour histogram\n '''", "# Make hour avarage", "# Time stamp", "# Get this days data --> currently using only last one", "# Parse data and return", "# I recently found out the date on my server is 2 hours behind...." ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
c8c7e10d5c606f0a7a807f25ceede73f6590e7a9
FlorisFok/DataVisualisation
dockers/API/restV1.py
[ "MIT" ]
Python
make_json
<not_specific>
def make_json(row_headers, data): ''' Make a json from the sql list in list ''' json_data=[] for result in data: result = list(result) result[2] = str(result[2]) result[3] = str(result[3]) json_data.append(dict(zip(row_headers,result))) return json_data
Make a json from the sql list in list
Make a json from the sql list in list
[ "Make", "a", "json", "from", "the", "sql", "list", "in", "list" ]
def make_json(row_headers, data): json_data=[] for result in data: result = list(result) result[2] = str(result[2]) result[3] = str(result[3]) json_data.append(dict(zip(row_headers,result))) return json_data
[ "def", "make_json", "(", "row_headers", ",", "data", ")", ":", "json_data", "=", "[", "]", "for", "result", "in", "data", ":", "result", "=", "list", "(", "result", ")", "result", "[", "2", "]", "=", "str", "(", "result", "[", "2", "]", ")", "res...
Make a json from the sql list in list
[ "Make", "a", "json", "from", "the", "sql", "list", "in", "list" ]
[ "'''\n Make a json from the sql list in list\n '''" ]
[ { "param": "row_headers", "type": null }, { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "row_headers", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "data", "type": null, "docstring": null, "docstring_tok...
c8c7e10d5c606f0a7a807f25ceede73f6590e7a9
FlorisFok/DataVisualisation
dockers/API/restV1.py
[ "MIT" ]
Python
commands_parser
<not_specific>
def commands_parser(raw_url): ''' Universal, but unique command parser :D returns list of calls - no string ''' commands = raw_url.split("&") calls = [] for com in commands: if 'from' in com and 'till' in com: period = com.split("+") period0 = period[0].split(...
Universal, but unique command parser :D returns list of calls - no string
Universal, but unique command parser :D returns list of calls - no string
[ "Universal", "but", "unique", "command", "parser", ":", "D", "returns", "list", "of", "calls", "-", "no", "string" ]
def commands_parser(raw_url): commands = raw_url.split("&") calls = [] for com in commands: if 'from' in com and 'till' in com: period = com.split("+") period0 = period[0].split('=') period1 = period[1].split('=') t0 = period0[1][4:].split("$") ...
[ "def", "commands_parser", "(", "raw_url", ")", ":", "commands", "=", "raw_url", ".", "split", "(", "\"&\"", ")", "calls", "=", "[", "]", "for", "com", "in", "commands", ":", "if", "'from'", "in", "com", "and", "'till'", "in", "com", ":", "period", "=...
Universal, but unique command parser :D returns list of calls - no string
[ "Universal", "but", "unique", "command", "parser", ":", "D", "returns", "list", "of", "calls", "-", "no", "string" ]
[ "'''\n Universal, but unique command parser :D\n returns list of calls - no string\n '''" ]
[ { "param": "raw_url", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "raw_url", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7880dba32d46b00e909b64b67b5c5a8db4815281
FlorisFok/DataVisualisation
dockers/scraper/schedular.py
[ "MIT" ]
Python
make_insert
<not_specific>
def make_insert(mycursor, loc, start_date, due_date, size, url, price, lat, lon, maanden): """ Insert data into database table of mysql """ call = "INSERT INTO kamernet (loc, start_date, due_date, size, url, price, lat, lon, tijd)" call += " VALUES ('{}','{}','{}',{},'{}','{}', {}, {}, {});".format(...
Insert data into database table of mysql
Insert data into database table of mysql
[ "Insert", "data", "into", "database", "table", "of", "mysql" ]
def make_insert(mycursor, loc, start_date, due_date, size, url, price, lat, lon, maanden): call = "INSERT INTO kamernet (loc, start_date, due_date, size, url, price, lat, lon, tijd)" call += " VALUES ('{}','{}','{}',{},'{}','{}', {}, {}, {});".format(loc, ...
[ "def", "make_insert", "(", "mycursor", ",", "loc", ",", "start_date", ",", "due_date", ",", "size", ",", "url", ",", "price", ",", "lat", ",", "lon", ",", "maanden", ")", ":", "call", "=", "\"INSERT INTO kamernet (loc, start_date, due_date, size, url, price, lat, ...
Insert data into database table of mysql
[ "Insert", "data", "into", "database", "table", "of", "mysql" ]
[ "\"\"\"\n Insert data into database table of mysql\n \"\"\"" ]
[ { "param": "mycursor", "type": null }, { "param": "loc", "type": null }, { "param": "start_date", "type": null }, { "param": "due_date", "type": null }, { "param": "size", "type": null }, { "param": "url", "type": null }, { "param": "price"...
{ "returns": [], "raises": [], "params": [ { "identifier": "mycursor", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "loc", "type": null, "docstring": null, "docstring_tokens"...
7880dba32d46b00e909b64b67b5c5a8db4815281
FlorisFok/DataVisualisation
dockers/scraper/schedular.py
[ "MIT" ]
Python
save_log
<not_specific>
def save_log(mycursor, count): """ Insert data into database table of mysql """ ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S') call = "INSERT INTO kamernet_log (count, date)" call += " VALUES ({},'{}');".format(count, st) mycursor.execute(call) ...
Insert data into database table of mysql
Insert data into database table of mysql
[ "Insert", "data", "into", "database", "table", "of", "mysql" ]
def save_log(mycursor, count): ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S') call = "INSERT INTO kamernet_log (count, date)" call += " VALUES ({},'{}');".format(count, st) mycursor.execute(call) return call
[ "def", "save_log", "(", "mycursor", ",", "count", ")", ":", "ts", "=", "time", ".", "time", "(", ")", "st", "=", "datetime", ".", "datetime", ".", "fromtimestamp", "(", "ts", ")", ".", "strftime", "(", "'%Y-%m-%d %H:%M:%S'", ")", "call", "=", "\"INSERT...
Insert data into database table of mysql
[ "Insert", "data", "into", "database", "table", "of", "mysql" ]
[ "\"\"\"\n Insert data into database table of mysql\n \"\"\"" ]
[ { "param": "mycursor", "type": null }, { "param": "count", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "mycursor", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "count", "type": null, "docstring": null, "docstring_token...
7880dba32d46b00e909b64b67b5c5a8db4815281
FlorisFok/DataVisualisation
dockers/scraper/schedular.py
[ "MIT" ]
Python
latlon_by_term
<not_specific>
def latlon_by_term(searchterm): ''' Get lat and Longitude from address, not in the street dict, these results Are added to the dict, in this way we never search the same term twice! ''' YOUR_APP_ID = "icnkexRkeE1jpTvEhi8G" YOUR_APP_CODE = "b75GL1eDwQ11BAp6kO-jkA" # Send rewuest with all inf...
Get lat and Longitude from address, not in the street dict, these results Are added to the dict, in this way we never search the same term twice!
Get lat and Longitude from address, not in the street dict, these results Are added to the dict, in this way we never search the same term twice!
[ "Get", "lat", "and", "Longitude", "from", "address", "not", "in", "the", "street", "dict", "these", "results", "Are", "added", "to", "the", "dict", "in", "this", "way", "we", "never", "search", "the", "same", "term", "twice!" ]
def latlon_by_term(searchterm): YOUR_APP_ID = "icnkexRkeE1jpTvEhi8G" YOUR_APP_CODE = "b75GL1eDwQ11BAp6kO-jkA" url = f"https://geocoder.api.here.com/6.2/geocode.json?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}&searchtext={searchterm.replace(' ','+')}" response = requests.get(url) d = json.loads(res...
[ "def", "latlon_by_term", "(", "searchterm", ")", ":", "YOUR_APP_ID", "=", "\"icnkexRkeE1jpTvEhi8G\"", "YOUR_APP_CODE", "=", "\"b75GL1eDwQ11BAp6kO-jkA\"", "url", "=", "f\"https://geocoder.api.here.com/6.2/geocode.json?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}&searchtext={searchterm.re...
Get lat and Longitude from address, not in the street dict, these results Are added to the dict, in this way we never search the same term twice!
[ "Get", "lat", "and", "Longitude", "from", "address", "not", "in", "the", "street", "dict", "these", "results", "Are", "added", "to", "the", "dict", "in", "this", "way", "we", "never", "search", "the", "same", "term", "twice!" ]
[ "'''\n Get lat and Longitude from address, not in the street dict, these results\n Are added to the dict, in this way we never search the same term twice!\n '''", "# Send rewuest with all info", "# Retrieve only the lat and long of the very complex API response." ]
[ { "param": "searchterm", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "searchterm", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7880dba32d46b00e909b64b67b5c5a8db4815281
FlorisFok/DataVisualisation
dockers/scraper/schedular.py
[ "MIT" ]
Python
save
null
def save(e, file): ''' Parse the data scraped and insert it MYSQL ''' # Since pickles don't work, i needed to convert it to json.txt with open('streetlocations.txt') as json_file: streetdict = json.load(json_file) # Connect to database conn = connect() mycursor = conn.cursor() ...
Parse the data scraped and insert it MYSQL
Parse the data scraped and insert it MYSQL
[ "Parse", "the", "data", "scraped", "and", "insert", "it", "MYSQL" ]
def save(e, file): with open('streetlocations.txt') as json_file: streetdict = json.load(json_file) conn = connect() mycursor = conn.cursor() now = file[4:14].split('-') now = [int(i) for i in now] scrape_date = file[4:14] new = 0 for single in e: try: single,...
[ "def", "save", "(", "e", ",", "file", ")", ":", "with", "open", "(", "'streetlocations.txt'", ")", "as", "json_file", ":", "streetdict", "=", "json", ".", "load", "(", "json_file", ")", "conn", "=", "connect", "(", ")", "mycursor", "=", "conn", ".", ...
Parse the data scraped and insert it MYSQL
[ "Parse", "the", "data", "scraped", "and", "insert", "it", "MYSQL" ]
[ "'''\n Parse the data scraped and insert it MYSQL\n '''", "# Since pickles don't work, i needed to convert it to json.txt", "# Connect to database", "# This is the weird part, because it first loaded files in the beta version", "# convert file name to dates", "# Get url", "# Split the rest", "# ...
[ { "param": "e", "type": null }, { "param": "file", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "e", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file", "type": null, "docstring": null, "docstring_tokens": [], ...
fffdb0cbf0b04243bdc0e42b48e554486141bd2b
FlorisFok/DataVisualisation
dockers/Bier/model.py
[ "MIT" ]
Python
null
null
def null(sheet,mens,row_num): """ Makes sure you start with empty row """ sheet.update_cell(row_num, BIER_COL, 0) sheet.update_cell(row_num, PILS_COL, 0) sheet.update_cell(row_num, CREDIT_COL, 0) sheet.update_cell(row_num, STAT_COL, 0)
Makes sure you start with empty row
Makes sure you start with empty row
[ "Makes", "sure", "you", "start", "with", "empty", "row" ]
def null(sheet,mens,row_num): sheet.update_cell(row_num, BIER_COL, 0) sheet.update_cell(row_num, PILS_COL, 0) sheet.update_cell(row_num, CREDIT_COL, 0) sheet.update_cell(row_num, STAT_COL, 0)
[ "def", "null", "(", "sheet", ",", "mens", ",", "row_num", ")", ":", "sheet", ".", "update_cell", "(", "row_num", ",", "BIER_COL", ",", "0", ")", "sheet", ".", "update_cell", "(", "row_num", ",", "PILS_COL", ",", "0", ")", "sheet", ".", "update_cell", ...
Makes sure you start with empty row
[ "Makes", "sure", "you", "start", "with", "empty", "row" ]
[ "\"\"\"\n\tMakes sure you start with empty row\n\t\"\"\"" ]
[ { "param": "sheet", "type": null }, { "param": "mens", "type": null }, { "param": "row_num", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "sheet", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "mens", "type": null, "docstring": null, "docstring_tokens": ...
fffdb0cbf0b04243bdc0e42b48e554486141bd2b
FlorisFok/DataVisualisation
dockers/Bier/model.py
[ "MIT" ]
Python
update
null
def update(sheet, row_num, mens, COL, new_values): ''' Checks if cell is empty to place value, otherwise add to old value ''' print(new_values) try: old_value = int(sheet.cell(row_num, COL).value) print('old', old_value) sheet.update_cell(row_num, COL, float(new_values) + old_value) except: sheet.update_c...
Checks if cell is empty to place value, otherwise add to old value
Checks if cell is empty to place value, otherwise add to old value
[ "Checks", "if", "cell", "is", "empty", "to", "place", "value", "otherwise", "add", "to", "old", "value" ]
def update(sheet, row_num, mens, COL, new_values): print(new_values) try: old_value = int(sheet.cell(row_num, COL).value) print('old', old_value) sheet.update_cell(row_num, COL, float(new_values) + old_value) except: sheet.update_cell(row_num, COL, float(new_values))
[ "def", "update", "(", "sheet", ",", "row_num", ",", "mens", ",", "COL", ",", "new_values", ")", ":", "print", "(", "new_values", ")", "try", ":", "old_value", "=", "int", "(", "sheet", ".", "cell", "(", "row_num", ",", "COL", ")", ".", "value", ")"...
Checks if cell is empty to place value, otherwise add to old value
[ "Checks", "if", "cell", "is", "empty", "to", "place", "value", "otherwise", "add", "to", "old", "value" ]
[ "'''\n\tChecks if cell is empty to place value, otherwise add to old value\n\t'''" ]
[ { "param": "sheet", "type": null }, { "param": "row_num", "type": null }, { "param": "mens", "type": null }, { "param": "COL", "type": null }, { "param": "new_values", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "sheet", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "row_num", "type": null, "docstring": null, "docstring_tokens...
fffdb0cbf0b04243bdc0e42b48e554486141bd2b
FlorisFok/DataVisualisation
dockers/Bier/model.py
[ "MIT" ]
Python
find_mens_row
<not_specific>
def find_mens_row(mens, sheet): ''' Find the correct row of a person ''' name_list = sheet.col_values(MENS_COL) try: row_num = name_list.index(mens) + 1 except: row_num = len(name_list) + 1 sheet.update_cell(row_num, MENS_COL, mens) return row_num
Find the correct row of a person
Find the correct row of a person
[ "Find", "the", "correct", "row", "of", "a", "person" ]
def find_mens_row(mens, sheet): name_list = sheet.col_values(MENS_COL) try: row_num = name_list.index(mens) + 1 except: row_num = len(name_list) + 1 sheet.update_cell(row_num, MENS_COL, mens) return row_num
[ "def", "find_mens_row", "(", "mens", ",", "sheet", ")", ":", "name_list", "=", "sheet", ".", "col_values", "(", "MENS_COL", ")", "try", ":", "row_num", "=", "name_list", ".", "index", "(", "mens", ")", "+", "1", "except", ":", "row_num", "=", "len", ...
Find the correct row of a person
[ "Find", "the", "correct", "row", "of", "a", "person" ]
[ "'''\n\tFind the correct row of a person\n\t'''" ]
[ { "param": "mens", "type": null }, { "param": "sheet", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "mens", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sheet", "type": null, "docstring": null, "docstring_tokens": ...
fffdb0cbf0b04243bdc0e42b48e554486141bd2b
FlorisFok/DataVisualisation
dockers/Bier/model.py
[ "MIT" ]
Python
time_stamp
<not_specific>
def time_stamp(): ''' Get local time, and make nice string ''' tijd = (str(time.gmtime().tm_mday) + "/" + str(time.gmtime().tm_mon) + "/" + str(time.gmtime().tm_year) + ' || ' + str(time.gmtime().tm_hour) + ':' + str(time.gmtime().tm_min) + '.') return tijd
Get local time, and make nice string
Get local time, and make nice string
[ "Get", "local", "time", "and", "make", "nice", "string" ]
def time_stamp(): tijd = (str(time.gmtime().tm_mday) + "/" + str(time.gmtime().tm_mon) + "/" + str(time.gmtime().tm_year) + ' || ' + str(time.gmtime().tm_hour) + ':' + str(time.gmtime().tm_min) + '.') return tijd
[ "def", "time_stamp", "(", ")", ":", "tijd", "=", "(", "str", "(", "time", ".", "gmtime", "(", ")", ".", "tm_mday", ")", "+", "\"/\"", "+", "str", "(", "time", ".", "gmtime", "(", ")", ".", "tm_mon", ")", "+", "\"/\"", "+", "str", "(", "time", ...
Get local time, and make nice string
[ "Get", "local", "time", "and", "make", "nice", "string" ]
[ "'''\n\tGet local time, and make nice string\n\t'''" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
b3683f99d544e0511a1bd50cafbf3f1d3ca2bd50
devavratTomar/torch-fidelity
torch_fidelity/feature_extractor_base.py
[ "Apache-2.0" ]
Python
convert_features_tuple_to_dict
<not_specific>
def convert_features_tuple_to_dict(self, features): """ The only compound return type of the forward function amenable to JIT tracing is tuple. This function simply helps to recover the mapping. """ vassert( type(features) is tuple and len(features) == len(self.featur...
The only compound return type of the forward function amenable to JIT tracing is tuple. This function simply helps to recover the mapping.
The only compound return type of the forward function amenable to JIT tracing is tuple. This function simply helps to recover the mapping.
[ "The", "only", "compound", "return", "type", "of", "the", "forward", "function", "amenable", "to", "JIT", "tracing", "is", "tuple", ".", "This", "function", "simply", "helps", "to", "recover", "the", "mapping", "." ]
def convert_features_tuple_to_dict(self, features): vassert( type(features) is tuple and len(features) == len(self.features_list), 'Features must be the output of forward function' ) return dict(((name, feature) for name, feature in zip(self.features_list, features)))
[ "def", "convert_features_tuple_to_dict", "(", "self", ",", "features", ")", ":", "vassert", "(", "type", "(", "features", ")", "is", "tuple", "and", "len", "(", "features", ")", "==", "len", "(", "self", ".", "features_list", ")", ",", "'Features must be the...
The only compound return type of the forward function amenable to JIT tracing is tuple.
[ "The", "only", "compound", "return", "type", "of", "the", "forward", "function", "amenable", "to", "JIT", "tracing", "is", "tuple", "." ]
[ "\"\"\"\n The only compound return type of the forward function amenable to JIT tracing is tuple.\n This function simply helps to recover the mapping.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "features", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "features", "type": null, "docstring": null, "docstring_tokens...
99ca368bca121f2403e0b37983b03de03bf3e4e4
qlan3/QuantumExplorer
components/qnn.py
[ "MIT" ]
Python
ReUploadingVQC
<not_specific>
def ReUploadingVQC(inputs, entangling_weights, embedding_weights): ''' A variational quantum circuit (VQC) with data re-uploading ''' # Prepare all zero state all_zero_state = torch.zeros(n_qubits) qml.BasisStatePreparation(all_zero_state, wires=range(n_qubits)) for i in range(...
A variational quantum circuit (VQC) with data re-uploading
A variational quantum circuit (VQC) with data re-uploading
[ "A", "variational", "quantum", "circuit", "(", "VQC", ")", "with", "data", "re", "-", "uploading" ]
def ReUploadingVQC(inputs, entangling_weights, embedding_weights): all_zero_state = torch.zeros(n_qubits) qml.BasisStatePreparation(all_zero_state, wires=range(n_qubits)) for i in range(qnn_layers): qml.StronglyEntanglingLayers(entangling_weights[i], wires=range(n_qubits)) features = i...
[ "def", "ReUploadingVQC", "(", "inputs", ",", "entangling_weights", ",", "embedding_weights", ")", ":", "all_zero_state", "=", "torch", ".", "zeros", "(", "n_qubits", ")", "qml", ".", "BasisStatePreparation", "(", "all_zero_state", ",", "wires", "=", "range", "("...
A variational quantum circuit (VQC) with data re-uploading
[ "A", "variational", "quantum", "circuit", "(", "VQC", ")", "with", "data", "re", "-", "uploading" ]
[ "'''\n A variational quantum circuit (VQC) with data re-uploading\n '''", "# Prepare all zero state", "# Variational layer", "# Encoding layer", "# Last varitional layer" ]
[ { "param": "inputs", "type": null }, { "param": "entangling_weights", "type": null }, { "param": "embedding_weights", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "inputs", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entangling_weights", "type": null, "docstring": null, "docs...
99ca368bca121f2403e0b37983b03de03bf3e4e4
qlan3/QuantumExplorer
components/qnn.py
[ "MIT" ]
Python
NormalVQC
<not_specific>
def NormalVQC(inputs, entangling_weights): ''' A variational quantum circuit (VQC) (without data re-uploading) ''' qml.AngleEmbedding(features=inputs, wires=range(n_qubits)) qml.StronglyEntanglingLayers(entangling_weights, wires=range(n_qubits)) return [qml.expval(qml.PauliZ(wires=i)...
A variational quantum circuit (VQC) (without data re-uploading)
A variational quantum circuit (VQC) (without data re-uploading)
[ "A", "variational", "quantum", "circuit", "(", "VQC", ")", "(", "without", "data", "re", "-", "uploading", ")" ]
def NormalVQC(inputs, entangling_weights): qml.AngleEmbedding(features=inputs, wires=range(n_qubits)) qml.StronglyEntanglingLayers(entangling_weights, wires=range(n_qubits)) return [qml.expval(qml.PauliZ(wires=i)) for i in range(n_qubits)]
[ "def", "NormalVQC", "(", "inputs", ",", "entangling_weights", ")", ":", "qml", ".", "AngleEmbedding", "(", "features", "=", "inputs", ",", "wires", "=", "range", "(", "n_qubits", ")", ")", "qml", ".", "StronglyEntanglingLayers", "(", "entangling_weights", ",",...
A variational quantum circuit (VQC) (without data re-uploading)
[ "A", "variational", "quantum", "circuit", "(", "VQC", ")", "(", "without", "data", "re", "-", "uploading", ")" ]
[ "'''\n A variational quantum circuit (VQC) (without data re-uploading)\n '''" ]
[ { "param": "inputs", "type": null }, { "param": "entangling_weights", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "inputs", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entangling_weights", "type": null, "docstring": null, "docs...
1dc696c6b4dd2b1409b98def10ef599bf1c34ed3
kracekumar/pep585-upgrade
src/upgrade_type_hints/utils.py
[ "BSD-3-Clause" ]
Python
flatten_list
list
def flatten_list(_list: list) -> list: """ Flattens a list of nested lists, and filters out falsy values. The list [1, 2, [3, [4, 5], None, 6], [7], 8] becomes [1, 2, 3, 4, 5, 6, 7, 8] """ while True: for index, item in enumerate(_list): if not item: _list.p...
Flattens a list of nested lists, and filters out falsy values. The list [1, 2, [3, [4, 5], None, 6], [7], 8] becomes [1, 2, 3, 4, 5, 6, 7, 8]
Flattens a list of nested lists, and filters out falsy values.
[ "Flattens", "a", "list", "of", "nested", "lists", "and", "filters", "out", "falsy", "values", "." ]
def flatten_list(_list: list) -> list: while True: for index, item in enumerate(_list): if not item: _list.pop(index) if isinstance(item, list): _list = list(flatten_to_generator(_list)) break else: return _list
[ "def", "flatten_list", "(", "_list", ":", "list", ")", "->", "list", ":", "while", "True", ":", "for", "index", ",", "item", "in", "enumerate", "(", "_list", ")", ":", "if", "not", "item", ":", "_list", ".", "pop", "(", "index", ")", "if", "isinsta...
Flattens a list of nested lists, and filters out falsy values.
[ "Flattens", "a", "list", "of", "nested", "lists", "and", "filters", "out", "falsy", "values", "." ]
[ "\"\"\"\n Flattens a list of nested lists, and filters out falsy values.\n\n The list [1, 2, [3, [4, 5], None, 6], [7], 8]\n becomes [1, 2, 3, 4, 5, 6, 7, 8]\n \"\"\"" ]
[ { "param": "_list", "type": "list" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "_list", "type": "list", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
693f3e5c8fbcccbfb6ba89d038a7d372dde7ca5a
kracekumar/pep585-upgrade
src/upgrade_type_hints/update.py
[ "BSD-3-Clause" ]
Python
replace_type
tuple[bytes, dict]
def replace_type(old_annotation: str, new_annotation: str, line) -> tuple[bytes, dict]: """ Perform type replacement on a string (line). """ new_annotation = bytes(new_annotation, encoding='utf-8') pattern = b'[^a-zA-Z](' + old_annotation.encode(encoding='utf-8') + b')(?:[^a-zA-Z]|$)' match = re...
Perform type replacement on a string (line).
Perform type replacement on a string (line).
[ "Perform", "type", "replacement", "on", "a", "string", "(", "line", ")", "." ]
def replace_type(old_annotation: str, new_annotation: str, line) -> tuple[bytes, dict]: new_annotation = bytes(new_annotation, encoding='utf-8') pattern = b'[^a-zA-Z](' + old_annotation.encode(encoding='utf-8') + b')(?:[^a-zA-Z]|$)' match = re.search(pattern, line) line = line[: match.start(1)] + line[m...
[ "def", "replace_type", "(", "old_annotation", ":", "str", ",", "new_annotation", ":", "str", ",", "line", ")", "->", "tuple", "[", "bytes", ",", "dict", "]", ":", "new_annotation", "=", "bytes", "(", "new_annotation", ",", "encoding", "=", "'utf-8'", ")", ...
Perform type replacement on a string (line).
[ "Perform", "type", "replacement", "on", "a", "string", "(", "line", ")", "." ]
[ "\"\"\"\n Perform type replacement on a string (line).\n \"\"\"" ]
[ { "param": "old_annotation", "type": "str" }, { "param": "new_annotation", "type": "str" }, { "param": "line", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "old_annotation", "type": "str", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "new_annotation", "type": "str", "docstring": null, ...
693f3e5c8fbcccbfb6ba89d038a7d372dde7ca5a
kracekumar/pep585-upgrade
src/upgrade_type_hints/update.py
[ "BSD-3-Clause" ]
Python
update_file
None
def update_file( filename: str, futures: bool, native_types: list, imported_types: list, imports_to_delete: list, futures_import_found: bool, future_import_insert_position: int, ) -> None: """ Reads a file, removes imports and updates types, then writes back to it. """ with o...
Reads a file, removes imports and updates types, then writes back to it.
Reads a file, removes imports and updates types, then writes back to it.
[ "Reads", "a", "file", "removes", "imports", "and", "updates", "types", "then", "writes", "back", "to", "it", "." ]
def update_file( filename: str, futures: bool, native_types: list, imported_types: list, imports_to_delete: list, futures_import_found: bool, future_import_insert_position: int, ) -> None: with open(filename, mode='rb+') as file: content = file.readlines() for item in native_...
[ "def", "update_file", "(", "filename", ":", "str", ",", "futures", ":", "bool", ",", "native_types", ":", "list", ",", "imported_types", ":", "list", ",", "imports_to_delete", ":", "list", ",", "futures_import_found", ":", "bool", ",", "future_import_insert_posi...
Reads a file, removes imports and updates types, then writes back to it.
[ "Reads", "a", "file", "removes", "imports", "and", "updates", "types", "then", "writes", "back", "to", "it", "." ]
[ "\"\"\"\n Reads a file, removes imports and updates types, then writes back to it.\n \"\"\"", "# New native types don't require us to do anything except inplace-replacement of type hints", "# The types handled here require us to add a new import statement at", "# the top of the file in addition to the i...
[ { "param": "filename", "type": "str" }, { "param": "futures", "type": "bool" }, { "param": "native_types", "type": "list" }, { "param": "imported_types", "type": "list" }, { "param": "imports_to_delete", "type": "list" }, { "param": "futures_import_fou...
{ "returns": [], "raises": [], "params": [ { "identifier": "filename", "type": "str", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "futures", "type": "bool", "docstring": null, "docstring_...
503b6af1bd7125156c1409deb93f25b53cc64443
kracekumar/pep585-upgrade
src/upgrade_type_hints/definitions.py
[ "BSD-3-Clause" ]
Python
check_if_types_need_substitution
tuple[list, list]
def check_if_types_need_substitution( annotations: list[dict[str, str]], imports: list[dict] ) -> tuple[list, list]: """ Checks whether the complete list of annotations contained in a file matches any of the pep-585-types we want to substitute. :return: We return a filtered list of dictionaries, wh...
Checks whether the complete list of annotations contained in a file matches any of the pep-585-types we want to substitute. :return: We return a filtered list of dictionaries, where the dict has an extra attribute to indicate what it should be substituted with.
Checks whether the complete list of annotations contained in a file matches any of the pep-585-types we want to substitute.
[ "Checks", "whether", "the", "complete", "list", "of", "annotations", "contained", "in", "a", "file", "matches", "any", "of", "the", "pep", "-", "585", "-", "types", "we", "want", "to", "substitute", "." ]
def check_if_types_need_substitution( annotations: list[dict[str, str]], imports: list[dict] ) -> tuple[list, list]: filtered_native_type_list = [] filtered_import_list = [] for item in annotations: stripped_annotation = item['annotation'].replace('typing.', '') if stripped_annotation in...
[ "def", "check_if_types_need_substitution", "(", "annotations", ":", "list", "[", "dict", "[", "str", ",", "str", "]", "]", ",", "imports", ":", "list", "[", "dict", "]", ")", "->", "tuple", "[", "list", ",", "list", "]", ":", "filtered_native_type_list", ...
Checks whether the complete list of annotations contained in a file matches any of the pep-585-types we want to substitute.
[ "Checks", "whether", "the", "complete", "list", "of", "annotations", "contained", "in", "a", "file", "matches", "any", "of", "the", "pep", "-", "585", "-", "types", "we", "want", "to", "substitute", "." ]
[ "\"\"\"\n Checks whether the complete list of annotations contained in a file matches any of the pep-585-types\n we want to substitute.\n\n :return: We return a filtered list of dictionaries, where the dict has an\n extra attribute to indicate what it should be substituted with.\n \"\"\"" ]
[ { "param": "annotations", "type": "list[dict[str, str]]" }, { "param": "imports", "type": "list[dict]" } ]
{ "returns": [ { "docstring": "We return a filtered list of dictionaries, where the dict has an\nextra attribute to indicate what it should be substituted with.", "docstring_tokens": [ "We", "return", "a", "filtered", "list", "of", "dictionaries"...
3083178b2541d1fe81a81320d1a75ad5e8bfc42b
kenjyco/aws-info-helper
aws_info_helper/ec2.py
[ "MIT" ]
Python
update_collection
<not_specific>
def update_collection(self): """Update the rh.Collection object if redis-helper installed""" if self._collection is None: return ids_for_profile = set([ x.get(self._collection._unique_field) for x in self._collection.find( 'profile:{}'.format(...
Update the rh.Collection object if redis-helper installed
Update the rh.Collection object if redis-helper installed
[ "Update", "the", "rh", ".", "Collection", "object", "if", "redis", "-", "helper", "installed" ]
def update_collection(self): if self._collection is None: return ids_for_profile = set([ x.get(self._collection._unique_field) for x in self._collection.find( 'profile:{}'.format(self._profile), include_meta=False, get_f...
[ "def", "update_collection", "(", "self", ")", ":", "if", "self", ".", "_collection", "is", "None", ":", "return", "ids_for_profile", "=", "set", "(", "[", "x", ".", "get", "(", "self", ".", "_collection", ".", "_unique_field", ")", "for", "x", "in", "s...
Update the rh.Collection object if redis-helper installed
[ "Update", "the", "rh", ".", "Collection", "object", "if", "redis", "-", "helper", "installed" ]
[ "\"\"\"Update the rh.Collection object if redis-helper installed\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
be2a5f5df9ea29ddbeae2b064b2510d8b9606858
kenjyco/aws-info-helper
aws_info_helper/scripts/ec2_update_collection.py
[ "MIT" ]
Python
main
null
def main(**kwargs): """Update info in AWS_EC2 and AWS_IP redis-helper collections""" if kwargs['all'] is True: for profile in get_profiles(): ec2 = EC2(profile) ec2.update_collection() else: ec2 = EC2(kwargs['profile']) ec2.update_collection() if kwargs['n...
Update info in AWS_EC2 and AWS_IP redis-helper collections
Update info in AWS_EC2 and AWS_IP redis-helper collections
[ "Update", "info", "in", "AWS_EC2", "and", "AWS_IP", "redis", "-", "helper", "collections" ]
def main(**kwargs): if kwargs['all'] is True: for profile in get_profiles(): ec2 = EC2(profile) ec2.update_collection() else: ec2 = EC2(kwargs['profile']) ec2.update_collection() if kwargs['non_interactive'] is not True: ih.start_ipython(ec2=AWS_EC2, i...
[ "def", "main", "(", "**", "kwargs", ")", ":", "if", "kwargs", "[", "'all'", "]", "is", "True", ":", "for", "profile", "in", "get_profiles", "(", ")", ":", "ec2", "=", "EC2", "(", "profile", ")", "ec2", ".", "update_collection", "(", ")", "else", ":...
Update info in AWS_EC2 and AWS_IP redis-helper collections
[ "Update", "info", "in", "AWS_EC2", "and", "AWS_IP", "redis", "-", "helper", "collections" ]
[ "\"\"\"Update info in AWS_EC2 and AWS_IP redis-helper collections\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
69f4e43efb35c2991448b609f96d18f6e769e1ab
kenjyco/aws-info-helper
aws_info_helper/s3.py
[ "MIT" ]
Python
download_file
<not_specific>
def download_file(self, bucket, filename, local_filename=''): """Download a file from S3 - bucket: name of S3 bucket - filename: name of file (key) in S3 bucket - local_filename: local file name (including path) to save file as - if an existing directory is given, the file w...
Download a file from S3 - bucket: name of S3 bucket - filename: name of file (key) in S3 bucket - local_filename: local file name (including path) to save file as - if an existing directory is given, the file will be saved in there
Download a file from S3 bucket: name of S3 bucket filename: name of file (key) in S3 bucket local_filename: local file name (including path) to save file as if an existing directory is given, the file will be saved in there
[ "Download", "a", "file", "from", "S3", "bucket", ":", "name", "of", "S3", "bucket", "filename", ":", "name", "of", "file", "(", "key", ")", "in", "S3", "bucket", "local_filename", ":", "local", "file", "name", "(", "including", "path", ")", "to", "save...
def download_file(self, bucket, filename, local_filename=''): if not local_filename: local_filename = basename(filename) elif isdir(local_filename): local_filename = join(local_filename, basename(filename)) local_dir = dirname(local_filename) if local_dir: ...
[ "def", "download_file", "(", "self", ",", "bucket", ",", "filename", ",", "local_filename", "=", "''", ")", ":", "if", "not", "local_filename", ":", "local_filename", "=", "basename", "(", "filename", ")", "elif", "isdir", "(", "local_filename", ")", ":", ...
Download a file from S3 bucket: name of S3 bucket filename: name of file (key) in S3 bucket local_filename: local file name (including path) to save file as if an existing directory is given, the file will be saved in there
[ "Download", "a", "file", "from", "S3", "bucket", ":", "name", "of", "S3", "bucket", "filename", ":", "name", "of", "file", "(", "key", ")", "in", "S3", "bucket", "local_filename", ":", "local", "file", "name", "(", "including", "path", ")", "to", "save...
[ "\"\"\"Download a file from S3\n\n - bucket: name of S3 bucket\n - filename: name of file (key) in S3 bucket\n - local_filename: local file name (including path) to save file as\n - if an existing directory is given, the file will be saved in there\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "bucket", "type": null }, { "param": "filename", "type": null }, { "param": "local_filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "bucket", "type": null, "docstring": null, "docstring_tokens":...
69f4e43efb35c2991448b609f96d18f6e769e1ab
kenjyco/aws-info-helper
aws_info_helper/s3.py
[ "MIT" ]
Python
clear_last_file_for_bucket_and_prefix
null
def clear_last_file_for_bucket_and_prefix(self, bucket, prefix=''): """Clear any 'last file' info for bucket/prefix combo""" if (bucket, prefix) in self._cache['_last_file']: del(self._cache['_last_file'][(bucket, prefix)]) if self._collection_last_file is not None: foun...
Clear any 'last file' info for bucket/prefix combo
Clear any 'last file' info for bucket/prefix combo
[ "Clear", "any", "'", "last", "file", "'", "info", "for", "bucket", "/", "prefix", "combo" ]
def clear_last_file_for_bucket_and_prefix(self, bucket, prefix=''): if (bucket, prefix) in self._cache['_last_file']: del(self._cache['_last_file'][(bucket, prefix)]) if self._collection_last_file is not None: found = self._collection_last_file.find( 'profile:{}, ...
[ "def", "clear_last_file_for_bucket_and_prefix", "(", "self", ",", "bucket", ",", "prefix", "=", "''", ")", ":", "if", "(", "bucket", ",", "prefix", ")", "in", "self", ".", "_cache", "[", "'_last_file'", "]", ":", "del", "(", "self", ".", "_cache", "[", ...
Clear any 'last file' info for bucket/prefix combo
[ "Clear", "any", "'", "last", "file", "'", "info", "for", "bucket", "/", "prefix", "combo" ]
[ "\"\"\"Clear any 'last file' info for bucket/prefix combo\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "bucket", "type": null }, { "param": "prefix", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "bucket", "type": null, "docstring": null, "docstring_tokens":...
69f4e43efb35c2991448b609f96d18f6e769e1ab
kenjyco/aws-info-helper
aws_info_helper/s3.py
[ "MIT" ]
Python
clear_last_files_for_bucket
null
def clear_last_files_for_bucket(self, bucket): """Clear any 'last file' info for bucket (across all prefixes)""" # Technically, should try to iterate over keys in _cache['_last_file'] # and find the ones for that bucket only to delete... but meh self._cache['_last_file'] = {} if...
Clear any 'last file' info for bucket (across all prefixes)
Clear any 'last file' info for bucket (across all prefixes)
[ "Clear", "any", "'", "last", "file", "'", "info", "for", "bucket", "(", "across", "all", "prefixes", ")" ]
def clear_last_files_for_bucket(self, bucket): self._cache['_last_file'] = {} if self._collection_last_file is not None: found_ids = self._collection_last_file.find( 'profile:{}, bucket:{}'.format(self._profile, bucket), item_format='{_id}', li...
[ "def", "clear_last_files_for_bucket", "(", "self", ",", "bucket", ")", ":", "self", ".", "_cache", "[", "'_last_file'", "]", "=", "{", "}", "if", "self", ".", "_collection_last_file", "is", "not", "None", ":", "found_ids", "=", "self", ".", "_collection_last...
Clear any 'last file' info for bucket (across all prefixes)
[ "Clear", "any", "'", "last", "file", "'", "info", "for", "bucket", "(", "across", "all", "prefixes", ")" ]
[ "\"\"\"Clear any 'last file' info for bucket (across all prefixes)\"\"\"", "# Technically, should try to iterate over keys in _cache['_last_file']", "# and find the ones for that bucket only to delete... but meh" ]
[ { "param": "self", "type": null }, { "param": "bucket", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "bucket", "type": null, "docstring": null, "docstring_tokens":...
69f4e43efb35c2991448b609f96d18f6e769e1ab
kenjyco/aws-info-helper
aws_info_helper/s3.py
[ "MIT" ]
Python
update_collection
<not_specific>
def update_collection(self): """Update the rh.Collection object if redis-helper installed""" if self._collection is None: return updates = [] for bucket in self.get_all_buckets_full_data(cache=True): data = ih.cast_keys(bucket, **BUCKET_KEY_VALUE_CASTING) ...
Update the rh.Collection object if redis-helper installed
Update the rh.Collection object if redis-helper installed
[ "Update", "the", "rh", ".", "Collection", "object", "if", "redis", "-", "helper", "installed" ]
def update_collection(self): if self._collection is None: return updates = [] for bucket in self.get_all_buckets_full_data(cache=True): data = ih.cast_keys(bucket, **BUCKET_KEY_VALUE_CASTING) data = ih.rename_keys(data, **BUCKET_KEY_NAME_MAPPING) d...
[ "def", "update_collection", "(", "self", ")", ":", "if", "self", ".", "_collection", "is", "None", ":", "return", "updates", "=", "[", "]", "for", "bucket", "in", "self", ".", "get_all_buckets_full_data", "(", "cache", "=", "True", ")", ":", "data", "=",...
Update the rh.Collection object if redis-helper installed
[ "Update", "the", "rh", ".", "Collection", "object", "if", "redis", "-", "helper", "installed" ]
[ "\"\"\"Update the rh.Collection object if redis-helper installed\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e74d547e207d5551ccd7888a1aa1fe2581d621cd
kenjyco/aws-info-helper
aws_info_helper/route53.py
[ "MIT" ]
Python
update_collection
<not_specific>
def update_collection(self): """Update the rh.Collection object if redis-helper installed""" if self._collection is None: return updates = [] self._collection.clear_keyspace() for data in self.get_all_record_sets_for_all_zones(): value = data.get('value')...
Update the rh.Collection object if redis-helper installed
Update the rh.Collection object if redis-helper installed
[ "Update", "the", "rh", ".", "Collection", "object", "if", "redis", "-", "helper", "installed" ]
def update_collection(self): if self._collection is None: return updates = [] self._collection.clear_keyspace() for data in self.get_all_record_sets_for_all_zones(): value = data.get('value') data.update(dict(profile=self._profile)) try: ...
[ "def", "update_collection", "(", "self", ")", ":", "if", "self", ".", "_collection", "is", "None", ":", "return", "updates", "=", "[", "]", "self", ".", "_collection", ".", "clear_keyspace", "(", ")", "for", "data", "in", "self", ".", "get_all_record_sets_...
Update the rh.Collection object if redis-helper installed
[ "Update", "the", "rh", ".", "Collection", "object", "if", "redis", "-", "helper", "installed" ]
[ "\"\"\"Update the rh.Collection object if redis-helper installed\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cc8d2f0d9de34fa40db0e47198b09b57484ee136
kenjyco/aws-info-helper
aws_info_helper/scripts/ec2_ssh_command.py
[ "MIT" ]
Python
main
<not_specific>
def main(**kwargs): """For matching instances, issue a command on the instance via SSH""" ec2 = ah.EC2(kwargs['profile']) find = kwargs['find'] command = kwargs['command'] use_private_ip = kwargs['private_ip'] matched_instances = [] local_pems = ah.find_all_pems() if not command: ...
For matching instances, issue a command on the instance via SSH
For matching instances, issue a command on the instance via SSH
[ "For", "matching", "instances", "issue", "a", "command", "on", "the", "instance", "via", "SSH" ]
def main(**kwargs): ec2 = ah.EC2(kwargs['profile']) find = kwargs['find'] command = kwargs['command'] use_private_ip = kwargs['private_ip'] matched_instances = [] local_pems = ah.find_all_pems() if not command: if kwargs['non_interactive']: print('No command specified') ...
[ "def", "main", "(", "**", "kwargs", ")", ":", "ec2", "=", "ah", ".", "EC2", "(", "kwargs", "[", "'profile'", "]", ")", "find", "=", "kwargs", "[", "'find'", "]", "command", "=", "kwargs", "[", "'command'", "]", "use_private_ip", "=", "kwargs", "[", ...
For matching instances, issue a command on the instance via SSH
[ "For", "matching", "instances", "issue", "a", "command", "on", "the", "instance", "via", "SSH" ]
[ "\"\"\"For matching instances, issue a command on the instance via SSH\"\"\"", "# # Uncomment and modify if you ever need to use a .pem file that", "# # is different than what AWS thinks it should be", "# for i, instance in enumerate(matched_instances):", "# if instance.get('pem', '') == 'old-pem':", ...
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
fe314181194dce92be75b640bc23bd98f2b2e497
kenjyco/aws-info-helper
aws_info_helper/scripts/s3_update_collection.py
[ "MIT" ]
Python
main
null
def main(**kwargs): """Update info in AWS_S3 redis-helper collection""" if kwargs['all'] is True: for profile in get_profiles(): s3 = S3(profile) s3.update_collection() else: s3 = S3(kwargs['profile']) s3.update_collection() if kwargs['non_interactive'] is...
Update info in AWS_S3 redis-helper collection
Update info in AWS_S3 redis-helper collection
[ "Update", "info", "in", "AWS_S3", "redis", "-", "helper", "collection" ]
def main(**kwargs): if kwargs['all'] is True: for profile in get_profiles(): s3 = S3(profile) s3.update_collection() else: s3 = S3(kwargs['profile']) s3.update_collection() if kwargs['non_interactive'] is not True: ih.start_ipython(s3=AWS_S3, s3_last_f...
[ "def", "main", "(", "**", "kwargs", ")", ":", "if", "kwargs", "[", "'all'", "]", "is", "True", ":", "for", "profile", "in", "get_profiles", "(", ")", ":", "s3", "=", "S3", "(", "profile", ")", "s3", ".", "update_collection", "(", ")", "else", ":", ...
Update info in AWS_S3 redis-helper collection
[ "Update", "info", "in", "AWS_S3", "redis", "-", "helper", "collection" ]
[ "\"\"\"Update info in AWS_S3 redis-helper collection\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
d5a779f6634698d349f1b247ecd43db921fa8a87
kenjyco/aws-info-helper
aws_info_helper/__init__.py
[ "MIT" ]
Python
client_call
<not_specific>
def client_call(client, method_name, main_key='', **kwargs): """Call a boto client method and return retrieved data - client: boto3.Session.client instance - method_name: name of the client method to execute - main_key: the name of the main top-level key in the response that has the actual releva...
Call a boto client method and return retrieved data - client: boto3.Session.client instance - method_name: name of the client method to execute - main_key: the name of the main top-level key in the response that has the actual relevant info - kwargs: any keyword args that need to be passed to the...
Call a boto client method and return retrieved data client: boto3.Session.client instance method_name: name of the client method to execute main_key: the name of the main top-level key in the response that has the actual relevant info kwargs: any keyword args that need to be passed to the client method
[ "Call", "a", "boto", "client", "method", "and", "return", "retrieved", "data", "client", ":", "boto3", ".", "Session", ".", "client", "instance", "method_name", ":", "name", "of", "the", "client", "method", "to", "execute", "main_key", ":", "the", "name", ...
def client_call(client, method_name, main_key='', **kwargs): results = [] try: results = getattr(client, method_name)(**kwargs) except (EndpointConnectionError, ClientError) as e: print(repr(e)) else: if main_key: results = results.get(main_key) return results
[ "def", "client_call", "(", "client", ",", "method_name", ",", "main_key", "=", "''", ",", "**", "kwargs", ")", ":", "results", "=", "[", "]", "try", ":", "results", "=", "getattr", "(", "client", ",", "method_name", ")", "(", "**", "kwargs", ")", "ex...
Call a boto client method and return retrieved data client: boto3.Session.client instance method_name: name of the client method to execute main_key: the name of the main top-level key in the response that has the actual relevant info kwargs: any keyword args that need to be passed to the client method
[ "Call", "a", "boto", "client", "method", "and", "return", "retrieved", "data", "client", ":", "boto3", ".", "Session", ".", "client", "instance", "method_name", ":", "name", "of", "the", "client", "method", "to", "execute", "main_key", ":", "the", "name", ...
[ "\"\"\"Call a boto client method and return retrieved data\n\n - client: boto3.Session.client instance\n - method_name: name of the client method to execute\n - main_key: the name of the main top-level key in the response that has the\n actual relevant info\n - kwargs: any keyword args that need to...
[ { "param": "client", "type": null }, { "param": "method_name", "type": null }, { "param": "main_key", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "client", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "method_name", "type": null, "docstring": null, "docstring_t...
d5a779f6634698d349f1b247ecd43db921fa8a87
kenjyco/aws-info-helper
aws_info_helper/__init__.py
[ "MIT" ]
Python
find_all_pems
<not_specific>
def find_all_pems(): """Find all .pem files in ~/.ssh and return a dict with absolute paths""" found = [] dirname = os.path.abspath(os.path.expanduser('~/.ssh')) for dirpath, dirnames, filenames in walk(dirname, topdown=True): found.extend([os.path.join(dirpath, f) for f in filenames if f.endswi...
Find all .pem files in ~/.ssh and return a dict with absolute paths
Find all .pem files in ~/.ssh and return a dict with absolute paths
[ "Find", "all", ".", "pem", "files", "in", "~", "/", ".", "ssh", "and", "return", "a", "dict", "with", "absolute", "paths" ]
def find_all_pems(): found = [] dirname = os.path.abspath(os.path.expanduser('~/.ssh')) for dirpath, dirnames, filenames in walk(dirname, topdown=True): found.extend([os.path.join(dirpath, f) for f in filenames if f.endswith('.pem')]) return { os.path.basename(path).rsplit('.', 1)[0]: pa...
[ "def", "find_all_pems", "(", ")", ":", "found", "=", "[", "]", "dirname", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "expanduser", "(", "'~/.ssh'", ")", ")", "for", "dirpath", ",", "dirnames", ",", "filenames", "in", "walk",...
Find all .pem files in ~/.ssh and return a dict with absolute paths
[ "Find", "all", ".", "pem", "files", "in", "~", "/", ".", "ssh", "and", "return", "a", "dict", "with", "absolute", "paths" ]
[ "\"\"\"Find all .pem files in ~/.ssh and return a dict with absolute paths\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }