repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.remove
def remove(self, models): """ Removed the passed model(s) from the selection""" models = self._check_model_types(models) for model in models: if model in self._selected: self._selected.remove(model)
python
def remove(self, models): """ Removed the passed model(s) from the selection""" models = self._check_model_types(models) for model in models: if model in self._selected: self._selected.remove(model)
[ "def", "remove", "(", "self", ",", "models", ")", ":", "models", "=", "self", ".", "_check_model_types", "(", "models", ")", "for", "model", "in", "models", ":", "if", "model", "in", "self", ".", "_selected", ":", "self", ".", "_selected", ".", "remove...
Removed the passed model(s) from the selection
[ "Removed", "the", "passed", "model", "(", "s", ")", "from", "the", "selection" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L180-L185
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.set
def set(self, models): """ Sets the selection to the passed model(s) """ # Do not add None values to selection if models is None: models = set() models = self._check_model_types(models) if len(models) > 1: models = reduce_to_parent_states(models) ...
python
def set(self, models): """ Sets the selection to the passed model(s) """ # Do not add None values to selection if models is None: models = set() models = self._check_model_types(models) if len(models) > 1: models = reduce_to_parent_states(models) ...
[ "def", "set", "(", "self", ",", "models", ")", ":", "# Do not add None values to selection", "if", "models", "is", "None", ":", "models", "=", "set", "(", ")", "models", "=", "self", ".", "_check_model_types", "(", "models", ")", "if", "len", "(", "models"...
Sets the selection to the passed model(s)
[ "Sets", "the", "selection", "to", "the", "passed", "model", "(", "s", ")" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L188-L198
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.handle_prepared_selection_of_core_class_elements
def handle_prepared_selection_of_core_class_elements(self, core_class, models): """Handles the selection for TreeStore widgets maintaining lists of a specific `core_class` elements If widgets hold a TreeStore with elements of a specific `core_class`, the local selection of that element type is ...
python
def handle_prepared_selection_of_core_class_elements(self, core_class, models): """Handles the selection for TreeStore widgets maintaining lists of a specific `core_class` elements If widgets hold a TreeStore with elements of a specific `core_class`, the local selection of that element type is ...
[ "def", "handle_prepared_selection_of_core_class_elements", "(", "self", ",", "core_class", ",", "models", ")", ":", "if", "extend_selection", "(", ")", ":", "self", ".", "_selected", ".", "difference_update", "(", "self", ".", "get_selected_elements_of_core_class", "(...
Handles the selection for TreeStore widgets maintaining lists of a specific `core_class` elements If widgets hold a TreeStore with elements of a specific `core_class`, the local selection of that element type is handled by that widget. This method is called to integrate the local selection with the ove...
[ "Handles", "the", "selection", "for", "TreeStore", "widgets", "maintaining", "lists", "of", "a", "specific", "core_class", "elements" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L206-L229
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.handle_new_selection
def handle_new_selection(self, models): """Handles the selection for generic widgets This is a helper method for generic widgets that want to modify the selection. These widgets can pass a list of newly selected (or clicked on) models. The method looks at the previous selection, the pa...
python
def handle_new_selection(self, models): """Handles the selection for generic widgets This is a helper method for generic widgets that want to modify the selection. These widgets can pass a list of newly selected (or clicked on) models. The method looks at the previous selection, the pa...
[ "def", "handle_new_selection", "(", "self", ",", "models", ")", ":", "models", "=", "self", ".", "_check_model_types", "(", "models", ")", "if", "extend_selection", "(", ")", ":", "already_selected_elements", "=", "models", "&", "self", ".", "_selected", "newl...
Handles the selection for generic widgets This is a helper method for generic widgets that want to modify the selection. These widgets can pass a list of newly selected (or clicked on) models. The method looks at the previous selection, the passed models and the list of pressed (modifier) keys...
[ "Handles", "the", "selection", "for", "generic", "widgets" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L232-L256
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.focus
def focus(self, model): """Sets the passed model as focused element :param ModelMT model: The element to be focused """ if model is None: del self.focus return self._check_model_types(model) self.add(model) focus_msg = FocusSignalMsg(mode...
python
def focus(self, model): """Sets the passed model as focused element :param ModelMT model: The element to be focused """ if model is None: del self.focus return self._check_model_types(model) self.add(model) focus_msg = FocusSignalMsg(mode...
[ "def", "focus", "(", "self", ",", "model", ")", ":", "if", "model", "is", "None", ":", "del", "self", ".", "focus", "return", "self", ".", "_check_model_types", "(", "model", ")", "self", ".", "add", "(", "model", ")", "focus_msg", "=", "FocusSignalMsg...
Sets the passed model as focused element :param ModelMT model: The element to be focused
[ "Sets", "the", "passed", "model", "as", "focused", "element" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L264-L279
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.focus
def focus(self): """ Unsets the focused element """ focus_msg = FocusSignalMsg(None, self._focus) self._focus = None self.focus_signal.emit(focus_msg)
python
def focus(self): """ Unsets the focused element """ focus_msg = FocusSignalMsg(None, self._focus) self._focus = None self.focus_signal.emit(focus_msg)
[ "def", "focus", "(", "self", ")", ":", "focus_msg", "=", "FocusSignalMsg", "(", "None", ",", "self", ".", "_focus", ")", "self", ".", "_focus", "=", "None", "self", ".", "focus_signal", ".", "emit", "(", "focus_msg", ")" ]
Unsets the focused element
[ "Unsets", "the", "focused", "element" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L282-L286
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.update_core_element_lists
def update_core_element_lists(self): """ Maintains inner lists of selected elements with a specific core element class """ def get_selected_elements_of_core_class(core_class): return set(element for element in self._selected if isinstance(element.core_element, core_class)) self._stat...
python
def update_core_element_lists(self): """ Maintains inner lists of selected elements with a specific core element class """ def get_selected_elements_of_core_class(core_class): return set(element for element in self._selected if isinstance(element.core_element, core_class)) self._stat...
[ "def", "update_core_element_lists", "(", "self", ")", ":", "def", "get_selected_elements_of_core_class", "(", "core_class", ")", ":", "return", "set", "(", "element", "for", "element", "in", "self", ".", "_selected", "if", "isinstance", "(", "element", ".", "cor...
Maintains inner lists of selected elements with a specific core element class
[ "Maintains", "inner", "lists", "of", "selected", "elements", "with", "a", "specific", "core", "element", "class" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L300-L310
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.get_selected_elements_of_core_class
def get_selected_elements_of_core_class(self, core_element_type): """Returns all selected elements having the specified `core_element_type` as state element class :return: Subset of the selection, only containing elements having `core_element_type` as state element class :rtype: set """...
python
def get_selected_elements_of_core_class(self, core_element_type): """Returns all selected elements having the specified `core_element_type` as state element class :return: Subset of the selection, only containing elements having `core_element_type` as state element class :rtype: set """...
[ "def", "get_selected_elements_of_core_class", "(", "self", ",", "core_element_type", ")", ":", "if", "core_element_type", "is", "Outcome", ":", "return", "self", ".", "outcomes", "elif", "core_element_type", "is", "InputDataPort", ":", "return", "self", ".", "input_...
Returns all selected elements having the specified `core_element_type` as state element class :return: Subset of the selection, only containing elements having `core_element_type` as state element class :rtype: set
[ "Returns", "all", "selected", "elements", "having", "the", "specified", "core_element_type", "as", "state", "element", "class" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L375-L395
DLR-RM/RAFCON
source/rafcon/gui/models/selection.py
Selection.is_selected
def is_selected(self, model): """Checks whether the given model is selected :param model: :return: True if the model is within the selection, False else :rtype: bool """ if model is None: return len(self._selected) == 0 return model in self._selected
python
def is_selected(self, model): """Checks whether the given model is selected :param model: :return: True if the model is within the selection, False else :rtype: bool """ if model is None: return len(self._selected) == 0 return model in self._selected
[ "def", "is_selected", "(", "self", ",", "model", ")", ":", "if", "model", "is", "None", ":", "return", "len", "(", "self", ".", "_selected", ")", "==", "0", "return", "model", "in", "self", ".", "_selected" ]
Checks whether the given model is selected :param model: :return: True if the model is within the selection, False else :rtype: bool
[ "Checks", "whether", "the", "given", "model", "is", "selected" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/selection.py#L397-L406
DLR-RM/RAFCON
source/rafcon/gui/utils/shell_execution.py
execute_command_with_path_in_process
def execute_command_with_path_in_process(command, path, shell=False, cwd=None, logger=None): """Executes a specific command in a separate process with a path as argument. :param command: the command to be executed :param path: the path as first argument to the shell command :param bool shell: Whether t...
python
def execute_command_with_path_in_process(command, path, shell=False, cwd=None, logger=None): """Executes a specific command in a separate process with a path as argument. :param command: the command to be executed :param path: the path as first argument to the shell command :param bool shell: Whether t...
[ "def", "execute_command_with_path_in_process", "(", "command", ",", "path", ",", "shell", "=", "False", ",", "cwd", "=", "None", ",", "logger", "=", "None", ")", ":", "if", "logger", "is", "None", ":", "logger", "=", "_logger", "logger", ".", "debug", "(...
Executes a specific command in a separate process with a path as argument. :param command: the command to be executed :param path: the path as first argument to the shell command :param bool shell: Whether to use a shell :param str cwd: The working directory of the command :param logger: optional l...
[ "Executes", "a", "specific", "command", "in", "a", "separate", "process", "with", "a", "path", "as", "argument", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/utils/shell_execution.py#L8-L29
DLR-RM/RAFCON
source/rafcon/gui/utils/shell_execution.py
execute_command_in_process
def execute_command_in_process(command, shell=False, cwd=None, logger=None): """ Executes a specific command in a separate process :param command: the command to be executed :param bool shell: Whether to use a shell :param str cwd: The working directory of the command :param logger: optional logger...
python
def execute_command_in_process(command, shell=False, cwd=None, logger=None): """ Executes a specific command in a separate process :param command: the command to be executed :param bool shell: Whether to use a shell :param str cwd: The working directory of the command :param logger: optional logger...
[ "def", "execute_command_in_process", "(", "command", ",", "shell", "=", "False", ",", "cwd", "=", "None", ",", "logger", "=", "None", ")", ":", "if", "logger", "is", "None", ":", "logger", "=", "_logger", "logger", ".", "debug", "(", "\"Run shell command: ...
Executes a specific command in a separate process :param command: the command to be executed :param bool shell: Whether to use a shell :param str cwd: The working directory of the command :param logger: optional logger instance which can be handed from other module :return: None
[ "Executes", "a", "specific", "command", "in", "a", "separate", "process" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/utils/shell_execution.py#L32-L49
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel._load_child_state_models
def _load_child_state_models(self, load_meta_data): """Adds models for each child state of the state :param bool load_meta_data: Whether to load the meta data of the child state """ self.states = {} # Create model for each child class child_states = self.state.states ...
python
def _load_child_state_models(self, load_meta_data): """Adds models for each child state of the state :param bool load_meta_data: Whether to load the meta data of the child state """ self.states = {} # Create model for each child class child_states = self.state.states ...
[ "def", "_load_child_state_models", "(", "self", ",", "load_meta_data", ")", ":", "self", ".", "states", "=", "{", "}", "# Create model for each child class", "child_states", "=", "self", ".", "state", ".", "states", "for", "child_state", "in", "child_states", ".",...
Adds models for each child state of the state :param bool load_meta_data: Whether to load the meta data of the child state
[ "Adds", "models", "for", "each", "child", "state", "of", "the", "state" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L72-L86
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel._load_scoped_variable_models
def _load_scoped_variable_models(self): """ Adds models for each scoped variable of the state """ self.scoped_variables = [] for scoped_variable in self.state.scoped_variables.values(): self._add_model(self.scoped_variables, scoped_variable, ScopedVariableModel)
python
def _load_scoped_variable_models(self): """ Adds models for each scoped variable of the state """ self.scoped_variables = [] for scoped_variable in self.state.scoped_variables.values(): self._add_model(self.scoped_variables, scoped_variable, ScopedVariableModel)
[ "def", "_load_scoped_variable_models", "(", "self", ")", ":", "self", ".", "scoped_variables", "=", "[", "]", "for", "scoped_variable", "in", "self", ".", "state", ".", "scoped_variables", ".", "values", "(", ")", ":", "self", ".", "_add_model", "(", "self",...
Adds models for each scoped variable of the state
[ "Adds", "models", "for", "each", "scoped", "variable", "of", "the", "state" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L88-L92
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel._load_data_flow_models
def _load_data_flow_models(self): """ Adds models for each data flow of the state """ self.data_flows = [] for data_flow in self.state.data_flows.values(): self._add_model(self.data_flows, data_flow, DataFlowModel)
python
def _load_data_flow_models(self): """ Adds models for each data flow of the state """ self.data_flows = [] for data_flow in self.state.data_flows.values(): self._add_model(self.data_flows, data_flow, DataFlowModel)
[ "def", "_load_data_flow_models", "(", "self", ")", ":", "self", ".", "data_flows", "=", "[", "]", "for", "data_flow", "in", "self", ".", "state", ".", "data_flows", ".", "values", "(", ")", ":", "self", ".", "_add_model", "(", "self", ".", "data_flows", ...
Adds models for each data flow of the state
[ "Adds", "models", "for", "each", "data", "flow", "of", "the", "state" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L94-L98
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel._load_transition_models
def _load_transition_models(self): """ Adds models for each transition of the state """ self.transitions = [] for transition in self.state.transitions.values(): self._add_model(self.transitions, transition, TransitionModel)
python
def _load_transition_models(self): """ Adds models for each transition of the state """ self.transitions = [] for transition in self.state.transitions.values(): self._add_model(self.transitions, transition, TransitionModel)
[ "def", "_load_transition_models", "(", "self", ")", ":", "self", ".", "transitions", "=", "[", "]", "for", "transition", "in", "self", ".", "state", ".", "transitions", ".", "values", "(", ")", ":", "self", ".", "_add_model", "(", "self", ".", "transitio...
Adds models for each transition of the state
[ "Adds", "models", "for", "each", "transition", "of", "the", "state" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L100-L104
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel.prepare_destruction
def prepare_destruction(self, recursive=True): """Prepares the model for destruction Recursively un-registers all observers and removes references to child models. Extends the destroy method of the base class by child elements of a container state. """ # logger.verbose("Prepare ...
python
def prepare_destruction(self, recursive=True): """Prepares the model for destruction Recursively un-registers all observers and removes references to child models. Extends the destroy method of the base class by child elements of a container state. """ # logger.verbose("Prepare ...
[ "def", "prepare_destruction", "(", "self", ",", "recursive", "=", "True", ")", ":", "# logger.verbose(\"Prepare destruction container state ...\")", "if", "recursive", ":", "for", "scoped_variable", "in", "self", ".", "scoped_variables", ":", "scoped_variable", ".", "pr...
Prepares the model for destruction Recursively un-registers all observers and removes references to child models. Extends the destroy method of the base class by child elements of a container state.
[ "Prepares", "the", "model", "for", "destruction" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L122-L144
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel.model_changed
def model_changed(self, model, prop_name, info): """This method notifies the model lists and the parent state about changes The method is called each time, the model is changed. This happens, when the state itself changes or one of its children (states, transitions, data flows) changes. Changes...
python
def model_changed(self, model, prop_name, info): """This method notifies the model lists and the parent state about changes The method is called each time, the model is changed. This happens, when the state itself changes or one of its children (states, transitions, data flows) changes. Changes...
[ "def", "model_changed", "(", "self", ",", "model", ",", "prop_name", ",", "info", ")", ":", "# if info.method_name == 'change_state_type': # Handled in method 'change_state_type'", "# return", "# If this model has been changed (and not one of its child states), then we have to updat...
This method notifies the model lists and the parent state about changes The method is called each time, the model is changed. This happens, when the state itself changes or one of its children (states, transitions, data flows) changes. Changes of the children cannot be observed directly, theref...
[ "This", "method", "notifies", "the", "model", "lists", "and", "the", "parent", "state", "about", "changes" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L159-L224
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel.update_child_models
def update_child_models(self, _, name, info): """ This method is always triggered when the state model changes It keeps the following models/model-lists consistent: transition models data-flow models state models scoped variable models """ ...
python
def update_child_models(self, _, name, info): """ This method is always triggered when the state model changes It keeps the following models/model-lists consistent: transition models data-flow models state models scoped variable models """ ...
[ "def", "update_child_models", "(", "self", ",", "_", ",", "name", ",", "info", ")", ":", "# Update is_start flag in child states if the start state has changed (eventually)", "if", "info", ".", "method_name", "in", "[", "'start_state_id'", ",", "'add_transition'", ",", ...
This method is always triggered when the state model changes It keeps the following models/model-lists consistent: transition models data-flow models state models scoped variable models
[ "This", "method", "is", "always", "triggered", "when", "the", "state", "model", "changes" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L266-L301
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel.get_scoped_variable_m
def get_scoped_variable_m(self, data_port_id): """Returns the scoped variable model for the given data port id :param data_port_id: The data port id to search for :return: The model of the scoped variable with the given id """ for scoped_variable_m in self.scoped_variables: ...
python
def get_scoped_variable_m(self, data_port_id): """Returns the scoped variable model for the given data port id :param data_port_id: The data port id to search for :return: The model of the scoped variable with the given id """ for scoped_variable_m in self.scoped_variables: ...
[ "def", "get_scoped_variable_m", "(", "self", ",", "data_port_id", ")", ":", "for", "scoped_variable_m", "in", "self", ".", "scoped_variables", ":", "if", "scoped_variable_m", ".", "scoped_variable", ".", "data_port_id", "==", "data_port_id", ":", "return", "scoped_v...
Returns the scoped variable model for the given data port id :param data_port_id: The data port id to search for :return: The model of the scoped variable with the given id
[ "Returns", "the", "scoped", "variable", "model", "for", "the", "given", "data", "port", "id" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L371-L380
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel.get_data_port_m
def get_data_port_m(self, data_port_id): """Searches and returns the model of a data port of a given state The method searches a port with the given id in the data ports of the given state model. If the state model is a container state, not only the input and output data ports are looked at, bu...
python
def get_data_port_m(self, data_port_id): """Searches and returns the model of a data port of a given state The method searches a port with the given id in the data ports of the given state model. If the state model is a container state, not only the input and output data ports are looked at, bu...
[ "def", "get_data_port_m", "(", "self", ",", "data_port_id", ")", ":", "for", "scoped_var_m", "in", "self", ".", "scoped_variables", ":", "if", "scoped_var_m", ".", "scoped_variable", ".", "data_port_id", "==", "data_port_id", ":", "return", "scoped_var_m", "return...
Searches and returns the model of a data port of a given state The method searches a port with the given id in the data ports of the given state model. If the state model is a container state, not only the input and output data ports are looked at, but also the scoped variables. :param data_po...
[ "Searches", "and", "returns", "the", "model", "of", "a", "data", "port", "of", "a", "given", "state" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L382-L396
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel.get_transition_m
def get_transition_m(self, transition_id): """Searches and return the transition model with the given in the given container state model :param transition_id: The transition id to be searched :return: The model of the transition or None if it is not found """ for transition_m in...
python
def get_transition_m(self, transition_id): """Searches and return the transition model with the given in the given container state model :param transition_id: The transition id to be searched :return: The model of the transition or None if it is not found """ for transition_m in...
[ "def", "get_transition_m", "(", "self", ",", "transition_id", ")", ":", "for", "transition_m", "in", "self", ".", "transitions", ":", "if", "transition_m", ".", "transition", ".", "transition_id", "==", "transition_id", ":", "return", "transition_m", "return", "...
Searches and return the transition model with the given in the given container state model :param transition_id: The transition id to be searched :return: The model of the transition or None if it is not found
[ "Searches", "and", "return", "the", "transition", "model", "with", "the", "given", "in", "the", "given", "container", "state", "model" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L398-L407
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel.get_data_flow_m
def get_data_flow_m(self, data_flow_id): """Searches and return the data flow model with the given in the given container state model :param data_flow_id: The data flow id to be searched :return: The model of the data flow or None if it is not found """ for data_flow_m in self.d...
python
def get_data_flow_m(self, data_flow_id): """Searches and return the data flow model with the given in the given container state model :param data_flow_id: The data flow id to be searched :return: The model of the data flow or None if it is not found """ for data_flow_m in self.d...
[ "def", "get_data_flow_m", "(", "self", ",", "data_flow_id", ")", ":", "for", "data_flow_m", "in", "self", ".", "data_flows", ":", "if", "data_flow_m", ".", "data_flow", ".", "data_flow_id", "==", "data_flow_id", ":", "return", "data_flow_m", "return", "None" ]
Searches and return the data flow model with the given in the given container state model :param data_flow_id: The data flow id to be searched :return: The model of the data flow or None if it is not found
[ "Searches", "and", "return", "the", "data", "flow", "model", "with", "the", "given", "in", "the", "given", "container", "state", "model" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L409-L418
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel.store_meta_data
def store_meta_data(self, copy_path=None): """Store meta data of container states to the filesystem Recursively stores meta data of child states. For further insides read the description of also called respective super class method. :param str copy_path: Optional copy path if meta data...
python
def store_meta_data(self, copy_path=None): """Store meta data of container states to the filesystem Recursively stores meta data of child states. For further insides read the description of also called respective super class method. :param str copy_path: Optional copy path if meta data...
[ "def", "store_meta_data", "(", "self", ",", "copy_path", "=", "None", ")", ":", "super", "(", "ContainerStateModel", ",", "self", ")", ".", "store_meta_data", "(", "copy_path", ")", "for", "state_key", ",", "state", "in", "self", ".", "states", ".", "items...
Store meta data of container states to the filesystem Recursively stores meta data of child states. For further insides read the description of also called respective super class method. :param str copy_path: Optional copy path if meta data is not stored to the file system path of state machin...
[ "Store", "meta", "data", "of", "container", "states", "to", "the", "filesystem" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L422-L432
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel.copy_meta_data_from_state_m
def copy_meta_data_from_state_m(self, source_state_m): """Dismiss current meta data and copy meta data from given state model In addition to the state model method, also the meta data of container states is copied. Then, the meta data of child states are recursively copied. :param sour...
python
def copy_meta_data_from_state_m(self, source_state_m): """Dismiss current meta data and copy meta data from given state model In addition to the state model method, also the meta data of container states is copied. Then, the meta data of child states are recursively copied. :param sour...
[ "def", "copy_meta_data_from_state_m", "(", "self", ",", "source_state_m", ")", ":", "for", "scoped_variable_m", "in", "self", ".", "scoped_variables", ":", "source_scoped_variable_m", "=", "source_state_m", ".", "get_scoped_variable_m", "(", "scoped_variable_m", ".", "s...
Dismiss current meta data and copy meta data from given state model In addition to the state model method, also the meta data of container states is copied. Then, the meta data of child states are recursively copied. :param source_state_m: State model to load the meta data from
[ "Dismiss", "current", "meta", "data", "and", "copy", "meta", "data", "from", "given", "state", "model" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L434-L458
DLR-RM/RAFCON
source/rafcon/gui/models/container_state.py
ContainerStateModel._generate_element_meta_data
def _generate_element_meta_data(self, meta_data): """Generate meta data for state elements and add it to the given dictionary This method retrieves the meta data of the container state elements (data flows, transitions) and adds it to the given meta data dictionary. :param meta_data: D...
python
def _generate_element_meta_data(self, meta_data): """Generate meta data for state elements and add it to the given dictionary This method retrieves the meta data of the container state elements (data flows, transitions) and adds it to the given meta data dictionary. :param meta_data: D...
[ "def", "_generate_element_meta_data", "(", "self", ",", "meta_data", ")", ":", "super", "(", "ContainerStateModel", ",", "self", ")", ".", "_generate_element_meta_data", "(", "meta_data", ")", "for", "transition_m", "in", "self", ".", "transitions", ":", "self", ...
Generate meta data for state elements and add it to the given dictionary This method retrieves the meta data of the container state elements (data flows, transitions) and adds it to the given meta data dictionary. :param meta_data: Dictionary of meta data
[ "Generate", "meta", "data", "for", "state", "elements", "and", "add", "it", "to", "the", "given", "dictionary" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/container_state.py#L478-L495
DLR-RM/RAFCON
source/rafcon/gui/interface.py
open_folder
def open_folder(query, default_path=None): """Shows a user dialog for folder selection A dialog is opened with the prompt `query`. The current path is set to the last path that was opened/created. The roots of all libraries is added to the list of shortcut folders. :param str query: Prompt as...
python
def open_folder(query, default_path=None): """Shows a user dialog for folder selection A dialog is opened with the prompt `query`. The current path is set to the last path that was opened/created. The roots of all libraries is added to the list of shortcut folders. :param str query: Prompt as...
[ "def", "open_folder", "(", "query", ",", "default_path", "=", "None", ")", ":", "from", "gi", ".", "repository", "import", "Gtk", "from", "os", ".", "path", "import", "expanduser", ",", "pathsep", ",", "dirname", ",", "isdir", "from", "rafcon", ".", "gui...
Shows a user dialog for folder selection A dialog is opened with the prompt `query`. The current path is set to the last path that was opened/created. The roots of all libraries is added to the list of shortcut folders. :param str query: Prompt asking the user for a specific folder :param str...
[ "Shows", "a", "user", "dialog", "for", "folder", "selection", "A", "dialog", "is", "opened", "with", "the", "prompt", "query", ".", "The", "current", "path", "is", "set", "to", "the", "last", "path", "that", "was", "opened", "/", "created", ".", "The", ...
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/interface.py#L34-L89
DLR-RM/RAFCON
source/rafcon/gui/interface.py
create_folder
def create_folder(query, default_name=None, default_path=None): """Shows a user dialog for folder creation A dialog is opened with the prompt `query`. The current path is set to the last path that was opened/created. The roots of all libraries is added to the list of shortcut folders. :param ...
python
def create_folder(query, default_name=None, default_path=None): """Shows a user dialog for folder creation A dialog is opened with the prompt `query`. The current path is set to the last path that was opened/created. The roots of all libraries is added to the list of shortcut folders. :param ...
[ "def", "create_folder", "(", "query", ",", "default_name", "=", "None", ",", "default_path", "=", "None", ")", ":", "from", "gi", ".", "repository", "import", "Gtk", "from", "os", ".", "path", "import", "expanduser", ",", "dirname", ",", "join", ",", "ex...
Shows a user dialog for folder creation A dialog is opened with the prompt `query`. The current path is set to the last path that was opened/created. The roots of all libraries is added to the list of shortcut folders. :param str query: Prompt asking the user for a specific folder :param str ...
[ "Shows", "a", "user", "dialog", "for", "folder", "creation", "A", "dialog", "is", "opened", "with", "the", "prompt", "query", ".", "The", "current", "path", "is", "set", "to", "the", "last", "path", "that", "was", "opened", "/", "created", ".", "The", ...
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/interface.py#L97-L157
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
add_state_machine
def add_state_machine(widget, event=None): """Create a new state-machine when the user clicks on the '+' next to the tabs""" logger.debug("Creating new state-machine...") root_state = HierarchyState("new root state") state_machine = StateMachine(root_state) rafcon.core.singleton.state_machine_manage...
python
def add_state_machine(widget, event=None): """Create a new state-machine when the user clicks on the '+' next to the tabs""" logger.debug("Creating new state-machine...") root_state = HierarchyState("new root state") state_machine = StateMachine(root_state) rafcon.core.singleton.state_machine_manage...
[ "def", "add_state_machine", "(", "widget", ",", "event", "=", "None", ")", ":", "logger", ".", "debug", "(", "\"Creating new state-machine...\"", ")", "root_state", "=", "HierarchyState", "(", "\"new root state\"", ")", "state_machine", "=", "StateMachine", "(", "...
Create a new state-machine when the user clicks on the '+' next to the tabs
[ "Create", "a", "new", "state", "-", "machine", "when", "the", "user", "clicks", "on", "the", "+", "next", "to", "the", "tabs" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L106-L111
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.register_view
def register_view(self, view): """Called when the View was registered""" super(StateMachinesEditorController, self).register_view(view) self.view['notebook'].connect('switch-page', self.on_switch_page) # Add all already open state machines for state_machine in self.model.state_m...
python
def register_view(self, view): """Called when the View was registered""" super(StateMachinesEditorController, self).register_view(view) self.view['notebook'].connect('switch-page', self.on_switch_page) # Add all already open state machines for state_machine in self.model.state_m...
[ "def", "register_view", "(", "self", ",", "view", ")", ":", "super", "(", "StateMachinesEditorController", ",", "self", ")", ".", "register_view", "(", "view", ")", "self", ".", "view", "[", "'notebook'", "]", ".", "connect", "(", "'switch-page'", ",", "se...
Called when the View was registered
[ "Called", "when", "the", "View", "was", "registered" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L134-L141
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.register_actions
def register_actions(self, shortcut_manager): """Register callback methods fot triggered actions. :param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings between shortcuts and actions. """ shortcut_manager.add_callback_fo...
python
def register_actions(self, shortcut_manager): """Register callback methods fot triggered actions. :param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings between shortcuts and actions. """ shortcut_manager.add_callback_fo...
[ "def", "register_actions", "(", "self", ",", "shortcut_manager", ")", ":", "shortcut_manager", ".", "add_callback_for_action", "(", "'close'", ",", "self", ".", "on_close_shortcut", ")", "# Call register_action of parent in order to register actions for child controllers", "sup...
Register callback methods fot triggered actions. :param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings between shortcuts and actions.
[ "Register", "callback", "methods", "fot", "triggered", "actions", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L143-L152
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.close_state_machine
def close_state_machine(self, widget, page_number, event=None): """Triggered when the close button in the tab is clicked """ page = widget.get_nth_page(page_number) for tab_info in self.tabs.values(): if tab_info['page'] is page: state_machine_m = tab_info['st...
python
def close_state_machine(self, widget, page_number, event=None): """Triggered when the close button in the tab is clicked """ page = widget.get_nth_page(page_number) for tab_info in self.tabs.values(): if tab_info['page'] is page: state_machine_m = tab_info['st...
[ "def", "close_state_machine", "(", "self", ",", "widget", ",", "page_number", ",", "event", "=", "None", ")", ":", "page", "=", "widget", ".", "get_nth_page", "(", "page_number", ")", "for", "tab_info", "in", "self", ".", "tabs", ".", "values", "(", ")",...
Triggered when the close button in the tab is clicked
[ "Triggered", "when", "the", "close", "button", "in", "the", "tab", "is", "clicked" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L154-L162
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.on_close_shortcut
def on_close_shortcut(self, *args): """Close selected state machine (triggered by shortcut)""" state_machine_m = self.model.get_selected_state_machine_model() if state_machine_m is None: return self.on_close_clicked(None, state_machine_m, None, force=False)
python
def on_close_shortcut(self, *args): """Close selected state machine (triggered by shortcut)""" state_machine_m = self.model.get_selected_state_machine_model() if state_machine_m is None: return self.on_close_clicked(None, state_machine_m, None, force=False)
[ "def", "on_close_shortcut", "(", "self", ",", "*", "args", ")", ":", "state_machine_m", "=", "self", ".", "model", ".", "get_selected_state_machine_model", "(", ")", "if", "state_machine_m", "is", "None", ":", "return", "self", ".", "on_close_clicked", "(", "N...
Close selected state machine (triggered by shortcut)
[ "Close", "selected", "state", "machine", "(", "triggered", "by", "shortcut", ")" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L164-L169
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.add_graphical_state_machine_editor
def add_graphical_state_machine_editor(self, state_machine_m): """Add to for new state machine If a new state machine was added, a new tab is created with a graphical editor for this state machine. :param StateMachineModel state_machine_m: The new state machine model """ assert...
python
def add_graphical_state_machine_editor(self, state_machine_m): """Add to for new state machine If a new state machine was added, a new tab is created with a graphical editor for this state machine. :param StateMachineModel state_machine_m: The new state machine model """ assert...
[ "def", "add_graphical_state_machine_editor", "(", "self", ",", "state_machine_m", ")", ":", "assert", "isinstance", "(", "state_machine_m", ",", "StateMachineModel", ")", "sm_id", "=", "state_machine_m", ".", "state_machine", ".", "state_machine_id", "logger", ".", "d...
Add to for new state machine If a new state machine was added, a new tab is created with a graphical editor for this state machine. :param StateMachineModel state_machine_m: The new state machine model
[ "Add", "to", "for", "new", "state", "machine" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L211-L247
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.notification_selected_sm_changed
def notification_selected_sm_changed(self, model, prop_name, info): """If a new state machine is selected, make sure the tab is open""" selected_state_machine_id = self.model.selected_state_machine_id if selected_state_machine_id is None: return page_id = self.get_page_num(s...
python
def notification_selected_sm_changed(self, model, prop_name, info): """If a new state machine is selected, make sure the tab is open""" selected_state_machine_id = self.model.selected_state_machine_id if selected_state_machine_id is None: return page_id = self.get_page_num(s...
[ "def", "notification_selected_sm_changed", "(", "self", ",", "model", ",", "prop_name", ",", "info", ")", ":", "selected_state_machine_id", "=", "self", ".", "model", ".", "selected_state_machine_id", "if", "selected_state_machine_id", "is", "None", ":", "return", "...
If a new state machine is selected, make sure the tab is open
[ "If", "a", "new", "state", "machine", "is", "selected", "make", "sure", "the", "tab", "is", "open" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L250-L276
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.update_state_machine_tab_label
def update_state_machine_tab_label(self, state_machine_m): """ Updates tab label if needed because system path, root state name or marked_dirty flag changed :param StateMachineModel state_machine_m: State machine model that has changed :return: """ sm_id = state_machine_m.state_...
python
def update_state_machine_tab_label(self, state_machine_m): """ Updates tab label if needed because system path, root state name or marked_dirty flag changed :param StateMachineModel state_machine_m: State machine model that has changed :return: """ sm_id = state_machine_m.state_...
[ "def", "update_state_machine_tab_label", "(", "self", ",", "state_machine_m", ")", ":", "sm_id", "=", "state_machine_m", ".", "state_machine", ".", "state_machine_id", "if", "sm_id", "in", "self", ".", "tabs", ":", "sm", "=", "state_machine_m", ".", "state_machine...
Updates tab label if needed because system path, root state name or marked_dirty flag changed :param StateMachineModel state_machine_m: State machine model that has changed :return:
[ "Updates", "tab", "label", "if", "needed", "because", "system", "path", "root", "state", "name", "or", "marked_dirty", "flag", "changed" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L306-L327
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.on_close_clicked
def on_close_clicked(self, event, state_machine_m, result, force=False): """Triggered when the close button of a state machine tab is clicked Closes state machine if it is saved. Otherwise gives the user the option to 'Close without Saving' or to 'Cancel the Close Operation' :param sta...
python
def on_close_clicked(self, event, state_machine_m, result, force=False): """Triggered when the close button of a state machine tab is clicked Closes state machine if it is saved. Otherwise gives the user the option to 'Close without Saving' or to 'Cancel the Close Operation' :param sta...
[ "def", "on_close_clicked", "(", "self", ",", "event", ",", "state_machine_m", ",", "result", ",", "force", "=", "False", ")", ":", "from", "rafcon", ".", "core", ".", "singleton", "import", "state_machine_execution_engine", ",", "state_machine_manager", "force", ...
Triggered when the close button of a state machine tab is clicked Closes state machine if it is saved. Otherwise gives the user the option to 'Close without Saving' or to 'Cancel the Close Operation' :param state_machine_m: The selected state machine model.
[ "Triggered", "when", "the", "close", "button", "of", "a", "state", "machine", "tab", "is", "clicked" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L354-L422
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.close_all_pages
def close_all_pages(self): """Closes all tabs of the state machines editor.""" state_machine_m_list = [tab['state_machine_m'] for tab in self.tabs.values()] for state_machine_m in state_machine_m_list: self.on_close_clicked(None, state_machine_m, None, force=True)
python
def close_all_pages(self): """Closes all tabs of the state machines editor.""" state_machine_m_list = [tab['state_machine_m'] for tab in self.tabs.values()] for state_machine_m in state_machine_m_list: self.on_close_clicked(None, state_machine_m, None, force=True)
[ "def", "close_all_pages", "(", "self", ")", ":", "state_machine_m_list", "=", "[", "tab", "[", "'state_machine_m'", "]", "for", "tab", "in", "self", ".", "tabs", ".", "values", "(", ")", "]", "for", "state_machine_m", "in", "state_machine_m_list", ":", "self...
Closes all tabs of the state machines editor.
[ "Closes", "all", "tabs", "of", "the", "state", "machines", "editor", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L458-L462
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.refresh_state_machines
def refresh_state_machines(self, state_machine_ids): """ Refresh list af state machine tabs :param list state_machine_ids: List of state machine ids to be refreshed :return: """ # remember current selected state machine id currently_selected_sm_id = None if self....
python
def refresh_state_machines(self, state_machine_ids): """ Refresh list af state machine tabs :param list state_machine_ids: List of state machine ids to be refreshed :return: """ # remember current selected state machine id currently_selected_sm_id = None if self....
[ "def", "refresh_state_machines", "(", "self", ",", "state_machine_ids", ")", ":", "# remember current selected state machine id", "currently_selected_sm_id", "=", "None", "if", "self", ".", "model", ".", "get_selected_state_machine_model", "(", ")", ":", "currently_selected...
Refresh list af state machine tabs :param list state_machine_ids: List of state machine ids to be refreshed :return:
[ "Refresh", "list", "af", "state", "machine", "tabs" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L464-L507
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.refresh_all_state_machines
def refresh_all_state_machines(self): """ Refreshes all state machine tabs """ self.refresh_state_machines(list(self.model.state_machine_manager.state_machines.keys()))
python
def refresh_all_state_machines(self): """ Refreshes all state machine tabs """ self.refresh_state_machines(list(self.model.state_machine_manager.state_machines.keys()))
[ "def", "refresh_all_state_machines", "(", "self", ")", ":", "self", ".", "refresh_state_machines", "(", "list", "(", "self", ".", "model", ".", "state_machine_manager", ".", "state_machines", ".", "keys", "(", ")", ")", ")" ]
Refreshes all state machine tabs
[ "Refreshes", "all", "state", "machine", "tabs" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L516-L519
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.switch_state_machine_execution_engine
def switch_state_machine_execution_engine(self, new_state_machine_execution_engine): """ Switch the state machine execution engine the main window controller listens to. :param new_state_machine_execution_engine: the new state machine execution engine for this controller :return: ...
python
def switch_state_machine_execution_engine(self, new_state_machine_execution_engine): """ Switch the state machine execution engine the main window controller listens to. :param new_state_machine_execution_engine: the new state machine execution engine for this controller :return: ...
[ "def", "switch_state_machine_execution_engine", "(", "self", ",", "new_state_machine_execution_engine", ")", ":", "# relieve old one", "self", ".", "relieve_model", "(", "self", ".", "state_machine_execution_model", ")", "# register new", "self", ".", "state_machine_execution...
Switch the state machine execution engine the main window controller listens to. :param new_state_machine_execution_engine: the new state machine execution engine for this controller :return:
[ "Switch", "the", "state", "machine", "execution", "engine", "the", "main", "window", "controller", "listens", "to", ".", ":", "param", "new_state_machine_execution_engine", ":", "the", "new", "state", "machine", "execution", "engine", "for", "this", "controller", ...
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L521-L532
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_machines_editor.py
StateMachinesEditorController.execution_engine_model_changed
def execution_engine_model_changed(self, model, prop_name, info): """High light active state machine. """ notebook = self.view['notebook'] active_state_machine_id = self.model.state_machine_manager.active_state_machine_id if active_state_machine_id is None: # un-mark all st...
python
def execution_engine_model_changed(self, model, prop_name, info): """High light active state machine. """ notebook = self.view['notebook'] active_state_machine_id = self.model.state_machine_manager.active_state_machine_id if active_state_machine_id is None: # un-mark all st...
[ "def", "execution_engine_model_changed", "(", "self", ",", "model", ",", "prop_name", ",", "info", ")", ":", "notebook", "=", "self", ".", "view", "[", "'notebook'", "]", "active_state_machine_id", "=", "self", ".", "model", ".", "state_machine_manager", ".", ...
High light active state machine.
[ "High", "light", "active", "state", "machine", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_machines_editor.py#L535-L552
DLR-RM/RAFCON
source/rafcon/gui/action.py
get_state_tuple
def get_state_tuple(state, state_m=None): """ Generates a tuple that holds the state as yaml-strings and its meta data in a dictionary. The tuple consists of: [0] json_str for state, [1] dict of child_state tuples, [2] dict of model_meta-data of self and elements [3] path of state in state machi...
python
def get_state_tuple(state, state_m=None): """ Generates a tuple that holds the state as yaml-strings and its meta data in a dictionary. The tuple consists of: [0] json_str for state, [1] dict of child_state tuples, [2] dict of model_meta-data of self and elements [3] path of state in state machi...
[ "def", "get_state_tuple", "(", "state", ",", "state_m", "=", "None", ")", ":", "state_str", "=", "json", ".", "dumps", "(", "state", ",", "cls", "=", "JSONObjectEncoder", ",", "indent", "=", "4", ",", "check_circular", "=", "False", ",", "sort_keys", "="...
Generates a tuple that holds the state as yaml-strings and its meta data in a dictionary. The tuple consists of: [0] json_str for state, [1] dict of child_state tuples, [2] dict of model_meta-data of self and elements [3] path of state in state machine [4] script_text [5] file system path ...
[ "Generates", "a", "tuple", "that", "holds", "the", "state", "as", "yaml", "-", "strings", "and", "its", "meta", "data", "in", "a", "dictionary", ".", "The", "tuple", "consists", "of", ":", "[", "0", "]", "json_str", "for", "state", "[", "1", "]", "di...
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/action.py#L78-L110
DLR-RM/RAFCON
source/rafcon/gui/action.py
meta_dump_or_deepcopy
def meta_dump_or_deepcopy(meta): """Function to observe meta data vivi-dict copy process and to debug it at one point""" if DEBUG_META_REFERENCES: # debug copy from rafcon.gui.helpers.meta_data import meta_data_reference_check meta_data_reference_check(meta) return copy.deepcopy(meta)
python
def meta_dump_or_deepcopy(meta): """Function to observe meta data vivi-dict copy process and to debug it at one point""" if DEBUG_META_REFERENCES: # debug copy from rafcon.gui.helpers.meta_data import meta_data_reference_check meta_data_reference_check(meta) return copy.deepcopy(meta)
[ "def", "meta_dump_or_deepcopy", "(", "meta", ")", ":", "if", "DEBUG_META_REFERENCES", ":", "# debug copy", "from", "rafcon", ".", "gui", ".", "helpers", ".", "meta_data", "import", "meta_data_reference_check", "meta_data_reference_check", "(", "meta", ")", "return", ...
Function to observe meta data vivi-dict copy process and to debug it at one point
[ "Function", "to", "observe", "meta", "data", "vivi", "-", "dict", "copy", "process", "and", "to", "debug", "it", "at", "one", "point" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/action.py#L176-L181
DLR-RM/RAFCON
source/rafcon/gui/action.py
StateMachineAction.undo
def undo(self): """ General Undo, that takes all elements in the parent and :return: """ # logger.verbose("#H# STATE_MACHINE_UNDO STARTED") state = self.state_machine.root_state self.set_root_state_to_version(state, self.before_storage)
python
def undo(self): """ General Undo, that takes all elements in the parent and :return: """ # logger.verbose("#H# STATE_MACHINE_UNDO STARTED") state = self.state_machine.root_state self.set_root_state_to_version(state, self.before_storage)
[ "def", "undo", "(", "self", ")", ":", "# logger.verbose(\"#H# STATE_MACHINE_UNDO STARTED\")", "state", "=", "self", ".", "state_machine", ".", "root_state", "self", ".", "set_root_state_to_version", "(", "state", ",", "self", ".", "before_storage", ")" ]
General Undo, that takes all elements in the parent and :return:
[ "General", "Undo", "that", "takes", "all", "elements", "in", "the", "parent", "and", ":", "return", ":" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/action.py#L888-L895
DLR-RM/RAFCON
source/rafcon/gui/mygaphas/utils/cache/image_cache.py
ImageCache.get_cached_image
def get_cached_image(self, width, height, zoom, parameters=None, clear=False): """Get ImageSurface object, if possible, cached The method checks whether the image was already rendered. This is done by comparing the passed size and parameters with those of the last image. If they are equal, the ...
python
def get_cached_image(self, width, height, zoom, parameters=None, clear=False): """Get ImageSurface object, if possible, cached The method checks whether the image was already rendered. This is done by comparing the passed size and parameters with those of the last image. If they are equal, the ...
[ "def", "get_cached_image", "(", "self", ",", "width", ",", "height", ",", "zoom", ",", "parameters", "=", "None", ",", "clear", "=", "False", ")", ":", "global", "MAX_ALLOWED_AREA", "if", "not", "parameters", ":", "parameters", "=", "{", "}", "if", "self...
Get ImageSurface object, if possible, cached The method checks whether the image was already rendered. This is done by comparing the passed size and parameters with those of the last image. If they are equal, the cached image is returned. Otherwise, a new ImageSurface with the specified dimensi...
[ "Get", "ImageSurface", "object", "if", "possible", "cached" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/cache/image_cache.py#L48-L85
DLR-RM/RAFCON
source/rafcon/gui/mygaphas/utils/cache/image_cache.py
ImageCache.copy_image_to_context
def copy_image_to_context(self, context, position, rotation=0, zoom=None): """Draw a cached image on the context :param context: The Cairo context to draw on :param position: The position od the image """ if not zoom: zoom = self.__zoom zoom_multiplicator = z...
python
def copy_image_to_context(self, context, position, rotation=0, zoom=None): """Draw a cached image on the context :param context: The Cairo context to draw on :param position: The position od the image """ if not zoom: zoom = self.__zoom zoom_multiplicator = z...
[ "def", "copy_image_to_context", "(", "self", ",", "context", ",", "position", ",", "rotation", "=", "0", ",", "zoom", "=", "None", ")", ":", "if", "not", "zoom", ":", "zoom", "=", "self", ".", "__zoom", "zoom_multiplicator", "=", "zoom", "*", "self", "...
Draw a cached image on the context :param context: The Cairo context to draw on :param position: The position od the image
[ "Draw", "a", "cached", "image", "on", "the", "context" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/cache/image_cache.py#L87-L105
DLR-RM/RAFCON
source/rafcon/gui/mygaphas/utils/cache/image_cache.py
ImageCache.get_context_for_image
def get_context_for_image(self, zoom): """Creates a temporary cairo context for the image surface :param zoom: The current scaling factor :return: Cairo context to draw on """ cairo_context = Context(self.__image) cairo_context.scale(zoom * self.multiplicator, zoom * sel...
python
def get_context_for_image(self, zoom): """Creates a temporary cairo context for the image surface :param zoom: The current scaling factor :return: Cairo context to draw on """ cairo_context = Context(self.__image) cairo_context.scale(zoom * self.multiplicator, zoom * sel...
[ "def", "get_context_for_image", "(", "self", ",", "zoom", ")", ":", "cairo_context", "=", "Context", "(", "self", ".", "__image", ")", "cairo_context", ".", "scale", "(", "zoom", "*", "self", ".", "multiplicator", ",", "zoom", "*", "self", ".", "multiplica...
Creates a temporary cairo context for the image surface :param zoom: The current scaling factor :return: Cairo context to draw on
[ "Creates", "a", "temporary", "cairo", "context", "for", "the", "image", "surface" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/cache/image_cache.py#L111-L119
DLR-RM/RAFCON
source/rafcon/gui/mygaphas/utils/cache/image_cache.py
ImageCache.__compare_parameters
def __compare_parameters(self, width, height, zoom, parameters): """Compare parameters for equality Checks if a cached image is existing, the the dimensions agree and finally if the properties are equal. If so, True is returned, else False, :param width: The width of the image :...
python
def __compare_parameters(self, width, height, zoom, parameters): """Compare parameters for equality Checks if a cached image is existing, the the dimensions agree and finally if the properties are equal. If so, True is returned, else False, :param width: The width of the image :...
[ "def", "__compare_parameters", "(", "self", ",", "width", ",", "height", ",", "zoom", ",", "parameters", ")", ":", "# Deactivated caching", "if", "not", "global_gui_config", ".", "get_config_value", "(", "'ENABLE_CACHING'", ",", "True", ")", ":", "return", "Fals...
Compare parameters for equality Checks if a cached image is existing, the the dimensions agree and finally if the properties are equal. If so, True is returned, else False, :param width: The width of the image :param height: The height of the image :param zoom: The current scale...
[ "Compare", "parameters", "for", "equality" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/mygaphas/utils/cache/image_cache.py#L128-L177
DLR-RM/RAFCON
source/rafcon/core/start.py
post_setup_plugins
def post_setup_plugins(parser_result): """Calls the post init hubs :param dict parser_result: Dictionary with the parsed arguments """ if not isinstance(parser_result, dict): parser_result = vars(parser_result) plugins.run_post_inits(parser_result)
python
def post_setup_plugins(parser_result): """Calls the post init hubs :param dict parser_result: Dictionary with the parsed arguments """ if not isinstance(parser_result, dict): parser_result = vars(parser_result) plugins.run_post_inits(parser_result)
[ "def", "post_setup_plugins", "(", "parser_result", ")", ":", "if", "not", "isinstance", "(", "parser_result", ",", "dict", ")", ":", "parser_result", "=", "vars", "(", "parser_result", ")", "plugins", ".", "run_post_inits", "(", "parser_result", ")" ]
Calls the post init hubs :param dict parser_result: Dictionary with the parsed arguments
[ "Calls", "the", "post", "init", "hubs" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/start.py#L59-L66
DLR-RM/RAFCON
source/rafcon/core/start.py
setup_environment
def setup_environment(): """Ensures that the environmental variable RAFCON_LIB_PATH is existent """ try: from gi.repository import GLib user_data_folder = GLib.get_user_data_dir() except ImportError: user_data_folder = join(os.path.expanduser("~"), ".local", "share") rafcon_r...
python
def setup_environment(): """Ensures that the environmental variable RAFCON_LIB_PATH is existent """ try: from gi.repository import GLib user_data_folder = GLib.get_user_data_dir() except ImportError: user_data_folder = join(os.path.expanduser("~"), ".local", "share") rafcon_r...
[ "def", "setup_environment", "(", ")", ":", "try", ":", "from", "gi", ".", "repository", "import", "GLib", "user_data_folder", "=", "GLib", ".", "get_user_data_dir", "(", ")", "except", "ImportError", ":", "user_data_folder", "=", "join", "(", "os", ".", "pat...
Ensures that the environmental variable RAFCON_LIB_PATH is existent
[ "Ensures", "that", "the", "environmental", "variable", "RAFCON_LIB_PATH", "is", "existent" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/start.py#L69-L95
DLR-RM/RAFCON
source/rafcon/core/start.py
parse_state_machine_path
def parse_state_machine_path(path): """Parser for argparse checking pfor a proper state machine path :param str path: Input path from the user :return: The path :raises argparse.ArgumentTypeError: if the path does not contain a statemachine.json file """ sm_root_file = join(path, storage.STATEM...
python
def parse_state_machine_path(path): """Parser for argparse checking pfor a proper state machine path :param str path: Input path from the user :return: The path :raises argparse.ArgumentTypeError: if the path does not contain a statemachine.json file """ sm_root_file = join(path, storage.STATEM...
[ "def", "parse_state_machine_path", "(", "path", ")", ":", "sm_root_file", "=", "join", "(", "path", ",", "storage", ".", "STATEMACHINE_FILE", ")", "if", "exists", "(", "sm_root_file", ")", ":", "return", "path", "else", ":", "sm_root_file", "=", "join", "(",...
Parser for argparse checking pfor a proper state machine path :param str path: Input path from the user :return: The path :raises argparse.ArgumentTypeError: if the path does not contain a statemachine.json file
[ "Parser", "for", "argparse", "checking", "pfor", "a", "proper", "state", "machine", "path" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/start.py#L98-L113
DLR-RM/RAFCON
source/rafcon/core/start.py
setup_argument_parser
def setup_argument_parser(): """Sets up teh parser with the required arguments :return: The parser object """ default_config_path = filesystem.get_default_config_path() filesystem.create_path(default_config_path) parser = core_singletons.argument_parser parser.add_argument('-o', '--open', ...
python
def setup_argument_parser(): """Sets up teh parser with the required arguments :return: The parser object """ default_config_path = filesystem.get_default_config_path() filesystem.create_path(default_config_path) parser = core_singletons.argument_parser parser.add_argument('-o', '--open', ...
[ "def", "setup_argument_parser", "(", ")", ":", "default_config_path", "=", "filesystem", ".", "get_default_config_path", "(", ")", "filesystem", ".", "create_path", "(", "default_config_path", ")", "parser", "=", "core_singletons", ".", "argument_parser", "parser", "....
Sets up teh parser with the required arguments :return: The parser object
[ "Sets", "up", "teh", "parser", "with", "the", "required", "arguments" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/start.py#L116-L137
DLR-RM/RAFCON
source/rafcon/core/start.py
setup_configuration
def setup_configuration(config_path): """Loads the core configuration from the specified path and uses its content for further setup :param config_path: Path to the core config file """ if config_path is not None: config_path, config_file = filesystem.separate_folder_path_and_file_name(config_p...
python
def setup_configuration(config_path): """Loads the core configuration from the specified path and uses its content for further setup :param config_path: Path to the core config file """ if config_path is not None: config_path, config_file = filesystem.separate_folder_path_and_file_name(config_p...
[ "def", "setup_configuration", "(", "config_path", ")", ":", "if", "config_path", "is", "not", "None", ":", "config_path", ",", "config_file", "=", "filesystem", ".", "separate_folder_path_and_file_name", "(", "config_path", ")", "global_config", ".", "load", "(", ...
Loads the core configuration from the specified path and uses its content for further setup :param config_path: Path to the core config file
[ "Loads", "the", "core", "configuration", "from", "the", "specified", "path", "and", "uses", "its", "content", "for", "further", "setup" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/start.py#L140-L152
DLR-RM/RAFCON
source/rafcon/core/start.py
open_state_machine
def open_state_machine(state_machine_path): """Executes the specified state machine :param str state_machine_path: The file path to the state machine :return StateMachine: The loaded state machine """ sm = storage.load_state_machine_from_path(state_machine_path) core_singletons.state_machine_ma...
python
def open_state_machine(state_machine_path): """Executes the specified state machine :param str state_machine_path: The file path to the state machine :return StateMachine: The loaded state machine """ sm = storage.load_state_machine_from_path(state_machine_path) core_singletons.state_machine_ma...
[ "def", "open_state_machine", "(", "state_machine_path", ")", ":", "sm", "=", "storage", ".", "load_state_machine_from_path", "(", "state_machine_path", ")", "core_singletons", ".", "state_machine_manager", ".", "add_state_machine", "(", "sm", ")", "return", "sm" ]
Executes the specified state machine :param str state_machine_path: The file path to the state machine :return StateMachine: The loaded state machine
[ "Executes", "the", "specified", "state", "machine" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/start.py#L155-L164
DLR-RM/RAFCON
source/rafcon/core/start.py
wait_for_state_machine_finished
def wait_for_state_machine_finished(state_machine): """ wait for a state machine to finish its execution :param state_machine: the statemachine to synchronize with :return: """ global _user_abort from rafcon.core.states.execution_state import ExecutionState if not isinstance(state_machine....
python
def wait_for_state_machine_finished(state_machine): """ wait for a state machine to finish its execution :param state_machine: the statemachine to synchronize with :return: """ global _user_abort from rafcon.core.states.execution_state import ExecutionState if not isinstance(state_machine....
[ "def", "wait_for_state_machine_finished", "(", "state_machine", ")", ":", "global", "_user_abort", "from", "rafcon", ".", "core", ".", "states", ".", "execution_state", "import", "ExecutionState", "if", "not", "isinstance", "(", "state_machine", ".", "root_state", "...
wait for a state machine to finish its execution :param state_machine: the statemachine to synchronize with :return:
[ "wait", "for", "a", "state", "machine", "to", "finish", "its", "execution" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/start.py#L175-L199
DLR-RM/RAFCON
source/rafcon/core/start.py
stop_reactor_on_state_machine_finish
def stop_reactor_on_state_machine_finish(state_machine): """ Wait for a state machine to be finished and stops the reactor :param state_machine: the state machine to synchronize with """ wait_for_state_machine_finished(state_machine) from twisted.internet import reactor if reactor.running: ...
python
def stop_reactor_on_state_machine_finish(state_machine): """ Wait for a state machine to be finished and stops the reactor :param state_machine: the state machine to synchronize with """ wait_for_state_machine_finished(state_machine) from twisted.internet import reactor if reactor.running: ...
[ "def", "stop_reactor_on_state_machine_finish", "(", "state_machine", ")", ":", "wait_for_state_machine_finished", "(", "state_machine", ")", "from", "twisted", ".", "internet", "import", "reactor", "if", "reactor", ".", "running", ":", "plugins", ".", "run_hook", "(",...
Wait for a state machine to be finished and stops the reactor :param state_machine: the state machine to synchronize with
[ "Wait", "for", "a", "state", "machine", "to", "be", "finished", "and", "stops", "the", "reactor" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/core/start.py#L202-L211
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.wait_until_ready
async def wait_until_ready( self, timeout: Optional[float] = None, no_raise: bool = False ) -> bool: """ Waits for the underlying node to become ready. If no_raise is set, returns false when a timeout occurs instead of propogating TimeoutError. A timeout of None means to wai...
python
async def wait_until_ready( self, timeout: Optional[float] = None, no_raise: bool = False ) -> bool: """ Waits for the underlying node to become ready. If no_raise is set, returns false when a timeout occurs instead of propogating TimeoutError. A timeout of None means to wai...
[ "async", "def", "wait_until_ready", "(", "self", ",", "timeout", ":", "Optional", "[", "float", "]", "=", "None", ",", "no_raise", ":", "bool", "=", "False", ")", "->", "bool", ":", "if", "self", ".", "node", ".", "ready", ".", "is_set", "(", ")", ...
Waits for the underlying node to become ready. If no_raise is set, returns false when a timeout occurs instead of propogating TimeoutError. A timeout of None means to wait indefinitely.
[ "Waits", "for", "the", "underlying", "node", "to", "become", "ready", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L94-L112
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.connect
async def connect(self): """ Connects to the voice channel associated with this Player. """ await self.node.join_voice_channel(self.channel.guild.id, self.channel.id)
python
async def connect(self): """ Connects to the voice channel associated with this Player. """ await self.node.join_voice_channel(self.channel.guild.id, self.channel.id)
[ "async", "def", "connect", "(", "self", ")", ":", "await", "self", ".", "node", ".", "join_voice_channel", "(", "self", ".", "channel", ".", "guild", ".", "id", ",", "self", ".", "channel", ".", "id", ")" ]
Connects to the voice channel associated with this Player.
[ "Connects", "to", "the", "voice", "channel", "associated", "with", "this", "Player", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L114-L118
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.move_to
async def move_to(self, channel: discord.VoiceChannel): """ Moves this player to a voice channel. Parameters ---------- channel : discord.VoiceChannel """ if channel.guild != self.channel.guild: raise TypeError("Cannot move to a different guild.") ...
python
async def move_to(self, channel: discord.VoiceChannel): """ Moves this player to a voice channel. Parameters ---------- channel : discord.VoiceChannel """ if channel.guild != self.channel.guild: raise TypeError("Cannot move to a different guild.") ...
[ "async", "def", "move_to", "(", "self", ",", "channel", ":", "discord", ".", "VoiceChannel", ")", ":", "if", "channel", ".", "guild", "!=", "self", ".", "channel", ".", "guild", ":", "raise", "TypeError", "(", "\"Cannot move to a different guild.\"", ")", "s...
Moves this player to a voice channel. Parameters ---------- channel : discord.VoiceChannel
[ "Moves", "this", "player", "to", "a", "voice", "channel", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L120-L132
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.disconnect
async def disconnect(self, requested=True): """ Disconnects this player from it's voice channel. """ if self.state == PlayerState.DISCONNECTING: return await self.update_state(PlayerState.DISCONNECTING) if not requested: log.debug( ...
python
async def disconnect(self, requested=True): """ Disconnects this player from it's voice channel. """ if self.state == PlayerState.DISCONNECTING: return await self.update_state(PlayerState.DISCONNECTING) if not requested: log.debug( ...
[ "async", "def", "disconnect", "(", "self", ",", "requested", "=", "True", ")", ":", "if", "self", ".", "state", "==", "PlayerState", ".", "DISCONNECTING", ":", "return", "await", "self", ".", "update_state", "(", "PlayerState", ".", "DISCONNECTING", ")", "...
Disconnects this player from it's voice channel.
[ "Disconnects", "this", "player", "from", "it", "s", "voice", "channel", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L134-L157
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.handle_event
async def handle_event(self, event: "node.LavalinkEvents", extra): """ Handles various Lavalink Events. If the event is TRACK END, extra will be TrackEndReason. If the event is TRACK EXCEPTION, extra will be the string reason. If the event is TRACK STUCK, extra will be the thr...
python
async def handle_event(self, event: "node.LavalinkEvents", extra): """ Handles various Lavalink Events. If the event is TRACK END, extra will be TrackEndReason. If the event is TRACK EXCEPTION, extra will be the string reason. If the event is TRACK STUCK, extra will be the thr...
[ "async", "def", "handle_event", "(", "self", ",", "event", ":", "\"node.LavalinkEvents\"", ",", "extra", ")", ":", "if", "event", "==", "LavalinkEvents", ".", "TRACK_END", ":", "if", "extra", "==", "TrackEndReason", ".", "FINISHED", ":", "await", "self", "."...
Handles various Lavalink Events. If the event is TRACK END, extra will be TrackEndReason. If the event is TRACK EXCEPTION, extra will be the string reason. If the event is TRACK STUCK, extra will be the threshold ms. Parameters ---------- event : node.LavalinkEvents ...
[ "Handles", "various", "Lavalink", "Events", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L193-L212
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.handle_player_update
async def handle_player_update(self, state: "node.PlayerState"): """ Handles player updates from lavalink. Parameters ---------- state : websocket.PlayerState """ if state.position > self.position: self._is_playing = True self.position = state...
python
async def handle_player_update(self, state: "node.PlayerState"): """ Handles player updates from lavalink. Parameters ---------- state : websocket.PlayerState """ if state.position > self.position: self._is_playing = True self.position = state...
[ "async", "def", "handle_player_update", "(", "self", ",", "state", ":", "\"node.PlayerState\"", ")", ":", "if", "state", ".", "position", ">", "self", ".", "position", ":", "self", ".", "_is_playing", "=", "True", "self", ".", "position", "=", "state", "."...
Handles player updates from lavalink. Parameters ---------- state : websocket.PlayerState
[ "Handles", "player", "updates", "from", "lavalink", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L214-L224
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.add
def add(self, requester: discord.User, track: Track): """ Adds a track to the queue. Parameters ---------- requester : discord.User User who requested the track. track : Track Result from any of the lavalink track search methods. """ ...
python
def add(self, requester: discord.User, track: Track): """ Adds a track to the queue. Parameters ---------- requester : discord.User User who requested the track. track : Track Result from any of the lavalink track search methods. """ ...
[ "def", "add", "(", "self", ",", "requester", ":", "discord", ".", "User", ",", "track", ":", "Track", ")", ":", "track", ".", "requester", "=", "requester", "self", ".", "queue", ".", "append", "(", "track", ")" ]
Adds a track to the queue. Parameters ---------- requester : discord.User User who requested the track. track : Track Result from any of the lavalink track search methods.
[ "Adds", "a", "track", "to", "the", "queue", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L227-L239
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.play
async def play(self): """ Starts playback from lavalink. """ if self.repeat and self.current is not None: self.queue.append(self.current) self.current = None self.position = 0 self._paused = False if not self.queue: await self.sto...
python
async def play(self): """ Starts playback from lavalink. """ if self.repeat and self.current is not None: self.queue.append(self.current) self.current = None self.position = 0 self._paused = False if not self.queue: await self.sto...
[ "async", "def", "play", "(", "self", ")", ":", "if", "self", ".", "repeat", "and", "self", ".", "current", "is", "not", "None", ":", "self", ".", "queue", ".", "append", "(", "self", ".", "current", ")", "self", ".", "current", "=", "None", "self",...
Starts playback from lavalink.
[ "Starts", "playback", "from", "lavalink", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L241-L263
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.stop
async def stop(self): """ Stops playback from lavalink. .. important:: This method will clear the queue. """ await self.node.stop(self.channel.guild.id) self.queue = [] self.current = None self.position = 0 self._paused = False
python
async def stop(self): """ Stops playback from lavalink. .. important:: This method will clear the queue. """ await self.node.stop(self.channel.guild.id) self.queue = [] self.current = None self.position = 0 self._paused = False
[ "async", "def", "stop", "(", "self", ")", ":", "await", "self", ".", "node", ".", "stop", "(", "self", ".", "channel", ".", "guild", ".", "id", ")", "self", ".", "queue", "=", "[", "]", "self", ".", "current", "=", "None", "self", ".", "position"...
Stops playback from lavalink. .. important:: This method will clear the queue.
[ "Stops", "playback", "from", "lavalink", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L265-L277
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.pause
async def pause(self, pause: bool = True): """ Pauses the current song. Parameters ---------- pause : bool Set to ``False`` to resume. """ self._paused = pause await self.node.pause(self.channel.guild.id, pause)
python
async def pause(self, pause: bool = True): """ Pauses the current song. Parameters ---------- pause : bool Set to ``False`` to resume. """ self._paused = pause await self.node.pause(self.channel.guild.id, pause)
[ "async", "def", "pause", "(", "self", ",", "pause", ":", "bool", "=", "True", ")", ":", "self", ".", "_paused", "=", "pause", "await", "self", ".", "node", ".", "pause", "(", "self", ".", "channel", ".", "guild", ".", "id", ",", "pause", ")" ]
Pauses the current song. Parameters ---------- pause : bool Set to ``False`` to resume.
[ "Pauses", "the", "current", "song", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L285-L295
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.set_volume
async def set_volume(self, volume: int): """ Sets the volume of Lavalink. Parameters ---------- volume : int Between 0 and 150 """ self._volume = max(min(volume, 150), 0) await self.node.volume(self.channel.guild.id, self.volume)
python
async def set_volume(self, volume: int): """ Sets the volume of Lavalink. Parameters ---------- volume : int Between 0 and 150 """ self._volume = max(min(volume, 150), 0) await self.node.volume(self.channel.guild.id, self.volume)
[ "async", "def", "set_volume", "(", "self", ",", "volume", ":", "int", ")", ":", "self", ".", "_volume", "=", "max", "(", "min", "(", "volume", ",", "150", ")", ",", "0", ")", "await", "self", ".", "node", ".", "volume", "(", "self", ".", "channel...
Sets the volume of Lavalink. Parameters ---------- volume : int Between 0 and 150
[ "Sets", "the", "volume", "of", "Lavalink", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L297-L307
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
Player.seek
async def seek(self, position: int): """ If the track allows it, seeks to a position. Parameters ---------- position : int Between 0 and track length. """ if self.current.seekable: position = max(min(position, self.current.length), 0) ...
python
async def seek(self, position: int): """ If the track allows it, seeks to a position. Parameters ---------- position : int Between 0 and track length. """ if self.current.seekable: position = max(min(position, self.current.length), 0) ...
[ "async", "def", "seek", "(", "self", ",", "position", ":", "int", ")", ":", "if", "self", ".", "current", ".", "seekable", ":", "position", "=", "max", "(", "min", "(", "position", ",", "self", ".", "current", ".", "length", ")", ",", "0", ")", "...
If the track allows it, seeks to a position. Parameters ---------- position : int Between 0 and track length.
[ "If", "the", "track", "allows", "it", "seeks", "to", "a", "position", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L309-L320
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
PlayerManager.create_player
async def create_player(self, channel: discord.VoiceChannel) -> Player: """ Connects to a discord voice channel. This function is safe to repeatedly call as it will return an existing player if there is one. Parameters ---------- channel Returns ...
python
async def create_player(self, channel: discord.VoiceChannel) -> Player: """ Connects to a discord voice channel. This function is safe to repeatedly call as it will return an existing player if there is one. Parameters ---------- channel Returns ...
[ "async", "def", "create_player", "(", "self", ",", "channel", ":", "discord", ".", "VoiceChannel", ")", "->", "Player", ":", "if", "self", ".", "_already_in_guild", "(", "channel", ")", ":", "p", "=", "self", ".", "get_player", "(", "channel", ".", "guil...
Connects to a discord voice channel. This function is safe to repeatedly call as it will return an existing player if there is one. Parameters ---------- channel Returns ------- Player The created Player object.
[ "Connects", "to", "a", "discord", "voice", "channel", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L339-L363
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
PlayerManager.get_player
def get_player(self, guild_id: int) -> Player: """ Gets a Player object from a guild ID. Parameters ---------- guild_id : int Discord guild ID. Returns ------- Player Raises ------ KeyError If that guild d...
python
def get_player(self, guild_id: int) -> Player: """ Gets a Player object from a guild ID. Parameters ---------- guild_id : int Discord guild ID. Returns ------- Player Raises ------ KeyError If that guild d...
[ "def", "get_player", "(", "self", ",", "guild_id", ":", "int", ")", "->", "Player", ":", "if", "guild_id", "in", "self", ".", "_player_dict", ":", "return", "self", ".", "_player_dict", "[", "guild_id", "]", "raise", "KeyError", "(", "\"No such player for th...
Gets a Player object from a guild ID. Parameters ---------- guild_id : int Discord guild ID. Returns ------- Player Raises ------ KeyError If that guild does not have a Player, e.g. is not connected to any voi...
[ "Gets", "a", "Player", "object", "from", "a", "guild", "ID", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L368-L389
Cog-Creators/Red-Lavalink
lavalink/player_manager.py
PlayerManager.disconnect
async def disconnect(self): """ Disconnects all players. """ for p in tuple(self.players): await p.disconnect(requested=False) log.debug("Disconnected players.")
python
async def disconnect(self): """ Disconnects all players. """ for p in tuple(self.players): await p.disconnect(requested=False) log.debug("Disconnected players.")
[ "async", "def", "disconnect", "(", "self", ")", ":", "for", "p", "in", "tuple", "(", "self", ".", "players", ")", ":", "await", "p", ".", "disconnect", "(", "requested", "=", "False", ")", "log", ".", "debug", "(", "\"Disconnected players.\"", ")" ]
Disconnects all players.
[ "Disconnects", "all", "players", "." ]
train
https://github.com/Cog-Creators/Red-Lavalink/blob/5b3fc6eb31ee5db8bd2b633a523cf69749957111/lavalink/player_manager.py#L475-L481
DLR-RM/RAFCON
source/rafcon/utils/resources.py
resource_filename
def resource_filename(package_or_requirement, resource_name): """ Similar to pkg_resources.resource_filename but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resid...
python
def resource_filename(package_or_requirement, resource_name): """ Similar to pkg_resources.resource_filename but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resid...
[ "def", "resource_filename", "(", "package_or_requirement", ",", "resource_name", ")", ":", "if", "pkg_resources", ".", "resource_exists", "(", "package_or_requirement", ",", "resource_name", ")", ":", "return", "pkg_resources", ".", "resource_filename", "(", "package_or...
Similar to pkg_resources.resource_filename but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides :param resource_name: the name of the resource :return: the pat...
[ "Similar", "to", "pkg_resources", ".", "resource_filename", "but", "if", "the", "resource", "it", "not", "found", "via", "pkg_resources", "it", "also", "looks", "in", "a", "predefined", "list", "of", "paths", "in", "order", "to", "find", "the", "resource" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/resources.py#L39-L57
DLR-RM/RAFCON
source/rafcon/utils/resources.py
resource_exists
def resource_exists(package_or_requirement, resource_name): """ Similar to pkg_resources.resource_exists but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides ...
python
def resource_exists(package_or_requirement, resource_name): """ Similar to pkg_resources.resource_exists but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides ...
[ "def", "resource_exists", "(", "package_or_requirement", ",", "resource_name", ")", ":", "if", "pkg_resources", ".", "resource_exists", "(", "package_or_requirement", ",", "resource_name", ")", ":", "return", "True", "path", "=", "_search_in_share_folders", "(", "pack...
Similar to pkg_resources.resource_exists but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides :param resource_name: the name of the resource :return: a flag if...
[ "Similar", "to", "pkg_resources", ".", "resource_exists", "but", "if", "the", "resource", "it", "not", "found", "via", "pkg_resources", "it", "also", "looks", "in", "a", "predefined", "list", "of", "paths", "in", "order", "to", "find", "the", "resource" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/resources.py#L60-L75
DLR-RM/RAFCON
source/rafcon/utils/resources.py
resource_string
def resource_string(package_or_requirement, resource_name): """ Similar to pkg_resources.resource_string but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides ...
python
def resource_string(package_or_requirement, resource_name): """ Similar to pkg_resources.resource_string but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides ...
[ "def", "resource_string", "(", "package_or_requirement", ",", "resource_name", ")", ":", "with", "open", "(", "resource_filename", "(", "package_or_requirement", ",", "resource_name", ")", ",", "'r'", ")", "as", "resource_file", ":", "return", "resource_file", ".", ...
Similar to pkg_resources.resource_string but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides :param resource_name: the name of the resource :return: the file ...
[ "Similar", "to", "pkg_resources", ".", "resource_string", "but", "if", "the", "resource", "it", "not", "found", "via", "pkg_resources", "it", "also", "looks", "in", "a", "predefined", "list", "of", "paths", "in", "order", "to", "find", "the", "resource" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/resources.py#L78-L89
DLR-RM/RAFCON
source/rafcon/utils/resources.py
resource_listdir
def resource_listdir(package_or_requirement, relative_path): """ Similar to pkg_resources.resource_listdir but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides...
python
def resource_listdir(package_or_requirement, relative_path): """ Similar to pkg_resources.resource_listdir but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides...
[ "def", "resource_listdir", "(", "package_or_requirement", ",", "relative_path", ")", ":", "path", "=", "resource_filename", "(", "package_or_requirement", ",", "relative_path", ")", "only_files", "=", "[", "f", "for", "f", "in", "listdir", "(", "path", ")", "if"...
Similar to pkg_resources.resource_listdir but if the resource it not found via pkg_resources it also looks in a predefined list of paths in order to find the resource :param package_or_requirement: the module in which the resource resides :param relative_path: the relative path to the resource :return:...
[ "Similar", "to", "pkg_resources", ".", "resource_listdir", "but", "if", "the", "resource", "it", "not", "found", "via", "pkg_resources", "it", "also", "looks", "in", "a", "predefined", "list", "of", "paths", "in", "order", "to", "find", "the", "resource" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/resources.py#L92-L104
DLR-RM/RAFCON
source/rafcon/utils/plugins.py
load_plugins
def load_plugins(): """Loads all plugins specified in the RAFCON_PLUGIN_PATH environment variable """ plugins = os.environ.get('RAFCON_PLUGIN_PATH', '') plugin_list = set(plugins.split(os.pathsep)) global plugin_dict for plugin_path in plugin_list: if not plugin_path: continu...
python
def load_plugins(): """Loads all plugins specified in the RAFCON_PLUGIN_PATH environment variable """ plugins = os.environ.get('RAFCON_PLUGIN_PATH', '') plugin_list = set(plugins.split(os.pathsep)) global plugin_dict for plugin_path in plugin_list: if not plugin_path: continu...
[ "def", "load_plugins", "(", ")", ":", "plugins", "=", "os", ".", "environ", ".", "get", "(", "'RAFCON_PLUGIN_PATH'", ",", "''", ")", "plugin_list", "=", "set", "(", "plugins", ".", "split", "(", "os", ".", "pathsep", ")", ")", "global", "plugin_dict", ...
Loads all plugins specified in the RAFCON_PLUGIN_PATH environment variable
[ "Loads", "all", "plugins", "specified", "in", "the", "RAFCON_PLUGIN_PATH", "environment", "variable" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/plugins.py#L34-L58
DLR-RM/RAFCON
source/rafcon/utils/plugins.py
run_hook
def run_hook(hook_name, *args, **kwargs): """Runs the passed hook on all registered plugins The function checks, whether the hook is available in the plugin. :param hook_name: Name of the hook, corresponds to the function name being called :param args: Arguments :param kwargs: Keyword arguments ...
python
def run_hook(hook_name, *args, **kwargs): """Runs the passed hook on all registered plugins The function checks, whether the hook is available in the plugin. :param hook_name: Name of the hook, corresponds to the function name being called :param args: Arguments :param kwargs: Keyword arguments ...
[ "def", "run_hook", "(", "hook_name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "for", "module", "in", "plugin_dict", ".", "values", "(", ")", ":", "if", "hasattr", "(", "module", ",", "\"hooks\"", ")", "and", "callable", "(", "getattr", "(...
Runs the passed hook on all registered plugins The function checks, whether the hook is available in the plugin. :param hook_name: Name of the hook, corresponds to the function name being called :param args: Arguments :param kwargs: Keyword arguments
[ "Runs", "the", "passed", "hook", "on", "all", "registered", "plugins" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/utils/plugins.py#L61-L72
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
get_state_model_class_for_state
def get_state_model_class_for_state(state): """Determines the model required for the given state class :param state: Instance of a state (ExecutionState, BarrierConcurrencyState, ...) :return: The model class required for holding such a state instance """ from rafcon.gui.models.state import StateMo...
python
def get_state_model_class_for_state(state): """Determines the model required for the given state class :param state: Instance of a state (ExecutionState, BarrierConcurrencyState, ...) :return: The model class required for holding such a state instance """ from rafcon.gui.models.state import StateMo...
[ "def", "get_state_model_class_for_state", "(", "state", ")", ":", "from", "rafcon", ".", "gui", ".", "models", ".", "state", "import", "StateModel", "from", "rafcon", ".", "gui", ".", "models", ".", "container_state", "import", "ContainerStateModel", "from", "ra...
Determines the model required for the given state class :param state: Instance of a state (ExecutionState, BarrierConcurrencyState, ...) :return: The model class required for holding such a state instance
[ "Determines", "the", "model", "required", "for", "the", "given", "state", "class" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L48-L65
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.update_is_start
def update_is_start(self): """Updates the `is_start` property of the state A state is a start state, if it is the root state, it has no parent, the parent is a LibraryState or the state's state_id is identical with the ContainerState.start_state_id of the ContainerState it is within. ...
python
def update_is_start(self): """Updates the `is_start` property of the state A state is a start state, if it is the root state, it has no parent, the parent is a LibraryState or the state's state_id is identical with the ContainerState.start_state_id of the ContainerState it is within. ...
[ "def", "update_is_start", "(", "self", ")", ":", "self", ".", "is_start", "=", "self", ".", "state", ".", "is_root_state", "or", "self", ".", "parent", "is", "None", "or", "isinstance", "(", "self", ".", "parent", ".", "state", ",", "LibraryState", ")", ...
Updates the `is_start` property of the state A state is a start state, if it is the root state, it has no parent, the parent is a LibraryState or the state's state_id is identical with the ContainerState.start_state_id of the ContainerState it is within.
[ "Updates", "the", "is_start", "property", "of", "the", "state", "A", "state", "is", "a", "start", "state", "if", "it", "is", "the", "root", "state", "it", "has", "no", "parent", "the", "parent", "is", "a", "LibraryState", "or", "the", "state", "s", "st...
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L185-L194
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.prepare_destruction
def prepare_destruction(self, recursive=True): """Prepares the model for destruction Recursively un-registers all observers and removes references to child models """ if self.state is None: logger.verbose("Multiple calls of prepare destruction for {0}".format(self)) ...
python
def prepare_destruction(self, recursive=True): """Prepares the model for destruction Recursively un-registers all observers and removes references to child models """ if self.state is None: logger.verbose("Multiple calls of prepare destruction for {0}".format(self)) ...
[ "def", "prepare_destruction", "(", "self", ",", "recursive", "=", "True", ")", ":", "if", "self", ".", "state", "is", "None", ":", "logger", ".", "verbose", "(", "\"Multiple calls of prepare destruction for {0}\"", ".", "format", "(", "self", ")", ")", "self",...
Prepares the model for destruction Recursively un-registers all observers and removes references to child models
[ "Prepares", "the", "model", "for", "destruction" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L205-L236
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.get_state_machine_m
def get_state_machine_m(self, two_factor_check=True): """ Get respective state machine model Get a reference of the state machine model the state model belongs to. As long as the root state model has no direct reference to its state machine model the state machine manager model is checked respe...
python
def get_state_machine_m(self, two_factor_check=True): """ Get respective state machine model Get a reference of the state machine model the state model belongs to. As long as the root state model has no direct reference to its state machine model the state machine manager model is checked respe...
[ "def", "get_state_machine_m", "(", "self", ",", "two_factor_check", "=", "True", ")", ":", "from", "rafcon", ".", "gui", ".", "singleton", "import", "state_machine_manager_model", "state_machine", "=", "self", ".", "state", ".", "get_state_machine", "(", ")", "i...
Get respective state machine model Get a reference of the state machine model the state model belongs to. As long as the root state model has no direct reference to its state machine model the state machine manager model is checked respective model. :rtype: rafcon.gui.models.state_machine.Stat...
[ "Get", "respective", "state", "machine", "model" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L274-L294
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.get_input_data_port_m
def get_input_data_port_m(self, data_port_id): """Returns the input data port model for the given data port id :param data_port_id: The data port id to search for :return: The model of the data port with the given id """ for data_port_m in self.input_data_ports: if d...
python
def get_input_data_port_m(self, data_port_id): """Returns the input data port model for the given data port id :param data_port_id: The data port id to search for :return: The model of the data port with the given id """ for data_port_m in self.input_data_ports: if d...
[ "def", "get_input_data_port_m", "(", "self", ",", "data_port_id", ")", ":", "for", "data_port_m", "in", "self", ".", "input_data_ports", ":", "if", "data_port_m", ".", "data_port", ".", "data_port_id", "==", "data_port_id", ":", "return", "data_port_m", "return", ...
Returns the input data port model for the given data port id :param data_port_id: The data port id to search for :return: The model of the data port with the given id
[ "Returns", "the", "input", "data", "port", "model", "for", "the", "given", "data", "port", "id" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L296-L305
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.get_output_data_port_m
def get_output_data_port_m(self, data_port_id): """Returns the output data port model for the given data port id :param data_port_id: The data port id to search for :return: The model of the data port with the given id """ for data_port_m in self.output_data_ports: i...
python
def get_output_data_port_m(self, data_port_id): """Returns the output data port model for the given data port id :param data_port_id: The data port id to search for :return: The model of the data port with the given id """ for data_port_m in self.output_data_ports: i...
[ "def", "get_output_data_port_m", "(", "self", ",", "data_port_id", ")", ":", "for", "data_port_m", "in", "self", ".", "output_data_ports", ":", "if", "data_port_m", ".", "data_port", ".", "data_port_id", "==", "data_port_id", ":", "return", "data_port_m", "return"...
Returns the output data port model for the given data port id :param data_port_id: The data port id to search for :return: The model of the data port with the given id
[ "Returns", "the", "output", "data", "port", "model", "for", "the", "given", "data", "port", "id" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L307-L316
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.get_data_port_m
def get_data_port_m(self, data_port_id): """Searches and returns the model of a data port of a given state The method searches a port with the given id in the data ports of the given state model. If the state model is a container state, not only the input and output data ports are looked at, bu...
python
def get_data_port_m(self, data_port_id): """Searches and returns the model of a data port of a given state The method searches a port with the given id in the data ports of the given state model. If the state model is a container state, not only the input and output data ports are looked at, bu...
[ "def", "get_data_port_m", "(", "self", ",", "data_port_id", ")", ":", "from", "itertools", "import", "chain", "data_ports_m", "=", "chain", "(", "self", ".", "input_data_ports", ",", "self", ".", "output_data_ports", ")", "for", "data_port_m", "in", "data_ports_...
Searches and returns the model of a data port of a given state The method searches a port with the given id in the data ports of the given state model. If the state model is a container state, not only the input and output data ports are looked at, but also the scoped variables. :param data_po...
[ "Searches", "and", "returns", "the", "model", "of", "a", "data", "port", "of", "a", "given", "state" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L318-L332
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.get_outcome_m
def get_outcome_m(self, outcome_id): """Returns the outcome model for the given outcome id :param outcome_id: The outcome id to search for :return: The model of the outcome with the given id """ for outcome_m in self.outcomes: if outcome_m.outcome.outcome_id == outco...
python
def get_outcome_m(self, outcome_id): """Returns the outcome model for the given outcome id :param outcome_id: The outcome id to search for :return: The model of the outcome with the given id """ for outcome_m in self.outcomes: if outcome_m.outcome.outcome_id == outco...
[ "def", "get_outcome_m", "(", "self", ",", "outcome_id", ")", ":", "for", "outcome_m", "in", "self", ".", "outcomes", ":", "if", "outcome_m", ".", "outcome", ".", "outcome_id", "==", "outcome_id", ":", "return", "outcome_m", "return", "False" ]
Returns the outcome model for the given outcome id :param outcome_id: The outcome id to search for :return: The model of the outcome with the given id
[ "Returns", "the", "outcome", "model", "for", "the", "given", "outcome", "id" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L334-L343
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.action_signal_triggered
def action_signal_triggered(self, model, prop_name, info): """This method notifies the parent state and child state models about complex actions """ msg = info.arg # print("action_signal_triggered state: ", self.state.state_id, model, prop_name, info) if msg.action.startswith('sm...
python
def action_signal_triggered(self, model, prop_name, info): """This method notifies the parent state and child state models about complex actions """ msg = info.arg # print("action_signal_triggered state: ", self.state.state_id, model, prop_name, info) if msg.action.startswith('sm...
[ "def", "action_signal_triggered", "(", "self", ",", "model", ",", "prop_name", ",", "info", ")", ":", "msg", "=", "info", ".", "arg", "# print(\"action_signal_triggered state: \", self.state.state_id, model, prop_name, info)", "if", "msg", ".", "action", ".", "startswit...
This method notifies the parent state and child state models about complex actions
[ "This", "method", "notifies", "the", "parent", "state", "and", "child", "state", "models", "about", "complex", "actions" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L376-L421
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.meta_changed
def meta_changed(self, model, prop_name, info): """This method notifies the parent state about changes made to the meta data """ msg = info.arg # print("meta_changed state: ", model, prop_name, info) if msg.notification is None: # Meta data of this state was changed, ...
python
def meta_changed(self, model, prop_name, info): """This method notifies the parent state about changes made to the meta data """ msg = info.arg # print("meta_changed state: ", model, prop_name, info) if msg.notification is None: # Meta data of this state was changed, ...
[ "def", "meta_changed", "(", "self", ",", "model", ",", "prop_name", ",", "info", ")", ":", "msg", "=", "info", ".", "arg", "# print(\"meta_changed state: \", model, prop_name, info)", "if", "msg", ".", "notification", "is", "None", ":", "# Meta data of this state wa...
This method notifies the parent state about changes made to the meta data
[ "This", "method", "notifies", "the", "parent", "state", "about", "changes", "made", "to", "the", "meta", "data" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L424-L449
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.load_meta_data
def load_meta_data(self, path=None): """Load meta data of state model from the file system The meta data of the state model is loaded from the file system and stored in the meta property of the model. Existing meta data is removed. Also the meta data of all state elements (data ports, outcomes,...
python
def load_meta_data(self, path=None): """Load meta data of state model from the file system The meta data of the state model is loaded from the file system and stored in the meta property of the model. Existing meta data is removed. Also the meta data of all state elements (data ports, outcomes,...
[ "def", "load_meta_data", "(", "self", ",", "path", "=", "None", ")", ":", "# TODO: for an Execution state this method is called for each hierarchy level again and again, still?? check it!", "# print(\"1AbstractState_load_meta_data: \", path, not path)", "if", "not", "path", ":", "pat...
Load meta data of state model from the file system The meta data of the state model is loaded from the file system and stored in the meta property of the model. Existing meta data is removed. Also the meta data of all state elements (data ports, outcomes, etc) are loaded, as those stored in the...
[ "Load", "meta", "data", "of", "state", "model", "from", "the", "file", "system" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L466-L522
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.store_meta_data
def store_meta_data(self, copy_path=None): """Save meta data of state model to the file system This method generates a dictionary of the meta data of the state together with the meta data of all state elements (data ports, outcomes, etc.) and stores it on the filesystem. Secure that the...
python
def store_meta_data(self, copy_path=None): """Save meta data of state model to the file system This method generates a dictionary of the meta data of the state together with the meta data of all state elements (data ports, outcomes, etc.) and stores it on the filesystem. Secure that the...
[ "def", "store_meta_data", "(", "self", ",", "copy_path", "=", "None", ")", ":", "if", "copy_path", ":", "meta_file_path_json", "=", "os", ".", "path", ".", "join", "(", "copy_path", ",", "self", ".", "state", ".", "get_storage_path", "(", ")", ",", "stor...
Save meta data of state model to the file system This method generates a dictionary of the meta data of the state together with the meta data of all state elements (data ports, outcomes, etc.) and stores it on the filesystem. Secure that the store meta data method is called after storing the co...
[ "Save", "meta", "data", "of", "state", "model", "to", "the", "file", "system" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L524-L548
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel.copy_meta_data_from_state_m
def copy_meta_data_from_state_m(self, source_state_m): """Dismiss current meta data and copy meta data from given state model The meta data of the given state model is used as meta data for this state. Also the meta data of all state elements (data ports, outcomes, etc.) is overwritten with the...
python
def copy_meta_data_from_state_m(self, source_state_m): """Dismiss current meta data and copy meta data from given state model The meta data of the given state model is used as meta data for this state. Also the meta data of all state elements (data ports, outcomes, etc.) is overwritten with the...
[ "def", "copy_meta_data_from_state_m", "(", "self", ",", "source_state_m", ")", ":", "self", ".", "meta", "=", "deepcopy", "(", "source_state_m", ".", "meta", ")", "for", "input_data_port_m", "in", "self", ".", "input_data_ports", ":", "source_data_port_m", "=", ...
Dismiss current meta data and copy meta data from given state model The meta data of the given state model is used as meta data for this state. Also the meta data of all state elements (data ports, outcomes, etc.) is overwritten with the meta data of the elements of the given state. :param sou...
[ "Dismiss", "current", "meta", "data", "and", "copy", "meta", "data", "from", "given", "state", "model" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L550-L572
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel._parse_for_element_meta_data
def _parse_for_element_meta_data(self, meta_data): """Load meta data for state elements The meta data of the state meta data file also contains the meta data for state elements (data ports, outcomes, etc). This method parses the loaded meta data for each state element model. The meta data of th...
python
def _parse_for_element_meta_data(self, meta_data): """Load meta data for state elements The meta data of the state meta data file also contains the meta data for state elements (data ports, outcomes, etc). This method parses the loaded meta data for each state element model. The meta data of th...
[ "def", "_parse_for_element_meta_data", "(", "self", ",", "meta_data", ")", ":", "# print(\"_parse meta data\", meta_data)", "for", "data_port_m", "in", "self", ".", "input_data_ports", ":", "self", ".", "_copy_element_meta_data_from_meta_file_data", "(", "meta_data", ",", ...
Load meta data for state elements The meta data of the state meta data file also contains the meta data for state elements (data ports, outcomes, etc). This method parses the loaded meta data for each state element model. The meta data of the elements is removed from the passed dictionary. ...
[ "Load", "meta", "data", "for", "state", "elements" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L574-L601
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel._copy_element_meta_data_from_meta_file_data
def _copy_element_meta_data_from_meta_file_data(meta_data, element_m, element_name, element_id): """Helper method to assign the meta of the given element The method assigns the meta data of the elements from the given meta data dictionary. The copied meta data is then removed from the dictionar...
python
def _copy_element_meta_data_from_meta_file_data(meta_data, element_m, element_name, element_id): """Helper method to assign the meta of the given element The method assigns the meta data of the elements from the given meta data dictionary. The copied meta data is then removed from the dictionar...
[ "def", "_copy_element_meta_data_from_meta_file_data", "(", "meta_data", ",", "element_m", ",", "element_name", ",", "element_id", ")", ":", "meta_data_element_id", "=", "element_name", "+", "str", "(", "element_id", ")", "meta_data_element", "=", "meta_data", "[", "me...
Helper method to assign the meta of the given element The method assigns the meta data of the elements from the given meta data dictionary. The copied meta data is then removed from the dictionary. :param meta_data: The loaded meta data :param element_m: The element model that is suppo...
[ "Helper", "method", "to", "assign", "the", "meta", "of", "the", "given", "element" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L604-L619
DLR-RM/RAFCON
source/rafcon/gui/models/abstract_state.py
AbstractStateModel._generate_element_meta_data
def _generate_element_meta_data(self, meta_data): """Generate meta data for state elements and add it to the given dictionary This method retrieves the meta data of the state elements (data ports, outcomes, etc) and adds it to the given meta data dictionary. :param meta_data: Dictionar...
python
def _generate_element_meta_data(self, meta_data): """Generate meta data for state elements and add it to the given dictionary This method retrieves the meta data of the state elements (data ports, outcomes, etc) and adds it to the given meta data dictionary. :param meta_data: Dictionar...
[ "def", "_generate_element_meta_data", "(", "self", ",", "meta_data", ")", ":", "for", "data_port_m", "in", "self", ".", "input_data_ports", ":", "self", ".", "_copy_element_meta_data_to_meta_file_data", "(", "meta_data", ",", "data_port_m", ",", "\"input_data_port\"", ...
Generate meta data for state elements and add it to the given dictionary This method retrieves the meta data of the state elements (data ports, outcomes, etc) and adds it to the given meta data dictionary. :param meta_data: Dictionary of meta data
[ "Generate", "meta", "data", "for", "state", "elements", "and", "add", "it", "to", "the", "given", "dictionary" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/models/abstract_state.py#L621-L639
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_editor/source_editor.py
SourceEditorController.save_file_data
def save_file_data(self, path): """ Implements the abstract method of the ExternalEditor class. """ sm = self.model.state.get_state_machine() if sm.marked_dirty and not self.saved_initial: try: # Save the file before opening it to update the applied changes. U...
python
def save_file_data(self, path): """ Implements the abstract method of the ExternalEditor class. """ sm = self.model.state.get_state_machine() if sm.marked_dirty and not self.saved_initial: try: # Save the file before opening it to update the applied changes. U...
[ "def", "save_file_data", "(", "self", ",", "path", ")", ":", "sm", "=", "self", ".", "model", ".", "state", ".", "get_state_machine", "(", ")", "if", "sm", ".", "marked_dirty", "and", "not", "self", ".", "saved_initial", ":", "try", ":", "# Save the file...
Implements the abstract method of the ExternalEditor class.
[ "Implements", "the", "abstract", "method", "of", "the", "ExternalEditor", "class", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/source_editor.py#L112-L127
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_editor/source_editor.py
SourceEditorController.load_and_set_file_content
def load_and_set_file_content(self, file_system_path): """ Implements the abstract method of the ExternalEditor class. """ content = filesystem.read_file(file_system_path, storage.SCRIPT_FILE) if content is not None: self.set_script_text(content)
python
def load_and_set_file_content(self, file_system_path): """ Implements the abstract method of the ExternalEditor class. """ content = filesystem.read_file(file_system_path, storage.SCRIPT_FILE) if content is not None: self.set_script_text(content)
[ "def", "load_and_set_file_content", "(", "self", ",", "file_system_path", ")", ":", "content", "=", "filesystem", ".", "read_file", "(", "file_system_path", ",", "storage", ".", "SCRIPT_FILE", ")", "if", "content", "is", "not", "None", ":", "self", ".", "set_s...
Implements the abstract method of the ExternalEditor class.
[ "Implements", "the", "abstract", "method", "of", "the", "ExternalEditor", "class", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/source_editor.py#L134-L139
DLR-RM/RAFCON
source/rafcon/gui/controllers/state_editor/source_editor.py
SourceEditorController.apply_clicked
def apply_clicked(self, button): """Triggered when the Apply button in the source editor is clicked. """ if isinstance(self.model.state, LibraryState): logger.warning("It is not allowed to modify libraries.") self.view.set_text("") return # Ugly work...
python
def apply_clicked(self, button): """Triggered when the Apply button in the source editor is clicked. """ if isinstance(self.model.state, LibraryState): logger.warning("It is not allowed to modify libraries.") self.view.set_text("") return # Ugly work...
[ "def", "apply_clicked", "(", "self", ",", "button", ")", ":", "if", "isinstance", "(", "self", ".", "model", ".", "state", ",", "LibraryState", ")", ":", "logger", ".", "warning", "(", "\"It is not allowed to modify libraries.\"", ")", "self", ".", "view", "...
Triggered when the Apply button in the source editor is clicked.
[ "Triggered", "when", "the", "Apply", "button", "in", "the", "source", "editor", "is", "clicked", "." ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/controllers/state_editor/source_editor.py#L143-L217
DLR-RM/RAFCON
source/rafcon/gui/views/logging_console.py
LoggingConsoleView.split_text
def split_text(text_to_split): """Split text Splits the debug text into its different parts: 'Time', 'LogLevel + Module Name', 'Debug message' :param text_to_split: Text to split :return: List containing the content of text_to_split split up """ assert isinstance(text_t...
python
def split_text(text_to_split): """Split text Splits the debug text into its different parts: 'Time', 'LogLevel + Module Name', 'Debug message' :param text_to_split: Text to split :return: List containing the content of text_to_split split up """ assert isinstance(text_t...
[ "def", "split_text", "(", "text_to_split", ")", ":", "assert", "isinstance", "(", "text_to_split", ",", "string_types", ")", "try", ":", "time", ",", "rest", "=", "text_to_split", ".", "split", "(", "': '", ",", "1", ")", "source", ",", "message", "=", "...
Split text Splits the debug text into its different parts: 'Time', 'LogLevel + Module Name', 'Debug message' :param text_to_split: Text to split :return: List containing the content of text_to_split split up
[ "Split", "text" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/logging_console.py#L107-L122
DLR-RM/RAFCON
source/rafcon/gui/views/logging_console.py
LoggingConsoleView.update_auto_scroll_mode
def update_auto_scroll_mode(self): """ Register or un-register signals for follow mode """ if self._enables['CONSOLE_FOLLOW_LOGGING']: if self._auto_scroll_handler_id is None: self._auto_scroll_handler_id = self.text_view.connect("size-allocate", self._auto_scroll) el...
python
def update_auto_scroll_mode(self): """ Register or un-register signals for follow mode """ if self._enables['CONSOLE_FOLLOW_LOGGING']: if self._auto_scroll_handler_id is None: self._auto_scroll_handler_id = self.text_view.connect("size-allocate", self._auto_scroll) el...
[ "def", "update_auto_scroll_mode", "(", "self", ")", ":", "if", "self", ".", "_enables", "[", "'CONSOLE_FOLLOW_LOGGING'", "]", ":", "if", "self", ".", "_auto_scroll_handler_id", "is", "None", ":", "self", ".", "_auto_scroll_handler_id", "=", "self", ".", "text_vi...
Register or un-register signals for follow mode
[ "Register", "or", "un", "-", "register", "signals", "for", "follow", "mode" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/logging_console.py#L140-L148
DLR-RM/RAFCON
source/rafcon/gui/views/logging_console.py
LoggingConsoleView._auto_scroll
def _auto_scroll(self, *args): """ Scroll to the end of the text view """ adj = self['scrollable'].get_vadjustment() adj.set_value(adj.get_upper() - adj.get_page_size())
python
def _auto_scroll(self, *args): """ Scroll to the end of the text view """ adj = self['scrollable'].get_vadjustment() adj.set_value(adj.get_upper() - adj.get_page_size())
[ "def", "_auto_scroll", "(", "self", ",", "*", "args", ")", ":", "adj", "=", "self", "[", "'scrollable'", "]", ".", "get_vadjustment", "(", ")", "adj", ".", "set_value", "(", "adj", ".", "get_upper", "(", ")", "-", "adj", ".", "get_page_size", "(", ")...
Scroll to the end of the text view
[ "Scroll", "to", "the", "end", "of", "the", "text", "view" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/logging_console.py#L150-L153
DLR-RM/RAFCON
source/rafcon/gui/views/logging_console.py
LoggingConsoleView.get_line_number_next_to_cursor_with_string_within
def get_line_number_next_to_cursor_with_string_within(self, s): """ Find the closest occurrence of a string with respect to the cursor position in the text view """ line_number, _ = self.get_cursor_position() text_buffer = self.text_view.get_buffer() line_iter = text_buffer.get_iter_at_l...
python
def get_line_number_next_to_cursor_with_string_within(self, s): """ Find the closest occurrence of a string with respect to the cursor position in the text view """ line_number, _ = self.get_cursor_position() text_buffer = self.text_view.get_buffer() line_iter = text_buffer.get_iter_at_l...
[ "def", "get_line_number_next_to_cursor_with_string_within", "(", "self", ",", "s", ")", ":", "line_number", ",", "_", "=", "self", ".", "get_cursor_position", "(", ")", "text_buffer", "=", "self", ".", "text_view", ".", "get_buffer", "(", ")", "line_iter", "=", ...
Find the closest occurrence of a string with respect to the cursor position in the text view
[ "Find", "the", "closest", "occurrence", "of", "a", "string", "with", "respect", "to", "the", "cursor", "position", "in", "the", "text", "view" ]
train
https://github.com/DLR-RM/RAFCON/blob/24942ef1a904531f49ab8830a1dbb604441be498/source/rafcon/gui/views/logging_console.py#L209-L242