partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
test
Screen.__render_left_panel
Render left blocks
yandextank/plugins/Console/screen.py
def __render_left_panel(self): ''' Render left blocks ''' self.log.debug("Rendering left blocks") left_block = self.left_panel left_block.render() blank_space = self.left_panel_width - left_block.width lines = [] pre_space = ' ' * int(blank_space / 2) if ...
def __render_left_panel(self): ''' Render left blocks ''' self.log.debug("Rendering left blocks") left_block = self.left_panel left_block.render() blank_space = self.left_panel_width - left_block.width lines = [] pre_space = ' ' * int(blank_space / 2) if ...
[ "Render", "left", "blocks" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Console/screen.py#L365-L383
[ "def", "__render_left_panel", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "\"Rendering left blocks\"", ")", "left_block", "=", "self", ".", "left_panel", "left_block", ".", "render", "(", ")", "blank_space", "=", "self", ".", "left_panel_widt...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
Screen.render_screen
Main method to render screen view
yandextank/plugins/Console/screen.py
def render_screen(self): ''' Main method to render screen view ''' self.term_width, self.term_height = get_terminal_size() self.log.debug( "Terminal size: %sx%s", self.term_width, self.term_height) self.right_panel_width = int( (self.term_width - len...
def render_screen(self): ''' Main method to render screen view ''' self.term_width, self.term_height = get_terminal_size() self.log.debug( "Terminal size: %sx%s", self.term_width, self.term_height) self.right_panel_width = int( (self.term_width - len...
[ "Main", "method", "to", "render", "screen", "view" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Console/screen.py#L385-L441
[ "def", "render_screen", "(", "self", ")", ":", "self", ".", "term_width", ",", "self", ".", "term_height", "=", "get_terminal_size", "(", ")", "self", ".", "log", ".", "debug", "(", "\"Terminal size: %sx%s\"", ",", "self", ".", "term_width", ",", "self", "...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
Screen.add_info_widget
Add widget string to right panel of the screen
yandextank/plugins/Console/screen.py
def add_info_widget(self, widget): ''' Add widget string to right panel of the screen ''' index = widget.get_index() while index in self.info_widgets.keys(): index += 1 self.info_widgets[widget.get_index()] = widget
def add_info_widget(self, widget): ''' Add widget string to right panel of the screen ''' index = widget.get_index() while index in self.info_widgets.keys(): index += 1 self.info_widgets[widget.get_index()] = widget
[ "Add", "widget", "string", "to", "right", "panel", "of", "the", "screen" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Console/screen.py#L443-L450
[ "def", "add_info_widget", "(", "self", ",", "widget", ")", ":", "index", "=", "widget", ".", "get_index", "(", ")", "while", "index", "in", "self", ".", "info_widgets", ".", "keys", "(", ")", ":", "index", "+=", "1", "self", ".", "info_widgets", "[", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
AbstractBlock.fill_rectangle
Right-pad lines of block to equal width
yandextank/plugins/Console/screen.py
def fill_rectangle(self, prepared): ''' Right-pad lines of block to equal width ''' result = [] width = max([self.clean_len(line) for line in prepared]) for line in prepared: spacer = ' ' * (width - self.clean_len(line)) result.append(line + (self.screen.markup....
def fill_rectangle(self, prepared): ''' Right-pad lines of block to equal width ''' result = [] width = max([self.clean_len(line) for line in prepared]) for line in prepared: spacer = ' ' * (width - self.clean_len(line)) result.append(line + (self.screen.markup....
[ "Right", "-", "pad", "lines", "of", "block", "to", "equal", "width" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Console/screen.py#L476-L483
[ "def", "fill_rectangle", "(", "self", ",", "prepared", ")", ":", "result", "=", "[", "]", "width", "=", "max", "(", "[", "self", ".", "clean_len", "(", "line", ")", "for", "line", "in", "prepared", "]", ")", "for", "line", "in", "prepared", ":", "s...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
AbstractBlock.clean_len
Calculate wisible length of string
yandextank/plugins/Console/screen.py
def clean_len(self, line): ''' Calculate wisible length of string ''' if isinstance(line, basestring): return len(self.screen.markup.clean_markup(line)) elif isinstance(line, tuple) or isinstance(line, list): markups = self.screen.markup.get_markup_vars() le...
def clean_len(self, line): ''' Calculate wisible length of string ''' if isinstance(line, basestring): return len(self.screen.markup.clean_markup(line)) elif isinstance(line, tuple) or isinstance(line, list): markups = self.screen.markup.get_markup_vars() le...
[ "Calculate", "wisible", "length", "of", "string" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Console/screen.py#L485-L495
[ "def", "clean_len", "(", "self", ",", "line", ")", ":", "if", "isinstance", "(", "line", ",", "basestring", ")", ":", "return", "len", "(", "self", ".", "screen", ".", "markup", ".", "clean_markup", "(", "line", ")", ")", "elif", "isinstance", "(", "...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
create
Creates load plan timestamps generator >>> from util import take >>> take(7, LoadPlanBuilder().ramp(5, 4000).create()) [0, 1000, 2000, 3000, 4000, 0, 0] >>> take(7, create(['ramp(5, 4s)'])) [0, 1000, 2000, 3000, 4000, 0, 0] >>> take(12, create(['ramp(5, 4s)', 'wait(5s)', 'ramp(5,4s)'])) ...
yandextank/stepper/instance_plan.py
def create(instances_schedule): ''' Creates load plan timestamps generator >>> from util import take >>> take(7, LoadPlanBuilder().ramp(5, 4000).create()) [0, 1000, 2000, 3000, 4000, 0, 0] >>> take(7, create(['ramp(5, 4s)'])) [0, 1000, 2000, 3000, 4000, 0, 0] >>> take(12, create(['ra...
def create(instances_schedule): ''' Creates load plan timestamps generator >>> from util import take >>> take(7, LoadPlanBuilder().ramp(5, 4000).create()) [0, 1000, 2000, 3000, 4000, 0, 0] >>> take(7, create(['ramp(5, 4s)'])) [0, 1000, 2000, 3000, 4000, 0, 0] >>> take(12, create(['ra...
[ "Creates", "load", "plan", "timestamps", "generator" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/stepper/instance_plan.py#L182-L233
[ "def", "create", "(", "instances_schedule", ")", ":", "lpb", "=", "LoadPlanBuilder", "(", ")", ".", "add_all_steps", "(", "instances_schedule", ")", "lp", "=", "lpb", ".", "create", "(", ")", "info", ".", "status", ".", "publish", "(", "'duration'", ",", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TotalHTTPCodesCriterion.get_level_str
format level str
yandextank/plugins/Autostop/cumulative_criterions.py
def get_level_str(self): ''' format level str ''' if self.is_relative: level_str = str(self.level) + "%" else: level_str = self.level return level_str
def get_level_str(self): ''' format level str ''' if self.is_relative: level_str = str(self.level) + "%" else: level_str = self.level return level_str
[ "format", "level", "str" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Autostop/cumulative_criterions.py#L205-L211
[ "def", "get_level_str", "(", "self", ")", ":", "if", "self", ".", "is_relative", ":", "level_str", "=", "str", "(", "self", ".", "level", ")", "+", "\"%\"", "else", ":", "level_str", "=", "self", ".", "level", "return", "level_str" ]
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TotalHTTPTrendCriterion.calc_measurement_error
formula for measurement error sqrt ( (sum(1, n, (k_i - <k>)**2) / (n*(n-1)))
yandextank/plugins/Autostop/cumulative_criterions.py
def calc_measurement_error(self, tangents): ''' formula for measurement error sqrt ( (sum(1, n, (k_i - <k>)**2) / (n*(n-1))) ''' if len(tangents) < 2: return 0.0 avg_tan = float(sum(tangents) / len(tangents)) numerator = float() for i in tang...
def calc_measurement_error(self, tangents): ''' formula for measurement error sqrt ( (sum(1, n, (k_i - <k>)**2) / (n*(n-1))) ''' if len(tangents) < 2: return 0.0 avg_tan = float(sum(tangents) / len(tangents)) numerator = float() for i in tang...
[ "formula", "for", "measurement", "error", "sqrt", "(", "(", "sum", "(", "1", "n", "(", "k_i", "-", "<k", ">", ")", "**", "2", ")", "/", "(", "n", "*", "(", "n", "-", "1", ")))" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Autostop/cumulative_criterions.py#L652-L666
[ "def", "calc_measurement_error", "(", "self", ",", "tangents", ")", ":", "if", "len", "(", "tangents", ")", "<", "2", ":", "return", "0.0", "avg_tan", "=", "float", "(", "sum", "(", "tangents", ")", "/", "len", "(", "tangents", ")", ")", "numerator", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
Plugin.add_info_widget
add right panel widget
yandextank/plugins/Console/plugin.py
def add_info_widget(self, widget): ''' add right panel widget ''' if not self.screen: self.log.debug("No screen instance to add widget") else: self.screen.add_info_widget(widget)
def add_info_widget(self, widget): ''' add right panel widget ''' if not self.screen: self.log.debug("No screen instance to add widget") else: self.screen.add_info_widget(widget)
[ "add", "right", "panel", "widget" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Console/plugin.py#L119-L124
[ "def", "add_info_widget", "(", "self", ",", "widget", ")", ":", "if", "not", "self", ".", "screen", ":", "self", ".", "log", ".", "debug", "(", "\"No screen instance to add widget\"", ")", "else", ":", "self", ".", "screen", ".", "add_info_widget", "(", "w...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
RealConsoleMarkup.clean_markup
clean markup from string
yandextank/plugins/Console/plugin.py
def clean_markup(self, orig_str): ''' clean markup from string ''' for val in self.get_markup_vars(): orig_str = orig_str.replace(val, '') return orig_str
def clean_markup(self, orig_str): ''' clean markup from string ''' for val in self.get_markup_vars(): orig_str = orig_str.replace(val, '') return orig_str
[ "clean", "markup", "from", "string" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Console/plugin.py#L159-L163
[ "def", "clean_markup", "(", "self", ",", "orig_str", ")", ":", "for", "val", "in", "self", ".", "get_markup_vars", "(", ")", ":", "orig_str", "=", "orig_str", ".", "replace", "(", "val", ",", "''", ")", "return", "orig_str" ]
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
APIClient.__make_writer_request
Send request to writer service.
yandextank/plugins/DataUploader/client.py
def __make_writer_request( self, params=None, json=None, http_method="POST", trace=False): ''' Send request to writer service. ''' request = requests.Request( http_method, self.writer_url, par...
def __make_writer_request( self, params=None, json=None, http_method="POST", trace=False): ''' Send request to writer service. ''' request = requests.Request( http_method, self.writer_url, par...
[ "Send", "request", "to", "writer", "service", "." ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/DataUploader/client.py#L221-L264
[ "def", "__make_writer_request", "(", "self", ",", "params", "=", "None", ",", "json", "=", "None", ",", "http_method", "=", "\"POST\"", ",", "trace", "=", "False", ")", ":", "request", "=", "requests", ".", "Request", "(", "http_method", ",", "self", "."...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
APIClient.new_job
:return: job_nr, upload_token :rtype: tuple
yandextank/plugins/DataUploader/client.py
def new_job( self, task, person, tank, target_host, target_port, loadscheme=None, detailed_time=None, notify_list=None, trace=False): """ :return: job_nr, upload_token :rtype: ...
def new_job( self, task, person, tank, target_host, target_port, loadscheme=None, detailed_time=None, notify_list=None, trace=False): """ :return: job_nr, upload_token :rtype: ...
[ ":", "return", ":", "job_nr", "upload_token", ":", "rtype", ":", "tuple" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/DataUploader/client.py#L308-L358
[ "def", "new_job", "(", "self", ",", "task", ",", "person", ",", "tank", ",", "target_host", ",", "target_port", ",", "loadscheme", "=", "None", ",", "detailed_time", "=", "None", ",", "notify_list", "=", "None", ",", "trace", "=", "False", ")", ":", "i...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.plugins
:returns: {plugin_name: plugin_class, ...} :rtype: dict
yandextank/core/tankcore.py
def plugins(self): """ :returns: {plugin_name: plugin_class, ...} :rtype: dict """ if self._plugins is None: self.load_plugins() if self._plugins is None: self._plugins = {} return self._plugins
def plugins(self): """ :returns: {plugin_name: plugin_class, ...} :rtype: dict """ if self._plugins is None: self.load_plugins() if self._plugins is None: self._plugins = {} return self._plugins
[ ":", "returns", ":", "{", "plugin_name", ":", "plugin_class", "...", "}", ":", "rtype", ":", "dict" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L162-L171
[ "def", "plugins", "(", "self", ")", ":", "if", "self", ".", "_plugins", "is", "None", ":", "self", ".", "load_plugins", "(", ")", "if", "self", ".", "_plugins", "is", "None", ":", "self", ".", "_plugins", "=", "{", "}", "return", "self", ".", "_plu...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.load_plugins
Tells core to take plugin options and instantiate plugin classes
yandextank/core/tankcore.py
def load_plugins(self): """ Tells core to take plugin options and instantiate plugin classes """ logger.info("Loading plugins...") for (plugin_name, plugin_path, plugin_cfg) in self.config.plugins: logger.debug("Loading plugin %s from %s", plugin_name, plugin_path) ...
def load_plugins(self): """ Tells core to take plugin options and instantiate plugin classes """ logger.info("Loading plugins...") for (plugin_name, plugin_path, plugin_cfg) in self.config.plugins: logger.debug("Loading plugin %s from %s", plugin_name, plugin_path) ...
[ "Tells", "core", "to", "take", "plugin", "options", "and", "instantiate", "plugin", "classes" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L186-L212
[ "def", "load_plugins", "(", "self", ")", ":", "logger", ".", "info", "(", "\"Loading plugins...\"", ")", "for", "(", "plugin_name", ",", "plugin_path", ",", "plugin_cfg", ")", "in", "self", ".", "config", ".", "plugins", ":", "logger", ".", "debug", "(", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.plugins_configure
Call configure() on all plugins
yandextank/core/tankcore.py
def plugins_configure(self): """ Call configure() on all plugins """ self.publish("core", "stage", "configure") logger.info("Configuring plugins...") self.taskset_affinity = self.get_option(self.SECTION, 'affinity') if self.taskset_affinity: self.__setu...
def plugins_configure(self): """ Call configure() on all plugins """ self.publish("core", "stage", "configure") logger.info("Configuring plugins...") self.taskset_affinity = self.get_option(self.SECTION, 'affinity') if self.taskset_affinity: self.__setu...
[ "Call", "configure", "()", "on", "all", "plugins" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L233-L245
[ "def", "plugins_configure", "(", "self", ")", ":", "self", ".", "publish", "(", "\"core\"", ",", "\"stage\"", ",", "\"configure\"", ")", "logger", ".", "info", "(", "\"Configuring plugins...\"", ")", "self", ".", "taskset_affinity", "=", "self", ".", "get_opti...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.wait_for_finish
Call is_test_finished() on all plugins 'till one of them initiates exit
yandextank/core/tankcore.py
def wait_for_finish(self): """ Call is_test_finished() on all plugins 'till one of them initiates exit """ if not self.interrupted.is_set(): logger.info("Waiting for test to finish...") logger.info('Artifacts dir: {dir}'.format(dir=self.artifacts_dir)) ...
def wait_for_finish(self): """ Call is_test_finished() on all plugins 'till one of them initiates exit """ if not self.interrupted.is_set(): logger.info("Waiting for test to finish...") logger.info('Artifacts dir: {dir}'.format(dir=self.artifacts_dir)) ...
[ "Call", "is_test_finished", "()", "on", "all", "plugins", "till", "one", "of", "them", "initiates", "exit" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L269-L297
[ "def", "wait_for_finish", "(", "self", ")", ":", "if", "not", "self", ".", "interrupted", ".", "is_set", "(", ")", ":", "logger", ".", "info", "(", "\"Waiting for test to finish...\"", ")", "logger", ".", "info", "(", "'Artifacts dir: {dir}'", ".", "format", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.plugins_post_process
Call post_process() on all plugins
yandextank/core/tankcore.py
def plugins_post_process(self, retcode): """ Call post_process() on all plugins """ logger.info("Post-processing test...") self.publish("core", "stage", "post_process") for plugin in self.plugins.values(): logger.debug("Post-process %s", plugin) tr...
def plugins_post_process(self, retcode): """ Call post_process() on all plugins """ logger.info("Post-processing test...") self.publish("core", "stage", "post_process") for plugin in self.plugins.values(): logger.debug("Post-process %s", plugin) tr...
[ "Call", "post_process", "()", "on", "all", "plugins" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L326-L342
[ "def", "plugins_post_process", "(", "self", ",", "retcode", ")", ":", "logger", ".", "info", "(", "\"Post-processing test...\"", ")", "self", ".", "publish", "(", "\"core\"", ",", "\"stage\"", ",", "\"post_process\"", ")", "for", "plugin", "in", "self", ".", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.__setup_taskset
if pid specified: set process w/ pid `pid` CPU affinity to specified `affinity` core(s) if args specified: modify list of args for Popen to start w/ taskset w/ affinity `affinity`
yandextank/core/tankcore.py
def __setup_taskset(self, affinity, pid=None, args=None): """ if pid specified: set process w/ pid `pid` CPU affinity to specified `affinity` core(s) if args specified: modify list of args for Popen to start w/ taskset w/ affinity `affinity` """ self.taskset_path = self.get_option(se...
def __setup_taskset(self, affinity, pid=None, args=None): """ if pid specified: set process w/ pid `pid` CPU affinity to specified `affinity` core(s) if args specified: modify list of args for Popen to start w/ taskset w/ affinity `affinity` """ self.taskset_path = self.get_option(se...
[ "if", "pid", "specified", ":", "set", "process", "w", "/", "pid", "pid", "CPU", "affinity", "to", "specified", "affinity", "core", "(", "s", ")", "if", "args", "specified", ":", "modify", "list", "of", "args", "for", "Popen", "to", "start", "w", "/", ...
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L347-L364
[ "def", "__setup_taskset", "(", "self", ",", "affinity", ",", "pid", "=", "None", ",", "args", "=", "None", ")", ":", "self", ".", "taskset_path", "=", "self", ".", "get_option", "(", "self", ".", "SECTION", ",", "'taskset_path'", ")", "if", "args", ":"...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.get_plugin_of_type
Retrieve a plugin of desired class, KeyError raised otherwise
yandextank/core/tankcore.py
def get_plugin_of_type(self, plugin_class): """ Retrieve a plugin of desired class, KeyError raised otherwise """ logger.debug("Searching for plugin: %s", plugin_class) matches = [plugin for plugin in self.plugins.values() if isinstance(plugin, plugin_class)] if matches: ...
def get_plugin_of_type(self, plugin_class): """ Retrieve a plugin of desired class, KeyError raised otherwise """ logger.debug("Searching for plugin: %s", plugin_class) matches = [plugin for plugin in self.plugins.values() if isinstance(plugin, plugin_class)] if matches: ...
[ "Retrieve", "a", "plugin", "of", "desired", "class", "KeyError", "raised", "otherwise" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L387-L400
[ "def", "get_plugin_of_type", "(", "self", ",", "plugin_class", ")", ":", "logger", ".", "debug", "(", "\"Searching for plugin: %s\"", ",", "plugin_class", ")", "matches", "=", "[", "plugin", "for", "plugin", "in", "self", ".", "plugins", ".", "values", "(", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.get_plugins_of_type
Retrieve a list of plugins of desired class, KeyError raised otherwise
yandextank/core/tankcore.py
def get_plugins_of_type(self, plugin_class): """ Retrieve a list of plugins of desired class, KeyError raised otherwise """ logger.debug("Searching for plugins: %s", plugin_class) matches = [plugin for plugin in self.plugins.values() if isinstance(plugin, plugin_class)] i...
def get_plugins_of_type(self, plugin_class): """ Retrieve a list of plugins of desired class, KeyError raised otherwise """ logger.debug("Searching for plugins: %s", plugin_class) matches = [plugin for plugin in self.plugins.values() if isinstance(plugin, plugin_class)] i...
[ "Retrieve", "a", "list", "of", "plugins", "of", "desired", "class", "KeyError", "raised", "otherwise" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L402-L411
[ "def", "get_plugins_of_type", "(", "self", ",", "plugin_class", ")", ":", "logger", ".", "debug", "(", "\"Searching for plugins: %s\"", ",", "plugin_class", ")", "matches", "=", "[", "plugin", "for", "plugin", "in", "self", ".", "plugins", ".", "values", "(", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.__collect_file
Move or copy single file to artifacts dir
yandextank/core/tankcore.py
def __collect_file(self, filename, keep_original=False): """ Move or copy single file to artifacts dir """ dest = self.artifacts_dir + '/' + os.path.basename(filename) logger.debug("Collecting file: %s to %s", filename, dest) if not filename or not os.path.exists(filename...
def __collect_file(self, filename, keep_original=False): """ Move or copy single file to artifacts dir """ dest = self.artifacts_dir + '/' + os.path.basename(filename) logger.debug("Collecting file: %s to %s", filename, dest) if not filename or not os.path.exists(filename...
[ "Move", "or", "copy", "single", "file", "to", "artifacts", "dir" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L417-L437
[ "def", "__collect_file", "(", "self", ",", "filename", ",", "keep_original", "=", "False", ")", ":", "dest", "=", "self", ".", "artifacts_dir", "+", "'/'", "+", "os", ".", "path", ".", "basename", "(", "filename", ")", "logger", ".", "debug", "(", "\"C...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.add_artifact_file
Add file to be stored as result artifact on post-process phase
yandextank/core/tankcore.py
def add_artifact_file(self, filename, keep_original=False): """ Add file to be stored as result artifact on post-process phase """ if filename: logger.debug( "Adding artifact file to collect (keep=%s): %s", keep_original, filename) ...
def add_artifact_file(self, filename, keep_original=False): """ Add file to be stored as result artifact on post-process phase """ if filename: logger.debug( "Adding artifact file to collect (keep=%s): %s", keep_original, filename) ...
[ "Add", "file", "to", "be", "stored", "as", "result", "artifact", "on", "post", "-", "process", "phase" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L439-L447
[ "def", "add_artifact_file", "(", "self", ",", "filename", ",", "keep_original", "=", "False", ")", ":", "if", "filename", ":", "logger", ".", "debug", "(", "\"Adding artifact file to collect (keep=%s): %s\"", ",", "keep_original", ",", "filename", ")", "self", "."...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.mkstemp
Generate temp file name in artifacts base dir and close temp file handle
yandextank/core/tankcore.py
def mkstemp(self, suffix, prefix, directory=None): """ Generate temp file name in artifacts base dir and close temp file handle """ if not directory: directory = self.artifacts_dir fd, fname = tempfile.mkstemp(suffix, prefix, directory) os.close(fd) ...
def mkstemp(self, suffix, prefix, directory=None): """ Generate temp file name in artifacts base dir and close temp file handle """ if not directory: directory = self.artifacts_dir fd, fname = tempfile.mkstemp(suffix, prefix, directory) os.close(fd) ...
[ "Generate", "temp", "file", "name", "in", "artifacts", "base", "dir", "and", "close", "temp", "file", "handle" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L465-L475
[ "def", "mkstemp", "(", "self", ",", "suffix", ",", "prefix", ",", "directory", "=", "None", ")", ":", "if", "not", "directory", ":", "directory", "=", "self", ".", "artifacts_dir", "fd", ",", "fname", "=", "tempfile", ".", "mkstemp", "(", "suffix", ","...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
TankCore.close
Call close() for all plugins
yandextank/core/tankcore.py
def close(self): """ Call close() for all plugins """ logger.info("Close allocated resources...") for plugin in self.plugins.values(): logger.debug("Close %s", plugin) try: plugin.close() except Exception as ex: ...
def close(self): """ Call close() for all plugins """ logger.info("Close allocated resources...") for plugin in self.plugins.values(): logger.debug("Close %s", plugin) try: plugin.close() except Exception as ex: ...
[ "Call", "close", "()", "for", "all", "plugins" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L480-L492
[ "def", "close", "(", "self", ")", ":", "logger", ".", "info", "(", "\"Close allocated resources...\"", ")", "for", "plugin", "in", "self", ".", "plugins", ".", "values", "(", ")", ":", "logger", ".", "debug", "(", "\"Close %s\"", ",", "plugin", ")", "try...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
ConfigManager.load_files
Read configs set into storage
yandextank/core/tankcore.py
def load_files(self, configs): """ Read configs set into storage """ logger.debug("Reading configs: %s", configs) config_filenames = [resource.resource_filename(config) for config in configs] try: self.config.read(config_filenames) except Exception as e...
def load_files(self, configs): """ Read configs set into storage """ logger.debug("Reading configs: %s", configs) config_filenames = [resource.resource_filename(config) for config in configs] try: self.config.read(config_filenames) except Exception as e...
[ "Read", "configs", "set", "into", "storage" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L618-L626
[ "def", "load_files", "(", "self", ",", "configs", ")", ":", "logger", ".", "debug", "(", "\"Reading configs: %s\"", ",", "configs", ")", "config_filenames", "=", "[", "resource", ".", "resource_filename", "(", "config", ")", "for", "config", "in", "configs", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
ConfigManager.flush
Flush current stat to file
yandextank/core/tankcore.py
def flush(self, filename=None): """ Flush current stat to file """ if not filename: filename = self.file if filename: with open(filename, 'w') as handle: self.config.write(handle)
def flush(self, filename=None): """ Flush current stat to file """ if not filename: filename = self.file if filename: with open(filename, 'w') as handle: self.config.write(handle)
[ "Flush", "current", "stat", "to", "file" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L628-L635
[ "def", "flush", "(", "self", ",", "filename", "=", "None", ")", ":", "if", "not", "filename", ":", "filename", "=", "self", ".", "file", "if", "filename", ":", "with", "open", "(", "filename", ",", "'w'", ")", "as", "handle", ":", "self", ".", "con...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
ConfigManager.get_options
Get options list with requested prefix
yandextank/core/tankcore.py
def get_options(self, section, prefix=''): """ Get options list with requested prefix """ res = [] try: for option in self.config.options(section): if not prefix or option.find(prefix) == 0: res += [( option[len(prefix):], s...
def get_options(self, section, prefix=''): """ Get options list with requested prefix """ res = [] try: for option in self.config.options(section): if not prefix or option.find(prefix) == 0: res += [( option[len(prefix):], s...
[ "Get", "options", "list", "with", "requested", "prefix" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L637-L650
[ "def", "get_options", "(", "self", ",", "section", ",", "prefix", "=", "''", ")", ":", "res", "=", "[", "]", "try", ":", "for", "option", "in", "self", ".", "config", ".", "options", "(", "section", ")", ":", "if", "not", "prefix", "or", "option", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
ConfigManager.find_sections
return sections with specified prefix
yandextank/core/tankcore.py
def find_sections(self, prefix): """ return sections with specified prefix """ res = [] for section in self.config.sections(): if section.startswith(prefix): res.append(section) return res
def find_sections(self, prefix): """ return sections with specified prefix """ res = [] for section in self.config.sections(): if section.startswith(prefix): res.append(section) return res
[ "return", "sections", "with", "specified", "prefix" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/core/tankcore.py#L652-L658
[ "def", "find_sections", "(", "self", ",", "prefix", ")", ":", "res", "=", "[", "]", "for", "section", "in", "self", ".", "config", ".", "sections", "(", ")", ":", "if", "section", ".", "startswith", "(", "prefix", ")", ":", "res", ".", "append", "(...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
PhantomStatsReader._decode_stat_data
Return all items found in this chunk
yandextank/plugins/Phantom/reader.py
def _decode_stat_data(self, chunk): """ Return all items found in this chunk """ for date_str, statistics in chunk.iteritems(): date_obj = datetime.datetime.strptime( date_str.split(".")[0], '%Y-%m-%d %H:%M:%S') chunk_date = int(time.mktime(date_ob...
def _decode_stat_data(self, chunk): """ Return all items found in this chunk """ for date_str, statistics in chunk.iteritems(): date_obj = datetime.datetime.strptime( date_str.split(".")[0], '%Y-%m-%d %H:%M:%S') chunk_date = int(time.mktime(date_ob...
[ "Return", "all", "items", "found", "in", "this", "chunk" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Phantom/reader.py#L115-L135
[ "def", "_decode_stat_data", "(", "self", ",", "chunk", ")", ":", "for", "date_str", ",", "statistics", "in", "chunk", ".", "iteritems", "(", ")", ":", "date_obj", "=", "datetime", ".", "datetime", ".", "strptime", "(", "date_str", ".", "split", "(", "\"....
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
Plugin.phantom
:rtype: PhantomConfig
yandextank/plugins/Phantom/plugin.py
def phantom(self): """ :rtype: PhantomConfig """ if not self._phantom: self._phantom = PhantomConfig(self.core, self.cfg, self.stat_log) self._phantom.read_config() return self._phantom
def phantom(self): """ :rtype: PhantomConfig """ if not self._phantom: self._phantom = PhantomConfig(self.core, self.cfg, self.stat_log) self._phantom.read_config() return self._phantom
[ ":", "rtype", ":", "PhantomConfig" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Phantom/plugin.py#L75-L82
[ "def", "phantom", "(", "self", ")", ":", "if", "not", "self", ".", "_phantom", ":", "self", ".", "_phantom", "=", "PhantomConfig", "(", "self", ".", "core", ",", "self", ".", "cfg", ",", "self", ".", "stat_log", ")", "self", ".", "_phantom", ".", "...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
Plugin.get_info
returns info object
yandextank/plugins/Phantom/plugin.py
def get_info(self): """ returns info object """ if not self.cached_info: if not self.phantom: return None self.cached_info = self.phantom.get_info() return self.cached_info
def get_info(self): """ returns info object """ if not self.cached_info: if not self.phantom: return None self.cached_info = self.phantom.get_info() return self.cached_info
[ "returns", "info", "object" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Phantom/plugin.py#L195-L201
[ "def", "get_info", "(", "self", ")", ":", "if", "not", "self", ".", "cached_info", ":", "if", "not", "self", ".", "phantom", ":", "return", "None", "self", ".", "cached_info", "=", "self", ".", "phantom", ".", "get_info", "(", ")", "return", "self", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
MonitoringCollector.prepare
Prepare for monitoring - install agents etc
yandextank/plugins/Telegraf/collector.py
def prepare(self): """Prepare for monitoring - install agents etc""" # Parse config agent_configs = [] if self.config: agent_configs = self.config_manager.getconfig( self.config, self.default_target) # Creating agent for hosts for config in a...
def prepare(self): """Prepare for monitoring - install agents etc""" # Parse config agent_configs = [] if self.config: agent_configs = self.config_manager.getconfig( self.config, self.default_target) # Creating agent for hosts for config in a...
[ "Prepare", "for", "monitoring", "-", "install", "agents", "etc" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Telegraf/collector.py#L51-L76
[ "def", "prepare", "(", "self", ")", ":", "# Parse config", "agent_configs", "=", "[", "]", "if", "self", ".", "config", ":", "agent_configs", "=", "self", ".", "config_manager", ".", "getconfig", "(", "self", ".", "config", ",", "self", ".", "default_targe...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
MonitoringCollector.start
Start agents execute popen of agent.py on target and start output reader thread.
yandextank/plugins/Telegraf/collector.py
def start(self): """ Start agents execute popen of agent.py on target and start output reader thread. """ [agent.start() for agent in self.agents] [agent.reader_thread.start() for agent in self.agents]
def start(self): """ Start agents execute popen of agent.py on target and start output reader thread. """ [agent.start() for agent in self.agents] [agent.reader_thread.start() for agent in self.agents]
[ "Start", "agents" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Telegraf/collector.py#L78-L84
[ "def", "start", "(", "self", ")", ":", "[", "agent", ".", "start", "(", ")", "for", "agent", "in", "self", ".", "agents", "]", "[", "agent", ".", "reader_thread", ".", "start", "(", ")", "for", "agent", "in", "self", ".", "agents", "]" ]
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
MonitoringCollector.poll
Poll agents for data
yandextank/plugins/Telegraf/collector.py
def poll(self): """ Poll agents for data """ start_time = time.time() for agent in self.agents: for collect in agent.reader: # don't crush if trash or traceback came from agent to stdout if not collect: return 0 ...
def poll(self): """ Poll agents for data """ start_time = time.time() for agent in self.agents: for collect in agent.reader: # don't crush if trash or traceback came from agent to stdout if not collect: return 0 ...
[ "Poll", "agents", "for", "data" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Telegraf/collector.py#L86-L121
[ "def", "poll", "(", "self", ")", ":", "start_time", "=", "time", ".", "time", "(", ")", "for", "agent", "in", "self", ".", "agents", ":", "for", "collect", "in", "agent", ".", "reader", ":", "# don't crush if trash or traceback came from agent to stdout", "if"...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
MonitoringCollector.stop
Shutdown agents
yandextank/plugins/Telegraf/collector.py
def stop(self): """Shutdown agents""" logger.debug("Uninstalling monitoring agents") for agent in self.agents: log_filename, data_filename = agent.uninstall() self.artifact_files.append(log_filename) self.artifact_files.append(data_filename) for agent ...
def stop(self): """Shutdown agents""" logger.debug("Uninstalling monitoring agents") for agent in self.agents: log_filename, data_filename = agent.uninstall() self.artifact_files.append(log_filename) self.artifact_files.append(data_filename) for agent ...
[ "Shutdown", "agents" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Telegraf/collector.py#L123-L136
[ "def", "stop", "(", "self", ")", ":", "logger", ".", "debug", "(", "\"Uninstalling monitoring agents\"", ")", "for", "agent", "in", "self", ".", "agents", ":", "log_filename", ",", "data_filename", "=", "agent", ".", "uninstall", "(", ")", "self", ".", "ar...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
MonitoringCollector.send_collected_data
sends pending data set to listeners
yandextank/plugins/Telegraf/collector.py
def send_collected_data(self): """sends pending data set to listeners""" data = self.__collected_data self.__collected_data = [] for listener in self.listeners: # deep copy to ensure each listener gets it's own copy listener.monitoring_data(copy.deepcopy(data))
def send_collected_data(self): """sends pending data set to listeners""" data = self.__collected_data self.__collected_data = [] for listener in self.listeners: # deep copy to ensure each listener gets it's own copy listener.monitoring_data(copy.deepcopy(data))
[ "sends", "pending", "data", "set", "to", "listeners" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Telegraf/collector.py#L138-L144
[ "def", "send_collected_data", "(", "self", ")", ":", "data", "=", "self", ".", "__collected_data", "self", ".", "__collected_data", "=", "[", "]", "for", "listener", "in", "self", ".", "listeners", ":", "# deep copy to ensure each listener gets it's own copy", "list...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
Plugin.__detect_configuration
we need to be flexible in order to determine which plugin's configuration specified and make appropriate configs to metrics collector :return: SECTION name or None for defaults
yandextank/plugins/Telegraf/plugin.py
def __detect_configuration(self): """ we need to be flexible in order to determine which plugin's configuration specified and make appropriate configs to metrics collector :return: SECTION name or None for defaults """ try: is_telegraf = self.core.get_option(...
def __detect_configuration(self): """ we need to be flexible in order to determine which plugin's configuration specified and make appropriate configs to metrics collector :return: SECTION name or None for defaults """ try: is_telegraf = self.core.get_option(...
[ "we", "need", "to", "be", "flexible", "in", "order", "to", "determine", "which", "plugin", "s", "configuration", "specified", "and", "make", "appropriate", "configs", "to", "metrics", "collector" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Telegraf/plugin.py#L72-L116
[ "def", "__detect_configuration", "(", "self", ")", ":", "try", ":", "is_telegraf", "=", "self", ".", "core", ".", "get_option", "(", "'telegraf'", ",", "\"config\"", ")", "except", "KeyError", ":", "is_telegraf", "=", "None", "try", ":", "is_monitoring", "="...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
MonitoringWidget.__handle_data_items
store metric in data tree and calc offset signs sign < 0 is CYAN, means metric value is lower then previous, sign > 1 is YELLOW, means metric value is higher then prevoius, sign == 0 is WHITE, means initial or equal metric value
yandextank/plugins/Telegraf/plugin.py
def __handle_data_items(self, host, data): """ store metric in data tree and calc offset signs sign < 0 is CYAN, means metric value is lower then previous, sign > 1 is YELLOW, means metric value is higher then prevoius, sign == 0 is WHITE, means initial or equal metric value """...
def __handle_data_items(self, host, data): """ store metric in data tree and calc offset signs sign < 0 is CYAN, means metric value is lower then previous, sign > 1 is YELLOW, means metric value is higher then prevoius, sign == 0 is WHITE, means initial or equal metric value """...
[ "store", "metric", "in", "data", "tree", "and", "calc", "offset", "signs" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Telegraf/plugin.py#L284-L304
[ "def", "__handle_data_items", "(", "self", ",", "host", ",", "data", ")", ":", "for", "metric", ",", "value", "in", "data", ".", "iteritems", "(", ")", ":", "if", "value", "==", "''", ":", "self", ".", "sign", "[", "host", "]", "[", "metric", "]", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
MonitoringReader._decode_agents_data
decode agents jsons, count diffs
yandextank/plugins/Telegraf/reader.py
def _decode_agents_data(self, block): """ decode agents jsons, count diffs """ collect = [] if block: for chunk in block.split('\n'): try: if chunk: prepared_results = {} jsn = json.lo...
def _decode_agents_data(self, block): """ decode agents jsons, count diffs """ collect = [] if block: for chunk in block.split('\n'): try: if chunk: prepared_results = {} jsn = json.lo...
[ "decode", "agents", "jsons", "count", "diffs" ]
yandex/yandex-tank
python
https://github.com/yandex/yandex-tank/blob/d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b/yandextank/plugins/Telegraf/reader.py#L27-L85
[ "def", "_decode_agents_data", "(", "self", ",", "block", ")", ":", "collect", "=", "[", "]", "if", "block", ":", "for", "chunk", "in", "block", ".", "split", "(", "'\\n'", ")", ":", "try", ":", "if", "chunk", ":", "prepared_results", "=", "{", "}", ...
d71d63b6ab5de8b8a5ea2b728b6ab9ac0b1ba71b
test
StreamConn.subscribe
Start subscribing channels. If the necessary connection isn't open yet, it opens now.
alpaca_trade_api/stream2.py
async def subscribe(self, channels): '''Start subscribing channels. If the necessary connection isn't open yet, it opens now. ''' ws_channels = [] nats_channels = [] for c in channels: if c.startswith(('Q.', 'T.', 'A.', 'AM.',)): nats_channels....
async def subscribe(self, channels): '''Start subscribing channels. If the necessary connection isn't open yet, it opens now. ''' ws_channels = [] nats_channels = [] for c in channels: if c.startswith(('Q.', 'T.', 'A.', 'AM.',)): nats_channels....
[ "Start", "subscribing", "channels", ".", "If", "the", "necessary", "connection", "isn", "t", "open", "yet", "it", "opens", "now", "." ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/stream2.py#L76-L99
[ "async", "def", "subscribe", "(", "self", ",", "channels", ")", ":", "ws_channels", "=", "[", "]", "nats_channels", "=", "[", "]", "for", "c", "in", "channels", ":", "if", "c", ".", "startswith", "(", "(", "'Q.'", ",", "'T.'", ",", "'A.'", ",", "'A...
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
StreamConn.run
Run forever and block until exception is rasised. initial_channels is the channels to start with.
alpaca_trade_api/stream2.py
def run(self, initial_channels=[]): '''Run forever and block until exception is rasised. initial_channels is the channels to start with. ''' loop = asyncio.get_event_loop() try: loop.run_until_complete(self.subscribe(initial_channels)) loop.run_forever() ...
def run(self, initial_channels=[]): '''Run forever and block until exception is rasised. initial_channels is the channels to start with. ''' loop = asyncio.get_event_loop() try: loop.run_until_complete(self.subscribe(initial_channels)) loop.run_forever() ...
[ "Run", "forever", "and", "block", "until", "exception", "is", "rasised", ".", "initial_channels", "is", "the", "channels", "to", "start", "with", "." ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/stream2.py#L101-L110
[ "def", "run", "(", "self", ",", "initial_channels", "=", "[", "]", ")", ":", "loop", "=", "asyncio", ".", "get_event_loop", "(", ")", "try", ":", "loop", ".", "run_until_complete", "(", "self", ".", "subscribe", "(", "initial_channels", ")", ")", "loop",...
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
StreamConn.close
Close any of open connections
alpaca_trade_api/stream2.py
async def close(self): '''Close any of open connections''' if self._ws is not None: await self._ws.close() if self.polygon is not None: await self.polygon.close()
async def close(self): '''Close any of open connections''' if self._ws is not None: await self._ws.close() if self.polygon is not None: await self.polygon.close()
[ "Close", "any", "of", "open", "connections" ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/stream2.py#L112-L117
[ "async", "def", "close", "(", "self", ")", ":", "if", "self", ".", "_ws", "is", "not", "None", ":", "await", "self", ".", "_ws", ".", "close", "(", ")", "if", "self", ".", "polygon", "is", "not", "None", ":", "await", "self", ".", "polygon", ".",...
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
BarSet.df
## Experimental
alpaca_trade_api/entity.py
def df(self): '''## Experimental ''' if not hasattr(self, '_df'): dfs = [] for symbol, bars in self.items(): df = bars.df.copy() df.columns = pd.MultiIndex.from_product( [[symbol, ], df.columns]) dfs.append(df) ...
def df(self): '''## Experimental ''' if not hasattr(self, '_df'): dfs = [] for symbol, bars in self.items(): df = bars.df.copy() df.columns = pd.MultiIndex.from_product( [[symbol, ], df.columns]) dfs.append(df) ...
[ "##", "Experimental" ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/entity.py#L102-L115
[ "def", "df", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_df'", ")", ":", "dfs", "=", "[", "]", "for", "symbol", ",", "bars", "in", "self", ".", "items", "(", ")", ":", "df", "=", "bars", ".", "df", ".", "copy", "(", ...
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
REST._one_request
Perform one request, possibly raising RetryException in the case the response is 429. Otherwise, if error text contain "code" string, then it decodes to json object and returns APIError. Returns the body json in the 200 status.
alpaca_trade_api/rest.py
def _one_request(self, method, url, opts, retry): ''' Perform one request, possibly raising RetryException in the case the response is 429. Otherwise, if error text contain "code" string, then it decodes to json object and returns APIError. Returns the body json in the 200 status...
def _one_request(self, method, url, opts, retry): ''' Perform one request, possibly raising RetryException in the case the response is 429. Otherwise, if error text contain "code" string, then it decodes to json object and returns APIError. Returns the body json in the 200 status...
[ "Perform", "one", "request", "possibly", "raising", "RetryException", "in", "the", "case", "the", "response", "is", "429", ".", "Otherwise", "if", "error", "text", "contain", "code", "string", "then", "it", "decodes", "to", "json", "object", "and", "returns", ...
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/rest.py#L111-L134
[ "def", "_one_request", "(", "self", ",", "method", ",", "url", ",", "opts", ",", "retry", ")", ":", "retry_codes", "=", "self", ".", "_retry_codes", "resp", "=", "self", ".", "_session", ".", "request", "(", "method", ",", "url", ",", "*", "*", "opts...
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
REST.list_orders
Get a list of orders https://docs.alpaca.markets/web-api/orders/#get-a-list-of-orders
alpaca_trade_api/rest.py
def list_orders(self, status=None, limit=None, after=None, until=None, direction=None, params=None): ''' Get a list of orders https://docs.alpaca.markets/web-api/orders/#get-a-list-of-orders ''' if params is None: params = dict() if limit i...
def list_orders(self, status=None, limit=None, after=None, until=None, direction=None, params=None): ''' Get a list of orders https://docs.alpaca.markets/web-api/orders/#get-a-list-of-orders ''' if params is None: params = dict() if limit i...
[ "Get", "a", "list", "of", "orders", "https", ":", "//", "docs", ".", "alpaca", ".", "markets", "/", "web", "-", "api", "/", "orders", "/", "#get", "-", "a", "-", "list", "-", "of", "-", "orders" ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/rest.py#L154-L173
[ "def", "list_orders", "(", "self", ",", "status", "=", "None", ",", "limit", "=", "None", ",", "after", "=", "None", ",", "until", "=", "None", ",", "direction", "=", "None", ",", "params", "=", "None", ")", ":", "if", "params", "is", "None", ":", ...
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
REST.submit_order
Request a new order
alpaca_trade_api/rest.py
def submit_order(self, symbol, qty, side, type, time_in_force, limit_price=None, stop_price=None, client_order_id=None): '''Request a new order''' params = { 'symbol': symbol, 'qty': qty, 'side': side, 'type': type, 'time_i...
def submit_order(self, symbol, qty, side, type, time_in_force, limit_price=None, stop_price=None, client_order_id=None): '''Request a new order''' params = { 'symbol': symbol, 'qty': qty, 'side': side, 'type': type, 'time_i...
[ "Request", "a", "new", "order" ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/rest.py#L175-L192
[ "def", "submit_order", "(", "self", ",", "symbol", ",", "qty", ",", "side", ",", "type", ",", "time_in_force", ",", "limit_price", "=", "None", ",", "stop_price", "=", "None", ",", "client_order_id", "=", "None", ")", ":", "params", "=", "{", "'symbol'",...
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
REST.get_order
Get an order
alpaca_trade_api/rest.py
def get_order(self, order_id): '''Get an order''' resp = self.get('/orders/{}'.format(order_id)) return Order(resp)
def get_order(self, order_id): '''Get an order''' resp = self.get('/orders/{}'.format(order_id)) return Order(resp)
[ "Get", "an", "order" ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/rest.py#L201-L204
[ "def", "get_order", "(", "self", ",", "order_id", ")", ":", "resp", "=", "self", ".", "get", "(", "'/orders/{}'", ".", "format", "(", "order_id", ")", ")", "return", "Order", "(", "resp", ")" ]
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
REST.get_position
Get an open position
alpaca_trade_api/rest.py
def get_position(self, symbol): '''Get an open position''' resp = self.get('/positions/{}'.format(symbol)) return Position(resp)
def get_position(self, symbol): '''Get an open position''' resp = self.get('/positions/{}'.format(symbol)) return Position(resp)
[ "Get", "an", "open", "position" ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/rest.py#L215-L218
[ "def", "get_position", "(", "self", ",", "symbol", ")", ":", "resp", "=", "self", ".", "get", "(", "'/positions/{}'", ".", "format", "(", "symbol", ")", ")", "return", "Position", "(", "resp", ")" ]
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
REST.list_assets
Get a list of assets
alpaca_trade_api/rest.py
def list_assets(self, status=None, asset_class=None): '''Get a list of assets''' params = { 'status': status, 'assert_class': asset_class, } resp = self.get('/assets', params) return [Asset(o) for o in resp]
def list_assets(self, status=None, asset_class=None): '''Get a list of assets''' params = { 'status': status, 'assert_class': asset_class, } resp = self.get('/assets', params) return [Asset(o) for o in resp]
[ "Get", "a", "list", "of", "assets" ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/rest.py#L220-L227
[ "def", "list_assets", "(", "self", ",", "status", "=", "None", ",", "asset_class", "=", "None", ")", ":", "params", "=", "{", "'status'", ":", "status", ",", "'assert_class'", ":", "asset_class", ",", "}", "resp", "=", "self", ".", "get", "(", "'/asset...
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
REST.get_asset
Get an asset
alpaca_trade_api/rest.py
def get_asset(self, symbol): '''Get an asset''' resp = self.get('/assets/{}'.format(symbol)) return Asset(resp)
def get_asset(self, symbol): '''Get an asset''' resp = self.get('/assets/{}'.format(symbol)) return Asset(resp)
[ "Get", "an", "asset" ]
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/rest.py#L229-L232
[ "def", "get_asset", "(", "self", ",", "symbol", ")", ":", "resp", "=", "self", ".", "get", "(", "'/assets/{}'", ".", "format", "(", "symbol", ")", ")", "return", "Asset", "(", "resp", ")" ]
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
REST.get_barset
Get BarSet(dict[str]->list[Bar]) The parameter symbols can be either a comma-split string or a list of string. Each symbol becomes the key of the returned value.
alpaca_trade_api/rest.py
def get_barset(self, symbols, timeframe, limit=None, start=None, end=None, after=None, until=None): '''Get BarSet(dict[str]->list[Bar]) The parameter symbols can be either...
def get_barset(self, symbols, timeframe, limit=None, start=None, end=None, after=None, until=None): '''Get BarSet(dict[str]->list[Bar]) The parameter symbols can be either...
[ "Get", "BarSet", "(", "dict", "[", "str", "]", "-", ">", "list", "[", "Bar", "]", ")", "The", "parameter", "symbols", "can", "be", "either", "a", "comma", "-", "split", "string", "or", "a", "list", "of", "string", ".", "Each", "symbol", "becomes", ...
alpacahq/alpaca-trade-api-python
python
https://github.com/alpacahq/alpaca-trade-api-python/blob/9c9dea3b4a37c909f88391b202e86ff356a8b4d7/alpaca_trade_api/rest.py#L234-L263
[ "def", "get_barset", "(", "self", ",", "symbols", ",", "timeframe", ",", "limit", "=", "None", ",", "start", "=", "None", ",", "end", "=", "None", ",", "after", "=", "None", ",", "until", "=", "None", ")", ":", "if", "not", "isinstance", "(", "symb...
9c9dea3b4a37c909f88391b202e86ff356a8b4d7
test
lambda_solid
(decorator) Create a simple solid. This shortcut allows the creation of simple solids that do not require configuration and whose implementations do not require a context. Lambda solids take inputs and produce a single output. The body of the function should return a single value. Args: n...
python_modules/dagster/dagster/core/definitions/decorators.py
def lambda_solid(name=None, inputs=None, output=None, description=None): '''(decorator) Create a simple solid. This shortcut allows the creation of simple solids that do not require configuration and whose implementations do not require a context. Lambda solids take inputs and produce a single output....
def lambda_solid(name=None, inputs=None, output=None, description=None): '''(decorator) Create a simple solid. This shortcut allows the creation of simple solids that do not require configuration and whose implementations do not require a context. Lambda solids take inputs and produce a single output....
[ "(", "decorator", ")", "Create", "a", "simple", "solid", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/definitions/decorators.py#L135-L170
[ "def", "lambda_solid", "(", "name", "=", "None", ",", "inputs", "=", "None", ",", "output", "=", "None", ",", "description", "=", "None", ")", ":", "output", "=", "output", "or", "OutputDefinition", "(", ")", "if", "callable", "(", "name", ")", ":", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
solid
(decorator) Create a solid with specified parameters. This shortcut simplifies the core solid API by exploding arguments into kwargs of the transform function and omitting additional parameters when they are not needed. Parameters are otherwise as in the core API, :py:class:`SolidDefinition`. The deco...
python_modules/dagster/dagster/core/definitions/decorators.py
def solid(name=None, inputs=None, outputs=None, config_field=None, description=None): '''(decorator) Create a solid with specified parameters. This shortcut simplifies the core solid API by exploding arguments into kwargs of the transform function and omitting additional parameters when they are not needed...
def solid(name=None, inputs=None, outputs=None, config_field=None, description=None): '''(decorator) Create a solid with specified parameters. This shortcut simplifies the core solid API by exploding arguments into kwargs of the transform function and omitting additional parameters when they are not needed...
[ "(", "decorator", ")", "Create", "a", "solid", "with", "specified", "parameters", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/definitions/decorators.py#L173-L271
[ "def", "solid", "(", "name", "=", "None", ",", "inputs", "=", "None", ",", "outputs", "=", "None", ",", "config_field", "=", "None", ",", "description", "=", "None", ")", ":", "# This case is for when decorator is used bare, without arguments. e.g. @solid versus @soli...
4119f8c773089de64831b1dfb9e168e353d401dc
test
MultipleResults.from_dict
Create a new ``MultipleResults`` object from a dictionary. Keys of the dictionary are unpacked into result names. Args: result_dict (dict) - The dictionary to unpack. Returns: (:py:class:`MultipleResults <dagster.MultipleResults>`) A new ``Multi...
python_modules/dagster/dagster/core/definitions/decorators.py
def from_dict(result_dict): '''Create a new ``MultipleResults`` object from a dictionary. Keys of the dictionary are unpacked into result names. Args: result_dict (dict) - The dictionary to unpack. Returns: (:py:class:`MultipleResults <d...
def from_dict(result_dict): '''Create a new ``MultipleResults`` object from a dictionary. Keys of the dictionary are unpacked into result names. Args: result_dict (dict) - The dictionary to unpack. Returns: (:py:class:`MultipleResults <d...
[ "Create", "a", "new", "MultipleResults", "object", "from", "a", "dictionary", ".", "Keys", "of", "the", "dictionary", "are", "unpacked", "into", "result", "names", ".", "Args", ":", "result_dict", "(", "dict", ")", "-", "The", "dictionary", "to", "unpack", ...
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/definitions/decorators.py#L64-L80
[ "def", "from_dict", "(", "result_dict", ")", ":", "check", ".", "dict_param", "(", "result_dict", ",", "'result_dict'", ",", "key_type", "=", "str", ")", "results", "=", "[", "]", "for", "name", ",", "value", "in", "result_dict", ".", "items", "(", ")", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
create_joining_subplan
This captures a common pattern of fanning out a single value to N steps, where each step has similar structure. The strict requirement here is that each step must provide an output named the parameters parallel_step_output. This takes those steps and then uses a join node to coalesce them so that downstrea...
python_modules/dagster/dagster/core/execution_plan/utility.py
def create_joining_subplan( pipeline_def, solid, join_step_key, parallel_steps, parallel_step_output ): ''' This captures a common pattern of fanning out a single value to N steps, where each step has similar structure. The strict requirement here is that each step must provide an output named the p...
def create_joining_subplan( pipeline_def, solid, join_step_key, parallel_steps, parallel_step_output ): ''' This captures a common pattern of fanning out a single value to N steps, where each step has similar structure. The strict requirement here is that each step must provide an output named the p...
[ "This", "captures", "a", "common", "pattern", "of", "fanning", "out", "a", "single", "value", "to", "N", "steps", "where", "each", "step", "has", "similar", "structure", ".", "The", "strict", "requirement", "here", "is", "that", "each", "step", "must", "pr...
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution_plan/utility.py#L60-L91
[ "def", "create_joining_subplan", "(", "pipeline_def", ",", "solid", ",", "join_step_key", ",", "parallel_steps", ",", "parallel_step_output", ")", ":", "check", ".", "inst_param", "(", "pipeline_def", ",", "'pipeline_def'", ",", "PipelineDefinition", ")", "check", "...
4119f8c773089de64831b1dfb9e168e353d401dc
test
gunzipper
gunzips /path/to/foo.gz to /path/to/raw/2019/01/01/data.json
examples/event-pipeline-demo/event_pipeline_demo/pipelines.py
def gunzipper(gzip_file): '''gunzips /path/to/foo.gz to /path/to/raw/2019/01/01/data.json ''' # TODO: take date as an input path_prefix = os.path.dirname(gzip_file) output_folder = os.path.join(path_prefix, 'raw/2019/01/01') outfile = os.path.join(output_folder, 'data.json') if not safe_is...
def gunzipper(gzip_file): '''gunzips /path/to/foo.gz to /path/to/raw/2019/01/01/data.json ''' # TODO: take date as an input path_prefix = os.path.dirname(gzip_file) output_folder = os.path.join(path_prefix, 'raw/2019/01/01') outfile = os.path.join(output_folder, 'data.json') if not safe_is...
[ "gunzips", "/", "path", "/", "to", "/", "foo", ".", "gz", "to", "/", "path", "/", "to", "/", "raw", "/", "2019", "/", "01", "/", "01", "/", "data", ".", "json" ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/examples/event-pipeline-demo/event_pipeline_demo/pipelines.py#L31-L46
[ "def", "gunzipper", "(", "gzip_file", ")", ":", "# TODO: take date as an input", "path_prefix", "=", "os", ".", "path", ".", "dirname", "(", "gzip_file", ")", "output_folder", "=", "os", ".", "path", ".", "join", "(", "path_prefix", ",", "'raw/2019/01/01'", ")...
4119f8c773089de64831b1dfb9e168e353d401dc
test
_check_key_value_types
Ensures argument obj is a dictionary, and enforces that the keys/values conform to the types specified by key_type, value_type.
python_modules/dagster/dagster/check/__init__.py
def _check_key_value_types(obj, key_type, value_type, key_check=isinstance, value_check=isinstance): '''Ensures argument obj is a dictionary, and enforces that the keys/values conform to the types specified by key_type, value_type. ''' if not isinstance(obj, dict): raise_with_traceback(_type_mis...
def _check_key_value_types(obj, key_type, value_type, key_check=isinstance, value_check=isinstance): '''Ensures argument obj is a dictionary, and enforces that the keys/values conform to the types specified by key_type, value_type. ''' if not isinstance(obj, dict): raise_with_traceback(_type_mis...
[ "Ensures", "argument", "obj", "is", "a", "dictionary", "and", "enforces", "that", "the", "keys", "/", "values", "conform", "to", "the", "types", "specified", "by", "key_type", "value_type", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/check/__init__.py#L328-L359
[ "def", "_check_key_value_types", "(", "obj", ",", "key_type", ",", "value_type", ",", "key_check", "=", "isinstance", ",", "value_check", "=", "isinstance", ")", ":", "if", "not", "isinstance", "(", "obj", ",", "dict", ")", ":", "raise_with_traceback", "(", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
dict_param
Ensures argument obj is a native Python dictionary, raises an exception if not, and otherwise returns obj.
python_modules/dagster/dagster/check/__init__.py
def dict_param(obj, param_name, key_type=None, value_type=None): '''Ensures argument obj is a native Python dictionary, raises an exception if not, and otherwise returns obj. ''' if not isinstance(obj, dict): raise_with_traceback(_param_type_mismatch_exception(obj, dict, param_name)) if not...
def dict_param(obj, param_name, key_type=None, value_type=None): '''Ensures argument obj is a native Python dictionary, raises an exception if not, and otherwise returns obj. ''' if not isinstance(obj, dict): raise_with_traceback(_param_type_mismatch_exception(obj, dict, param_name)) if not...
[ "Ensures", "argument", "obj", "is", "a", "native", "Python", "dictionary", "raises", "an", "exception", "if", "not", "and", "otherwise", "returns", "obj", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/check/__init__.py#L362-L372
[ "def", "dict_param", "(", "obj", ",", "param_name", ",", "key_type", "=", "None", ",", "value_type", "=", "None", ")", ":", "if", "not", "isinstance", "(", "obj", ",", "dict", ")", ":", "raise_with_traceback", "(", "_param_type_mismatch_exception", "(", "obj...
4119f8c773089de64831b1dfb9e168e353d401dc
test
opt_dict_param
Ensures argument obj is either a dictionary or None; if the latter, instantiates an empty dictionary.
python_modules/dagster/dagster/check/__init__.py
def opt_dict_param(obj, param_name, key_type=None, value_type=None, value_class=None): '''Ensures argument obj is either a dictionary or None; if the latter, instantiates an empty dictionary. ''' if obj is not None and not isinstance(obj, dict): raise_with_traceback(_param_type_mismatch_exceptio...
def opt_dict_param(obj, param_name, key_type=None, value_type=None, value_class=None): '''Ensures argument obj is either a dictionary or None; if the latter, instantiates an empty dictionary. ''' if obj is not None and not isinstance(obj, dict): raise_with_traceback(_param_type_mismatch_exceptio...
[ "Ensures", "argument", "obj", "is", "either", "a", "dictionary", "or", "None", ";", "if", "the", "latter", "instantiates", "an", "empty", "dictionary", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/check/__init__.py#L375-L387
[ "def", "opt_dict_param", "(", "obj", ",", "param_name", ",", "key_type", "=", "None", ",", "value_type", "=", "None", ",", "value_class", "=", "None", ")", ":", "if", "obj", "is", "not", "None", "and", "not", "isinstance", "(", "obj", ",", "dict", ")",...
4119f8c773089de64831b1dfb9e168e353d401dc
test
construct_event_logger
Callback receives a stream of event_records
python_modules/dagster/dagster/core/events/logging.py
def construct_event_logger(event_record_callback): ''' Callback receives a stream of event_records ''' check.callable_param(event_record_callback, 'event_record_callback') return construct_single_handler_logger( 'event-logger', DEBUG, StructuredLoggerHandler( lam...
def construct_event_logger(event_record_callback): ''' Callback receives a stream of event_records ''' check.callable_param(event_record_callback, 'event_record_callback') return construct_single_handler_logger( 'event-logger', DEBUG, StructuredLoggerHandler( lam...
[ "Callback", "receives", "a", "stream", "of", "event_records" ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/events/logging.py#L134-L146
[ "def", "construct_event_logger", "(", "event_record_callback", ")", ":", "check", ".", "callable_param", "(", "event_record_callback", ",", "'event_record_callback'", ")", "return", "construct_single_handler_logger", "(", "'event-logger'", ",", "DEBUG", ",", "StructuredLogg...
4119f8c773089de64831b1dfb9e168e353d401dc
test
construct_json_event_logger
Record a stream of event records to json
python_modules/dagster/dagster/core/events/logging.py
def construct_json_event_logger(json_path): '''Record a stream of event records to json''' check.str_param(json_path, 'json_path') return construct_single_handler_logger( "json-event-record-logger", DEBUG, JsonEventLoggerHandler( json_path, lambda record: cons...
def construct_json_event_logger(json_path): '''Record a stream of event records to json''' check.str_param(json_path, 'json_path') return construct_single_handler_logger( "json-event-record-logger", DEBUG, JsonEventLoggerHandler( json_path, lambda record: cons...
[ "Record", "a", "stream", "of", "event", "records", "to", "json" ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/events/logging.py#L149-L167
[ "def", "construct_json_event_logger", "(", "json_path", ")", ":", "check", ".", "str_param", "(", "json_path", ",", "'json_path'", ")", "return", "construct_single_handler_logger", "(", "\"json-event-record-logger\"", ",", "DEBUG", ",", "JsonEventLoggerHandler", "(", "j...
4119f8c773089de64831b1dfb9e168e353d401dc
test
RCParser.from_file
Read a config file and instantiate the RCParser. Create new :class:`configparser.ConfigParser` for the given **path** and instantiate the :class:`RCParser` with the ConfigParser as :attr:`config` attribute. If the **path** doesn't exist, raise :exc:`ConfigFileError`. Otherwise ...
bin/pypirc.py
def from_file(cls, path=None): """Read a config file and instantiate the RCParser. Create new :class:`configparser.ConfigParser` for the given **path** and instantiate the :class:`RCParser` with the ConfigParser as :attr:`config` attribute. If the **path** doesn't exist, raise ...
def from_file(cls, path=None): """Read a config file and instantiate the RCParser. Create new :class:`configparser.ConfigParser` for the given **path** and instantiate the :class:`RCParser` with the ConfigParser as :attr:`config` attribute. If the **path** doesn't exist, raise ...
[ "Read", "a", "config", "file", "and", "instantiate", "the", "RCParser", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/bin/pypirc.py#L49-L69
[ "def", "from_file", "(", "cls", ",", "path", "=", "None", ")", ":", "path", "=", "path", "or", "cls", ".", "CONFIG_PATH", "if", "not", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "error", "=", "'Config file not found: {0!r}'", ".", "format...
4119f8c773089de64831b1dfb9e168e353d401dc
test
RCParser.get_repository_config
Get config dictionary for the given repository. If the repository section is not found in the config file, return ``None``. If the file is invalid, raise :exc:`configparser.Error`. Otherwise return a dictionary with: * ``'repository'`` -- the repository URL * ``'usern...
bin/pypirc.py
def get_repository_config(self, repository): """Get config dictionary for the given repository. If the repository section is not found in the config file, return ``None``. If the file is invalid, raise :exc:`configparser.Error`. Otherwise return a dictionary with: * `...
def get_repository_config(self, repository): """Get config dictionary for the given repository. If the repository section is not found in the config file, return ``None``. If the file is invalid, raise :exc:`configparser.Error`. Otherwise return a dictionary with: * `...
[ "Get", "config", "dictionary", "for", "the", "given", "repository", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/bin/pypirc.py#L71-L91
[ "def", "get_repository_config", "(", "self", ",", "repository", ")", ":", "servers", "=", "self", ".", "_read_index_servers", "(", ")", "repo_config", "=", "self", ".", "_find_repo_config", "(", "servers", ",", "repository", ")", "return", "repo_config" ]
4119f8c773089de64831b1dfb9e168e353d401dc
test
replace_parameters
Assigned parameters into the appropiate place in the input notebook Args: nb (NotebookNode): Executable notebook object parameters (dict): Arbitrary keyword arguments to pass to the notebook parameters.
python_modules/dagstermill/dagstermill/__init__.py
def replace_parameters(context, nb, parameters): # Uma: This is a copy-paste from papermill papermill/execute.py:104 (execute_parameters). # Typically, papermill injects the injected-parameters cell *below* the parameters cell # but we want to *replace* the parameters cell, which is what this function does....
def replace_parameters(context, nb, parameters): # Uma: This is a copy-paste from papermill papermill/execute.py:104 (execute_parameters). # Typically, papermill injects the injected-parameters cell *below* the parameters cell # but we want to *replace* the parameters cell, which is what this function does....
[ "Assigned", "parameters", "into", "the", "appropiate", "place", "in", "the", "input", "notebook", "Args", ":", "nb", "(", "NotebookNode", ")", ":", "Executable", "notebook", "object", "parameters", "(", "dict", ")", ":", "Arbitrary", "keyword", "arguments", "t...
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagstermill/dagstermill/__init__.py#L478-L526
[ "def", "replace_parameters", "(", "context", ",", "nb", ",", "parameters", ")", ":", "# Uma: This is a copy-paste from papermill papermill/execute.py:104 (execute_parameters).", "# Typically, papermill injects the injected-parameters cell *below* the parameters cell", "# but we want to *repl...
4119f8c773089de64831b1dfb9e168e353d401dc
test
nonce_solid
Creates a solid with the given number of (meaningless) inputs and outputs. Config controls the behavior of the nonce solid.
examples/toys/log_spew.py
def nonce_solid(name, n_inputs, n_outputs): """Creates a solid with the given number of (meaningless) inputs and outputs. Config controls the behavior of the nonce solid.""" @solid( name=name, inputs=[ InputDefinition(name='input_{}'.format(i)) for i in range(n_inputs) ...
def nonce_solid(name, n_inputs, n_outputs): """Creates a solid with the given number of (meaningless) inputs and outputs. Config controls the behavior of the nonce solid.""" @solid( name=name, inputs=[ InputDefinition(name='input_{}'.format(i)) for i in range(n_inputs) ...
[ "Creates", "a", "solid", "with", "the", "given", "number", "of", "(", "meaningless", ")", "inputs", "and", "outputs", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/examples/toys/log_spew.py#L14-L60
[ "def", "nonce_solid", "(", "name", ",", "n_inputs", ",", "n_outputs", ")", ":", "@", "solid", "(", "name", "=", "name", ",", "inputs", "=", "[", "InputDefinition", "(", "name", "=", "'input_{}'", ".", "format", "(", "i", ")", ")", "for", "i", "in", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
format_config_for_graphql
This recursive descent thing formats a config dict for GraphQL.
python_modules/dagster-airflow/dagster_airflow/format.py
def format_config_for_graphql(config): '''This recursive descent thing formats a config dict for GraphQL.''' def _format_config_subdict(config, current_indent=0): check.dict_param(config, 'config', key_type=str) printer = IndentingStringIoPrinter(indent_level=2, current_indent=current_indent) ...
def format_config_for_graphql(config): '''This recursive descent thing formats a config dict for GraphQL.''' def _format_config_subdict(config, current_indent=0): check.dict_param(config, 'config', key_type=str) printer = IndentingStringIoPrinter(indent_level=2, current_indent=current_indent) ...
[ "This", "recursive", "descent", "thing", "formats", "a", "config", "dict", "for", "GraphQL", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster-airflow/dagster_airflow/format.py#L5-L71
[ "def", "format_config_for_graphql", "(", "config", ")", ":", "def", "_format_config_subdict", "(", "config", ",", "current_indent", "=", "0", ")", ":", "check", ".", "dict_param", "(", "config", ",", "'config'", ",", "key_type", "=", "str", ")", "printer", "...
4119f8c773089de64831b1dfb9e168e353d401dc
test
RepositoryDefinition.get_pipeline
Get a pipeline by name. Only constructs that pipeline and caches it. Args: name (str): Name of the pipeline to retriever Returns: PipelineDefinition: Instance of PipelineDefinition with that name.
python_modules/dagster/dagster/core/definitions/repository.py
def get_pipeline(self, name): '''Get a pipeline by name. Only constructs that pipeline and caches it. Args: name (str): Name of the pipeline to retriever Returns: PipelineDefinition: Instance of PipelineDefinition with that name. ''' check.str_param(name...
def get_pipeline(self, name): '''Get a pipeline by name. Only constructs that pipeline and caches it. Args: name (str): Name of the pipeline to retriever Returns: PipelineDefinition: Instance of PipelineDefinition with that name. ''' check.str_param(name...
[ "Get", "a", "pipeline", "by", "name", ".", "Only", "constructs", "that", "pipeline", "and", "caches", "it", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/definitions/repository.py#L56-L100
[ "def", "get_pipeline", "(", "self", ",", "name", ")", ":", "check", ".", "str_param", "(", "name", ",", "'name'", ")", "if", "name", "in", "self", ".", "_pipeline_cache", ":", "return", "self", ".", "_pipeline_cache", "[", "name", "]", "try", ":", "pip...
4119f8c773089de64831b1dfb9e168e353d401dc
test
RepositoryDefinition.get_all_pipelines
Return all pipelines as a list Returns: List[PipelineDefinition]:
python_modules/dagster/dagster/core/definitions/repository.py
def get_all_pipelines(self): '''Return all pipelines as a list Returns: List[PipelineDefinition]: ''' pipelines = list(map(self.get_pipeline, self.pipeline_dict.keys())) # This does uniqueness check self._construct_solid_defs(pipelines) return pipeli...
def get_all_pipelines(self): '''Return all pipelines as a list Returns: List[PipelineDefinition]: ''' pipelines = list(map(self.get_pipeline, self.pipeline_dict.keys())) # This does uniqueness check self._construct_solid_defs(pipelines) return pipeli...
[ "Return", "all", "pipelines", "as", "a", "list" ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/definitions/repository.py#L102-L112
[ "def", "get_all_pipelines", "(", "self", ")", ":", "pipelines", "=", "list", "(", "map", "(", "self", ".", "get_pipeline", ",", "self", ".", "pipeline_dict", ".", "keys", "(", ")", ")", ")", "# This does uniqueness check", "self", ".", "_construct_solid_defs",...
4119f8c773089de64831b1dfb9e168e353d401dc
test
define_spark_config
Spark configuration. See the Spark documentation for reference: https://spark.apache.org/docs/latest/submitting-applications.html
python_modules/libraries/dagster-spark/dagster_spark/configs.py
def define_spark_config(): '''Spark configuration. See the Spark documentation for reference: https://spark.apache.org/docs/latest/submitting-applications.html ''' master_url = Field( String, description='The master URL for the cluster (e.g. spark://23.195.26.187:7077)', ...
def define_spark_config(): '''Spark configuration. See the Spark documentation for reference: https://spark.apache.org/docs/latest/submitting-applications.html ''' master_url = Field( String, description='The master URL for the cluster (e.g. spark://23.195.26.187:7077)', ...
[ "Spark", "configuration", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/libraries/dagster-spark/dagster_spark/configs.py#L14-L75
[ "def", "define_spark_config", "(", ")", ":", "master_url", "=", "Field", "(", "String", ",", "description", "=", "'The master URL for the cluster (e.g. spark://23.195.26.187:7077)'", ",", "is_optional", "=", "False", ",", ")", "deploy_mode", "=", "Field", "(", "SparkD...
4119f8c773089de64831b1dfb9e168e353d401dc
test
get_next_event
This function polls the process until it returns a valid item or returns PROCESS_DEAD_AND_QUEUE_EMPTY if it is in a state where the process has terminated and the queue is empty Warning: if the child process is in an infinite loop. This will also infinitely loop.
python_modules/dagster/dagster/core/execution_plan/child_process_executor.py
def get_next_event(process, queue): ''' This function polls the process until it returns a valid item or returns PROCESS_DEAD_AND_QUEUE_EMPTY if it is in a state where the process has terminated and the queue is empty Warning: if the child process is in an infinite loop. This will also infinite...
def get_next_event(process, queue): ''' This function polls the process until it returns a valid item or returns PROCESS_DEAD_AND_QUEUE_EMPTY if it is in a state where the process has terminated and the queue is empty Warning: if the child process is in an infinite loop. This will also infinite...
[ "This", "function", "polls", "the", "process", "until", "it", "returns", "a", "valid", "item", "or", "returns", "PROCESS_DEAD_AND_QUEUE_EMPTY", "if", "it", "is", "in", "a", "state", "where", "the", "process", "has", "terminated", "and", "the", "queue", "is", ...
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution_plan/child_process_executor.py#L65-L89
[ "def", "get_next_event", "(", "process", ",", "queue", ")", ":", "while", "True", ":", "try", ":", "return", "queue", ".", "get", "(", "block", "=", "True", ",", "timeout", "=", "TICK", ")", "except", "multiprocessing", ".", "queues", ".", "Empty", ":"...
4119f8c773089de64831b1dfb9e168e353d401dc
test
execute_pipeline_through_queue
Execute pipeline using message queue as a transport
python_modules/dagster-graphql/dagster_graphql/implementation/pipeline_execution_manager.py
def execute_pipeline_through_queue( repository_info, pipeline_name, solid_subset, environment_dict, run_id, message_queue, reexecution_config, step_keys_to_execute, ): """ Execute pipeline using message queue as a transport """ message_queue.put(ProcessStartedSentinel(os...
def execute_pipeline_through_queue( repository_info, pipeline_name, solid_subset, environment_dict, run_id, message_queue, reexecution_config, step_keys_to_execute, ): """ Execute pipeline using message queue as a transport """ message_queue.put(ProcessStartedSentinel(os...
[ "Execute", "pipeline", "using", "message", "queue", "as", "a", "transport" ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster-graphql/dagster_graphql/implementation/pipeline_execution_manager.py#L268-L315
[ "def", "execute_pipeline_through_queue", "(", "repository_info", ",", "pipeline_name", ",", "solid_subset", ",", "environment_dict", ",", "run_id", ",", "message_queue", ",", "reexecution_config", ",", "step_keys_to_execute", ",", ")", ":", "message_queue", ".", "put", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
MultiprocessingExecutionManager.join
Waits until all there are no processes enqueued.
python_modules/dagster-graphql/dagster_graphql/implementation/pipeline_execution_manager.py
def join(self): '''Waits until all there are no processes enqueued.''' while True: with self._processes_lock: if not self._processes and self._processing_semaphore.locked(): return True gevent.sleep(0.1)
def join(self): '''Waits until all there are no processes enqueued.''' while True: with self._processes_lock: if not self._processes and self._processing_semaphore.locked(): return True gevent.sleep(0.1)
[ "Waits", "until", "all", "there", "are", "no", "processes", "enqueued", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster-graphql/dagster_graphql/implementation/pipeline_execution_manager.py#L223-L229
[ "def", "join", "(", "self", ")", ":", "while", "True", ":", "with", "self", ".", "_processes_lock", ":", "if", "not", "self", ".", "_processes", "and", "self", ".", "_processing_semaphore", ".", "locked", "(", ")", ":", "return", "True", "gevent", ".", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
Field
The schema for configuration data that describes the type, optionality, defaults, and description. Args: dagster_type (DagsterType): A ``DagsterType`` describing the schema of this field, ie `Dict({'example': Field(String)})` default_value (Any): A default value to use that ...
python_modules/dagster/dagster/core/types/field.py
def Field( dagster_type, default_value=FIELD_NO_DEFAULT_PROVIDED, is_optional=INFER_OPTIONAL_COMPOSITE_FIELD, is_secret=False, description=None, ): ''' The schema for configuration data that describes the type, optionality, defaults, and description. Args: dagster_type (DagsterT...
def Field( dagster_type, default_value=FIELD_NO_DEFAULT_PROVIDED, is_optional=INFER_OPTIONAL_COMPOSITE_FIELD, is_secret=False, description=None, ): ''' The schema for configuration data that describes the type, optionality, defaults, and description. Args: dagster_type (DagsterT...
[ "The", "schema", "for", "configuration", "data", "that", "describes", "the", "type", "optionality", "defaults", "and", "description", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/types/field.py#L34-L66
[ "def", "Field", "(", "dagster_type", ",", "default_value", "=", "FIELD_NO_DEFAULT_PROVIDED", ",", "is_optional", "=", "INFER_OPTIONAL_COMPOSITE_FIELD", ",", "is_secret", "=", "False", ",", "description", "=", "None", ",", ")", ":", "config_type", "=", "resolve_to_co...
4119f8c773089de64831b1dfb9e168e353d401dc
test
define_snowflake_config
Snowflake configuration. See the Snowflake documentation for reference: https://docs.snowflake.net/manuals/user-guide/python-connector-api.html
python_modules/libraries/dagster-snowflake/dagster_snowflake/configs.py
def define_snowflake_config(): '''Snowflake configuration. See the Snowflake documentation for reference: https://docs.snowflake.net/manuals/user-guide/python-connector-api.html ''' account = Field( String, description='Your Snowflake account name. For more details, see https:...
def define_snowflake_config(): '''Snowflake configuration. See the Snowflake documentation for reference: https://docs.snowflake.net/manuals/user-guide/python-connector-api.html ''' account = Field( String, description='Your Snowflake account name. For more details, see https:...
[ "Snowflake", "configuration", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/libraries/dagster-snowflake/dagster_snowflake/configs.py#L4-L136
[ "def", "define_snowflake_config", "(", ")", ":", "account", "=", "Field", "(", "String", ",", "description", "=", "'Your Snowflake account name. For more details, see https://bit.ly/2FBL320.'", ",", "is_optional", "=", "True", ",", ")", "user", "=", "Field", "(", "St...
4119f8c773089de64831b1dfb9e168e353d401dc
test
_PlanBuilder.build
Builds the execution plan.
python_modules/dagster/dagster/core/execution_plan/plan.py
def build(self, pipeline_def, artifacts_persisted): '''Builds the execution plan. ''' # Construct dependency dictionary deps = {step.key: set() for step in self.steps} for step in self.steps: for step_input in step.step_inputs: deps[step.key].add(ste...
def build(self, pipeline_def, artifacts_persisted): '''Builds the execution plan. ''' # Construct dependency dictionary deps = {step.key: set() for step in self.steps} for step in self.steps: for step_input in step.step_inputs: deps[step.key].add(ste...
[ "Builds", "the", "execution", "plan", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution_plan/plan.py#L72-L85
[ "def", "build", "(", "self", ",", "pipeline_def", ",", "artifacts_persisted", ")", ":", "# Construct dependency dictionary", "deps", "=", "{", "step", ".", "key", ":", "set", "(", ")", "for", "step", "in", "self", ".", "steps", "}", "for", "step", "in", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
ExecutionPlan.build
Here we build a new ExecutionPlan from a pipeline definition and the environment config. To do this, we iterate through the pipeline's solids in topological order, and hand off the execution steps for each solid to a companion _PlanBuilder object. Once we've processed the entire pipeline, we i...
python_modules/dagster/dagster/core/execution_plan/plan.py
def build(pipeline_def, environment_config): '''Here we build a new ExecutionPlan from a pipeline definition and the environment config. To do this, we iterate through the pipeline's solids in topological order, and hand off the execution steps for each solid to a companion _PlanBuilder object....
def build(pipeline_def, environment_config): '''Here we build a new ExecutionPlan from a pipeline definition and the environment config. To do this, we iterate through the pipeline's solids in topological order, and hand off the execution steps for each solid to a companion _PlanBuilder object....
[ "Here", "we", "build", "a", "new", "ExecutionPlan", "from", "a", "pipeline", "definition", "and", "the", "environment", "config", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution_plan/plan.py#L193-L255
[ "def", "build", "(", "pipeline_def", ",", "environment_config", ")", ":", "check", ".", "inst_param", "(", "pipeline_def", ",", "'pipeline_def'", ",", "PipelineDefinition", ")", "check", ".", "inst_param", "(", "environment_config", ",", "'environment_config'", ",",...
4119f8c773089de64831b1dfb9e168e353d401dc
test
_build_sub_pipeline
Build a pipeline which is a subset of another pipeline. Only includes the solids which are in solid_names.
python_modules/dagster/dagster/core/definitions/pipeline.py
def _build_sub_pipeline(pipeline_def, solid_names): ''' Build a pipeline which is a subset of another pipeline. Only includes the solids which are in solid_names. ''' check.inst_param(pipeline_def, 'pipeline_def', PipelineDefinition) check.list_param(solid_names, 'solid_names', of_type=str) ...
def _build_sub_pipeline(pipeline_def, solid_names): ''' Build a pipeline which is a subset of another pipeline. Only includes the solids which are in solid_names. ''' check.inst_param(pipeline_def, 'pipeline_def', PipelineDefinition) check.list_param(solid_names, 'solid_names', of_type=str) ...
[ "Build", "a", "pipeline", "which", "is", "a", "subset", "of", "another", "pipeline", ".", "Only", "includes", "the", "solids", "which", "are", "in", "solid_names", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/definitions/pipeline.py#L302-L335
[ "def", "_build_sub_pipeline", "(", "pipeline_def", ",", "solid_names", ")", ":", "check", ".", "inst_param", "(", "pipeline_def", ",", "'pipeline_def'", ",", "PipelineDefinition", ")", "check", ".", "list_param", "(", "solid_names", ",", "'solid_names'", ",", "of_...
4119f8c773089de64831b1dfb9e168e353d401dc
test
PipelineDefinition.solid_named
Return the solid named "name". Throws if it does not exist. Args: name (str): Name of solid Returns: SolidDefinition: SolidDefinition with correct name.
python_modules/dagster/dagster/core/definitions/pipeline.py
def solid_named(self, name): '''Return the solid named "name". Throws if it does not exist. Args: name (str): Name of solid Returns: SolidDefinition: SolidDefinition with correct name. ''' check.str_param(name, 'name') if name not in self._solid_...
def solid_named(self, name): '''Return the solid named "name". Throws if it does not exist. Args: name (str): Name of solid Returns: SolidDefinition: SolidDefinition with correct name. ''' check.str_param(name, 'name') if name not in self._solid_...
[ "Return", "the", "solid", "named", "name", ".", "Throws", "if", "it", "does", "not", "exist", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/definitions/pipeline.py#L185-L201
[ "def", "solid_named", "(", "self", ",", "name", ")", ":", "check", ".", "str_param", "(", "name", ",", "'name'", ")", "if", "name", "not", "in", "self", ".", "_solid_dict", ":", "raise", "DagsterInvariantViolationError", "(", "'Pipeline {pipeline_name} has no so...
4119f8c773089de64831b1dfb9e168e353d401dc
test
construct_publish_comands
Get the shell commands we'll use to actually build and publish a package to PyPI.
bin/publish.py
def construct_publish_comands(additional_steps=None, nightly=False): '''Get the shell commands we'll use to actually build and publish a package to PyPI.''' publish_commands = ( ['rm -rf dist'] + (additional_steps if additional_steps else []) + [ 'python setup.py sdist bdist_...
def construct_publish_comands(additional_steps=None, nightly=False): '''Get the shell commands we'll use to actually build and publish a package to PyPI.''' publish_commands = ( ['rm -rf dist'] + (additional_steps if additional_steps else []) + [ 'python setup.py sdist bdist_...
[ "Get", "the", "shell", "commands", "we", "ll", "use", "to", "actually", "build", "and", "publish", "a", "package", "to", "PyPI", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/bin/publish.py#L50-L63
[ "def", "construct_publish_comands", "(", "additional_steps", "=", "None", ",", "nightly", "=", "False", ")", ":", "publish_commands", "=", "(", "[", "'rm -rf dist'", "]", "+", "(", "additional_steps", "if", "additional_steps", "else", "[", "]", ")", "+", "[", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
publish
Publishes (uploads) all submodules to PyPI. Appropriate credentials must be available to twine, e.g. in a ~/.pypirc file, and users must be permissioned as maintainers on the PyPI projects. Publishing will fail if versions (git tags and Python versions) are not in lockstep, if the current commit is not tag...
bin/publish.py
def publish(nightly): """Publishes (uploads) all submodules to PyPI. Appropriate credentials must be available to twine, e.g. in a ~/.pypirc file, and users must be permissioned as maintainers on the PyPI projects. Publishing will fail if versions (git tags and Python versions) are not in lockstep, if ...
def publish(nightly): """Publishes (uploads) all submodules to PyPI. Appropriate credentials must be available to twine, e.g. in a ~/.pypirc file, and users must be permissioned as maintainers on the PyPI projects. Publishing will fail if versions (git tags and Python versions) are not in lockstep, if ...
[ "Publishes", "(", "uploads", ")", "all", "submodules", "to", "PyPI", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/bin/publish.py#L416-L459
[ "def", "publish", "(", "nightly", ")", ":", "try", ":", "RCParser", ".", "from_file", "(", ")", "except", "ConfigFileError", ":", "raise", "ConfigFileError", "(", "PYPIRC_EXCEPTION_MESSAGE", ")", "assert", "'\\nwheel'", "in", "subprocess", ".", "check_output", "...
4119f8c773089de64831b1dfb9e168e353d401dc
test
release
Tags all submodules for a new release. Ensures that git tags, as well as the version.py files in each submodule, agree and that the new version is strictly greater than the current version. Will fail if the new version is not an increment (following PEP 440). Creates a new git tag and commit.
bin/publish.py
def release(version): """Tags all submodules for a new release. Ensures that git tags, as well as the version.py files in each submodule, agree and that the new version is strictly greater than the current version. Will fail if the new version is not an increment (following PEP 440). Creates a new git ...
def release(version): """Tags all submodules for a new release. Ensures that git tags, as well as the version.py files in each submodule, agree and that the new version is strictly greater than the current version. Will fail if the new version is not an increment (following PEP 440). Creates a new git ...
[ "Tags", "all", "submodules", "for", "a", "new", "release", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/bin/publish.py#L464-L474
[ "def", "release", "(", "version", ")", ":", "check_new_version", "(", "version", ")", "set_new_version", "(", "version", ")", "commit_new_version", "(", "version", ")", "set_git_tag", "(", "version", ")" ]
4119f8c773089de64831b1dfb9e168e353d401dc
test
PipelineContextDefinition.passthrough_context_definition
Create a context definition from a pre-existing context. This can be useful in testing contexts where you may want to create a context manually and then pass it into a one-off PipelineDefinition Args: context (ExecutionContext): The context that will provided to the pipeline. ...
python_modules/dagster/dagster/core/definitions/context.py
def passthrough_context_definition(context_params): '''Create a context definition from a pre-existing context. This can be useful in testing contexts where you may want to create a context manually and then pass it into a one-off PipelineDefinition Args: context (ExecutionC...
def passthrough_context_definition(context_params): '''Create a context definition from a pre-existing context. This can be useful in testing contexts where you may want to create a context manually and then pass it into a one-off PipelineDefinition Args: context (ExecutionC...
[ "Create", "a", "context", "definition", "from", "a", "pre", "-", "existing", "context", ".", "This", "can", "be", "useful", "in", "testing", "contexts", "where", "you", "may", "want", "to", "create", "a", "context", "manually", "and", "then", "pass", "it",...
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/definitions/context.py#L58-L71
[ "def", "passthrough_context_definition", "(", "context_params", ")", ":", "check", ".", "inst_param", "(", "context_params", ",", "'context'", ",", "ExecutionContext", ")", "context_definition", "=", "PipelineContextDefinition", "(", "context_fn", "=", "lambda", "*", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
input_selector_schema
A decorator for annotating a function that can take the selected properties from a ``config_value`` in to an instance of a custom type. Args: config_cls (Selector)
python_modules/dagster/dagster/core/types/config_schema.py
def input_selector_schema(config_cls): ''' A decorator for annotating a function that can take the selected properties from a ``config_value`` in to an instance of a custom type. Args: config_cls (Selector) ''' config_type = resolve_config_cls_arg(config_cls) check.param_invariant(c...
def input_selector_schema(config_cls): ''' A decorator for annotating a function that can take the selected properties from a ``config_value`` in to an instance of a custom type. Args: config_cls (Selector) ''' config_type = resolve_config_cls_arg(config_cls) check.param_invariant(c...
[ "A", "decorator", "for", "annotating", "a", "function", "that", "can", "take", "the", "selected", "properties", "from", "a", "config_value", "in", "to", "an", "instance", "of", "a", "custom", "type", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/types/config_schema.py#L85-L103
[ "def", "input_selector_schema", "(", "config_cls", ")", ":", "config_type", "=", "resolve_config_cls_arg", "(", "config_cls", ")", "check", ".", "param_invariant", "(", "config_type", ".", "is_selector", ",", "'config_cls'", ")", "def", "_wrap", "(", "func", ")", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
output_selector_schema
A decorator for a annotating a function that can take the selected properties of a ``config_value`` and an instance of a custom type and materialize it. Args: config_cls (Selector):
python_modules/dagster/dagster/core/types/config_schema.py
def output_selector_schema(config_cls): ''' A decorator for a annotating a function that can take the selected properties of a ``config_value`` and an instance of a custom type and materialize it. Args: config_cls (Selector): ''' config_type = resolve_config_cls_arg(config_cls) chec...
def output_selector_schema(config_cls): ''' A decorator for a annotating a function that can take the selected properties of a ``config_value`` and an instance of a custom type and materialize it. Args: config_cls (Selector): ''' config_type = resolve_config_cls_arg(config_cls) chec...
[ "A", "decorator", "for", "a", "annotating", "a", "function", "that", "can", "take", "the", "selected", "properties", "of", "a", "config_value", "and", "an", "instance", "of", "a", "custom", "type", "and", "materialize", "it", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/types/config_schema.py#L130-L148
[ "def", "output_selector_schema", "(", "config_cls", ")", ":", "config_type", "=", "resolve_config_cls_arg", "(", "config_cls", ")", "check", ".", "param_invariant", "(", "config_type", ".", "is_selector", ",", "'config_cls'", ")", "def", "_wrap", "(", "func", ")",...
4119f8c773089de64831b1dfb9e168e353d401dc
test
IndentingPrinter.block
Automagically wrap a block of text.
python_modules/dagster/dagster/utils/indenting_printer.py
def block(self, text, prefix=''): '''Automagically wrap a block of text.''' wrapper = TextWrapper( width=self.line_length - len(self.current_indent_str), initial_indent=prefix, subsequent_indent=prefix, break_long_words=False, break_on_hyphens=...
def block(self, text, prefix=''): '''Automagically wrap a block of text.''' wrapper = TextWrapper( width=self.line_length - len(self.current_indent_str), initial_indent=prefix, subsequent_indent=prefix, break_long_words=False, break_on_hyphens=...
[ "Automagically", "wrap", "a", "block", "of", "text", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/utils/indenting_printer.py#L32-L42
[ "def", "block", "(", "self", ",", "text", ",", "prefix", "=", "''", ")", ":", "wrapper", "=", "TextWrapper", "(", "width", "=", "self", ".", "line_length", "-", "len", "(", "self", ".", "current_indent_str", ")", ",", "initial_indent", "=", "prefix", "...
4119f8c773089de64831b1dfb9e168e353d401dc
test
_define_shared_fields
The following fields are shared between both QueryJobConfig and LoadJobConfig.
python_modules/libraries/dagster-gcp/dagster_gcp/configs.py
def _define_shared_fields(): '''The following fields are shared between both QueryJobConfig and LoadJobConfig. ''' clustering_fields = Field( List(String), description='''Fields defining clustering for the table (Defaults to None). Clustering fields are immutable after tab...
def _define_shared_fields(): '''The following fields are shared between both QueryJobConfig and LoadJobConfig. ''' clustering_fields = Field( List(String), description='''Fields defining clustering for the table (Defaults to None). Clustering fields are immutable after tab...
[ "The", "following", "fields", "are", "shared", "between", "both", "QueryJobConfig", "and", "LoadJobConfig", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/libraries/dagster-gcp/dagster_gcp/configs.py#L40-L122
[ "def", "_define_shared_fields", "(", ")", ":", "clustering_fields", "=", "Field", "(", "List", "(", "String", ")", ",", "description", "=", "'''Fields defining clustering for the table\n\n (Defaults to None).\n\n Clustering fields are immutable after table creation.\n ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
define_bigquery_query_config
See: https://googleapis.github.io/google-cloud-python/latest/bigquery/generated/google.cloud.bigquery.job.QueryJobConfig.html
python_modules/libraries/dagster-gcp/dagster_gcp/configs.py
def define_bigquery_query_config(): '''See: https://googleapis.github.io/google-cloud-python/latest/bigquery/generated/google.cloud.bigquery.job.QueryJobConfig.html ''' sf = _define_shared_fields() allow_large_results = Field( Bool, description='''Allow large query results tables (l...
def define_bigquery_query_config(): '''See: https://googleapis.github.io/google-cloud-python/latest/bigquery/generated/google.cloud.bigquery.job.QueryJobConfig.html ''' sf = _define_shared_fields() allow_large_results = Field( Bool, description='''Allow large query results tables (l...
[ "See", ":", "https", ":", "//", "googleapis", ".", "github", ".", "io", "/", "google", "-", "cloud", "-", "python", "/", "latest", "/", "bigquery", "/", "generated", "/", "google", ".", "cloud", ".", "bigquery", ".", "job", ".", "QueryJobConfig", ".", ...
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/libraries/dagster-gcp/dagster_gcp/configs.py#L125-L280
[ "def", "define_bigquery_query_config", "(", ")", ":", "sf", "=", "_define_shared_fields", "(", ")", "allow_large_results", "=", "Field", "(", "Bool", ",", "description", "=", "'''Allow large query results tables (legacy SQL, only)\n See https://g.co/cloud/bigquery/docs/ref...
4119f8c773089de64831b1dfb9e168e353d401dc
test
sql_solid
Return a new solid that executes and materializes a SQL select statement. Args: name (str): The name of the new solid. select_statement (str): The select statement to execute. materialization_strategy (str): Must be 'table', the only currently supported materialization strategy....
examples/airline-demo/airline_demo/solids.py
def sql_solid(name, select_statement, materialization_strategy, table_name=None, inputs=None): '''Return a new solid that executes and materializes a SQL select statement. Args: name (str): The name of the new solid. select_statement (str): The select statement to execute. materializati...
def sql_solid(name, select_statement, materialization_strategy, table_name=None, inputs=None): '''Return a new solid that executes and materializes a SQL select statement. Args: name (str): The name of the new solid. select_statement (str): The select statement to execute. materializati...
[ "Return", "a", "new", "solid", "that", "executes", "and", "materializes", "a", "SQL", "select", "statement", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/examples/airline-demo/airline_demo/solids.py#L42-L130
[ "def", "sql_solid", "(", "name", ",", "select_statement", ",", "materialization_strategy", ",", "table_name", "=", "None", ",", "inputs", "=", "None", ")", ":", "inputs", "=", "check", ".", "opt_list_param", "(", "inputs", ",", "'inputs'", ",", "InputDefinitio...
4119f8c773089de64831b1dfb9e168e353d401dc
test
download_from_s3
Download an object from s3. Args: info (ExpectationExecutionInfo): Must expose a boto3 S3 client as its `s3` resource. Returns: str: The path to the downloaded object.
examples/airline-demo/airline_demo/solids.py
def download_from_s3(context): '''Download an object from s3. Args: info (ExpectationExecutionInfo): Must expose a boto3 S3 client as its `s3` resource. Returns: str: The path to the downloaded object. ''' target_file = context.solid_config['target_file'] return con...
def download_from_s3(context): '''Download an object from s3. Args: info (ExpectationExecutionInfo): Must expose a boto3 S3 client as its `s3` resource. Returns: str: The path to the downloaded object. ''' target_file = context.solid_config['target_file'] return con...
[ "Download", "an", "object", "from", "s3", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/examples/airline-demo/airline_demo/solids.py#L141-L152
[ "def", "download_from_s3", "(", "context", ")", ":", "target_file", "=", "context", ".", "solid_config", "[", "'target_file'", "]", "return", "context", ".", "resources", ".", "download_manager", ".", "download_file_contents", "(", "context", ",", "target_file", "...
4119f8c773089de64831b1dfb9e168e353d401dc
test
upload_to_s3
Upload a file to s3. Args: info (ExpectationExecutionInfo): Must expose a boto3 S3 client as its `s3` resource. Returns: (str, str): The bucket and key to which the file was uploaded.
examples/airline-demo/airline_demo/solids.py
def upload_to_s3(context, file_obj): '''Upload a file to s3. Args: info (ExpectationExecutionInfo): Must expose a boto3 S3 client as its `s3` resource. Returns: (str, str): The bucket and key to which the file was uploaded. ''' bucket = context.solid_config['bucket'] ...
def upload_to_s3(context, file_obj): '''Upload a file to s3. Args: info (ExpectationExecutionInfo): Must expose a boto3 S3 client as its `s3` resource. Returns: (str, str): The bucket and key to which the file was uploaded. ''' bucket = context.solid_config['bucket'] ...
[ "Upload", "a", "file", "to", "s3", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/examples/airline-demo/airline_demo/solids.py#L180-L197
[ "def", "upload_to_s3", "(", "context", ",", "file_obj", ")", ":", "bucket", "=", "context", ".", "solid_config", "[", "'bucket'", "]", "key", "=", "context", ".", "solid_config", "[", "'key'", "]", "context", ".", "resources", ".", "s3", ".", "put_object",...
4119f8c773089de64831b1dfb9e168e353d401dc
test
user_code_error_boundary
Wraps the execution of user-space code in an error boundary. This places a uniform policy around an user code invoked by the framework. This ensures that all user errors are wrapped in the DagsterUserCodeExecutionError, and that the original stack trace of the user error is preserved, so that it can be repo...
python_modules/dagster/dagster/core/errors.py
def user_code_error_boundary(error_cls, msg, **kwargs): ''' Wraps the execution of user-space code in an error boundary. This places a uniform policy around an user code invoked by the framework. This ensures that all user errors are wrapped in the DagsterUserCodeExecutionError, and that the original st...
def user_code_error_boundary(error_cls, msg, **kwargs): ''' Wraps the execution of user-space code in an error boundary. This places a uniform policy around an user code invoked by the framework. This ensures that all user errors are wrapped in the DagsterUserCodeExecutionError, and that the original st...
[ "Wraps", "the", "execution", "of", "user", "-", "space", "code", "in", "an", "error", "boundary", ".", "This", "places", "a", "uniform", "policy", "around", "an", "user", "code", "invoked", "by", "the", "framework", ".", "This", "ensures", "that", "all", ...
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/errors.py#L164-L187
[ "def", "user_code_error_boundary", "(", "error_cls", ",", "msg", ",", "*", "*", "kwargs", ")", ":", "check", ".", "str_param", "(", "msg", ",", "'msg'", ")", "check", ".", "subclass_param", "(", "error_cls", ",", "'error_cls'", ",", "DagsterUserCodeExecutionEr...
4119f8c773089de64831b1dfb9e168e353d401dc
test
mkdir_p
The missing mkdir -p functionality in os.
examples/airline-demo/airline_demo/utils.py
def mkdir_p(newdir, mode=0o777): """The missing mkdir -p functionality in os.""" try: os.makedirs(newdir, mode) except OSError as err: # Reraise the error unless it's about an already existing directory if err.errno != errno.EEXIST or not os.path.isdir(newdir): raise
def mkdir_p(newdir, mode=0o777): """The missing mkdir -p functionality in os.""" try: os.makedirs(newdir, mode) except OSError as err: # Reraise the error unless it's about an already existing directory if err.errno != errno.EEXIST or not os.path.isdir(newdir): raise
[ "The", "missing", "mkdir", "-", "p", "functionality", "in", "os", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/examples/airline-demo/airline_demo/utils.py#L10-L17
[ "def", "mkdir_p", "(", "newdir", ",", "mode", "=", "0o777", ")", ":", "try", ":", "os", ".", "makedirs", "(", "newdir", ",", "mode", ")", "except", "OSError", "as", "err", ":", "# Reraise the error unless it's about an already existing directory", "if", "err", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
user_code_context_manager
Wraps the output of a user provided function that may yield or return a value and returns a generator that asserts it only yields a single value.
python_modules/dagster/dagster/core/execution.py
def user_code_context_manager(user_fn, error_cls, msg): '''Wraps the output of a user provided function that may yield or return a value and returns a generator that asserts it only yields a single value. ''' check.callable_param(user_fn, 'user_fn') check.subclass_param(error_cls, 'error_cls', Dagst...
def user_code_context_manager(user_fn, error_cls, msg): '''Wraps the output of a user provided function that may yield or return a value and returns a generator that asserts it only yields a single value. ''' check.callable_param(user_fn, 'user_fn') check.subclass_param(error_cls, 'error_cls', Dagst...
[ "Wraps", "the", "output", "of", "a", "user", "provided", "function", "that", "may", "yield", "or", "return", "a", "value", "and", "returns", "a", "generator", "that", "asserts", "it", "only", "yields", "a", "single", "value", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution.py#L346-L371
[ "def", "user_code_context_manager", "(", "user_fn", ",", "error_cls", ",", "msg", ")", ":", "check", ".", "callable_param", "(", "user_fn", ",", "'user_fn'", ")", "check", ".", "subclass_param", "(", "error_cls", ",", "'error_cls'", ",", "DagsterUserCodeExecutionE...
4119f8c773089de64831b1dfb9e168e353d401dc
test
construct_run_storage
Construct the run storage for this pipeline. Our rules are the following: If the RunConfig has a storage_mode provided, we use that. Then we fallback to environment config. If there is no config, we default to in memory storage. This is mostly so that tests default to in-memory.
python_modules/dagster/dagster/core/execution.py
def construct_run_storage(run_config, environment_config): ''' Construct the run storage for this pipeline. Our rules are the following: If the RunConfig has a storage_mode provided, we use that. Then we fallback to environment config. If there is no config, we default to in memory storage. This ...
def construct_run_storage(run_config, environment_config): ''' Construct the run storage for this pipeline. Our rules are the following: If the RunConfig has a storage_mode provided, we use that. Then we fallback to environment config. If there is no config, we default to in memory storage. This ...
[ "Construct", "the", "run", "storage", "for", "this", "pipeline", ".", "Our", "rules", "are", "the", "following", ":" ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution.py#L374-L410
[ "def", "construct_run_storage", "(", "run_config", ",", "environment_config", ")", ":", "check", ".", "inst_param", "(", "run_config", ",", "'run_config'", ",", "RunConfig", ")", "check", ".", "inst_param", "(", "environment_config", ",", "'environment_config'", ","...
4119f8c773089de64831b1dfb9e168e353d401dc
test
_create_context_free_log
In the event of pipeline initialization failure, we want to be able to log the failure without a dependency on the ExecutionContext to initialize DagsterLog
python_modules/dagster/dagster/core/execution.py
def _create_context_free_log(run_config, pipeline_def): '''In the event of pipeline initialization failure, we want to be able to log the failure without a dependency on the ExecutionContext to initialize DagsterLog ''' check.inst_param(run_config, 'run_config', RunConfig) check.inst_param(pipeline_...
def _create_context_free_log(run_config, pipeline_def): '''In the event of pipeline initialization failure, we want to be able to log the failure without a dependency on the ExecutionContext to initialize DagsterLog ''' check.inst_param(run_config, 'run_config', RunConfig) check.inst_param(pipeline_...
[ "In", "the", "event", "of", "pipeline", "initialization", "failure", "we", "want", "to", "be", "able", "to", "log", "the", "failure", "without", "a", "dependency", "on", "the", "ExecutionContext", "to", "initialize", "DagsterLog" ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution.py#L598-L612
[ "def", "_create_context_free_log", "(", "run_config", ",", "pipeline_def", ")", ":", "check", ".", "inst_param", "(", "run_config", ",", "'run_config'", ",", "RunConfig", ")", "check", ".", "inst_param", "(", "pipeline_def", ",", "'pipeline_def'", ",", "PipelineDe...
4119f8c773089de64831b1dfb9e168e353d401dc
test
execute_pipeline_iterator
Returns iterator that yields :py:class:`SolidExecutionResult` for each solid executed in the pipeline. This is intended to allow the caller to do things between each executed node. For the 'synchronous' API, see :py:func:`execute_pipeline`. Parameters: pipeline (PipelineDefinition): Pipeline to ...
python_modules/dagster/dagster/core/execution.py
def execute_pipeline_iterator(pipeline, environment_dict=None, run_config=None): '''Returns iterator that yields :py:class:`SolidExecutionResult` for each solid executed in the pipeline. This is intended to allow the caller to do things between each executed node. For the 'synchronous' API, see :py:fun...
def execute_pipeline_iterator(pipeline, environment_dict=None, run_config=None): '''Returns iterator that yields :py:class:`SolidExecutionResult` for each solid executed in the pipeline. This is intended to allow the caller to do things between each executed node. For the 'synchronous' API, see :py:fun...
[ "Returns", "iterator", "that", "yields", ":", "py", ":", "class", ":", "SolidExecutionResult", "for", "each", "solid", "executed", "in", "the", "pipeline", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution.py#L731-L757
[ "def", "execute_pipeline_iterator", "(", "pipeline", ",", "environment_dict", "=", "None", ",", "run_config", "=", "None", ")", ":", "check", ".", "inst_param", "(", "pipeline", ",", "'pipeline'", ",", "PipelineDefinition", ")", "environment_dict", "=", "check", ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
execute_pipeline
"Synchronous" version of :py:func:`execute_pipeline_iterator`. Note: raise_on_error is very useful in testing contexts when not testing for error conditions Parameters: pipeline (PipelineDefinition): Pipeline to run environment_dict (dict): The enviroment configuration that parameterizes this ...
python_modules/dagster/dagster/core/execution.py
def execute_pipeline(pipeline, environment_dict=None, run_config=None): ''' "Synchronous" version of :py:func:`execute_pipeline_iterator`. Note: raise_on_error is very useful in testing contexts when not testing for error conditions Parameters: pipeline (PipelineDefinition): Pipeline to run ...
def execute_pipeline(pipeline, environment_dict=None, run_config=None): ''' "Synchronous" version of :py:func:`execute_pipeline_iterator`. Note: raise_on_error is very useful in testing contexts when not testing for error conditions Parameters: pipeline (PipelineDefinition): Pipeline to run ...
[ "Synchronous", "version", "of", ":", "py", ":", "func", ":", "execute_pipeline_iterator", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution.py#L760-L796
[ "def", "execute_pipeline", "(", "pipeline", ",", "environment_dict", "=", "None", ",", "run_config", "=", "None", ")", ":", "check", ".", "inst_param", "(", "pipeline", ",", "'pipeline'", ",", "PipelineDefinition", ")", "environment_dict", "=", "check", ".", "...
4119f8c773089de64831b1dfb9e168e353d401dc
test
PipelineExecutionResult.result_for_solid
Get a :py:class:`SolidExecutionResult` for a given solid name.
python_modules/dagster/dagster/core/execution.py
def result_for_solid(self, name): '''Get a :py:class:`SolidExecutionResult` for a given solid name. ''' check.str_param(name, 'name') if not self.pipeline.has_solid(name): raise DagsterInvariantViolationError( 'Try to get result for solid {name} in {pipeline}...
def result_for_solid(self, name): '''Get a :py:class:`SolidExecutionResult` for a given solid name. ''' check.str_param(name, 'name') if not self.pipeline.has_solid(name): raise DagsterInvariantViolationError( 'Try to get result for solid {name} in {pipeline}...
[ "Get", "a", ":", "py", ":", "class", ":", "SolidExecutionResult", "for", "a", "given", "solid", "name", "." ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution.py#L141-L160
[ "def", "result_for_solid", "(", "self", ",", "name", ")", ":", "check", ".", "str_param", "(", "name", ",", "'name'", ")", "if", "not", "self", ".", "pipeline", ".", "has_solid", "(", "name", ")", ":", "raise", "DagsterInvariantViolationError", "(", "'Try ...
4119f8c773089de64831b1dfb9e168e353d401dc
test
SolidExecutionResult.success
Whether the solid execution was successful
python_modules/dagster/dagster/core/execution.py
def success(self): '''Whether the solid execution was successful''' any_success = False for step_event in itertools.chain( self.input_expectations, self.output_expectations, self.transforms ): if step_event.event_type == DagsterEventType.STEP_FAILURE: ...
def success(self): '''Whether the solid execution was successful''' any_success = False for step_event in itertools.chain( self.input_expectations, self.output_expectations, self.transforms ): if step_event.event_type == DagsterEventType.STEP_FAILURE: ...
[ "Whether", "the", "solid", "execution", "was", "successful" ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution.py#L196-L207
[ "def", "success", "(", "self", ")", ":", "any_success", "=", "False", "for", "step_event", "in", "itertools", ".", "chain", "(", "self", ".", "input_expectations", ",", "self", ".", "output_expectations", ",", "self", ".", "transforms", ")", ":", "if", "st...
4119f8c773089de64831b1dfb9e168e353d401dc
test
SolidExecutionResult.skipped
Whether the solid execution was skipped
python_modules/dagster/dagster/core/execution.py
def skipped(self): '''Whether the solid execution was skipped''' return all( [ step_event.event_type == DagsterEventType.STEP_SKIPPED for step_event in itertools.chain( self.input_expectations, self.output_expectations, self.transforms ...
def skipped(self): '''Whether the solid execution was skipped''' return all( [ step_event.event_type == DagsterEventType.STEP_SKIPPED for step_event in itertools.chain( self.input_expectations, self.output_expectations, self.transforms ...
[ "Whether", "the", "solid", "execution", "was", "skipped" ]
dagster-io/dagster
python
https://github.com/dagster-io/dagster/blob/4119f8c773089de64831b1dfb9e168e353d401dc/python_modules/dagster/dagster/core/execution.py#L210-L219
[ "def", "skipped", "(", "self", ")", ":", "return", "all", "(", "[", "step_event", ".", "event_type", "==", "DagsterEventType", ".", "STEP_SKIPPED", "for", "step_event", "in", "itertools", ".", "chain", "(", "self", ".", "input_expectations", ",", "self", "."...
4119f8c773089de64831b1dfb9e168e353d401dc