sequence
stringlengths
902
12k
docstring
stringlengths
4
15.2k
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'date_to_datetime'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'time_input'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'tz'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '14', '78']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'try_statement', 'children': ['15', '66', '70', '74']}; {'id': '15', 'type': 'block', 'children': ['16', '25']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'parse'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'time_input'}; {'id': '25', 'type': 'if_statement', 'children': ['26', '37']}; {'id': '26', 'type': 'boolean_operator', 'children': ['27', '30'], 'value': 'and'}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '29'], 'value': 'is not'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'tz'}; {'id': '29', 'type': 'None', 'children': []}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': '!='}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'tz'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'tzname'}; {'id': '36', 'type': 'argument_list', 'children': []}; {'id': '37', 'type': 'block', 'children': ['38', '54']}; {'id': '38', 'type': 'if_statement', 'children': ['39', '44']}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '43'], 'value': 'is'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'tzinfo'}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': '_replace_timezone'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'astimezone'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'tz'}; {'id': '66', 'type': 'except_clause', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'IndexError'}; {'id': '68', 'type': 'block', 'children': ['69']}; {'id': '69', 'type': 'pass_statement', 'children': []}; {'id': '70', 'type': 'except_clause', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '72', 'type': 'block', 'children': ['73']}; {'id': '73', 'type': 'pass_statement', 'children': []}; {'id': '74', 'type': 'except_clause', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'pass_statement', 'children': []}; {'id': '78', 'type': 'return_statement', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'dt'}
Convert ISO 8601 and other date strings to datetime.datetime type. Args: time_input (string): The time input string (see formats above). tz (string): The time zone for the returned data. Returns: (datetime.datetime): Python datetime.datetime object.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_on_wheel_event'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '6', 'type': 'block', 'children': ['7', '32']}; {'id': '7', 'type': 'try_statement', 'children': ['8', '21']}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '12', 'type': 'call', 'children': ['13', '20']}; {'id': '13', 'type': 'attribute', 'children': ['14', '19']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'angleDelta'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'except_clause', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'if_statement', 'children': ['33', '49']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '48'], 'value': '>'}; {'id': '34', 'type': 'binary_operator', 'children': ['35', '43'], 'value': '&'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'modifiers'}; {'id': '42', 'type': 'argument_list', 'children': []}; {'id': '43', 'type': 'attribute', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'QtCore'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'Qt'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'ControlModifier'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'if_statement', 'children': ['51', '56', '71']}; {'id': '51', 'type': 'comparison_operator', 'children': ['52', '53'], 'value': '<'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'prev_delta'}; {'id': '56', 'type': 'block', 'children': ['57', '65']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '64']}; {'id': '59', 'type': 'attribute', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'editor'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'zoom_out'}; {'id': '64', 'type': 'argument_list', 'children': []}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'accept'}; {'id': '70', 'type': 'argument_list', 'children': []}; {'id': '71', 'type': 'else_clause', 'children': ['72']}; {'id': '72', 'type': 'block', 'children': ['73', '81']}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '80']}; {'id': '75', 'type': 'attribute', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'editor'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'zoom_in'}; {'id': '80', 'type': 'argument_list', 'children': []}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'accept'}; {'id': '86', 'type': 'argument_list', 'children': []}
Increments or decrements editor fonts settings on mouse wheel event if ctrl modifier is on. :param event: wheel event :type event: QWheelEvent
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'display_exc'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '14']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'errmsg'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'get_error'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'if_statement', 'children': ['15', '18']}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '17'], 'value': 'is not'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'errmsg'}; {'id': '17', 'type': 'None', 'children': []}; {'id': '18', 'type': 'block', 'children': ['19', '72']}; {'id': '19', 'type': 'if_statement', 'children': ['20', '25']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '24'], 'value': 'is not'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '24', 'type': 'None', 'children': []}; {'id': '25', 'type': 'block', 'children': ['26', '37', '63']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'errmsg_lines'}; {'id': '29', 'type': 'list', 'children': ['30'], 'value': '["in " + self.path + ":"]'}; {'id': '30', 'type': 'binary_operator', 'children': ['31', '36'], 'value': '+'}; {'id': '31', 'type': 'binary_operator', 'children': ['32', '33'], 'value': '+'}; {'id': '32', 'type': 'string', 'children': [], 'value': '"in "'}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '36', 'type': 'string', 'children': [], 'value': '":"'}; {'id': '37', 'type': 'for_statement', 'children': ['38', '39', '44']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'errmsg'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'splitlines'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'block', 'children': ['45', '56']}; {'id': '45', 'type': 'if_statement', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '55'], 'value': '+'}; {'id': '52', 'type': 'binary_operator', 'children': ['53', '54'], 'value': '*'}; {'id': '53', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'taberrfmt'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'errmsg_lines'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'errmsg'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'errmsg_lines'}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'printerr'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'errmsg'}
Properly prints an exception in the exception context.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load_event_list'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '5', 'type': 'dictionary_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'return_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '19']}; {'id': '10', 'type': 'attribute', 'children': ['11', '18']}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'dcase_util'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'containers'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'MetaDataContainer'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'load'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '23']}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '23', 'type': 'dictionary_splat', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
Load event list from csv formatted text-file Supported formats (see more `dcase_util.containers.MetaDataContainer.load()` method): - [event onset (float >= 0)][delimiter][event offset (float >= 0)] - [event onset (float >= 0)][delimiter][event offset (float >= 0)][delimiter][label] - [filename][delimiter][event onset (float >= 0)][delimiter][event offset (float >= 0)][delimiter][event label] - [filename][delimiter][scene_label][delimiter][event onset (float >= 0)][delimiter][event offset (float >= 0)][delimiter][event label] - [filename] Supported delimiters: ``,``, ``;``, ``tab`` Example of event list file:: 21.64715 23.00552 alert 36.91184 38.27021 alert 69.72575 71.09029 alert 63.53990 64.89827 alert 84.25553 84.83920 alert 20.92974 21.82661 clearthroat 28.39992 29.29679 clearthroat 80.47837 81.95937 clearthroat 44.48363 45.96463 clearthroat 78.13073 79.05953 clearthroat 15.17031 16.27235 cough 20.54931 21.65135 cough 27.79964 28.90168 cough 75.45959 76.32490 cough 70.81708 71.91912 cough 21.23203 22.55902 doorslam 7.546220 9.014880 doorslam 34.11303 35.04183 doorslam 45.86001 47.32867 doorslam Parameters ---------- filename : str Path to the csv-file Returns ------- list of dict Event list
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'iiscgi'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'application'}; {'id': '5', 'type': 'block', 'children': ['6', '22', '33']}; {'id': '6', 'type': 'try_statement', 'children': ['7', '14']}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'import_from_statement', 'children': ['9', '12']}; {'id': '9', 'type': 'dotted_name', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'wsgiref'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'handlers'}; {'id': '12', 'type': 'dotted_name', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'IISCGIHandler'}; {'id': '14', 'type': 'except_clause', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'ImportError'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'string', 'children': [], 'value': '"Python 3.2 or newer is required."'}; {'id': '22', 'type': 'if_statement', 'children': ['23', '25']}; {'id': '23', 'type': 'not_operator', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '__debug__'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'warnings'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'warn'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': '"Interactive debugging and other persistence-based processes will not work."'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '40']}; {'id': '35', 'type': 'attribute', 'children': ['36', '39']}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'IISCGIHandler'}; {'id': '38', 'type': 'argument_list', 'children': []}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'application'}
A specialized version of the reference WSGI-CGI server to adapt to Microsoft IIS quirks. This is not a production quality interface and will behave badly under load.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'emit_containers'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'containers'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'verbose'}; {'id': '8', 'type': 'True', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '28', '47']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'containers'}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'containers'}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '19', 'type': 'lambda', 'children': ['20', '22']}; {'id': '20', 'type': 'lambda_parameters', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'task_definition'}; {'id': '31', 'type': 'dictionary', 'children': ['32', '37', '40']}; {'id': '32', 'type': 'pair', 'children': ['33', '34']}; {'id': '33', 'type': 'string', 'children': [], 'value': "'family'"}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'family'}; {'id': '37', 'type': 'pair', 'children': ['38', '39']}; {'id': '38', 'type': 'string', 'children': [], 'value': "'containerDefinitions'"}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'containers'}; {'id': '40', 'type': 'pair', 'children': ['41', '42']}; {'id': '41', 'type': 'string', 'children': [], 'value': "'volumes'"}; {'id': '42', 'type': 'boolean_operator', 'children': ['43', '46'], 'value': 'or'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'volumes'}; {'id': '46', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '47', 'type': 'if_statement', 'children': ['48', '49', '63']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'verbose'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '57', '60']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'task_definition'}; {'id': '57', 'type': 'keyword_argument', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '59', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '60', 'type': 'keyword_argument', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'sort_keys'}; {'id': '62', 'type': 'True', 'children': []}; {'id': '63', 'type': 'else_clause', 'children': ['64']}; {'id': '64', 'type': 'block', 'children': ['65']}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'task_definition'}
Emits the task definition and sorts containers by name :param containers: List of the container definitions :type containers: list of dict :param verbose: Print out newlines and indented JSON :type verbose: bool :returns: The text output :rtype: str
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '19']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create_config'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7', '10', '13', '16']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'subvolume'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'fstype'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'default_parameter', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '15', 'type': 'None', 'children': []}; {'id': '16', 'type': 'default_parameter', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'extra_opts'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'block', 'children': ['20', '35', '44', '53', '62', '70']}; {'id': '20', 'type': 'function_definition', 'children': ['21', '22', '24']}; {'id': '21', 'type': 'function_name', 'children': [], 'value': 'raise_arg_error'}; {'id': '22', 'type': 'parameters', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'argname'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'raise_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'CommandExecutionError'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'string', 'children': [], 'value': '\'You must provide a "{0}" for the new configuration\''}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'argname'}; {'id': '35', 'type': 'if_statement', 'children': ['36', '38']}; {'id': '36', 'type': 'not_operator', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'raise_arg_error'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'string', 'children': [], 'value': '"name"'}; {'id': '44', 'type': 'if_statement', 'children': ['45', '47']}; {'id': '45', 'type': 'not_operator', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'subvolume'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'raise_arg_error'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'string', 'children': [], 'value': '"subvolume"'}; {'id': '53', 'type': 'if_statement', 'children': ['54', '56']}; {'id': '54', 'type': 'not_operator', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'fstype'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'raise_arg_error'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'string', 'children': [], 'value': '"fstype"'}; {'id': '62', 'type': 'if_statement', 'children': ['63', '65']}; {'id': '63', 'type': 'not_operator', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'assignment', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '69', 'type': 'string', 'children': [], 'value': '""'}; {'id': '70', 'type': 'try_statement', 'children': ['71', '97']}; {'id': '71', 'type': 'block', 'children': ['72', '82', '92']}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'snapper'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'CreateConfig'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '79', '80', '81']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'subvolume'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'fstype'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '82', 'type': 'if_statement', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'extra_opts'}; {'id': '84', 'type': 'block', 'children': ['85']}; {'id': '85', 'type': 'expression_statement', 'children': ['86']}; {'id': '86', 'type': 'call', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'set_config'}; {'id': '88', 'type': 'argument_list', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '90', 'type': 'dictionary_splat', 'children': ['91']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'extra_opts'}; {'id': '92', 'type': 'return_statement', 'children': ['93']}; {'id': '93', 'type': 'call', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'get_config'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '97', 'type': 'except_clause', 'children': ['98', '104']}; {'id': '98', 'type': 'as_pattern', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'dbus'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'DBusException'}; {'id': '102', 'type': 'as_pattern_target', 'children': ['103']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '104', 'type': 'block', 'children': ['105']}; {'id': '105', 'type': 'raise_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'CommandExecutionError'}; {'id': '108', 'type': 'argument_list', 'children': ['109']}; {'id': '109', 'type': 'call', 'children': ['110', '113']}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'string', 'children': [], 'value': "'Error encountered while creating the new configuration: {0}'"}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '113', 'type': 'argument_list', 'children': ['114']}; {'id': '114', 'type': 'call', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': '_dbus_exception_to_reason'}; {'id': '116', 'type': 'argument_list', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '118', 'type': 'call', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '120', 'type': 'argument_list', 'children': []}
Creates a new Snapper configuration name Name of the new Snapper configuration. subvolume Path to the related subvolume. fstype Filesystem type of the subvolume. template Configuration template to use. (Default: default) extra_opts Extra Snapper configuration opts dictionary. It will override the values provided by the given template (if any). CLI example: .. code-block:: bash salt '*' snapper.create_config name=myconfig subvolume=/foo/bar/ fstype=btrfs salt '*' snapper.create_config name=myconfig subvolume=/foo/bar/ fstype=btrfs template="default" salt '*' snapper.create_config name=myconfig subvolume=/foo/bar/ fstype=btrfs extra_opts='{"NUMBER_CLEANUP": False}'
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'register_components'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '54']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'unregistered_components'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '15']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'paths'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'for_statement', 'children': ['17', '18', '37']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '18', 'type': 'call', 'children': ['19', '24']}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'foundations'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'walkers'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'files_walker'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26', '35']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '26', 'type': 'tuple', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"\\.{0}$"'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '__extension'}; {'id': '35', 'type': 'tuple', 'children': ['36']}; {'id': '36', 'type': 'string', 'children': [], 'value': '"\\._"'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'if_statement', 'children': ['39', '46']}; {'id': '39', 'type': 'not_operator', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'register_component'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'unregistered_components'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '54', 'type': 'if_statement', 'children': ['55', '57', '60']}; {'id': '55', 'type': 'not_operator', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'unregistered_components'}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'return_statement', 'children': ['59']}; {'id': '59', 'type': 'True', 'children': []}; {'id': '60', 'type': 'else_clause', 'children': ['61']}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'raise_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '69']}; {'id': '64', 'type': 'attribute', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'manager'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'exceptions'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'ComponentRegistrationError'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'call', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'string', 'children': [], 'value': '"{0} | \'{1}\' Components failed to register!"'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '80']}; {'id': '75', 'type': 'attribute', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '80', 'type': 'call', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'string', 'children': [], 'value': '", "'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'unregistered_components'}
Registers the Components. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.components.keys() [u'core.tests_component_a', u'core.tests_component_b'] :return: Method success. :rtype: bool
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_all_external_accounts'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'resource_root'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'type_name'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'view'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'return_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'call'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '17', '22', '23', '24']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'resource_root'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '17', 'type': 'binary_operator', 'children': ['18', '19'], 'value': '%'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'EXTERNAL_ACCOUNT_FETCH_PATH'}; {'id': '19', 'type': 'tuple', 'children': ['20', '21']}; {'id': '20', 'type': 'string', 'children': [], 'value': '"type"'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'type_name'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'ApiExternalAccount'}; {'id': '23', 'type': 'True', 'children': []}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '26', 'type': 'boolean_operator', 'children': ['27', '35'], 'value': 'or'}; {'id': '27', 'type': 'boolean_operator', 'children': ['28', '29'], 'value': 'and'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'view'}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'view'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'view'}; {'id': '35', 'type': 'None', 'children': []}
Lookup all external accounts of a particular type, by type name. @param resource_root: The root Resource object. @param type_name: Type name @param view: View @return: An ApiList of ApiExternalAccount objects matching the specified type
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'addUnexpectedSuccess'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'test'}; {'id': '6', 'type': 'block', 'children': ['7', '19']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_handle_result'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'test'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'TestCompletionStatus'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'unexpected_success'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '26']}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'unexpectedSuccesses'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'result'}
Register a test that passed unexpectedly. Parameters ---------- test : unittest.TestCase The test that has completed.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '22', '30']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_what_follows_raw'}; {'id': '3', 'type': 'parameters', 'children': ['4', '8', '12', '17']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '8', 'type': 'typed_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '10', 'type': 'type', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '12', 'type': 'typed_default_parameter', 'children': ['13', '14', '16']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'onlyatstart'}; {'id': '14', 'type': 'type', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '16', 'type': 'True', 'children': []}; {'id': '17', 'type': 'typed_default_parameter', 'children': ['18', '19', '21']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'stripwhitespace'}; {'id': '19', 'type': 'type', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '21', 'type': 'True', 'children': []}; {'id': '22', 'type': 'type', 'children': ['23']}; {'id': '23', 'type': 'generic_type', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'Tuple'}; {'id': '25', 'type': 'type_parameter', 'children': ['26', '28']}; {'id': '26', 'type': 'type', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '28', 'type': 'type', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '30', 'type': 'block', 'children': ['31', '40', '90']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'prefixstart'}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'find'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '57']}; {'id': '41', 'type': '()', 'children': ['42']}; {'id': '42', 'type': 'boolean_operator', 'children': ['43', '49'], 'value': 'or'}; {'id': '43', 'type': '()', 'children': ['44']}; {'id': '44', 'type': 'boolean_operator', 'children': ['45', '48'], 'value': 'and'}; {'id': '45', 'type': 'comparison_operator', 'children': ['46', '47'], 'value': '=='}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'prefixstart'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'onlyatstart'}; {'id': '49', 'type': '()', 'children': ['50']}; {'id': '50', 'type': 'boolean_operator', 'children': ['51', '55'], 'value': 'and'}; {'id': '51', 'type': 'comparison_operator', 'children': ['52', '53'], 'value': '!='}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'prefixstart'}; {'id': '53', 'type': 'unary_operator', 'children': ['54'], 'value': '-'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '55', 'type': 'not_operator', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'onlyatstart'}; {'id': '57', 'type': 'block', 'children': ['58', '67', '75', '86']}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'resultstart'}; {'id': '61', 'type': 'binary_operator', 'children': ['62', '63'], 'value': '+'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'prefixstart'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '72', 'type': 'slice', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'resultstart'}; {'id': '74', 'type': 'colon', 'children': []}; {'id': '75', 'type': 'if_statement', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'stripwhitespace'}; {'id': '77', 'type': 'block', 'children': ['78']}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '85', 'type': 'argument_list', 'children': []}; {'id': '86', 'type': 'return_statement', 'children': ['87']}; {'id': '87', 'type': 'expression_list', 'children': ['88', '89']}; {'id': '88', 'type': 'True', 'children': []}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '90', 'type': 'return_statement', 'children': ['91']}; {'id': '91', 'type': 'expression_list', 'children': ['92', '93']}; {'id': '92', 'type': 'False', 'children': []}; {'id': '93', 'type': 'string', 'children': [], 'value': '""'}
Find the part of ``s`` that is after ``prefix``. Args: s: string to analyse prefix: prefix to find onlyatstart: only accept the prefix if it is right at the start of ``s`` stripwhitespace: remove whitespace from the result Returns: tuple: ``(found, result)``
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_all'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '11', '15', '112']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'assignment', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'info_dir'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': '_get_info_dir'}; {'id': '10', 'type': 'argument_list', 'children': []}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '14', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '15', 'type': 'for_statement', 'children': ['16', '17', '23']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'listdir'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'info_dir'}; {'id': '23', 'type': 'block', 'children': ['24', '36', '76']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '27', 'type': 'call', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'info_dir'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '36', 'type': 'try_statement', 'children': ['37', '57']}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'with_statement', 'children': ['39', '48']}; {'id': '39', 'type': 'with_clause', 'children': ['40']}; {'id': '40', 'type': 'with_item', 'children': ['41']}; {'id': '41', 'type': 'as_pattern', 'children': ['42', '46']}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '46', 'type': 'as_pattern_target', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'infile'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'contents'}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'infile'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '56', 'type': 'argument_list', 'children': []}; {'id': '57', 'type': 'except_clause', 'children': ['58', '62']}; {'id': '58', 'type': 'as_pattern', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'IOError'}; {'id': '60', 'type': 'as_pattern_target', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '62', 'type': 'block', 'children': ['63']}; {'id': '63', 'type': 'if_statement', 'children': ['64', '71', '73']}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '68'], 'value': '=='}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'errno'}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'errno'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'EACCES'}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'continue_statement', 'children': []}; {'id': '73', 'type': 'else_clause', 'children': ['74']}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'raise_statement', 'children': []}; {'id': '76', 'type': 'try_statement', 'children': ['77', '85', '103']}; {'id': '77', 'type': 'block', 'children': ['78']}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '81', 'type': 'call', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': '_info_from_string'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'contents'}; {'id': '85', 'type': 'except_clause', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '87', 'type': 'block', 'children': ['88']}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'call', 'children': ['90', '97']}; {'id': '90', 'type': 'attribute', 'children': ['91', '96']}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'tb_logging'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'get_logger'}; {'id': '95', 'type': 'argument_list', 'children': []}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '97', 'type': 'argument_list', 'children': ['98', '99', '100']}; {'id': '98', 'type': 'string', 'children': [], 'value': '"invalid info file: %r"'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '100', 'type': 'keyword_argument', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'exc_info'}; {'id': '102', 'type': 'True', 'children': []}; {'id': '103', 'type': 'else_clause', 'children': ['104']}; {'id': '104', 'type': 'block', 'children': ['105']}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '112', 'type': 'return_statement', 'children': ['113']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'results'}
Return TensorBoardInfo values for running TensorBoard processes. This function may not provide a perfect snapshot of the set of running processes. Its result set may be incomplete if the user has cleaned their /tmp/ directory while TensorBoard processes are running. It may contain extraneous entries if TensorBoard processes exited uncleanly (e.g., with SIGKILL or SIGQUIT). Returns: A fresh list of `TensorBoardInfo` objects.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'drop_columns'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'colnames'}; {'id': '6', 'type': 'dictionary_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '8', 'type': 'block', 'children': ['9', '27']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'new_arr'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'rfn'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'drop_fields'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18', '19', '22', '25']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'colnames'}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'usemask'}; {'id': '21', 'type': 'False', 'children': []}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'asrecarray'}; {'id': '24', 'type': 'True', 'children': []}; {'id': '25', 'type': 'dictionary_splat', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34', '39', '44', '49']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'new_arr'}; {'id': '34', 'type': 'keyword_argument', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'h5loc'}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'h5loc'}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'split_h5'}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'split_h5'}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'h5singleton'}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'h5singleton'}
Drop columns from the table. See the docs for ``numpy.lib.recfunctions.drop_fields`` for an explanation of the remaining options.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reference'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '39']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '__reference'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '__reference'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_ConstructReference'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '24', '29', '34']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'pairs'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '__pairs'}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'app'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '__app'}; {'id': '34', 'type': 'keyword_argument', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '__namespace'}; {'id': '39', 'type': 'return_statement', 'children': ['40']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '__reference'}
Return the Reference object for this Key. This is a entity_pb.Reference instance -- a protocol buffer class used by the lower-level API to the datastore. NOTE: The caller should not mutate the return value.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_relationship'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'term1'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'relationship'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'term2'}; {'id': '8', 'type': 'block', 'children': ['9', '17', '51']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '12', 'type': 'binary_operator', 'children': ['13', '16'], 'value': '+'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'base_path'}; {'id': '16', 'type': 'string', 'children': [], 'value': "'term/add-relationship'"}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '20', 'type': 'dictionary', 'children': ['21', '26', '31', '36', '41', '46']}; {'id': '21', 'type': 'pair', 'children': ['22', '23']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'term1_id'"}; {'id': '23', 'type': 'subscript', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'term1'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '26', 'type': 'pair', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': "'relationship_tid'"}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'relationship'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '31', 'type': 'pair', 'children': ['32', '33']}; {'id': '32', 'type': 'string', 'children': [], 'value': "'term2_id'"}; {'id': '33', 'type': 'subscript', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'term2'}; {'id': '35', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '36', 'type': 'pair', 'children': ['37', '38']}; {'id': '37', 'type': 'string', 'children': [], 'value': "'term1_version'"}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'term1'}; {'id': '40', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '41', 'type': 'pair', 'children': ['42', '43']}; {'id': '42', 'type': 'string', 'children': [], 'value': "'relationship_term_version'"}; {'id': '43', 'type': 'subscript', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'relationship'}; {'id': '45', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '46', 'type': 'pair', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': "'term2_version'"}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'term2'}; {'id': '50', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '56', 'type': 'argument_list', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'data'}
Creates a relationship between 3 entities in database
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'step'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'provided_inputs'}; {'id': '6', 'type': 'block', 'children': ['7', '59', '80', '89', '98', '114', '131', '143', '152', '168']}; {'id': '7', 'type': 'for_statement', 'children': ['8', '11', '16']}; {'id': '8', 'type': 'pattern_list', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'wire'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'provided_inputs'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'block', 'children': ['17', '35']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'wire'}; {'id': '20', 'type': 'conditional_expression', 'children': ['21', '29', '34'], 'value': 'if'}; {'id': '21', 'type': 'call', 'children': ['22', '27']}; {'id': '22', 'type': 'attribute', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'block'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'get_wirevector_by_name'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'wire'}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'wire'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'wire'}; {'id': '35', 'type': 'if_statement', 'children': ['36', '45']}; {'id': '36', 'type': 'boolean_operator', 'children': ['37', '42'], 'value': 'or'}; {'id': '37', 'type': 'comparison_operator', 'children': ['38', '39'], 'value': '>'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'wire'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'bitmask'}; {'id': '42', 'type': 'comparison_operator', 'children': ['43', '44'], 'value': '<'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '44', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'raise_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'PyrtlError'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '56']}; {'id': '51', 'type': 'attribute', 'children': ['52', '55']}; {'id': '52', 'type': 'concatenated_string', 'children': ['53', '54']}; {'id': '53', 'type': 'string', 'children': [], 'value': '"Wire {} has value {} which cannot be represented"'}; {'id': '54', 'type': 'string', 'children': [], 'value': '" using its bitwidth"'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '56', 'type': 'argument_list', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'wire'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'ins'}; {'id': '62', 'type': 'dictionary_comprehension', 'children': ['63', '71']}; {'id': '63', 'type': 'pair', 'children': ['64', '70']}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': '_to_name'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'wire'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '71', 'type': 'for_in_clause', 'children': ['72', '75']}; {'id': '72', 'type': 'pattern_list', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'wire'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'provided_inputs'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '79', 'type': 'argument_list', 'children': []}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'ins'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'regs'}; {'id': '89', 'type': 'expression_statement', 'children': ['90']}; {'id': '90', 'type': 'call', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'ins'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'mems'}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'assignment', 'children': ['100', '108']}; {'id': '100', 'type': 'pattern_list', 'children': ['101', '104', '107']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'regs'}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'outs'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'mem_writes'}; {'id': '108', 'type': 'call', 'children': ['109', '112']}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'sim_func'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'ins'}; {'id': '114', 'type': 'for_statement', 'children': ['115', '119', '120']}; {'id': '115', 'type': 'pattern_list', 'children': ['116', '117', '118']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'mem'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'addr'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'mem_writes'}; {'id': '120', 'type': 'block', 'children': ['121']}; {'id': '121', 'type': 'expression_statement', 'children': ['122']}; {'id': '122', 'type': 'assignment', 'children': ['123', '130']}; {'id': '123', 'type': 'subscript', 'children': ['124', '129']}; {'id': '124', 'type': 'subscript', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'mems'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'mem'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'addr'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '136']}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '136', 'type': 'call', 'children': ['137', '142']}; {'id': '137', 'type': 'attribute', 'children': ['138', '141']}; {'id': '138', 'type': 'attribute', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'outs'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '142', 'type': 'argument_list', 'children': []}; {'id': '143', 'type': 'expression_statement', 'children': ['144']}; {'id': '144', 'type': 'call', 'children': ['145', '150']}; {'id': '145', 'type': 'attribute', 'children': ['146', '149']}; {'id': '146', 'type': 'attribute', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '150', 'type': 'argument_list', 'children': ['151']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'ins'}; {'id': '152', 'type': 'if_statement', 'children': ['153', '158']}; {'id': '153', 'type': 'comparison_operator', 'children': ['154', '157'], 'value': 'is not'}; {'id': '154', 'type': 'attribute', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'tracer'}; {'id': '157', 'type': 'None', 'children': []}; {'id': '158', 'type': 'block', 'children': ['159']}; {'id': '159', 'type': 'expression_statement', 'children': ['160']}; {'id': '160', 'type': 'call', 'children': ['161', '166']}; {'id': '161', 'type': 'attribute', 'children': ['162', '165']}; {'id': '162', 'type': 'attribute', 'children': ['163', '164']}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '164', 'type': 'identifier', 'children': [], 'value': 'tracer'}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'add_fast_step'}; {'id': '166', 'type': 'argument_list', 'children': ['167']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '168', 'type': 'expression_statement', 'children': ['169']}; {'id': '169', 'type': 'call', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'check_rtl_assertions'}; {'id': '171', 'type': 'argument_list', 'children': ['172']}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'self'}
Run the simulation for a cycle :param provided_inputs: a dictionary mapping WireVectors (or their names) to their values for this step eg: {wire: 3, "wire_name": 17}
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_background_sids'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'src_filter'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '24']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'branch_key'}; {'id': '10', 'type': 'subscript', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'idx_set'}; {'id': '14', 'type': 'string', 'children': [], 'value': '"grid_key"'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'idist'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'src_filter'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'integration_distance'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'DEFAULT_TRT'}; {'id': '24', 'type': 'with_statement', 'children': ['25', '39']}; {'id': '25', 'type': 'with_clause', 'children': ['26']}; {'id': '26', 'type': 'with_item', 'children': ['27']}; {'id': '27', 'type': 'as_pattern', 'children': ['28', '37']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'h5py'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'File'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'source_file'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '37', 'type': 'as_pattern_target', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'hdf5'}; {'id': '39', 'type': 'block', 'children': ['40', '48', '70', '94', '107', '118']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'bg_locations'}; {'id': '43', 'type': 'attribute', 'children': ['44', '47']}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'hdf5'}; {'id': '46', 'type': 'string', 'children': [], 'value': '"Grid/Locations"'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'distances'}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'min_geodetic_distance'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '59']}; {'id': '54', 'type': 'attribute', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'src_filter'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'sitecol'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'xyz'}; {'id': '59', 'type': 'tuple', 'children': ['60', '65']}; {'id': '60', 'type': 'subscript', 'children': ['61', '62', '64']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'bg_locations'}; {'id': '62', 'type': 'slice', 'children': ['63']}; {'id': '63', 'type': 'colon', 'children': []}; {'id': '64', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '65', 'type': 'subscript', 'children': ['66', '67', '69']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'bg_locations'}; {'id': '67', 'type': 'slice', 'children': ['68']}; {'id': '68', 'type': 'colon', 'children': []}; {'id': '69', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'mmax_areas'}; {'id': '73', 'type': 'call', 'children': ['74', '79']}; {'id': '74', 'type': 'attribute', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'msr'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'get_median_area'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '93']}; {'id': '80', 'type': 'attribute', 'children': ['81', '92']}; {'id': '81', 'type': 'subscript', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'hdf5'}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'string', 'children': [], 'value': '"/"'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'list', 'children': ['89', '90', '91'], 'value': '["Grid", branch_key, "MMax"]'}; {'id': '89', 'type': 'string', 'children': [], 'value': '"Grid"'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'branch_key'}; {'id': '91', 'type': 'string', 'children': [], 'value': '"MMax"'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '93', 'type': 'float', 'children': [], 'value': '0.0'}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'mmax_lengths'}; {'id': '97', 'type': 'call', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'sqrt'}; {'id': '101', 'type': 'argument_list', 'children': ['102']}; {'id': '102', 'type': 'binary_operator', 'children': ['103', '104'], 'value': '/'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'mmax_areas'}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'aspect'}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'assignment', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'ok'}; {'id': '110', 'type': 'comparison_operator', 'children': ['111', '112'], 'value': '<='}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'distances'}; {'id': '112', 'type': '()', 'children': ['113']}; {'id': '113', 'type': 'binary_operator', 'children': ['114', '117'], 'value': '+'}; {'id': '114', 'type': 'binary_operator', 'children': ['115', '116'], 'value': '*'}; {'id': '115', 'type': 'float', 'children': [], 'value': '0.5'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'mmax_lengths'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'idist'}; {'id': '118', 'type': 'return_statement', 'children': ['119']}; {'id': '119', 'type': 'call', 'children': ['120', '130']}; {'id': '120', 'type': 'attribute', 'children': ['121', '129']}; {'id': '121', 'type': 'subscript', 'children': ['122', '128']}; {'id': '122', 'type': 'call', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'where'}; {'id': '126', 'type': 'argument_list', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'ok'}; {'id': '128', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'tolist'}; {'id': '130', 'type': 'argument_list', 'children': []}
We can apply the filtering of the background sites as a pre-processing step - this is done here rather than in the sampling of the ruptures themselves
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'fallback'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '14', '40', '49']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'if_statement', 'children': ['15', '20']}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '17'], 'value': 'in'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_config'}; {'id': '20', 'type': 'block', 'children': ['21', '29']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '24', 'type': 'subscript', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_config'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '29', 'type': 'if_statement', 'children': ['30', '35']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'Section'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '39', 'type': 'None', 'children': []}; {'id': '40', 'type': 'if_statement', 'children': ['41', '44']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '43'], 'value': 'is'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'fallback'}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'value'}
look up global config values from alot's config :param key: key to look up :type key: str :param fallback: fallback returned if key is not present :type fallback: str :returns: config value with type as specified in the spec-file
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'delete'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'db_session'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '17']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'db_session'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'get_db_session'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'db_session'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'db_session'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'delete'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}
Deletes the object via session, this will permanently delete the object from storage on commit :param db_session: :return:
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_range_along_dimension'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'range_dim'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '6', 'type': 'block', 'children': ['7', '14', '24', '40', '66']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'rank'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '14', 'type': 'if_statement', 'children': ['15', '18']}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '17'], 'value': '>='}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'range_dim'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'rank'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'raise_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'string', 'children': [], 'value': '"Cannot calculate range along non-existent index."'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '35']}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'range_dim'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'reshape'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '51', 'type': 'list_comprehension', 'children': ['52', '60']}; {'id': '52', 'type': 'conditional_expression', 'children': ['53', '54', '57'], 'value': 'if'}; {'id': '53', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '54', 'type': 'comparison_operator', 'children': ['55', '56'], 'value': '!='}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'range_dim'}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'range_dim'}; {'id': '60', 'type': 'for_in_clause', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'rank'}; {'id': '66', 'type': 'return_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'tile'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '73', 'type': 'list_comprehension', 'children': ['74', '82']}; {'id': '74', 'type': 'conditional_expression', 'children': ['75', '78', '81'], 'value': 'if'}; {'id': '75', 'type': 'subscript', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '78', 'type': 'comparison_operator', 'children': ['79', '80'], 'value': '!='}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'range_dim'}; {'id': '81', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '82', 'type': 'for_in_clause', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'rank'}
Construct a Tensor whose values are the index along a dimension. Construct a Tensor that counts the distance along a single dimension. This is useful, for example, when constructing an identity matrix, >>> x = _range_along_dimension(0, [2, 2]).eval() >>> x array([[0, 0], [1, 1]], dtype=int32) >>> y = _range_along_dimension(1, [2, 2]).eval() >>> y array([[0, 1], [0, 1]], dtype=int32) >>> tf.cast(tf.equal(x, y), dtype=tf.int32).eval() array([[1, 0], [0, 1]], dtype=int32) Args: range_dim: int. Dimension to count indices on. shape: 1D Tensor of ints. Shape of Tensor to construct. Returns: A Tensor whose values are the same as the range along dimension range_dim. Raises: ValueError: If range_dim isn't a valid dimension.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'toggle'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path_or_id'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'badge_kind'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '12', '42']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'path_or_id'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'with_statement', 'children': ['14', '23']}; {'id': '14', 'type': 'with_clause', 'children': ['15']}; {'id': '15', 'type': 'with_item', 'children': ['16']}; {'id': '16', 'type': 'as_pattern', 'children': ['17', '21']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'path_or_id'}; {'id': '21', 'type': 'as_pattern_target', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'open_file'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'for_statement', 'children': ['25', '26', '31']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'id_or_slug'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'open_file'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'readlines'}; {'id': '30', 'type': 'argument_list', 'children': []}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'toggle_badge'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '41']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'id_or_slug'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'badge_kind'}; {'id': '42', 'type': 'else_clause', 'children': ['43']}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'toggle_badge'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'path_or_id'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'badge_kind'}
Toggle a `badge_kind` for a given `path_or_id` The `path_or_id` is either an id, a slug or a file containing a list of ids or slugs.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'GetName'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '5', 'type': 'block', 'children': ['6', '18']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'precondition'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'AssertType'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '13', 'type': 'tuple', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'types'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'FunctionType'}; {'id': '18', 'type': 'if_statement', 'children': ['19', '20', '30']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'PY2'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'return_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"ascii"'}; {'id': '30', 'type': 'else_clause', 'children': ['31']}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '__name__'}
A compatibility wrapper for getting object's name. In Python 2 class names are returned as `bytes` (since class names can contain only ASCII characters) whereas in Python 3 they are `unicode` (since class names can contain arbitrary unicode characters). This function makes this behaviour consistent and always returns class name as an unicode string. Once support for Python 2 is dropped all invocations of this call can be replaced with ordinary `__name__` access. Args: obj: A type or function object to get the name for. Returns: Name of the specified class as unicode string.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'drop_namespaces'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '32']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '18']}; {'id': '8', 'type': 'attribute', 'children': ['9', '17']}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'NamespaceEntry'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'delete'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '31']}; {'id': '21', 'type': 'attribute', 'children': ['22', '30']}; {'id': '22', 'type': 'call', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'Namespace'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'delete'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'commit'}; {'id': '39', 'type': 'argument_list', 'children': []}
Drop all namespaces.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load_file'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '6', 'type': 'block', 'children': ['7', '37', '49', '60', '71', '78', '84', '92']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '17']}; {'id': '8', 'type': 'not_operator', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'foundations'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'common'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'path_exists'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'raise_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '25']}; {'id': '20', 'type': 'attribute', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'foundations'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'exceptions'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'FileExistsError'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': '"{0} | \'{1}\' file doesn\'t exists!"'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '36']}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'LOGGER'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"> Loading \'{0}\' file."'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '52', 'type': 'call', 'children': ['53', '58']}; {'id': '53', 'type': 'attribute', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'foundations'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'io'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'File'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'setPlainText'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '70', 'type': 'argument_list', 'children': []}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'set_file'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': '__set_document_signals'}; {'id': '83', 'type': 'argument_list', 'children': []}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'call', 'children': ['86', '91']}; {'id': '86', 'type': 'attribute', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'file_loaded'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'emit'}; {'id': '91', 'type': 'argument_list', 'children': []}; {'id': '92', 'type': 'return_statement', 'children': ['93']}; {'id': '93', 'type': 'True', 'children': []}
Reads and loads given file into the editor. :param File: File to load. :type File: unicode :return: Method success. :rtype: bool
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'deserialize'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'status_code'}; {'id': '7', 'type': 'block', 'children': ['8', '15']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '12']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': '=='}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'status_code'}; {'id': '11', 'type': 'integer', 'children': [], 'value': '204'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'subscript', 'children': ['17', '27']}; {'id': '17', 'type': 'call', 'children': ['18', '25']}; {'id': '18', 'type': 'attribute', 'children': ['19', '24']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'serializer'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'Serializer'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'deserialize'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'body'"}
Deserializes a JSON string into a dictionary.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_bmu'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'activations'}; {'id': '6', 'type': 'block', 'children': ['7', '19', '29']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '13']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': '=='}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'argfunc'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'argmax'"}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'activations'}; {'id': '17', 'type': 'unary_operator', 'children': ['18'], 'value': '-'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'activations'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'argsort'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'activations'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'argsort'}; {'id': '34', 'type': 'argument_list', 'children': []}
Get indices of bmus, sorted by their distance from input.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '24']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'imread'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14', '17', '20']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'grayscale'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'interpolate'}; {'id': '13', 'type': 'string', 'children': [], 'value': '"bilinear"'}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'channel_first'}; {'id': '16', 'type': 'False', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'as_uint16'}; {'id': '19', 'type': 'False', 'children': []}; {'id': '20', 'type': 'default_parameter', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'num_channels'}; {'id': '22', 'type': 'unary_operator', 'children': ['23'], 'value': '-'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '24', 'type': 'block', 'children': ['25', '31', '42', '50', '106', '114', '125']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_imread_before'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'grayscale'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'num_channels'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'r_mode'}; {'id': '34', 'type': 'conditional_expression', 'children': ['35', '38', '39'], 'value': 'if'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'cv2'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'IMREAD_GRAYSCALE'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'grayscale'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'cv2'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'IMREAD_UNCHANGED'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': '_imread_helper'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'r_mode'}; {'id': '50', 'type': 'if_statement', 'children': ['51', '60']}; {'id': '51', 'type': 'boolean_operator', 'children': ['52', '53'], 'value': 'and'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'as_uint16'}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '57'], 'value': '!='}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'uint16'}; {'id': '60', 'type': 'block', 'children': ['61']}; {'id': '61', 'type': 'if_statement', 'children': ['62', '69', '92']}; {'id': '62', 'type': 'comparison_operator', 'children': ['63', '66'], 'value': '=='}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'uint8'}; {'id': '69', 'type': 'block', 'children': ['70', '79']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'concatenated_string', 'children': ['77', '78']}; {'id': '77', 'type': 'string', 'children': [], 'value': '"You want to read image as uint16, but the original bit-depth is 8 bit."'}; {'id': '78', 'type': 'string', 'children': [], 'value': '"All pixel values are simply increased by 256 times."'}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '82', 'type': 'binary_operator', 'children': ['83', '91'], 'value': '*'}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'uint16'}; {'id': '91', 'type': 'integer', 'children': [], 'value': '256'}; {'id': '92', 'type': 'else_clause', 'children': ['93']}; {'id': '93', 'type': 'block', 'children': ['94']}; {'id': '94', 'type': 'raise_statement', 'children': ['95']}; {'id': '95', 'type': 'call', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '97', 'type': 'argument_list', 'children': ['98']}; {'id': '98', 'type': 'call', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'string', 'children': [], 'value': '"casting {} to uint16 is not safe."'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '102', 'type': 'argument_list', 'children': ['103']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'assignment', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '109', 'type': 'call', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': '_cvtColor_helper'}; {'id': '111', 'type': 'argument_list', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'num_channels'}; {'id': '114', 'type': 'expression_statement', 'children': ['115']}; {'id': '115', 'type': 'assignment', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '117', 'type': 'call', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': '_imread_after'}; {'id': '119', 'type': 'argument_list', 'children': ['120', '121', '122', '123', '124']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'interpolate'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'channel_first'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'imresize'}; {'id': '125', 'type': 'return_statement', 'children': ['126']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'img'}
Read image by cv2 module. Args: path (str or 'file object'): File path or object to read. grayscale (bool): size (tupple of int): (width, height). If None, output img shape depends on the files to read. channel_first (bool): This argument specifies the shape of img is whether (height, width, channel) or (channel, height, width). Default value is False, which means the img shape is (height, width, channel). interpolate (str): must be one of ["nearest", "box", "bilinear", "hamming", "bicubic", "lanczos"]. as_uint16 (bool): If True, this function reads image as uint16. num_channels (int): channel size of output array. Default is -1 which preserves raw image shape. Returns: numpy.ndarray
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create_primary_zone_by_axfr'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'account_name'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'zone_name'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'master'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'tsig_key'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'key_value'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15', '28', '59', '72', '82']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'zone_properties'}; {'id': '18', 'type': 'dictionary', 'children': ['19', '22', '25']}; {'id': '19', 'type': 'pair', 'children': ['20', '21']}; {'id': '20', 'type': 'string', 'children': [], 'value': '"name"'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'zone_name'}; {'id': '22', 'type': 'pair', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': '"accountName"'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'account_name'}; {'id': '25', 'type': 'pair', 'children': ['26', '27']}; {'id': '26', 'type': 'string', 'children': [], 'value': '"type"'}; {'id': '27', 'type': 'string', 'children': [], 'value': '"PRIMARY"'}; {'id': '28', 'type': 'if_statement', 'children': ['29', '36', '50']}; {'id': '29', 'type': 'boolean_operator', 'children': ['30', '33'], 'value': 'and'}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': 'is not'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'tsig_key'}; {'id': '32', 'type': 'None', 'children': []}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '35'], 'value': 'is not'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'key_value'}; {'id': '35', 'type': 'None', 'children': []}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'name_server_info'}; {'id': '40', 'type': 'dictionary', 'children': ['41', '44', '47']}; {'id': '41', 'type': 'pair', 'children': ['42', '43']}; {'id': '42', 'type': 'string', 'children': [], 'value': '"ip"'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'master'}; {'id': '44', 'type': 'pair', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"tsigKey"'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'tsig_key'}; {'id': '47', 'type': 'pair', 'children': ['48', '49']}; {'id': '48', 'type': 'string', 'children': [], 'value': '"tsigKeyValue"'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'key_value'}; {'id': '50', 'type': 'else_clause', 'children': ['51']}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'name_server_info'}; {'id': '55', 'type': 'dictionary', 'children': ['56']}; {'id': '56', 'type': 'pair', 'children': ['57', '58']}; {'id': '57', 'type': 'string', 'children': [], 'value': '"ip"'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'master'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'primary_zone_info'}; {'id': '62', 'type': 'dictionary', 'children': ['63', '66', '69']}; {'id': '63', 'type': 'pair', 'children': ['64', '65']}; {'id': '64', 'type': 'string', 'children': [], 'value': '"forceImport"'}; {'id': '65', 'type': 'True', 'children': []}; {'id': '66', 'type': 'pair', 'children': ['67', '68']}; {'id': '67', 'type': 'string', 'children': [], 'value': '"createType"'}; {'id': '68', 'type': 'string', 'children': [], 'value': '"TRANSFER"'}; {'id': '69', 'type': 'pair', 'children': ['70', '71']}; {'id': '70', 'type': 'string', 'children': [], 'value': '"nameServer"'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'name_server_info'}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'zone_data'}; {'id': '75', 'type': 'dictionary', 'children': ['76', '79']}; {'id': '76', 'type': 'pair', 'children': ['77', '78']}; {'id': '77', 'type': 'string', 'children': [], 'value': '"properties"'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'zone_properties'}; {'id': '79', 'type': 'pair', 'children': ['80', '81']}; {'id': '80', 'type': 'string', 'children': [], 'value': '"primaryCreateInfo"'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'primary_zone_info'}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '89']}; {'id': '84', 'type': 'attribute', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'rest_api_connection'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '89', 'type': 'argument_list', 'children': ['90', '91']}; {'id': '90', 'type': 'string', 'children': [], 'value': '"/v1/zones"'}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'zone_data'}
Creates a new primary zone by zone transferring off a master. Arguments: account_name -- The name of the account that will contain this zone. zone_name -- The name of the zone. It must be unique. master -- Primary name server IP address. Keyword Arguments: tsig_key -- For TSIG-enabled zones: The transaction signature key. NOTE: Requires key_value. key_value -- TSIG key secret.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'coinc'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 's0'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 's1'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'slide'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'step'}; {'id': '9', 'type': 'block', 'children': ['10', '17', '33', '48']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'loglr'}; {'id': '13', 'type': 'binary_operator', 'children': ['14', '16'], 'value': '-'}; {'id': '14', 'type': 'unary_operator', 'children': ['15'], 'value': '-'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 's0'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 's1'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'threshes'}; {'id': '20', 'type': 'list_comprehension', 'children': ['21', '28']}; {'id': '21', 'type': 'subscript', 'children': ['22', '27']}; {'id': '22', 'type': 'subscript', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'fits_by_tid'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'thresh'"}; {'id': '28', 'type': 'for_in_clause', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'ifos'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'augmented_assignment', 'children': ['35', '36'], 'value': '+='}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'loglr'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'list_comprehension', 'children': ['40', '45']}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '44'], 'value': '/'}; {'id': '41', 'type': 'binary_operator', 'children': ['42', '43'], 'value': '**'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '43', 'type': 'float', 'children': [], 'value': '2.'}; {'id': '44', 'type': 'float', 'children': [], 'value': '2.'}; {'id': '45', 'type': 'for_in_clause', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'threshes'}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'binary_operator', 'children': ['50', '54'], 'value': '**'}; {'id': '50', 'type': '()', 'children': ['51']}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '53'], 'value': '*'}; {'id': '52', 'type': 'float', 'children': [], 'value': '2.'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'loglr'}; {'id': '54', 'type': 'float', 'children': [], 'value': '0.5'}
Calculate the final coinc ranking statistic
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'expect'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'instr'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'expected'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '7', 'type': 'block', 'children': ['8', '34']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '15']}; {'id': '9', 'type': 'not_operator', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'instr'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'expected'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'raise_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'DecompilationError'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'string', 'children': [], 'value': '"Expected a {expected} instruction {context}. Got {instr}."'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '28', '31']}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'instr'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'instr'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'expected'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'expected'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'instr'}
Check that an instruction is of the expected type.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'annotatedcore'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '19', '110']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'string', 'children': [], 'value': "'Calculating annotated core'"}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'total_core'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'for_statement', 'children': ['20', '21', '24']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'metadata'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'if_statement', 'children': ['26', '33']}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '32'], 'value': '!='}; {'id': '27', 'type': 'attribute', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'general'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'bestassemblyfile'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'NA'"}; {'id': '33', 'type': 'block', 'children': ['34', '46']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '43']}; {'id': '36', 'type': 'attribute', 'children': ['37', '42']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'analysistype'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'coreset'}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '45', 'type': 'argument_list', 'children': []}; {'id': '46', 'type': 'if_statement', 'children': ['47', '54']}; {'id': '47', 'type': 'comparison_operator', 'children': ['48', '53'], 'value': '=='}; {'id': '48', 'type': 'attribute', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'general'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'referencegenus'}; {'id': '53', 'type': 'string', 'children': [], 'value': "'Escherichia'"}; {'id': '54', 'type': 'block', 'children': ['55', '66']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '64']}; {'id': '57', 'type': 'attribute', 'children': ['58', '63']}; {'id': '58', 'type': 'attribute', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'runmetadata'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'samples'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '66', 'type': 'try_statement', 'children': ['67', '95']}; {'id': '67', 'type': 'block', 'children': ['68', '78']}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'report'}; {'id': '71', 'type': 'attribute', 'children': ['72', '77']}; {'id': '72', 'type': 'subscript', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'analysistype'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'report'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'blastparser'}; {'id': '83', 'type': 'argument_list', 'children': ['84', '87', '90']}; {'id': '84', 'type': 'keyword_argument', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'report'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'report'}; {'id': '87', 'type': 'keyword_argument', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '90', 'type': 'keyword_argument', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'fieldnames'}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'fieldnames'}; {'id': '95', 'type': 'except_clause', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '97', 'type': 'block', 'children': ['98']}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'assignment', 'children': ['100', '107']}; {'id': '100', 'type': 'attribute', 'children': ['101', '106']}; {'id': '101', 'type': 'subscript', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'analysistype'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'coreset'}; {'id': '107', 'type': 'call', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '109', 'type': 'argument_list', 'children': []}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'call', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'reporter'}; {'id': '115', 'type': 'argument_list', 'children': []}
Calculates the core genome of organisms using custom databases
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '22']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'attach'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '11', '16', '19']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'engine'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'Events'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'STARTED'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'pause'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'Events'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'COMPLETED'}; {'id': '16', 'type': 'default_parameter', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'resume'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'default_parameter', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'step'}; {'id': '21', 'type': 'None', 'children': []}; {'id': '22', 'type': 'block', 'children': ['23', '33', '43', '58', '73']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'engine'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'add_event_handler'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'reset'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'engine'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'add_event_handler'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'pause'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'pause'}; {'id': '43', 'type': 'if_statement', 'children': ['44', '47']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '46'], 'value': 'is not'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'resume'}; {'id': '46', 'type': 'None', 'children': []}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'engine'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'add_event_handler'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'resume'}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'resume'}; {'id': '58', 'type': 'if_statement', 'children': ['59', '62']}; {'id': '59', 'type': 'comparison_operator', 'children': ['60', '61'], 'value': 'is not'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'step'}; {'id': '61', 'type': 'None', 'children': []}; {'id': '62', 'type': 'block', 'children': ['63']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'engine'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'add_event_handler'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'step'}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'step'}; {'id': '73', 'type': 'return_statement', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'self'}
Register callbacks to control the timer. Args: engine (Engine): Engine that this timer will be attached to. start (Events): Event which should start (reset) the timer. pause (Events): Event which should pause the timer. resume (Events, optional): Event which should resume the timer. step (Events, optional): Event which should call the `step` method of the counter. Returns: self (Timer)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reactivate'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '21', '29', '37']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '13']}; {'id': '8', 'type': 'attribute', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_protocol'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'connectionLost'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_protocol'}; {'id': '20', 'type': 'None', 'children': []}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'terminal'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'reset'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '36']}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '_window'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'filthy'}; {'id': '36', 'type': 'argument_list', 'children': []}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '44']}; {'id': '39', 'type': 'attribute', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '_window'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'repaint'}; {'id': '44', 'type': 'argument_list', 'children': []}
Called when a sub-protocol is finished. This disconnects the sub-protocol and redraws the main menu UI.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'generate_sigv4_auth_request'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'header_value'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'block', 'children': ['8', '34', '45', '53']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'requests'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'Request'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '19', '22', '31']}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'POST'"}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'https://sts.amazonaws.com/'"}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '24', 'type': 'dictionary', 'children': ['25', '28']}; {'id': '25', 'type': 'pair', 'children': ['26', '27']}; {'id': '26', 'type': 'string', 'children': [], 'value': "'Content-Type'"}; {'id': '27', 'type': 'string', 'children': [], 'value': "'application/x-www-form-urlencoded; charset=utf-8'"}; {'id': '28', 'type': 'pair', 'children': ['29', '30']}; {'id': '29', 'type': 'string', 'children': [], 'value': "'Host'"}; {'id': '30', 'type': 'string', 'children': [], 'value': "'sts.amazonaws.com'"}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'Action=GetCallerIdentity&Version=2011-06-15'"}; {'id': '34', 'type': 'if_statement', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'header_value'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '44']}; {'id': '39', 'type': 'subscript', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'X-Vault-AWS-IAM-Server-ID'"}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'header_value'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'prepared_request'}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'prepare'}; {'id': '52', 'type': 'argument_list', 'children': []}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'prepared_request'}
Helper function to prepare a AWS API request to subsequently generate a "AWS Signature Version 4" header. :param header_value: Vault allows you to require an additional header, X-Vault-AWS-IAM-Server-ID, to be present to mitigate against different types of replay attacks. Depending on the configuration of the AWS auth backend, providing a argument to this optional parameter may be required. :type header_value: str :return: A PreparedRequest instance, optionally containing the provided header value under a 'X-Vault-AWS-IAM-Server-ID' header name pointed to AWS's simple token service with action "GetCallerIdentity" :rtype: requests.PreparedRequest
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_descriptions'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'description_type'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '20', '35']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '12']}; {'id': '9', 'type': 'tuple_pattern', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'desc_type'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'max_units'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'description_type'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '16', 'type': 'binary_operator', 'children': ['17', '19'], 'value': '*'}; {'id': '17', 'type': 'list', 'children': ['18'], 'value': '[None]'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'max_units'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '29']}; {'id': '22', 'type': 'subscript', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'elk'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_descriptions_in_progress'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'desc_type'}; {'id': '29', 'type': 'tuple', 'children': ['30', '31', '32']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'max_units'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '_got_desc'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'elk'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'send'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sd_encode'}; {'id': '45', 'type': 'argument_list', 'children': ['46', '49']}; {'id': '46', 'type': 'keyword_argument', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'desc_type'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'desc_type'}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'unit'}; {'id': '51', 'type': 'integer', 'children': [], 'value': '0'}
Gets the descriptions for specified type. When complete the callback is called with a list of descriptions
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'enter_room'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sid'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'room'}; {'id': '8', 'type': 'block', 'children': ['9', '24', '43']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '15']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': 'not in'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'rooms'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '23']}; {'id': '18', 'type': 'subscript', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'rooms'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '23', 'type': 'dictionary', 'children': []}; {'id': '24', 'type': 'if_statement', 'children': ['25', '32']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': 'not in'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'room'}; {'id': '27', 'type': 'subscript', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'rooms'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '42']}; {'id': '35', 'type': 'subscript', 'children': ['36', '41']}; {'id': '36', 'type': 'subscript', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'rooms'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'room'}; {'id': '42', 'type': 'dictionary', 'children': []}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '54']}; {'id': '45', 'type': 'subscript', 'children': ['46', '53']}; {'id': '46', 'type': 'subscript', 'children': ['47', '52']}; {'id': '47', 'type': 'subscript', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'rooms'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'room'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'sid'}; {'id': '54', 'type': 'True', 'children': []}
Add a client to a room.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'hangup'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '32']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '10']}; {'id': '7', 'type': 'attribute', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'active'}; {'id': '10', 'type': 'block', 'children': ['11', '20', '26']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_gsmModem'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'string', 'children': [], 'value': "'ATH'"}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'answered'}; {'id': '25', 'type': 'False', 'children': []}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'active'}; {'id': '31', 'type': 'False', 'children': []}; {'id': '32', 'type': 'if_statement', 'children': ['33', '42']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '37'], 'value': 'in'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_gsmModem'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'activeCalls'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'delete_statement', 'children': ['44']}; {'id': '44', 'type': 'subscript', 'children': ['45', '50']}; {'id': '45', 'type': 'attribute', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': '_gsmModem'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'activeCalls'}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'id'}
End the phone call. Does nothing if the call is already inactive.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'check'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'feature'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '42', '96']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'found'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'for_statement', 'children': ['12', '13', '16']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'handler'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'handlers'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'try_statement', 'children': ['18', '27', '32', '36']}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'if_statement', 'children': ['20', '24']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'handler'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'feature'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'True', 'children': []}; {'id': '27', 'type': 'except_clause', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'StopCheckingFeatureFlags'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'return_statement', 'children': ['31']}; {'id': '31', 'type': 'False', 'children': []}; {'id': '32', 'type': 'except_clause', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'NoFeatureFlagFound'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'pass_statement', 'children': []}; {'id': '36', 'type': 'else_clause', 'children': ['37']}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'found'}; {'id': '41', 'type': 'True', 'children': []}; {'id': '42', 'type': 'if_statement', 'children': ['43', '45']}; {'id': '43', 'type': 'not_operator', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'found'}; {'id': '45', 'type': 'block', 'children': ['46', '57']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'string', 'children': [], 'value': 'u"No feature flag defined for {feature}"'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'feature'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'feature'}; {'id': '57', 'type': 'if_statement', 'children': ['58', '71', '77']}; {'id': '58', 'type': 'boolean_operator', 'children': ['59', '62'], 'value': 'and'}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'current_app'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '62', 'type': 'call', 'children': ['63', '68']}; {'id': '63', 'type': 'attribute', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'current_app'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'RAISE_ERROR_ON_MISSING_FEATURES'}; {'id': '70', 'type': 'False', 'children': []}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'raise_statement', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '77', 'type': 'else_clause', 'children': ['78']}; {'id': '78', 'type': 'block', 'children': ['79', '86']}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'call', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'missing_feature'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'send'}; {'id': '91', 'type': 'argument_list', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '93', 'type': 'keyword_argument', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'feature'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'feature'}; {'id': '96', 'type': 'return_statement', 'children': ['97']}; {'id': '97', 'type': 'False', 'children': []}
Loop through all our feature flag checkers and return true if any of them are true. The order of handlers matters - we will immediately return True if any handler returns true. If you want to a handler to return False and stop the chain, raise the StopCheckingFeatureFlags exception.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ordered'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'ord'}; {'id': '7', 'type': 'string', 'children': [], 'value': "'desc'"}; {'id': '8', 'type': 'block', 'children': ['9', '17', '29']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '15']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': 'not in'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ord'}; {'id': '12', 'type': 'tuple', 'children': ['13', '14']}; {'id': '13', 'type': 'string', 'children': [], 'value': "'asc'"}; {'id': '14', 'type': 'string', 'children': [], 'value': "'desc'"}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'raise_statement', 'children': []}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'ord_f'}; {'id': '20', 'type': 'call', 'children': ['21', '28']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'PIDRelation'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'ord'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'order_by'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ord_f'}
Order the query result on the relations' indexes.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_settings'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'config_file'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '27', '75', '98', '117']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'default_settings'}; {'id': '9', 'type': 'dictionary', 'children': ['10']}; {'id': '10', 'type': 'pair', 'children': ['11', '12']}; {'id': '11', 'type': 'string', 'children': [], 'value': "'general'"}; {'id': '12', 'type': 'dictionary', 'children': ['13', '16']}; {'id': '13', 'type': 'pair', 'children': ['14', '15']}; {'id': '14', 'type': 'string', 'children': [], 'value': "'endpoint'"}; {'id': '15', 'type': 'string', 'children': [], 'value': "'http://guacamole.antojitos.io/files/'"}; {'id': '16', 'type': 'pair', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'shortener'"}; {'id': '18', 'type': 'string', 'children': [], 'value': "'http://t.antojitos.io/api/v1/urls'"}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'configparser'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'ConfigParser'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'try_statement', 'children': ['28', '36']}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'read_dict'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'default_settings'}; {'id': '36', 'type': 'except_clause', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'for_statement', 'children': ['40', '43', '48']}; {'id': '40', 'type': 'pattern_list', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'default_settings'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'block', 'children': ['49', '56']}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'add_section'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '56', 'type': 'for_statement', 'children': ['57', '60', '65']}; {'id': '57', 'type': 'pattern_list', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'option'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '64', 'type': 'argument_list', 'children': []}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '73', '74']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'option'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '75', 'type': 'if_statement', 'children': ['76', '88']}; {'id': '76', 'type': 'boolean_operator', 'children': ['77', '80'], 'value': 'and'}; {'id': '77', 'type': 'comparison_operator', 'children': ['78', '79'], 'value': 'is not'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'config_file'}; {'id': '79', 'type': 'None', 'children': []}; {'id': '80', 'type': 'call', 'children': ['81', '86']}; {'id': '81', 'type': 'attribute', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'config_file'}; {'id': '88', 'type': 'block', 'children': ['89', '96']}; {'id': '89', 'type': 'expression_statement', 'children': ['90']}; {'id': '90', 'type': 'call', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'config_file'}; {'id': '96', 'type': 'return_statement', 'children': ['97']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '98', 'type': 'if_statement', 'children': ['99', '107']}; {'id': '99', 'type': 'call', 'children': ['100', '105']}; {'id': '100', 'type': 'attribute', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'CONFIG_FILE'}; {'id': '107', 'type': 'block', 'children': ['108', '115']}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'call', 'children': ['110', '113']}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '113', 'type': 'argument_list', 'children': ['114']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'CONFIG_FILE'}; {'id': '115', 'type': 'return_statement', 'children': ['116']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '117', 'type': 'return_statement', 'children': ['118']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'settings'}
Search and load a configuration file.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_colormap'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '5', 'type': 'list_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '7', 'type': 'dictionary_splat_pattern', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '9', 'type': 'block', 'children': ['10', '72']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '16', '21']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'BaseColormap'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'cmap'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '21', 'type': 'else_clause', 'children': ['22']}; {'id': '22', 'type': 'block', 'children': ['23', '36', '48', '54']}; {'id': '23', 'type': 'if_statement', 'children': ['24', '30']}; {'id': '24', 'type': 'not_operator', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'string_types'}; {'id': '30', 'type': 'block', 'children': ['31']}; {'id': '31', 'type': 'raise_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'string', 'children': [], 'value': "'colormap must be a Colormap or string name'"}; {'id': '36', 'type': 'if_statement', 'children': ['37', '40']}; {'id': '37', 'type': 'comparison_operator', 'children': ['38', '39'], 'value': 'not in'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '_colormaps'}; {'id': '40', 'type': 'block', 'children': ['41']}; {'id': '41', 'type': 'raise_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '47'], 'value': '%'}; {'id': '46', 'type': 'string', 'children': [], 'value': "'colormap name %s not found'"}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'cmap'}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': '_colormaps'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '54', 'type': 'if_statement', 'children': ['55', '61']}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'inspect'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'isclass'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'cmap'}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'cmap'}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'cmap'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '70']}; {'id': '68', 'type': 'list_splat', 'children': ['69']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '70', 'type': 'dictionary_splat', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '72', 'type': 'return_statement', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'cmap'}
Obtain a colormap Some colormaps can have additional configuration parameters. Refer to their corresponding documentation for more information. Parameters ---------- name : str | Colormap Colormap name. Can also be a Colormap for pass-through. Examples -------- >>> get_colormap('autumn') >>> get_colormap('single_hue', hue=10)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'rm'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '5', 'type': 'block', 'children': ['6', '15']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'paths'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'glob'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'glob'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '15', 'type': 'for_statement', 'children': ['16', '17', '18']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'paths'}; {'id': '18', 'type': 'block', 'children': ['19', '28']}; {'id': '19', 'type': 'if_statement', 'children': ['20', '26']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'string', 'children': [], 'value': "'.git/'"}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'continue_statement', 'children': []}; {'id': '28', 'type': 'if_statement', 'children': ['29', '37', '78']}; {'id': '29', 'type': 'call', 'children': ['30', '35']}; {'id': '30', 'type': 'attribute', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'isdir'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '37', 'type': 'block', 'children': ['38', '61', '68']}; {'id': '38', 'type': 'function_definition', 'children': ['39', '40', '44']}; {'id': '39', 'type': 'function_name', 'children': [], 'value': 'onerror'}; {'id': '40', 'type': 'parameters', 'children': ['41', '42', '43']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'fun'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'excinfo'}; {'id': '44', 'type': 'block', 'children': ['45', '51']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'excinfo'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '51', 'type': 'if_statement', 'children': ['52', '59']}; {'id': '52', 'type': 'comparison_operator', 'children': ['53', '56'], 'value': '!='}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'errno'}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'errno'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'ENOENT'}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'raise_statement', 'children': []}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'safe_print'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '67'], 'value': '%'}; {'id': '66', 'type': 'string', 'children': [], 'value': '"rmdir -f %s"'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'shutil'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'rmtree'}; {'id': '73', 'type': 'argument_list', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '75', 'type': 'keyword_argument', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'onerror'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'onerror'}; {'id': '78', 'type': 'else_clause', 'children': ['79']}; {'id': '79', 'type': 'block', 'children': ['80', '87']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'safe_print'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'binary_operator', 'children': ['85', '86'], 'value': '%'}; {'id': '85', 'type': 'string', 'children': [], 'value': '"rm %s"'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'call', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '92', 'type': 'argument_list', 'children': ['93']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'path'}
Recursively remove a file or dir by pattern.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create_and_configure_wrapper'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '5', 'type': 'block', 'children': ['6', '16', '26', '43', '57', '67']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'driver_wrapper'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'DriverWrappersPool'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'get_default_wrapper'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'driver_wrapper'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '26', 'type': 'try_statement', 'children': ['27', '36']}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'behave_properties'}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'userdata'}; {'id': '36', 'type': 'except_clause', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'behave_properties'}; {'id': '42', 'type': 'None', 'children': []}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '50']}; {'id': '45', 'type': 'attribute', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'driver_wrapper'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'configure'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'config_files'}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'behave_properties'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'behave_properties'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'toolium_config'}; {'id': '62', 'type': 'attribute', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'driver_wrapper'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'context_or_world'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': '__name__'}
Create and configure driver wrapper in behave or lettuce tests :param context_or_world: behave context or lettuce world
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'iter'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '34', '43', '53', '60']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '16', '25']}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '15'], 'value': 'is'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '15', 'type': 'None', 'children': []}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '24'], 'value': '+'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_index'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '25', 'type': 'elif_clause', 'children': ['26', '29']}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '28'], 'value': '=='}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'raise_statement', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'StopIteration'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'if_statement', 'children': ['35', '38']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': '>='}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'raise_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'StopIteration'}; {'id': '42', 'type': 'argument_list', 'children': []}; {'id': '43', 'type': 'assert_statement', 'children': ['44']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '46', '47'], 'value': '<='}; {'id': '45', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': '_history'}; {'id': '53', 'type': 'assert_statement', 'children': ['54']}; {'id': '54', 'type': 'comparison_operator', 'children': ['55', '56', '57'], 'value': '<='}; {'id': '55', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '59'], 'value': '-'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '59', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '60', 'type': 'for_statement', 'children': ['61', '62', '67']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'yield', 'children': ['70']}; {'id': '70', 'type': 'subscript', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': '_history'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'i'}
Iterate through successive history items. Parameters ---------- end : int Index of the last item to loop through + 1. start : int Initial index for the loop (0 by default).
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_write_to_datastore'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '26', '32']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'roots_and_submissions'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '16']}; {'id': '12', 'type': 'list', 'children': ['13', '14', '15'], 'value': '[ATTACKS_ENTITY_KEY,\n TARGET_ATTACKS_ENTITY_KEY,\n DEFENSES_ENTITY_KEY]'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'ATTACKS_ENTITY_KEY'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'TARGET_ATTACKS_ENTITY_KEY'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'DEFENSES_ENTITY_KEY'}; {'id': '16', 'type': 'list', 'children': ['17', '20', '23'], 'value': '[self._attacks,\n self._targeted_attacks,\n self._defenses]'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_attacks'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_targeted_attacks'}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_defenses'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_datastore_client'}; {'id': '32', 'type': 'with_statement', 'children': ['33', '43']}; {'id': '33', 'type': 'with_clause', 'children': ['34']}; {'id': '34', 'type': 'with_item', 'children': ['35']}; {'id': '35', 'type': 'as_pattern', 'children': ['36', '41']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'no_transact_batch'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'as_pattern_target', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'batch'}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'for_statement', 'children': ['45', '48', '49']}; {'id': '45', 'type': 'pattern_list', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'root_key'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'submissions'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'roots_and_submissions'}; {'id': '49', 'type': 'block', 'children': ['50', '68']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'batch'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'put'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'entity'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'list_splat', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'root_key'}; {'id': '68', 'type': 'for_statement', 'children': ['69', '72', '76']}; {'id': '69', 'type': 'pattern_list', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'submissions'}; {'id': '76', 'type': 'block', 'children': ['77', '97', '105', '117']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'entity'}; {'id': '80', 'type': 'call', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'entity'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'list_splat', 'children': ['91']}; {'id': '91', 'type': '()', 'children': ['92']}; {'id': '92', 'type': 'binary_operator', 'children': ['93', '94'], 'value': '+'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'root_key'}; {'id': '94', 'type': 'list', 'children': ['95', '96'], 'value': '[KIND_SUBMISSION, k]'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'KIND_SUBMISSION'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'assignment', 'children': ['99', '102']}; {'id': '99', 'type': 'subscript', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'entity'}; {'id': '101', 'type': 'string', 'children': [], 'value': "'submission_path'"}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'entity'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'call', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'participant_from_submission_path'}; {'id': '113', 'type': 'argument_list', 'children': ['114']}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'call', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'batch'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'put'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'entity'}
Writes all submissions to datastore.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'list_to_bytes_list'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'strList'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '29', '53', '59', '77']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'pList'}; {'id': '9', 'type': 'binary_operator', 'children': ['10', '11'], 'value': '*'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'c_char_p'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'strList'}; {'id': '15', 'type': 'if_statement', 'children': ['16', '26']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'strList'}; {'id': '20', 'type': 'tuple', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'pList'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'None', 'children': []}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'strList'}; {'id': '29', 'type': 'if_statement', 'children': ['30', '39']}; {'id': '30', 'type': 'not_operator', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'strList'}; {'id': '35', 'type': 'tuple', 'children': ['36', '37', '38']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'raise_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'binary_operator', 'children': ['45', '46'], 'value': '+'}; {'id': '45', 'type': 'string', 'children': [], 'value': '"strList must be list, set or tuple, not "'}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'strList'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'pList'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'pList'}; {'id': '58', 'type': 'argument_list', 'children': []}; {'id': '59', 'type': 'for_statement', 'children': ['60', '63', '67']}; {'id': '60', 'type': 'pattern_list', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'elem'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'strList'}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '73']}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'pList'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'str_to_bytes'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'elem'}; {'id': '77', 'type': 'return_statement', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'pList'}
This function turns an array of strings into a pointer array with pointers pointing to the encodings of those strings Possibly contained bytes are kept as they are. :param strList: List of strings that shall be converted :type strList: List of strings :returns: Pointer array with pointers pointing to bytes :raises: TypeError if strList is not list, set or tuple
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'pop_scope'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '20', '30', '44']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'child_scope'}; {'id': '9', 'type': 'call', 'children': ['10', '19']}; {'id': '10', 'type': 'attribute', 'children': ['11', '18']}; {'id': '11', 'type': 'attribute', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'stack'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '29']}; {'id': '22', 'type': 'attribute', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'stack'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'parent_scope'}; {'id': '33', 'type': 'call', 'children': ['34', '43']}; {'id': '34', 'type': 'attribute', 'children': ['35', '42']}; {'id': '35', 'type': 'attribute', 'children': ['36', '41']}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'stack'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '53']}; {'id': '46', 'type': 'attribute', 'children': ['47', '52']}; {'id': '47', 'type': 'attribute', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'stack'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '53', 'type': 'dictionary_comprehension', 'children': ['54', '59', '62']}; {'id': '54', 'type': 'pair', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'child_scope'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '59', 'type': 'for_in_clause', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'child_scope'}; {'id': '62', 'type': 'if_clause', 'children': ['63']}; {'id': '63', 'type': 'comparison_operator', 'children': ['64', '65'], 'value': 'in'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'parent_scope'}
Delete the current scope in the current scope.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'in_reply_to'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'type', 'children': ['6']}; {'id': '6', 'type': 'generic_type', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'Optional'}; {'id': '8', 'type': 'type_parameter', 'children': ['9']}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'UnstructuredHeader'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'try_statement', 'children': ['13', '24']}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'cast'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'UnstructuredHeader'}; {'id': '19', 'type': 'subscript', 'children': ['20', '23']}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'string', 'children': [], 'value': "b'in-reply-to'"}; {'id': '23', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '24', 'type': 'except_clause', 'children': ['25', '28']}; {'id': '25', 'type': 'tuple', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'IndexError'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'None', 'children': []}
The ``In-Reply-To`` header.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'is_console'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'users_text'}; {'id': '6', 'type': 'block', 'children': ['7', '21', '85', '92']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': 'is'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'users_text'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '19']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'string', 'children': [], 'value': '"Console information not collected"'}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'None', 'children': []}; {'id': '21', 'type': 'for_statement', 'children': ['22', '23', '29']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'users_text'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'if_statement', 'children': ['31', '34']}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '33'], 'value': 'in'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'*'"}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '34', 'type': 'block', 'children': ['35', '47']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'search'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'vty_re'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '47', 'type': 'if_statement', 'children': ['48', '49', '59']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '49', 'type': 'block', 'children': ['50', '57']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'string', 'children': [], 'value': '"Detected connection to vty"'}; {'id': '57', 'type': 'return_statement', 'children': ['58']}; {'id': '58', 'type': 'False', 'children': []}; {'id': '59', 'type': 'else_clause', 'children': ['60']}; {'id': '60', 'type': 'block', 'children': ['61', '73']}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'search'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'console_re'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '73', 'type': 'if_statement', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '75', 'type': 'block', 'children': ['76', '83']}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'string', 'children': [], 'value': '"Detected connection to console"'}; {'id': '83', 'type': 'return_statement', 'children': ['84']}; {'id': '84', 'type': 'True', 'children': []}; {'id': '85', 'type': 'expression_statement', 'children': ['86']}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'string', 'children': [], 'value': '"Connection port unknown"'}; {'id': '92', 'type': 'return_statement', 'children': ['93']}; {'id': '93', 'type': 'None', 'children': []}
Return if device is connected over console.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_format_volume_string'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'volume_string'}; {'id': '6', 'type': 'block', 'children': ['7', '38']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'actual_volume'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'subscript', 'children': ['16', '37']}; {'id': '16', 'type': 'call', 'children': ['17', '36']}; {'id': '17', 'type': 'attribute', 'children': ['18', '35']}; {'id': '18', 'type': 'subscript', 'children': ['19', '34']}; {'id': '19', 'type': 'call', 'children': ['20', '32']}; {'id': '20', 'type': 'attribute', 'children': ['21', '31']}; {'id': '21', 'type': 'subscript', 'children': ['22', '30']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'volume_string'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'volume_string'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'string', 'children': [], 'value': "','"}; {'id': '34', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '36', 'type': 'argument_list', 'children': []}; {'id': '37', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'string', 'children': [], 'value': "'[Vol: {}%] '"}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'binary_operator', 'children': ['48', '53'], 'value': '/'}; {'id': '48', 'type': 'binary_operator', 'children': ['49', '50'], 'value': '*'}; {'id': '49', 'type': 'integer', 'children': [], 'value': '100'}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'actual_volume'}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'max_volume'}
format vlc's volume
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'vicinity'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '35']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '24']}; {'id': '7', 'type': 'boolean_operator', 'children': ['8', '19'], 'value': 'and'}; {'id': '8', 'type': 'boolean_operator', 'children': ['9', '14'], 'value': 'and'}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '13'], 'value': '=='}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_vicinity'}; {'id': '13', 'type': 'string', 'children': [], 'value': "''"}; {'id': '14', 'type': 'comparison_operator', 'children': ['15', '18'], 'value': '!='}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'details'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '21'], 'value': 'in'}; {'id': '20', 'type': 'string', 'children': [], 'value': "'vicinity'"}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'details'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_vicinity'}; {'id': '30', 'type': 'subscript', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'details'}; {'id': '34', 'type': 'string', 'children': [], 'value': "'vicinity'"}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '_vicinity'}
Returns a feature name of a nearby location. Often this feature refers to a street or neighborhood within the given results.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_messages'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'page'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'block', 'children': ['9', '13', '31', '46', '60', '65']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'https://outlook.office.com/api/v2.0/me/messages'"}; {'id': '13', 'type': 'if_statement', 'children': ['14', '17']}; {'id': '14', 'type': 'comparison_operator', 'children': ['15', '16'], 'value': '>'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'page'}; {'id': '16', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '21', 'type': 'binary_operator', 'children': ['22', '30'], 'value': '+'}; {'id': '22', 'type': 'binary_operator', 'children': ['23', '26'], 'value': '+'}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '25'], 'value': '+'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'/?%24skip='"}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'page'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'0'"}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'string', 'children': [], 'value': "'Getting messages from endpoint: {} with Headers: {}'"}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_headers'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'requests'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '55', 'type': 'keyword_argument', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_headers'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'check_response'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'Message'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': '_json_to_messages'}; {'id': '70', 'type': 'argument_list', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '76', 'type': 'argument_list', 'children': []}
Get first 10 messages in account, across all folders. Keyword Args: page (int): Integer representing the 'page' of results to fetch Returns: List[:class:`Message <pyOutlook.core.message.Message>`]
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'mobile_template'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '5', 'type': 'block', 'children': ['6', '85']}; {'id': '6', 'type': 'function_definition', 'children': ['7', '8', '10']}; {'id': '7', 'type': 'function_name', 'children': [], 'value': 'decorator'}; {'id': '8', 'type': 'parameters', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '10', 'type': 'block', 'children': ['11', '83']}; {'id': '11', 'type': 'decorated_definition', 'children': ['12', '19']}; {'id': '12', 'type': 'decorator', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'functools'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'wraps'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '19', 'type': 'function_definition', 'children': ['20', '21', '26']}; {'id': '20', 'type': 'function_name', 'children': [], 'value': 'wrapper'}; {'id': '21', 'type': 'parameters', 'children': ['22', '24']}; {'id': '22', 'type': 'list_splat_pattern', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '24', 'type': 'dictionary_splat_pattern', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '26', 'type': 'block', 'children': ['27', '33', '75']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'stack'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'top'}; {'id': '33', 'type': 'if_statement', 'children': ['34', '43']}; {'id': '34', 'type': 'boolean_operator', 'children': ['35', '38'], 'value': 'and'}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': 'is not'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '37', 'type': 'None', 'children': []}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '42', 'type': 'string', 'children': [], 'value': "'request'"}; {'id': '43', 'type': 'block', 'children': ['44', '50', '59']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'is_mobile'}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '57', '58']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '57', 'type': 'string', 'children': [], 'value': "'MOBILE'"}; {'id': '58', 'type': 'None', 'children': []}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '64']}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '63', 'type': 'string', 'children': [], 'value': "'template'"}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'sub'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '70', '74']}; {'id': '69', 'type': 'string', 'children': [], 'value': "r'{(.+?)}'"}; {'id': '70', 'type': 'conditional_expression', 'children': ['71', '72', '73'], 'value': 'if'}; {'id': '71', 'type': 'string', 'children': [], 'value': "r'\\1'"}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'is_mobile'}; {'id': '73', 'type': 'string', 'children': [], 'value': "''"}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '75', 'type': 'return_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '81']}; {'id': '79', 'type': 'list_splat', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '81', 'type': 'dictionary_splat', 'children': ['82']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '83', 'type': 'return_statement', 'children': ['84']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'wrapper'}; {'id': '85', 'type': 'return_statement', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'decorator'}
Mark a function as mobile-ready and pass a mobile template if MOBILE. For example:: @mobile_template('a/{mobile/}b.html') def view(template=None): ... if ``request.MOBILE=True`` the template will be `a/mobile/b.html`. if ``request.MOBILE=False`` the template will be `a/b.html`. This function is useful if the mobile view uses the same context but a different template.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'DisplayEstimate'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'min_estimate'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'max_estimate'}; {'id': '7', 'type': 'block', 'children': ['8', '34', '56', '68', '84', '86', '93', '100', '107']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'mean_avg_cpc'}; {'id': '11', 'type': '()', 'children': ['12']}; {'id': '12', 'type': 'conditional_expression', 'children': ['13', '26', '33'], 'value': 'if'}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_CalculateMean'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '21']}; {'id': '16', 'type': 'subscript', 'children': ['17', '20']}; {'id': '17', 'type': 'subscript', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'min_estimate'}; {'id': '19', 'type': 'string', 'children': [], 'value': "'averageCpc'"}; {'id': '20', 'type': 'string', 'children': [], 'value': "'microAmount'"}; {'id': '21', 'type': 'subscript', 'children': ['22', '25']}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'max_estimate'}; {'id': '24', 'type': 'string', 'children': [], 'value': "'averageCpc'"}; {'id': '25', 'type': 'string', 'children': [], 'value': "'microAmount'"}; {'id': '26', 'type': 'boolean_operator', 'children': ['27', '30'], 'value': 'and'}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '29'], 'value': 'in'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'averageCpc'"}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'min_estimate'}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'min_estimate'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'averageCpc'"}; {'id': '33', 'type': 'None', 'children': []}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'mean_avg_pos'}; {'id': '37', 'type': '()', 'children': ['38']}; {'id': '38', 'type': 'conditional_expression', 'children': ['39', '48', '55'], 'value': 'if'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_CalculateMean'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '45']}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'min_estimate'}; {'id': '44', 'type': 'string', 'children': [], 'value': "'averagePosition'"}; {'id': '45', 'type': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'max_estimate'}; {'id': '47', 'type': 'string', 'children': [], 'value': "'averagePosition'"}; {'id': '48', 'type': 'boolean_operator', 'children': ['49', '52'], 'value': 'and'}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '51'], 'value': 'in'}; {'id': '50', 'type': 'string', 'children': [], 'value': "'averagePosition'"}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'min_estimate'}; {'id': '52', 'type': 'subscript', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'min_estimate'}; {'id': '54', 'type': 'string', 'children': [], 'value': "'averagePosition'"}; {'id': '55', 'type': 'None', 'children': []}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'mean_clicks'}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': '_CalculateMean'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '65']}; {'id': '62', 'type': 'subscript', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'min_estimate'}; {'id': '64', 'type': 'string', 'children': [], 'value': "'clicksPerDay'"}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'max_estimate'}; {'id': '67', 'type': 'string', 'children': [], 'value': "'clicksPerDay'"}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'mean_total_cost'}; {'id': '71', 'type': 'call', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': '_CalculateMean'}; {'id': '73', 'type': 'argument_list', 'children': ['74', '79']}; {'id': '74', 'type': 'subscript', 'children': ['75', '78']}; {'id': '75', 'type': 'subscript', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'min_estimate'}; {'id': '77', 'type': 'string', 'children': [], 'value': "'totalCost'"}; {'id': '78', 'type': 'string', 'children': [], 'value': "'microAmount'"}; {'id': '79', 'type': 'subscript', 'children': ['80', '83']}; {'id': '80', 'type': 'subscript', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'max_estimate'}; {'id': '82', 'type': 'string', 'children': [], 'value': "'totalCost'"}; {'id': '83', 'type': 'string', 'children': [], 'value': "'microAmount'"}; {'id': '84', 'type': 'print_statement', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '86', 'type': 'print_statement', 'children': ['87']}; {'id': '87', 'type': 'binary_operator', 'children': ['88', '89'], 'value': '%'}; {'id': '88', 'type': 'string', 'children': [], 'value': "' Estimated average CPC: %s'"}; {'id': '89', 'type': 'call', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': '_FormatMean'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'mean_avg_cpc'}; {'id': '93', 'type': 'print_statement', 'children': ['94']}; {'id': '94', 'type': 'binary_operator', 'children': ['95', '96'], 'value': '%'}; {'id': '95', 'type': 'string', 'children': [], 'value': "' Estimated ad position: %s'"}; {'id': '96', 'type': 'call', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': '_FormatMean'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'mean_avg_pos'}; {'id': '100', 'type': 'print_statement', 'children': ['101']}; {'id': '101', 'type': 'binary_operator', 'children': ['102', '103'], 'value': '%'}; {'id': '102', 'type': 'string', 'children': [], 'value': "' Estimated daily clicks: %s'"}; {'id': '103', 'type': 'call', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': '_FormatMean'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'mean_clicks'}; {'id': '107', 'type': 'print_statement', 'children': ['108']}; {'id': '108', 'type': 'binary_operator', 'children': ['109', '110'], 'value': '%'}; {'id': '109', 'type': 'string', 'children': [], 'value': "' Estimated daily cost: %s'"}; {'id': '110', 'type': 'call', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': '_FormatMean'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'mean_total_cost'}
Displays mean average cpc, position, clicks, and total cost for estimate. Args: message: str message to display for the given estimate. min_estimate: sudsobject containing a minimum estimate from the TrafficEstimatorService response. max_estimate: sudsobject containing a maximum estimate from the TrafficEstimatorService response.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'show_tooltip'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'tooltip'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': '_sender_deco'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'block', 'children': ['11', '23']}; {'id': '11', 'type': 'if_statement', 'children': ['12', '21']}; {'id': '12', 'type': 'boolean_operator', 'children': ['13', '16'], 'value': 'and'}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '15'], 'value': 'is not'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_sender_deco'}; {'id': '15', 'type': 'None', 'children': []}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '18'], 'value': 'not in'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_sender_deco'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'decorations'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'return_statement', 'children': []}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '30']}; {'id': '25', 'type': 'attribute', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'QtWidgets'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'QToolTip'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'showText'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32', '38']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'tooltip'}; {'id': '34', 'type': 'slice', 'children': ['35', '36', '37']}; {'id': '35', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '36', 'type': 'colon', 'children': []}; {'id': '37', 'type': 'integer', 'children': [], 'value': '1024'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}
Show a tool tip at the specified position :param pos: Tooltip position :param tooltip: Tooltip text :param _sender_deco: TextDecoration which is the sender of the show tooltip request. (for internal use only).
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load_reader_options'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '13', '25']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'assignment', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '8', 'type': 'subscript', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'PANDOC_READER_OPTIONS'"}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'loads'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'object_pairs_hook'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'options'}
Retrieve Pandoc Reader options from the environment
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_make_minimal'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'dictionary'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '56']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'new_dict'}; {'id': '9', 'type': 'dictionary', 'children': []}; {'id': '10', 'type': 'for_statement', 'children': ['11', '14', '19']}; {'id': '11', 'type': 'pattern_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'dictionary'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'if_statement', 'children': ['21', '24']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '23'], 'value': 'is not'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '23', 'type': 'None', 'children': []}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'if_statement', 'children': ['26', '31', '48']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '31', 'type': 'block', 'children': ['32', '39']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'new_value'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_make_minimal'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '39', 'type': 'if_statement', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'new_value'}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '47']}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'new_dict'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'new_value'}; {'id': '48', 'type': 'else_clause', 'children': ['49']}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '55']}; {'id': '52', 'type': 'subscript', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'new_dict'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'new_dict'}
This function removes all the keys whose value is either None or an empty dictionary.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'is_valid_vpnv4_prefix'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '5', 'type': 'block', 'children': ['6', '16', '26', '36', '56']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '13']}; {'id': '7', 'type': 'not_operator', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'False', 'children': []}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'string', 'children': [], 'value': "':'"}; {'id': '25', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '26', 'type': 'if_statement', 'children': ['27', '33']}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '32'], 'value': '!='}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '32', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'False', 'children': []}; {'id': '36', 'type': 'if_statement', 'children': ['37', '53']}; {'id': '37', 'type': 'not_operator', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'is_valid_route_dist'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'string', 'children': [], 'value': "':'"}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'list', 'children': ['47', '50'], 'value': '[tokens[0], tokens[1]]'}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '49', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '52', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'False', 'children': []}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'is_valid_ipv4_prefix'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '2'}
Returns True if given prefix is a string represent vpnv4 prefix. Vpnv4 prefix is made up of RD:Ipv4, where RD is represents route distinguisher and Ipv4 represents valid dot-decimal ipv4 notation string.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'start'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '17', '25', '35', '73', '92']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '15']}; {'id': '7', 'type': 'not_operator', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '14']}; {'id': '9', 'type': 'attribute', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_done_event'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'is_set'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': []}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '24']}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_done_event'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'clear'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'nb_pending_tasks'}; {'id': '28', 'type': 'call', 'children': ['29', '34']}; {'id': '29', 'type': 'attribute', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_queue'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'qsize'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'if_statement', 'children': ['36', '41', '54', '67']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '38'], 'value': '>'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'nb_pending_tasks'}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_max_threads'}; {'id': '41', 'type': 'block', 'children': ['42', '48']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'nb_threads'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': '_max_threads'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'nb_pending_tasks'}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': '_max_threads'}; {'id': '54', 'type': 'elif_clause', 'children': ['55', '60']}; {'id': '55', 'type': 'comparison_operator', 'children': ['56', '57'], 'value': '<'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'nb_pending_tasks'}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_min_threads'}; {'id': '60', 'type': 'block', 'children': ['61']}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'nb_threads'}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_min_threads'}; {'id': '67', 'type': 'else_clause', 'children': ['68']}; {'id': '68', 'type': 'block', 'children': ['69']}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'nb_threads'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'nb_pending_tasks'}; {'id': '73', 'type': 'for_statement', 'children': ['74', '75', '79']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'nb_pending_tasks'}; {'id': '79', 'type': 'block', 'children': ['80', '86']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'augmented_assignment', 'children': ['82', '85'], 'value': '+='}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': '__nb_pending_task'}; {'id': '85', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': '__start_thread'}; {'id': '91', 'type': 'argument_list', 'children': []}; {'id': '92', 'type': 'for_statement', 'children': ['93', '94', '100']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'binary_operator', 'children': ['98', '99'], 'value': '-'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'nb_threads'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'nb_pending_tasks'}; {'id': '100', 'type': 'block', 'children': ['101']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': '__start_thread'}; {'id': '106', 'type': 'argument_list', 'children': []}
Starts the thread pool. Does nothing if the pool is already started.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'write'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'file_or_path'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '8', 'type': 'False', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '11', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '12', 'type': 'block', 'children': ['13', '66']}; {'id': '13', 'type': 'if_statement', 'children': ['14', '21', '57']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'file_or_path'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'string_types'}; {'id': '21', 'type': 'block', 'children': ['22', '41']}; {'id': '22', 'type': 'if_statement', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'coverage'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'file_or_path'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'get_smother_filename'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'file_or_path'}; {'id': '34', 'type': 'attribute', 'children': ['35', '40']}; {'id': '35', 'type': 'attribute', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'coverage'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'parallel'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'Lock'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48', '51', '54']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'file_or_path'}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'mode'}; {'id': '50', 'type': 'string', 'children': [], 'value': "'a+'"}; {'id': '51', 'type': 'keyword_argument', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'fail_when_locked'}; {'id': '56', 'type': 'False', 'children': []}; {'id': '57', 'type': 'else_clause', 'children': ['58']}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'noclose'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'file_or_path'}; {'id': '66', 'type': 'with_statement', 'children': ['67', '73']}; {'id': '67', 'type': 'with_clause', 'children': ['68']}; {'id': '68', 'type': 'with_item', 'children': ['69']}; {'id': '69', 'type': 'as_pattern', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '71', 'type': 'as_pattern_target', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'fh'}; {'id': '73', 'type': 'block', 'children': ['74', '105', '112', '118']}; {'id': '74', 'type': 'if_statement', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '76', 'type': 'block', 'children': ['77', '84']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'fh'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'seek'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '84', 'type': 'try_statement', 'children': ['85', '95', '99']}; {'id': '85', 'type': 'block', 'children': ['86']}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '89', 'type': 'call', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'Smother'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'load'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'fh'}; {'id': '95', 'type': 'except_clause', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '97', 'type': 'block', 'children': ['98']}; {'id': '98', 'type': 'pass_statement', 'children': []}; {'id': '99', 'type': 'else_clause', 'children': ['100']}; {'id': '100', 'type': 'block', 'children': ['101']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'augmented_assignment', 'children': ['103', '104'], 'value': '|='}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'fh'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'seek'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '112', 'type': 'expression_statement', 'children': ['113']}; {'id': '113', 'type': 'call', 'children': ['114', '117']}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'fh'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'truncate'}; {'id': '117', 'type': 'argument_list', 'children': []}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'call', 'children': ['120', '123']}; {'id': '120', 'type': 'attribute', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'dump'}; {'id': '123', 'type': 'argument_list', 'children': ['124', '127']}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'fh'}
Write Smother results to a file. Parameters ---------- fiile_or_path : str Path to write report to append : bool If True, read an existing smother report from `outpath` and combine it with this file before writing. timeout : int Time in seconds to wait to acquire a file lock, before raising an error. Note ---- Append mode is atomic when file_or_path is a path, and can be safely run in a multithreaded or multiprocess test environment. When using `parallel_mode`, file_or_path is given a unique suffix based on the machine name and process id.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'error_log'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '7', 'type': 'string', 'children': [], 'value': "''"}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '20'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'traceback'}; {'id': '13', 'type': 'False', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15', '26', '34']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'stderr'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '25'], 'value': '+'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'stderr'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'flush'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'if_statement', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'traceback'}; {'id': '36', 'type': 'block', 'children': ['37', '45', '54']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'tblines'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'traceback_'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'format_exc'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '52']}; {'id': '47', 'type': 'attribute', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'stderr'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'tblines'}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '61']}; {'id': '56', 'type': 'attribute', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'stderr'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'flush'}; {'id': '61', 'type': 'argument_list', 'children': []}
Write error message to log. Args: msg (str): error message level (int): logging level traceback (bool): add traceback to output or not
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'handleOneClientMsg'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'wrappedMsg'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'try_statement', 'children': ['8', '29', '33']}; {'id': '8', 'type': 'block', 'children': ['9', '18']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'vmsg'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'validateClientMsg'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'wrappedMsg'}; {'id': '18', 'type': 'if_statement', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'vmsg'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'unpackClientMsg'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'list_splat', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'vmsg'}; {'id': '29', 'type': 'except_clause', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'BlowUp'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'raise_statement', 'children': []}; {'id': '33', 'type': 'except_clause', 'children': ['34', '38']}; {'id': '34', 'type': 'as_pattern', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '36', 'type': 'as_pattern_target', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ex'}; {'id': '38', 'type': 'block', 'children': ['39', '45', '52', '67']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '44']}; {'id': '41', 'type': 'pattern_list', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'frm'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'wrappedMsg'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'friendly'}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'friendlyEx'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'ex'}; {'id': '52', 'type': 'if_statement', 'children': ['53', '58']}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'ex'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'SuspiciousClient'}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'reportSuspiciousClient'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'frm'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'friendly'}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'handleInvalidClientMsg'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'ex'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'wrappedMsg'}
Validate and process a client message :param wrappedMsg: a message from a client
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'GetUserinfo'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'http'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '19', '26', '37', '71']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'http'}; {'id': '12', 'type': 'boolean_operator', 'children': ['13', '14'], 'value': 'or'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'http'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'httplib2'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'Http'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_GetUserinfoUrl'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '31']}; {'id': '28', 'type': 'pattern_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'http'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '37', 'type': 'if_statement', 'children': ['38', '45']}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '42'], 'value': '=='}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'status'}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'http_client'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'BAD_REQUEST'}; {'id': '45', 'type': 'block', 'children': ['46', '53', '60']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'refresh'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'http'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': '_GetUserinfoUrl'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '65']}; {'id': '62', 'type': 'pattern_list', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'http'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '71', 'type': 'return_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'loads'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'boolean_operator', 'children': ['78', '79'], 'value': 'or'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '79', 'type': 'string', 'children': [], 'value': "'{}'"}
Get the userinfo associated with the given credentials. This is dependent on the token having either the userinfo.email or userinfo.profile scope for the given token. Args: credentials: (oauth2client.client.Credentials) incoming credentials http: (httplib2.Http, optional) http instance to use Returns: The email address for this token, or None if the required scopes aren't available.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'compute_colors_for_labels'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '6', 'type': 'block', 'children': ['7', '19', '35']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '10', 'type': 'binary_operator', 'children': ['11', '16'], 'value': '*'}; {'id': '11', 'type': 'subscript', 'children': ['12', '13', '15']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '13', 'type': 'slice', 'children': ['14']}; {'id': '14', 'type': 'colon', 'children': []}; {'id': '15', 'type': 'None', 'children': []}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'palette'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '22', 'type': 'call', 'children': ['23', '33']}; {'id': '23', 'type': 'attribute', 'children': ['24', '32']}; {'id': '24', 'type': 'call', 'children': ['25', '31']}; {'id': '25', 'type': 'attribute', 'children': ['26', '30']}; {'id': '26', 'type': '()', 'children': ['27']}; {'id': '27', 'type': 'binary_operator', 'children': ['28', '29'], 'value': '%'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '29', 'type': 'integer', 'children': [], 'value': '255'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'string', 'children': [], 'value': '"uint8"'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'colors'}
Simple function that adds fixed colors depending on the class
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_process_batch_write_response'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'table_crypto_config'}; {'id': '7', 'type': 'block', 'children': ['8', '21', '128']}; {'id': '8', 'type': 'try_statement', 'children': ['9', '16']}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'unprocessed_items'}; {'id': '13', 'type': 'subscript', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '15', 'type': 'string', 'children': [], 'value': '"UnprocessedItems"'}; {'id': '16', 'type': 'except_clause', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '21', 'type': 'for_statement', 'children': ['22', '25', '30']}; {'id': '22', 'type': 'pattern_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'table_name'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'unprocessed'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'unprocessed_items'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'block', 'children': ['31', '37', '43', '68']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'original_items'}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'table_name'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'crypto_config'}; {'id': '40', 'type': 'subscript', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'table_crypto_config'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'table_name'}; {'id': '43', 'type': 'if_statement', 'children': ['44', '49', '58']}; {'id': '44', 'type': 'attribute', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'crypto_config'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'encryption_context'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'partition_key_name'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'items_match'}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'partial'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_item_keys_match'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'crypto_config'}; {'id': '58', 'type': 'else_clause', 'children': ['59']}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'items_match'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'partial'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_item_attributes_match'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'crypto_config'}; {'id': '68', 'type': 'for_statement', 'children': ['69', '72', '76']}; {'id': '69', 'type': 'pattern_list', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'operation'}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'unprocessed'}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'for_statement', 'children': ['78', '81', '86']}; {'id': '78', 'type': 'pattern_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'request_type'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'operation'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '85', 'type': 'argument_list', 'children': []}; {'id': '86', 'type': 'block', 'children': ['87', '93']}; {'id': '87', 'type': 'if_statement', 'children': ['88', '91']}; {'id': '88', 'type': 'comparison_operator', 'children': ['89', '90'], 'value': '!='}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'request_type'}; {'id': '90', 'type': 'string', 'children': [], 'value': '"PutRequest"'}; {'id': '91', 'type': 'block', 'children': ['92']}; {'id': '92', 'type': 'continue_statement', 'children': []}; {'id': '93', 'type': 'for_statement', 'children': ['94', '95', '96']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'plaintext_item'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'original_items'}; {'id': '96', 'type': 'block', 'children': ['97']}; {'id': '97', 'type': 'if_statement', 'children': ['98', '116']}; {'id': '98', 'type': 'boolean_operator', 'children': ['99', '105'], 'value': 'and'}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'plaintext_item'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'request_type'}; {'id': '105', 'type': 'call', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'items_match'}; {'id': '107', 'type': 'argument_list', 'children': ['108', '113']}; {'id': '108', 'type': 'subscript', 'children': ['109', '112']}; {'id': '109', 'type': 'subscript', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'plaintext_item'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'request_type'}; {'id': '112', 'type': 'string', 'children': [], 'value': '"Item"'}; {'id': '113', 'type': 'subscript', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '115', 'type': 'string', 'children': [], 'value': '"Item"'}; {'id': '116', 'type': 'block', 'children': ['117', '127']}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'assignment', 'children': ['119', '122']}; {'id': '119', 'type': 'subscript', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'unprocessed'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '122', 'type': 'call', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'plaintext_item'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '126', 'type': 'argument_list', 'children': []}; {'id': '127', 'type': 'break_statement', 'children': []}; {'id': '128', 'type': 'return_statement', 'children': ['129']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'response'}
Handle unprocessed items in the response from a transparently encrypted write. :param dict request: The DynamoDB plaintext request dictionary :param dict response: The DynamoDB response from the batch operation :param Dict[Text, CryptoConfig] table_crypto_config: table level CryptoConfig used in encrypting the request items :return: DynamoDB response, with any unprocessed items reverted back to the original plaintext values :rtype: dict
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'publish_server_heartbeat_succeeded'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'connection_id'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'duration'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'reply'}; {'id': '8', 'type': 'block', 'children': ['9', '18']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'ServerHeartbeatSucceededEvent'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16', '17']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'duration'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'reply'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'connection_id'}; {'id': '18', 'type': 'for_statement', 'children': ['19', '20', '23']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'subscriber'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '__server_heartbeat_listeners'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'try_statement', 'children': ['25', '33']}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'subscriber'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'succeeded'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '33', 'type': 'except_clause', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '_handle_exception'}; {'id': '39', 'type': 'argument_list', 'children': []}
Publish a ServerHeartbeatSucceededEvent to all server heartbeat listeners. :Parameters: - `connection_id`: The address (host/port pair) of the connection. - `duration`: The execution time of the event in the highest possible resolution for the platform. - `reply`: The command reply.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'put'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'DEFAULT_PRIORITY'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'delay'}; {'id': '11', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'ttr'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'DEFAULT_TTR'}; {'id': '15', 'type': 'block', 'children': ['16', '23', '48']}; {'id': '16', 'type': 'assert_statement', 'children': ['17', '22']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'Job body must be a str instance'"}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'jid'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_interact_value'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '42', '44']}; {'id': '31', 'type': 'binary_operator', 'children': ['32', '33'], 'value': '%'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'put %d %d %d %d\\r\\n%s\\r\\n'"}; {'id': '33', 'type': 'tuple', 'children': ['34', '35', '36', '37', '41']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'delay'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ttr'}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '42', 'type': 'list', 'children': ['43'], 'value': "['INSERTED']"}; {'id': '43', 'type': 'string', 'children': [], 'value': "'INSERTED'"}; {'id': '44', 'type': 'list', 'children': ['45', '46', '47'], 'value': "['JOB_TOO_BIG', 'BURIED', 'DRAINING']"}; {'id': '45', 'type': 'string', 'children': [], 'value': "'JOB_TOO_BIG'"}; {'id': '46', 'type': 'string', 'children': [], 'value': "'BURIED'"}; {'id': '47', 'type': 'string', 'children': [], 'value': "'DRAINING'"}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'jid'}
Put a job into the current tube. Returns job id.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_char_density'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'font'}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ImageFont'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'load_default'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14', '32', '41', '57']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'image'}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'Image'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'new'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23', '29']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'1'"}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'font'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'getsize'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '255'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'draw'}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ImageDraw'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'Draw'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'image'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'draw'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '50', '51', '54']}; {'id': '47', 'type': 'tuple', 'children': ['48', '49']}; {'id': '48', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '49', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '51', 'type': 'keyword_argument', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'fill'}; {'id': '53', 'type': 'string', 'children': [], 'value': '"white"'}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'font'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'font'}; {'id': '57', 'type': 'return_statement', 'children': ['58']}; {'id': '58', 'type': 'subscript', 'children': ['59', '69']}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'collections'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'Counter'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'image'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'getdata'}; {'id': '68', 'type': 'argument_list', 'children': []}; {'id': '69', 'type': 'integer', 'children': [], 'value': '0'}
Count the number of black pixels in a rendered character.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_tile_ticks'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'frac'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'tickvec'}; {'id': '7', 'type': 'block', 'children': ['8', '27', '48', '54']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'origins'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'tile'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '21']}; {'id': '16', 'type': 'attribute', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_vec'}; {'id': '21', 'type': 'tuple', 'children': ['22', '26']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'frac'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'origins'}; {'id': '30', 'type': 'binary_operator', 'children': ['31', '40'], 'value': '+'}; {'id': '31', 'type': 'attribute', 'children': ['32', '39']}; {'id': '32', 'type': 'subscript', 'children': ['33', '38']}; {'id': '33', 'type': 'attribute', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'T'}; {'id': '40', 'type': 'attribute', 'children': ['41', '47']}; {'id': '41', 'type': '()', 'children': ['42']}; {'id': '42', 'type': 'binary_operator', 'children': ['43', '46'], 'value': '*'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'origins'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'T'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'frac'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'T'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'endpoints'}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '53'], 'value': '+'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'tickvec'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'origins'}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'expression_list', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'origins'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'endpoints'}
Tiles tick marks along the axis.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_peek_buffer'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'block', 'children': ['9', '33']}; {'id': '9', 'type': 'while_statement', 'children': ['10', '18']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '17'], 'value': '<='}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_buffer'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '26']}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_buffer'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'next'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_source'}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'subscript', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_buffer'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'i'}
Get the next line without consuming it.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'filing_history'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'num'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'transaction'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'dictionary_splat_pattern', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '11', 'type': 'block', 'children': ['12', '25', '39', '53', '60']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'baseuri'}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '19'], 'value': '+'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_BASE_URI'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': '"company/{}/filing-history"'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'num'}; {'id': '25', 'type': 'if_statement', 'children': ['26', '29']}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '28'], 'value': 'is not'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'transaction'}; {'id': '28', 'type': 'None', 'children': []}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'augmented_assignment', 'children': ['32', '33'], 'value': '+='}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'baseuri'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'string', 'children': [], 'value': '"/{}"'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'transaction'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '42', 'type': 'call', 'children': ['43', '48']}; {'id': '43', 'type': 'attribute', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '48', 'type': 'argument_list', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'baseuri'}; {'id': '50', 'type': 'keyword_argument', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'handle_http_error'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '60', 'type': 'return_statement', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'res'}
Search for a company's filling history by company number. Args: num (str): Company number to search on. transaction (Optional[str]): Filing record number. kwargs (dict): additional keywords passed into requests.session.get params keyword.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'validate_reaction'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '14']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'not in'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'reaction'}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_reaction_valid_values'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'raise_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': '"reaction should be one of: {valid}"'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'valid'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': '", "'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_reaction_valid_values'}
Ensure reaction is of a certain type. Mainly for future expansion.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'collection'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'block', 'children': ['8', '45']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '12', '24']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': 'is'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'collection'}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'Collection'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'get_or_404'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '24', 'type': 'else_clause', 'children': ['25']}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'collection'}; {'id': '29', 'type': 'call', 'children': ['30', '44']}; {'id': '30', 'type': 'attribute', 'children': ['31', '43']}; {'id': '31', 'type': 'call', 'children': ['32', '37']}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'Collection'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '42'], 'value': '=='}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'Collection'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'first_or_404'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'render_template'}; {'id': '48', 'type': 'argument_list', 'children': ['49', '73']}; {'id': '49', 'type': 'list', 'children': ['50', '58', '68'], 'value': "[\n 'invenio_collections/collection_{0}.html'.format(collection.id),\n 'invenio_collections/collection_{0}.html'.format(slugify(name, '_')),\n current_app.config['COLLECTIONS_DEFAULT_TEMPLATE']\n ]"}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'string', 'children': [], 'value': "'invenio_collections/collection_{0}.html'"}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'collection'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'string', 'children': [], 'value': "'invenio_collections/collection_{0}.html'"}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'slugify'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '67', 'type': 'string', 'children': [], 'value': "'_'"}; {'id': '68', 'type': 'subscript', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'current_app'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '72', 'type': 'string', 'children': [], 'value': "'COLLECTIONS_DEFAULT_TEMPLATE'"}; {'id': '73', 'type': 'keyword_argument', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'collection'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'collection'}
Render the collection page. It renders it either with a collection specific template (aka collection_{collection_name}.html) or with the default collection template (collection.html).
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'merge'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'list_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'others'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'for_statement', 'children': ['9', '10', '11']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'others'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'for_statement', 'children': ['13', '16', '17']}; {'id': '13', 'type': 'pattern_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'setattr'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23', '24']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'BoundValue'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28', '29']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'value'}
Merge the `others` schema into this instance. The values will all be read from the provider of the original object.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'extract_params'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '67']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'if_statement', 'children': ['11', '16', '37', '58']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'for_statement', 'children': ['18', '21', '26']}; {'id': '18', 'type': 'pattern_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '25', 'type': 'argument_list', 'children': []}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'extract_params'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '37', 'type': 'elif_clause', 'children': ['38', '43']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'for_statement', 'children': ['45', '46', '47']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'extract_params'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '58', 'type': 'else_clause', 'children': ['59']}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '67', 'type': 'return_statement', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'values'}
Extracts the values of a set of parameters, recursing into nested dictionaries.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_check_list_minions'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'greedy'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'ignore_missing'}; {'id': '9', 'type': 'False', 'children': []}; {'id': '10', 'type': 'block', 'children': ['11', '35', '43']}; {'id': '11', 'type': 'if_statement', 'children': ['12', '19']}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'string_types'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '23', 'type': 'list_comprehension', 'children': ['24', '25', '33']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '25', 'type': 'for_in_clause', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': "','"}; {'id': '33', 'type': 'if_clause', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'minions'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_pki_minions'}; {'id': '42', 'type': 'argument_list', 'children': []}; {'id': '43', 'type': 'return_statement', 'children': ['44']}; {'id': '44', 'type': 'dictionary', 'children': ['45', '56']}; {'id': '45', 'type': 'pair', 'children': ['46', '47']}; {'id': '46', 'type': 'string', 'children': [], 'value': "'minions'"}; {'id': '47', 'type': 'list_comprehension', 'children': ['48', '49', '52']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '49', 'type': 'for_in_clause', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '52', 'type': 'if_clause', 'children': ['53']}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '55'], 'value': 'in'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'minions'}; {'id': '56', 'type': 'pair', 'children': ['57', '58']}; {'id': '57', 'type': 'string', 'children': [], 'value': "'missing'"}; {'id': '58', 'type': 'conditional_expression', 'children': ['59', '60', '61'], 'value': 'if'}; {'id': '59', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'ignore_missing'}; {'id': '61', 'type': 'list_comprehension', 'children': ['62', '63', '66']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '63', 'type': 'for_in_clause', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '66', 'type': 'if_clause', 'children': ['67']}; {'id': '67', 'type': 'comparison_operator', 'children': ['68', '69'], 'value': 'not in'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'minions'}
Return the minions found by looking via a list
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create_password_reset'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'valid_for'}; {'id': '8', 'type': 'integer', 'children': [], 'value': '3600'}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '11', 'type': 'block', 'children': ['12', '21', '28', '37', '64', '82', '88', '94', '100', '108', '114']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'where_email'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '25']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '24'], 'value': 'is'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '24', 'type': 'None', 'children': []}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'return_statement', 'children': ['27']}; {'id': '27', 'type': 'None', 'children': []}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'PasswordResetModel'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'delete_where_user_id'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '40', 'type': 'call', 'children': ['41', '46']}; {'id': '41', 'type': 'attribute', 'children': ['42', '45']}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'JWT'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'create_token'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '61']}; {'id': '47', 'type': 'dictionary', 'children': ['48', '56']}; {'id': '48', 'type': 'pair', 'children': ['49', '50']}; {'id': '49', 'type': 'string', 'children': [], 'value': "'code'"}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'Security'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'random_string'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '56', 'type': 'pair', 'children': ['57', '58']}; {'id': '57', 'type': 'string', 'children': [], 'value': "'user_id'"}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '61', 'type': 'keyword_argument', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'token_valid_for'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'valid_for'}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '67', 'type': 'binary_operator', 'children': ['68', '76'], 'value': '+'}; {'id': '68', 'type': 'binary_operator', 'children': ['69', '75'], 'value': '+'}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'Security'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'generate_uuid'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '75', 'type': 'string', 'children': [], 'value': '"-"'}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'Security'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'random_string'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'password_reset_model'}; {'id': '85', 'type': 'call', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'PasswordResetModel'}; {'id': '87', 'type': 'argument_list', 'children': []}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'assignment', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'password_reset_model'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '99']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'password_reset_model'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'password_reset_model'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'call', 'children': ['110', '113']}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'password_reset_model'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'save'}; {'id': '113', 'type': 'argument_list', 'children': []}; {'id': '114', 'type': 'return_statement', 'children': ['115']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'code'}
Create a password reset request in the user_password_resets database table. Hashed code gets stored in the database. Returns unhashed reset code
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'VerifyStructure'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'parser_mediator'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '7', 'type': 'block', 'children': ['8', '22']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'match_generator'}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_VERIFICATION_GRAMMAR'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'scanString'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'maxMatches'}; {'id': '21', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'match_generator'}
Verifies that this is a bash history file. Args: parser_mediator (ParserMediator): mediates interactions between parsers and other components, such as storage and dfvfs. lines (str): one or more lines from the text file. Returns: bool: True if this is the correct parser, False otherwise.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'link_sources'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '57', '121']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': '"Returns potential Link or Stream sources."'}; {'id': '8', 'type': 'if_statement', 'children': ['9', '14', '19', '48']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'GenericOverlayPlot'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'zorders'}; {'id': '18', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '19', 'type': 'elif_clause', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'batched'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'zorders'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'zorder'}; {'id': '36', 'type': 'binary_operator', 'children': ['37', '40'], 'value': '+'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'zorder'}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'attribute', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'hmap'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'last'}; {'id': '48', 'type': 'else_clause', 'children': ['49']}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'zorders'}; {'id': '53', 'type': 'list', 'children': ['54'], 'value': '[self.zorder]'}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'zorder'}; {'id': '57', 'type': 'if_statement', 'children': ['58', '68', '73', '110']}; {'id': '58', 'type': 'boolean_operator', 'children': ['59', '64'], 'value': 'and'}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'GenericOverlayPlot'}; {'id': '64', 'type': 'not_operator', 'children': ['65']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'batched'}; {'id': '68', 'type': 'block', 'children': ['69']}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '72', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '73', 'type': 'elif_clause', 'children': ['74', '86']}; {'id': '74', 'type': 'boolean_operator', 'children': ['75', '79'], 'value': 'or'}; {'id': '75', 'type': 'not_operator', 'children': ['76']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'static'}; {'id': '79', 'type': 'call', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '81', 'type': 'argument_list', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'hmap'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'DynamicMap'}; {'id': '86', 'type': 'block', 'children': ['87']}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'assignment', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '90', 'type': 'list_comprehension', 'children': ['91', '92', '103', '106']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '92', 'type': 'for_in_clause', 'children': ['93', '96']}; {'id': '93', 'type': 'pattern_list', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'inputs'}; {'id': '96', 'type': 'call', 'children': ['97', '102']}; {'id': '97', 'type': 'attribute', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'stream_sources'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '102', 'type': 'argument_list', 'children': []}; {'id': '103', 'type': 'for_in_clause', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'inputs'}; {'id': '106', 'type': 'if_clause', 'children': ['107']}; {'id': '107', 'type': 'comparison_operator', 'children': ['108', '109'], 'value': 'in'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'zorders'}; {'id': '110', 'type': 'else_clause', 'children': ['111']}; {'id': '111', 'type': 'block', 'children': ['112']}; {'id': '112', 'type': 'expression_statement', 'children': ['113']}; {'id': '113', 'type': 'assignment', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '115', 'type': 'list', 'children': ['116'], 'value': '[self.hmap.last]'}; {'id': '116', 'type': 'attribute', 'children': ['117', '120']}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'hmap'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'last'}; {'id': '121', 'type': 'return_statement', 'children': ['122']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'sources'}
Returns potential Link or Stream sources.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14', '16']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'visit_Call'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'AST'}; {'id': '9', 'type': 'typed_default_parameter', 'children': ['10', '11', '13']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'dfltChaining'}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '13', 'type': 'True', 'children': []}; {'id': '14', 'type': 'type', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '16', 'type': 'block', 'children': ['17', '23', '38', '44', '57', '70', '83', '87', '93']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '23', 'type': 'try_statement', 'children': ['24', '31']}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'kwds'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'keywords'}; {'id': '31', 'type': 'except_clause', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'kwds'}; {'id': '37', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'compact'}; {'id': '43', 'type': 'True', 'children': []}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'args_src'}; {'id': '47', 'type': 'generator_expression', 'children': ['48', '54']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'visit'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'arg'}; {'id': '54', 'type': 'for_in_clause', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'arg'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'kwds_src'}; {'id': '60', 'type': 'generator_expression', 'children': ['61', '67']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'visit'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'kwd'}; {'id': '67', 'type': 'for_in_clause', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'kwd'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'kwds'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'param_src'}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'string', 'children': [], 'value': "', '"}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'chain'}; {'id': '80', 'type': 'argument_list', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'args_src'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'kwds_src'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'assignment', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '86', 'type': 'string', 'children': [], 'value': 'f"{self.visit(node.func)}({param_src})"'}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'assignment', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'compact'}; {'id': '92', 'type': 'False', 'children': []}; {'id': '93', 'type': 'return_statement', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'src'}
Return `node`s representation as function call.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'abundances'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '13', '20']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': 'is'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'table'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'else_clause', 'children': ['21']}; {'id': '21', 'type': 'block', 'children': ['22', '30']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'table'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'return_statement', 'children': ['31']}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '33', 'type': 'call', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '37', 'type': 'string', 'children': [], 'value': '"tax_id"'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'isin'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'ids'}
Query the results table to get abundance data for all or some tax ids
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_external_reference_to_entity'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'entity_id'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'external_ref'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '14']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '13'], 'value': 'is not'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'entity_layer'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'entity_layer'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'add_external_reference_to_entity'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'entity_id'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'external_ref'}
Adds an external reference to the given entity identifier in the entity layer @type entity_id: string @param entity_id: the entity identifier @param external_ref: an external reference object @type external_ref: L{CexternalReference}
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'binOp'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'indx'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'amap'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'bmap'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'fill_vec'}; {'id': '9', 'type': 'block', 'children': ['10', '78', '86', '95']}; {'id': '10', 'type': 'function_definition', 'children': ['11', '12', '14']}; {'id': '11', 'type': 'function_name', 'children': [], 'value': 'op_or_missing'}; {'id': '12', 'type': 'parameters', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '14', 'type': 'block', 'children': ['15', '25', '35']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'va'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'amap'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '24', 'type': 'None', 'children': []}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'vb'}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'bmap'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '34', 'type': 'None', 'children': []}; {'id': '35', 'type': 'if_statement', 'children': ['36', '43', '48']}; {'id': '36', 'type': 'boolean_operator', 'children': ['37', '40'], 'value': 'or'}; {'id': '37', 'type': 'comparison_operator', 'children': ['38', '39'], 'value': 'is'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'va'}; {'id': '39', 'type': 'None', 'children': []}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '42'], 'value': 'is'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'vb'}; {'id': '42', 'type': 'None', 'children': []}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'fill_vec'}; {'id': '48', 'type': 'else_clause', 'children': ['49']}; {'id': '49', 'type': 'block', 'children': ['50', '67', '76']}; {'id': '50', 'type': 'try_statement', 'children': ['51', '60']}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'va'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'vb'}; {'id': '60', 'type': 'except_clause', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '62', 'type': 'block', 'children': ['63']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '66', 'type': 'None', 'children': []}; {'id': '67', 'type': 'if_statement', 'children': ['68', '71']}; {'id': '68', 'type': 'comparison_operator', 'children': ['69', '70'], 'value': 'is'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '70', 'type': 'None', 'children': []}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'fill_vec'}; {'id': '76', 'type': 'return_statement', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'seq_arys'}; {'id': '81', 'type': 'call', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'map'}; {'id': '83', 'type': 'argument_list', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'op_or_missing'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'indx'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '89', 'type': 'call', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'vstack'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'seq_arys'}; {'id': '95', 'type': 'return_statement', 'children': ['96']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'data'}
Combines the values from two map objects using the indx values using the op operator. In situations where there is a missing value it will use the callable function handle_missing
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'update_allowed'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '13']}; {'id': '8', 'type': 'attribute', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'update_action'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'allowed'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '21', '24']}; {'id': '14', 'type': 'attribute', 'children': ['15', '20']}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'table'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'datum'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}
Determines whether update of given cell is allowed. Calls allowed action of defined UpdateAction of the Column.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_delete_branch_command'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'branch_name'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'author'}; {'id': '8', 'type': 'block', 'children': ['9', '19', '36', '48', '55']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '12', 'type': 'list', 'children': ['13'], 'value': "['hg update --rev=%s && hg commit' % quote(branch_name)]"}; {'id': '13', 'type': 'binary_operator', 'children': ['14', '15'], 'value': '%'}; {'id': '14', 'type': 'string', 'children': [], 'value': "'hg update --rev=%s && hg commit'"}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'quote'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'branch_name'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'author'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'binary_operator', 'children': ['29', '30'], 'value': '%'}; {'id': '29', 'type': 'string', 'children': [], 'value': "'--user=%s'"}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'quote'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'author'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'combined'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'binary_operator', 'children': ['43', '44'], 'value': '%'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'--message=%s'"}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'quote'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'string', 'children': [], 'value': "'--close-branch'"}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'list', 'children': ['57'], 'value': "[' '.join(tokens)]"}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'tokens'}
Get the command to delete or close a branch in the local repository.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'insert'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'return_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '17']}; {'id': '10', 'type': 'attribute', 'children': ['11', '16']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'Collection'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'insert'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_ensure_value_is_valid'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'value'}
Insert an item at a given position.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'cli'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'filters'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'tags'}; {'id': '9', 'type': 'block', 'children': ['10', '16', '74']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '13', 'type': 'subscript', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'client'"}; {'id': '16', 'type': 'if_statement', 'children': ['17', '18', '26']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'total'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '26', 'type': 'else_clause', 'children': ['27']}; {'id': '27', 'type': 'block', 'children': ['28', '47', '59']}; {'id': '28', 'type': 'if_statement', 'children': ['29', '30', '38']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '30', 'type': 'block', 'children': ['31']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '34', 'type': 'list', 'children': ['35'], 'value': "[('q', query)]"}; {'id': '35', 'type': 'tuple', 'children': ['36', '37']}; {'id': '36', 'type': 'string', 'children': [], 'value': "'q'"}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '38', 'type': 'else_clause', 'children': ['39']}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'build_query'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'filters'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '53']}; {'id': '49', 'type': 'pattern_list', 'children': ['50', '51', '52']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'total'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'get_count'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '62', 'type': 'list_comprehension', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '66', 'type': 'for_in_clause', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'get_alerts'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '74', 'type': 'with_statement', 'children': ['75', '94']}; {'id': '75', 'type': 'with_clause', 'children': ['76']}; {'id': '76', 'type': 'with_item', 'children': ['77']}; {'id': '77', 'type': 'as_pattern', 'children': ['78', '92']}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'click'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'progressbar'}; {'id': '82', 'type': 'argument_list', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '84', 'type': 'keyword_argument', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'string', 'children': [], 'value': "'Untagging {} alerts'"}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'total'}; {'id': '92', 'type': 'as_pattern_target', 'children': ['93']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'bar'}; {'id': '94', 'type': 'block', 'children': ['95']}; {'id': '95', 'type': 'for_statement', 'children': ['96', '97', '98']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'bar'}; {'id': '98', 'type': 'block', 'children': ['99']}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'call', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'untag_alert'}; {'id': '104', 'type': 'argument_list', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'tags'}
Remove tags from alerts.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'clean'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '16']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'not in'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'HOOK_EVENTS'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'raise_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'ValidationError'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': '"Invalid hook event {evt}."'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'keyword_argument', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'evt'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'event'}
Validation for events.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'download_and_bootstrap'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'prereq'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '38', '47', '55', '66', '72', '82', '91']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'prereq'}; {'id': '12', 'type': 'block', 'children': ['13', '23', '32']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'prereq_cmd'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'string', 'children': [], 'value': '\'{0} -c "{1}"\''}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'PY_EXE'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'prereq'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'rv'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'system'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'prereq_cmd'}; {'id': '32', 'type': 'if_statement', 'children': ['33', '36']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '35'], 'value': '=='}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'rv'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'return_statement', 'children': []}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'ulp'}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'urllib2'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'urlopen'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '54', 'type': 'string', 'children': [], 'value': '"wb"'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'ulp'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '65', 'type': 'argument_list', 'children': []}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '71', 'type': 'argument_list', 'children': []}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'cmdline'}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'string', 'children': [], 'value': '"{0} {1}"'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'PY_EXE'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'rv'}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'system'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'cmdline'}; {'id': '91', 'type': 'assert_statement', 'children': ['92']}; {'id': '92', 'type': 'comparison_operator', 'children': ['93', '94'], 'value': '=='}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'rv'}; {'id': '94', 'type': 'integer', 'children': [], 'value': '0'}
Download and install something if 'prerequisite' fails
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'run'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'start_command_srv'}; {'id': '6', 'type': 'block', 'children': ['7', '24', '32', '38', '52']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'start_command_srv'}; {'id': '9', 'type': 'block', 'children': ['10', '18']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_command_server'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_drop_privs'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_task_runner'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_reg_sighandlers'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'while_statement', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'running'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sleep'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': '_sleep_period'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'shutdown'}; {'id': '57', 'type': 'argument_list', 'children': []}
Setup daemon process, start child forks, and sleep until events are signalled. `start_command_srv` Set to ``True`` if command server should be started.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_update_physical_disk_details'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'raid_config'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'server'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '21']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '12']}; {'id': '9', 'type': 'subscript', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'raid_config'}; {'id': '11', 'type': 'string', 'children': [], 'value': "'physical_disks'"}; {'id': '12', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'physical_drives'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'server'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'get_physical_drives'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'for_statement', 'children': ['22', '23', '24']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'physical_drive'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'physical_drives'}; {'id': '24', 'type': 'block', 'children': ['25', '33']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'physical_drive_dict'}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'physical_drive'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'get_physical_drive_dict'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '40']}; {'id': '35', 'type': 'attribute', 'children': ['36', '39']}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'raid_config'}; {'id': '38', 'type': 'string', 'children': [], 'value': "'physical_disks'"}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'physical_drive_dict'}
Adds the physical disk details to the RAID configuration passed.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_load'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'scale'}; {'id': '7', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '8', 'type': 'block', 'children': ['9', '22', '32', '45', '56']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'LOG'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': '"File: %s"'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'requested_band_filename'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'ncf'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'Dataset'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'requested_band_filename'}; {'id': '31', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'wvl'}; {'id': '35', 'type': 'binary_operator', 'children': ['36', '44'], 'value': '*'}; {'id': '36', 'type': 'subscript', 'children': ['37', '42']}; {'id': '37', 'type': 'subscript', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'ncf'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'variables'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'wavelength'"}; {'id': '42', 'type': 'slice', 'children': ['43']}; {'id': '43', 'type': 'colon', 'children': []}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'scale'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'resp'}; {'id': '48', 'type': 'subscript', 'children': ['49', '54']}; {'id': '49', 'type': 'subscript', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'ncf'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'variables'}; {'id': '53', 'type': 'string', 'children': [], 'value': "'response'"}; {'id': '54', 'type': 'slice', 'children': ['55']}; {'id': '55', 'type': 'colon', 'children': []}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'rsr'}; {'id': '61', 'type': 'dictionary', 'children': ['62', '65']}; {'id': '62', 'type': 'pair', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'wavelength'"}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'wvl'}; {'id': '65', 'type': 'pair', 'children': ['66', '67']}; {'id': '66', 'type': 'string', 'children': [], 'value': "'response'"}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'resp'}
Load the SLSTR relative spectral responses
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14', '16']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'signRequest'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'Request'}; {'id': '9', 'type': 'typed_default_parameter', 'children': ['10', '11', '13']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'Identifier'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'type', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'Request'}; {'id': '16', 'type': 'block', 'children': ['17', '32', '38', '48', '76']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'idr'}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'requiredIdr'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'idr'}; {'id': '27', 'type': 'boolean_operator', 'children': ['28', '29'], 'value': 'or'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_identifier'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_identifier'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'idr'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'reqId'}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'gen_req_id'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'signature'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'signMsg'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '68', '71']}; {'id': '58', 'type': 'keyword_argument', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'signingPayloadState'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'keyword_argument', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'idr'}; {'id': '68', 'type': 'keyword_argument', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'idr'}; {'id': '71', 'type': 'keyword_argument', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'otherIdentifier'}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '76', 'type': 'return_statement', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'req'}
Signs request. Modifies reqId and signature. May modify identifier. :param req: request :param requestIdStore: request id generator :param identifier: signer identifier :return: signed request
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'matrixToMathTransform'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'matrix'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '29']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '9', 'type': 'argument_list', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'matrix'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ShallowTransform'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'matrix'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '21']}; {'id': '17', 'type': 'pattern_list', 'children': ['18', '19', '20']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'off'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'scl'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'rot'}; {'id': '21', 'type': 'call', 'children': ['22', '28']}; {'id': '22', 'type': 'attribute', 'children': ['23', '27']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'MathTransform'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'matrix'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'decompose'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'ShallowTransform'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34', '35']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'off'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'scl'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'rot'}
Take a 6-tuple and return a ShallowTransform object.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'run_and_print_log'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'workflow'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'highlight'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '17', '22', '25', '28', '36', '45', '54', '61', '70', '79', '86', '110', '125']}; {'id': '9', 'type': 'import_from_statement', 'children': ['10', '15']}; {'id': '10', 'type': 'dotted_name', 'children': ['11', '12', '13', '14']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'noodles'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'threading'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'sqlite3'}; {'id': '15', 'type': 'dotted_name', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'run_parallel'}; {'id': '17', 'type': 'import_from_statement', 'children': ['18', '20']}; {'id': '18', 'type': 'dotted_name', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'noodles'}; {'id': '20', 'type': 'dotted_name', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'serial'}; {'id': '22', 'type': 'import_statement', 'children': ['23']}; {'id': '23', 'type': 'dotted_name', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'io'}; {'id': '25', 'type': 'import_statement', 'children': ['26']}; {'id': '26', 'type': 'dotted_name', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'io'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'StringIO'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'log_handler'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'StreamHandler'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'formatter'}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'Formatter'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'string', 'children': [], 'value': "'%(asctime)s - %(message)s'"}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'log_handler'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'setFormatter'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'formatter'}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'string', 'children': [], 'value': "'noodles'"}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'setLevel'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'INFO'}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'handlers'}; {'id': '84', 'type': 'list', 'children': ['85'], 'value': '[log_handler]'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'log_handler'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '89', 'type': 'call', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'run_parallel'}; {'id': '91', 'type': 'argument_list', 'children': ['92', '93', '96', '101', '104', '107']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'workflow'}; {'id': '93', 'type': 'keyword_argument', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'n_threads'}; {'id': '95', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '96', 'type': 'keyword_argument', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'registry'}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'serial'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '101', 'type': 'keyword_argument', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'db_file'}; {'id': '103', 'type': 'string', 'children': [], 'value': "'tutorial.db'"}; {'id': '104', 'type': 'keyword_argument', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'always_cache'}; {'id': '106', 'type': 'True', 'children': []}; {'id': '107', 'type': 'keyword_argument', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'echo_log'}; {'id': '109', 'type': 'False', 'children': []}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'call', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'display_text'}; {'id': '113', 'type': 'argument_list', 'children': ['114', '119', '122']}; {'id': '114', 'type': 'call', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'getvalue'}; {'id': '118', 'type': 'argument_list', 'children': []}; {'id': '119', 'type': 'boolean_operator', 'children': ['120', '121'], 'value': 'or'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'highlight'}; {'id': '121', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '122', 'type': 'keyword_argument', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'split_at'}; {'id': '124', 'type': 'integer', 'children': [], 'value': '40'}; {'id': '125', 'type': 'return_statement', 'children': ['126']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'result'}
Run workflow on multi-threaded worker cached with Sqlite3. :param workflow: workflow to evaluate. :param highlight: highlight these lines.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'process_management_config_section'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'management_config'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': 'in'}; {'id': '9', 'type': 'string', 'children': [], 'value': "'commands'"}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'management_config'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'for_statement', 'children': ['13', '14', '17']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '14', 'type': 'subscript', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'management_config'}; {'id': '16', 'type': 'string', 'children': [], 'value': "'commands'"}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '27']}; {'id': '20', 'type': 'attribute', 'children': ['21', '26']}; {'id': '21', 'type': 'subscript', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'management'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'commands'"}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'command'}
Processes the management section from a configuration data dict. :param config: The config reference of the object that will hold the configuration data from the config_data. :param management_config: Management section from a config data dict.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'tangent'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '6', 'type': 'dictionary_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '8', 'type': 'block', 'children': ['9', '19', '57']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'normalize'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'normalize'"}; {'id': '18', 'type': 'True', 'children': []}; {'id': '19', 'type': 'if_statement', 'children': ['20', '27']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'abstract'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'Curve'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'if_statement', 'children': ['29', '36', '46']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '33', 'type': 'tuple', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'ops'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'tangent_curve_single_list'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '44', '45']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'normalize'}; {'id': '46', 'type': 'else_clause', 'children': ['47']}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'ops'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'tangent_curve_single'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '55', '56']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'normalize'}; {'id': '57', 'type': 'if_statement', 'children': ['58', '65']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'abstract'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'Surface'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'if_statement', 'children': ['67', '74', '84']}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '69', 'type': 'argument_list', 'children': ['70', '73']}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '72', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'return_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'ops'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'tangent_surface_single'}; {'id': '80', 'type': 'argument_list', 'children': ['81', '82', '83']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'normalize'}; {'id': '84', 'type': 'else_clause', 'children': ['85']}; {'id': '85', 'type': 'block', 'children': ['86']}; {'id': '86', 'type': 'return_statement', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'ops'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'tangent_surface_single_list'}; {'id': '91', 'type': 'argument_list', 'children': ['92', '93', '94']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'normalize'}
Evaluates the tangent vector of the curves or surfaces at the input parameter values. This function is designed to evaluate tangent vectors of the B-Spline and NURBS shapes at single or multiple parameter positions. :param obj: input shape :type obj: abstract.Curve or abstract.Surface :param params: parameters :type params: float, list or tuple :return: a list containing "point" and "vector" pairs :rtype: tuple
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '23']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '10', 'type': 'call', 'children': ['11', '16']}; {'id': '11', 'type': 'attribute', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'connection'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'res'}
get a set of keys from redis
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'to_timezone'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'tzinfo'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '15', '23', '29', '38']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '12']}; {'id': '10', 'type': 'not_operator', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'tz'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'pick_timezone'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'tzinfo'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '__timezone__'}; {'id': '23', 'type': 'if_statement', 'children': ['24', '26']}; {'id': '24', 'type': 'not_operator', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'tz'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'dttz'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36', '37']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'tzinfo'"}; {'id': '37', 'type': 'None', 'children': []}; {'id': '38', 'type': 'if_statement', 'children': ['39', '41', '51']}; {'id': '39', 'type': 'not_operator', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'dttz'}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'tzinfo'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'tz'}; {'id': '51', 'type': 'else_clause', 'children': ['52']}; {'id': '52', 'type': 'block', 'children': ['53']}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'astimezone'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'tz'}
Convert a datetime to timezone
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'use'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7', '10']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'encode'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14', '19']}; {'id': '14', 'type': 'global_statement', 'children': ['15', '16', '17', '18']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_decode'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_encode'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_initialized'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_using'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '23', '61']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '22'], 'value': 'is not'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'block', 'children': ['24', '38', '53', '57']}; {'id': '24', 'type': 'if_statement', 'children': ['25', '31']}; {'id': '25', 'type': 'not_operator', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'basestring'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '38', 'type': 'if_statement', 'children': ['39', '45']}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '41'], 'value': 'not in'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '41', 'type': 'tuple', 'children': ['42', '43', '44']}; {'id': '42', 'type': 'string', 'children': [], 'value': "'cjson'"}; {'id': '43', 'type': 'string', 'children': [], 'value': "'json'"}; {'id': '44', 'type': 'string', 'children': [], 'value': "'simplejson'"}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'raise_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'binary_operator', 'children': ['51', '52'], 'value': '%'}; {'id': '51', 'type': 'string', 'children': [], 'value': "'Unsupported JSON module %s'"}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': '_using'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_initialized'}; {'id': '60', 'type': 'False', 'children': []}; {'id': '61', 'type': 'else_clause', 'children': ['62']}; {'id': '62', 'type': 'block', 'children': ['63', '71', '75', '79', '83']}; {'id': '63', 'type': 'assert_statement', 'children': ['64']}; {'id': '64', 'type': 'boolean_operator', 'children': ['65', '68'], 'value': 'and'}; {'id': '65', 'type': 'comparison_operator', 'children': ['66', '67'], 'value': 'is not'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'id': '67', 'type': 'None', 'children': []}; {'id': '68', 'type': 'comparison_operator', 'children': ['69', '70'], 'value': 'is not'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'encode'}; {'id': '70', 'type': 'None', 'children': []}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': '_using'}; {'id': '74', 'type': 'string', 'children': [], 'value': "'custom'"}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': '_decode'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': '_encode'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'encode'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'assignment', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': '_initialized'}; {'id': '86', 'type': 'True', 'children': []}
Set the JSON library that should be used, either by specifying a known module name, or by providing a decode and encode function. The modules "simplejson", "cjson", and "json" are currently supported for the ``module`` parameter. If provided, the ``decode`` parameter must be a callable that accepts a JSON string and returns a corresponding Python data structure. The ``encode`` callable must accept a Python data structure and return the corresponding JSON string. Exceptions raised by decoding and encoding should be propagated up unaltered. @param module: the name of the JSON library module to use, or the module object itself @type module: str or module @param decode: a function for decoding JSON strings @type decode: callable @param encode: a function for encoding objects as JSON strings @type encode: callable