sequence
stringlengths
902
12k
docstring
stringlengths
4
15.2k
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'process_json_file'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'file_name'}; {'id': '5', 'type': 'block', 'children': ['6', '28']}; {'id': '6', 'type': 'with_statement', 'children': ['7', '17']}; {'id': '7', 'type': 'with_clause', 'children': ['8']}; {'id': '8', 'type': 'with_item', 'children': ['9']}; {'id': '9', 'type': 'as_pattern', 'children': ['10', '15']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'file_name'}; {'id': '14', 'type': 'string', 'children': [], 'value': "'rt'"}; {'id': '15', 'type': 'as_pattern_target', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'fh'}; {'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': 'pybel_graph'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'pybel'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'from_json_file'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'fh'}; {'id': '27', 'type': 'False', 'children': []}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'process_pybel_graph'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'pybel_graph'}
Return a PybelProcessor by processing a Node-Link JSON file. For more information on this format, see: http://pybel.readthedocs.io/en/latest/io.html#node-link-json Parameters ---------- file_name : str The path to a Node-Link JSON file. Returns ------- bp : PybelProcessor A PybelProcessor object which contains INDRA Statements in bp.statements.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_float'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '5', 'type': 'block', 'children': ['6', '63']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '10', '57']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '9'], 'value': 'in'}; {'id': '8', 'type': 'string', 'children': [], 'value': '"["'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '10', 'type': 'block', 'children': ['11', '23', '29']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '17']}; {'id': '13', 'type': 'pattern_list', 'children': ['14', '15', '16']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sep'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'unit'}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'partition'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'string', 'children': [], 'value': '"["'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'unit'}; {'id': '26', 'type': 'binary_operator', 'children': ['27', '28'], 'value': '+'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'sep'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'unit'}; {'id': '29', 'type': 'if_statement', 'children': ['30', '35', '40', '49']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': 'in'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'unit'}; {'id': '32', 'type': 'tuple', 'children': ['33', '34']}; {'id': '33', 'type': 'string', 'children': [], 'value': '"[km]"'}; {'id': '34', 'type': 'string', 'children': [], 'value': '"[km/s]"'}; {'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': 'multiplier'}; {'id': '39', 'type': 'integer', 'children': [], 'value': '1000'}; {'id': '40', 'type': 'elif_clause', 'children': ['41', '44']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '43'], 'value': '=='}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'unit'}; {'id': '43', 'type': 'string', 'children': [], 'value': '"[s]"'}; {'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': 'multiplier'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '49', 'type': 'else_clause', 'children': ['50']}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'raise_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '56']}; {'id': '55', 'type': 'string', 'children': [], 'value': '"Unknown unit for this field"'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'unit'}; {'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': 'multiplier'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '1000'}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'binary_operator', 'children': ['65', '69'], 'value': '*'}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'multiplier'}
Conversion of state vector field, with automatic unit handling
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_install_eslint'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'bootstrap_dir'}; {'id': '6', 'type': 'block', 'children': ['7', '66', '82']}; {'id': '7', 'type': 'with_statement', 'children': ['8', '14']}; {'id': '8', 'type': 'with_clause', 'children': ['9']}; {'id': '9', 'type': 'with_item', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'pushd'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'bootstrap_dir'}; {'id': '14', 'type': 'block', 'children': ['15', '48']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '20']}; {'id': '17', 'type': 'pattern_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'install_command'}; {'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': 'install_module'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '37', '42']}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'package_manager'}; {'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': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'node_distribution'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'get_package_manager'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'keyword_argument', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'package_manager'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'PACKAGE_MANAGER_YARNPKG'}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'workunit_name'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'INSTALL_JAVASCRIPTSTYLE_TARGET_NAME'}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'workunit_labels'}; {'id': '44', 'type': 'list', 'children': ['45'], 'value': '[WorkUnitLabel.PREP]'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'WorkUnitLabel'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'PREP'}; {'id': '48', 'type': 'if_statement', 'children': ['49', '52']}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '51'], 'value': '!='}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '51', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '52', 'type': 'block', 'children': ['53']}; {'id': '53', 'type': 'raise_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'TaskError'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '63']}; {'id': '58', 'type': 'attribute', 'children': ['59', '62']}; {'id': '59', 'type': 'concatenated_string', 'children': ['60', '61']}; {'id': '60', 'type': 'string', 'children': [], 'value': "'Failed to install ESLint\\n'"}; {'id': '61', 'type': 'string', 'children': [], 'value': "'\\t{} failed with exit code {}'"}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'install_command'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '75']}; {'id': '68', 'type': 'attribute', 'children': ['69', '74']}; {'id': '69', 'type': 'attribute', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'string', 'children': [], 'value': "'Successfully installed ESLint to {}'"}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'bootstrap_dir'}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'bootstrap_dir'}
Install the ESLint distribution. :rtype: string
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_expand'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '12', '19', '94', '114']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'is_text'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_simple_expand'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '19', 'type': 'elif_clause', 'children': ['20', '24']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'is_data'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '24', 'type': 'block', 'children': ['25', '32', '37', '42', '53', '57', '81']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'wrap'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '32', 'type': 'assert_statement', 'children': ['33', '36']}; {'id': '33', 'type': 'subscript', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"from"'}; {'id': '36', 'type': 'string', 'children': [], 'value': '"Expecting template to have \'from\' attribute"'}; {'id': '37', 'type': 'assert_statement', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '41', 'type': 'string', 'children': [], 'value': '"Expecting template to have \'template\' attribute"'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '45', 'type': 'subscript', 'children': ['46', '50']}; {'id': '46', 'type': 'subscript', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '48', 'type': 'unary_operator', 'children': ['49'], 'value': '-'}; {'id': '49', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '52', 'type': 'string', 'children': [], 'value': '"from"'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '56', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '57', 'type': 'for_statement', 'children': ['58', '59', '60']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '60', 'type': 'block', 'children': ['61', '68']}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '64', 'type': 'binary_operator', 'children': ['65', '66'], 'value': '+'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '66', 'type': 'tuple', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'd'}; {'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': 'output'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': '_expand'}; {'id': '76', 'type': 'argument_list', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '81', 'type': 'return_statement', 'children': ['82']}; {'id': '82', 'type': 'call', 'children': ['83', '92']}; {'id': '83', 'type': 'attribute', 'children': ['84', '91']}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'coalesce'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'separator'}; {'id': '90', 'type': 'string', 'children': [], 'value': '""'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '92', 'type': 'argument_list', 'children': ['93']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '94', 'type': 'elif_clause', 'children': ['95', '99']}; {'id': '95', 'type': 'call', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'is_list'}; {'id': '97', 'type': 'argument_list', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '99', 'type': 'block', 'children': ['100']}; {'id': '100', 'type': 'return_statement', 'children': ['101']}; {'id': '101', 'type': 'call', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'string', 'children': [], 'value': '""'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '105', 'type': 'generator_expression', 'children': ['106', '111']}; {'id': '106', 'type': 'call', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': '_expand'}; {'id': '108', 'type': 'argument_list', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '111', 'type': 'for_in_clause', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '114', 'type': 'else_clause', 'children': ['115']}; {'id': '115', 'type': 'block', 'children': ['116', '124']}; {'id': '116', 'type': 'if_statement', 'children': ['117', '119']}; {'id': '117', 'type': 'not_operator', 'children': ['118']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': '_Log'}; {'id': '119', 'type': 'block', 'children': ['120']}; {'id': '120', 'type': 'expression_statement', 'children': ['121']}; {'id': '121', 'type': 'call', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': '_late_import'}; {'id': '123', 'type': 'argument_list', 'children': []}; {'id': '124', 'type': 'expression_statement', 'children': ['125']}; {'id': '125', 'type': 'call', 'children': ['126', '129']}; {'id': '126', 'type': 'attribute', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': '_Log'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '129', 'type': 'argument_list', 'children': ['130']}; {'id': '130', 'type': 'string', 'children': [], 'value': '"can not handle"'}
seq IS TUPLE OF OBJECTS IN PATH ORDER INTO THE DATA TREE
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reducer_metro'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'metro'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '7', 'type': 'block', 'children': ['8', '17']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'lookup'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'CachedLookup'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'keyword_argument', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'precision'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'POI_GEOHASH_PRECISION'}; {'id': '17', 'type': 'for_statement', 'children': ['18', '21', '25']}; {'id': '18', 'type': 'pattern_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '25', 'type': 'block', 'children': ['26', '33']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '32']}; {'id': '28', 'type': 'pattern_list', 'children': ['29', '30', '31']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'type_tag'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'lonlat'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '33', 'type': 'if_statement', 'children': ['34', '37', '70']}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '36'], 'value': '=='}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'type_tag'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'lookup'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'insert'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '62']}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'geometry'}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '56']}; {'id': '53', 'type': 'keyword_argument', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '55', 'type': 'string', 'children': [], 'value': "'Point'"}; {'id': '56', 'type': 'keyword_argument', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'coordinates'}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'project'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'lonlat'}; {'id': '62', 'type': 'keyword_argument', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'properties'}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'keyword_argument', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'tags'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '70', 'type': 'else_clause', 'children': ['71']}; {'id': '71', 'type': 'block', 'children': ['72', '79', '83', '95', '141']}; {'id': '72', 'type': 'if_statement', 'children': ['73', '77']}; {'id': '73', 'type': 'not_operator', 'children': ['74']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'lookup'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'data_store'}; {'id': '77', 'type': 'block', 'children': ['78']}; {'id': '78', 'type': 'return_statement', 'children': []}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'poi_names'}; {'id': '82', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'assignment', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '86', 'type': 'call', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '88', 'type': 'argument_list', 'children': ['89', '92']}; {'id': '89', 'type': 'keyword_argument', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'buffer_size'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'POI_DISTANCE'}; {'id': '92', 'type': 'keyword_argument', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'multiple'}; {'id': '94', 'type': 'True', 'children': []}; {'id': '95', 'type': 'for_statement', 'children': ['96', '97', '105']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'poi'}; {'id': '97', 'type': 'call', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'lookup'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '101', 'type': 'argument_list', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'lonlat'}; {'id': '103', 'type': 'dictionary_splat', 'children': ['104']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '105', 'type': 'block', 'children': ['106', '118']}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'assignment', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'has_tag'}; {'id': '109', 'type': 'list_comprehension', 'children': ['110', '115']}; {'id': '110', 'type': 'comparison_operator', 'children': ['111', '112'], 'value': 'in'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '112', 'type': 'subscript', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'poi'}; {'id': '114', 'type': 'string', 'children': [], 'value': "'tags'"}; {'id': '115', 'type': 'for_in_clause', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'POI_TAGS'}; {'id': '118', 'type': 'if_statement', 'children': ['119', '129']}; {'id': '119', 'type': 'boolean_operator', 'children': ['120', '124'], 'value': 'and'}; {'id': '120', 'type': 'call', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'any'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'has_tag'}; {'id': '124', 'type': 'comparison_operator', 'children': ['125', '126'], 'value': 'in'}; {'id': '125', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '126', 'type': 'subscript', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'poi'}; {'id': '128', 'type': 'string', 'children': [], 'value': "'tags'"}; {'id': '129', 'type': 'block', 'children': ['130']}; {'id': '130', 'type': 'expression_statement', 'children': ['131']}; {'id': '131', 'type': 'call', 'children': ['132', '135']}; {'id': '132', 'type': 'attribute', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'poi_names'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '135', 'type': 'argument_list', 'children': ['136']}; {'id': '136', 'type': 'subscript', 'children': ['137', '140']}; {'id': '137', 'type': 'subscript', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'poi'}; {'id': '139', 'type': 'string', 'children': [], 'value': "'tags'"}; {'id': '140', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '141', 'type': 'for_statement', 'children': ['142', '143', '147']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'poi'}; {'id': '143', 'type': 'call', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '145', 'type': 'argument_list', 'children': ['146']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'poi_names'}; {'id': '147', 'type': 'block', 'children': ['148']}; {'id': '148', 'type': 'expression_statement', 'children': ['149']}; {'id': '149', 'type': 'yield', 'children': ['150']}; {'id': '150', 'type': 'expression_list', 'children': ['151', '154']}; {'id': '151', 'type': 'tuple', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'metro'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'poi'}; {'id': '154', 'type': 'integer', 'children': [], 'value': '1'}
Output tags of POI locations nearby tweet locations Values will be sorted coming into reducer. First element in each value tuple will be either 1 (osm POI) or 2 (geotweet). Build a spatial index with POI records. For each tweet lookup nearby POI, and emit tag values for predefined tags.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'name'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '27']}; {'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': 'hasattr'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'string', 'children': [], 'value': '"_name"'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_name'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': '"{}_hub_module_embedding"'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_name'}
Returns string. Used for variable_scope and naming.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'command'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'regexp'}; {'id': '6', 'type': 'block', 'children': ['7', '22']}; {'id': '7', 'type': 'function_definition', 'children': ['8', '9', '11']}; {'id': '8', 'type': 'function_name', 'children': [], 'value': 'decorator'}; {'id': '9', 'type': 'parameters', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '11', 'type': 'block', 'children': ['12', '20']}; {'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': 'add_command'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'regexp'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'decorator'}
Register a new command :param str regexp: Regular expression matching the command to register :Example: >>> @bot.command(r"/echo (.+)") >>> def echo(chat, match): >>> return chat.reply(match.group(1))
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'convert_roipooling'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '5', 'type': 'dictionary_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '7', 'type': 'block', 'children': ['8', '19', '31', '43', '66']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '14']}; {'id': '10', 'type': 'pattern_list', 'children': ['11', '12', '13']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'input_nodes'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'get_inputs'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'pooled_shape'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'convert_string_to_list'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'string', 'children': [], 'value': "'pooled_size'"}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'scale'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'string', 'children': [], 'value': '"spatial_scale"'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'node'}; {'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': 'onnx'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'helper'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'make_node'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54', '55', '57', '60', '63']}; {'id': '53', 'type': 'string', 'children': [], 'value': "'MaxRoiPool'"}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'input_nodes'}; {'id': '55', 'type': 'list', 'children': ['56'], 'value': '[name]'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '57', 'type': 'keyword_argument', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'pooled_shape'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'pooled_shape'}; {'id': '60', 'type': 'keyword_argument', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'spatial_scale'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'scale'}; {'id': '63', 'type': 'keyword_argument', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '66', 'type': 'return_statement', 'children': ['67']}; {'id': '67', 'type': 'list', 'children': ['68'], 'value': '[node]'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'node'}
Map MXNet's ROIPooling operator attributes to onnx's MaxRoiPool operator and return the created node.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'com_google_fonts_check_metadata_nameid_family_and_full_names'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'ttFont'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'font_metadata'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '23', '46', '58']}; {'id': '7', 'type': 'import_from_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'dotted_name', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'fontbakery'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '11', 'type': 'dotted_name', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'get_name_entry_strings'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'font_familynames'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'get_name_entry_strings'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'ttFont'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'NameID'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'TYPOGRAPHIC_FAMILY_NAME'}; {'id': '23', 'type': 'if_statement', 'children': ['24', '25', '32']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'font_familynames'}; {'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': 'font_familyname'}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'font_familynames'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '32', 'type': 'else_clause', 'children': ['33']}; {'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': 'font_familyname'}; {'id': '37', 'type': 'subscript', 'children': ['38', '45']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'get_name_entry_strings'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'ttFont'}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'NameID'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'FONT_FAMILY_NAME'}; {'id': '45', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'font_fullname'}; {'id': '49', 'type': 'subscript', 'children': ['50', '57']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'get_name_entry_strings'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'ttFont'}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'NameID'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'FULL_FONT_NAME'}; {'id': '57', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '58', 'type': 'if_statement', 'children': ['59', '64', '86', '114']}; {'id': '59', 'type': 'comparison_operator', 'children': ['60', '61'], 'value': '!='}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'font_fullname'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'font_metadata'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'full_name'}; {'id': '64', 'type': 'block', 'children': ['65']}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'yield', 'children': ['67']}; {'id': '67', 'type': 'expression_list', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'FAIL'}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'Message'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '73']}; {'id': '72', 'type': 'string', 'children': [], 'value': '"fullname-mismatch"'}; {'id': '73', 'type': 'call', 'children': ['74', '81']}; {'id': '74', 'type': 'attribute', 'children': ['75', '80']}; {'id': '75', 'type': '()', 'children': ['76']}; {'id': '76', 'type': 'concatenated_string', 'children': ['77', '78', '79']}; {'id': '77', 'type': 'string', 'children': [], 'value': '"METADATA.pb: Fullname (\\"{}\\")"'}; {'id': '78', 'type': 'string', 'children': [], 'value': '" does not match name table"'}; {'id': '79', 'type': 'string', 'children': [], 'value': '" entry \\"{}\\" !"'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '81', 'type': 'argument_list', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'font_metadata'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'full_name'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'font_fullname'}; {'id': '86', 'type': 'elif_clause', 'children': ['87', '92']}; {'id': '87', 'type': 'comparison_operator', 'children': ['88', '89'], 'value': '!='}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'font_familyname'}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'font_metadata'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'yield', 'children': ['95']}; {'id': '95', 'type': 'expression_list', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'FAIL'}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'Message'}; {'id': '99', 'type': 'argument_list', 'children': ['100', '101']}; {'id': '100', 'type': 'string', 'children': [], 'value': '"familyname-mismatch"'}; {'id': '101', 'type': 'call', 'children': ['102', '109']}; {'id': '102', 'type': 'attribute', 'children': ['103', '108']}; {'id': '103', 'type': '()', 'children': ['104']}; {'id': '104', 'type': 'concatenated_string', 'children': ['105', '106', '107']}; {'id': '105', 'type': 'string', 'children': [], 'value': '"METADATA.pb Family name \\"{}\\")"'}; {'id': '106', 'type': 'string', 'children': [], 'value': '" does not match name table"'}; {'id': '107', 'type': 'string', 'children': [], 'value': '" entry \\"{}\\" !"'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '109', 'type': 'argument_list', 'children': ['110', '113']}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'font_metadata'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'font_familyname'}; {'id': '114', 'type': 'else_clause', 'children': ['115']}; {'id': '115', 'type': 'block', 'children': ['116']}; {'id': '116', 'type': 'expression_statement', 'children': ['117']}; {'id': '117', 'type': 'yield', 'children': ['118']}; {'id': '118', 'type': 'expression_list', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'PASS'}; {'id': '120', 'type': '()', 'children': ['121']}; {'id': '121', 'type': 'concatenated_string', 'children': ['122', '123']}; {'id': '122', 'type': 'string', 'children': [], 'value': '"METADATA.pb familyname and fullName fields"'}; {'id': '123', 'type': 'string', 'children': [], 'value': '" match corresponding name table entries."'}
METADATA.pb font.name and font.full_name fields match the values declared on the name table?
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'generate_http_basic_token'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '6', 'type': 'block', 'children': ['7', '32']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '10', 'type': 'call', 'children': ['11', '30']}; {'id': '11', 'type': 'attribute', 'children': ['12', '29']}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'base64'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'b64encode'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '27']}; {'id': '18', 'type': 'attribute', 'children': ['19', '26']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'{}:{}'"}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'encode'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'utf-8'"}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'string', 'children': [], 'value': "'utf-8'"}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'token'}
Generates a HTTP basic token from username and password Returns a token string (not a byte)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'user_id_partition_keygen'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'request_envelope'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'try_statement', 'children': ['7', '22']}; {'id': '7', 'type': 'block', 'children': ['8', '20']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '11', 'type': 'attribute', 'children': ['12', '19']}; {'id': '12', 'type': 'attribute', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'request_envelope'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'system'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '22', 'type': 'except_clause', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'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': 'PersistenceException'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'concatenated_string', 'children': ['30', '31']}; {'id': '30', 'type': 'string', 'children': [], 'value': '"Couldn\'t retrieve user id from request "'}; {'id': '31', 'type': 'string', 'children': [], 'value': '"envelope, for partition key use"'}
Retrieve user id from request envelope, to use as partition key. :param request_envelope: Request Envelope passed during skill invocation :type request_envelope: ask_sdk_model.RequestEnvelope :return: User Id retrieved from request envelope :rtype: str :raises: :py:class:`ask_sdk_core.exceptions.PersistenceException`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'list_runners'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'list_splat_pattern', 'children': ['5']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '24', '53', '119']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'run_'}; {'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': 'salt'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'runner'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'Runner'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '__opts__'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'runners'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'if_statement', 'children': ['25', '27']}; {'id': '25', 'type': 'not_operator', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '27', 'type': 'block', 'children': ['28', '48']}; {'id': '28', 'type': 'for_statement', 'children': ['29', '30', '33']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'run_'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'functions'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'runners'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'subscript', 'children': ['41', '47']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'string', 'children': [], 'value': "'.'"}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'runners'}; {'id': '53', 'type': 'for_statement', 'children': ['54', '55', '56']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'if_statement', 'children': ['58', '61', '88']}; {'id': '58', 'type': 'comparison_operator', 'children': ['59', '60'], 'value': 'in'}; {'id': '59', 'type': 'string', 'children': [], 'value': "'*'"}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'for_statement', 'children': ['63', '64', '73']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'fnmatch'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'run_'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'functions'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '73', 'type': 'block', 'children': ['74']}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'runners'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '79', 'type': 'argument_list', 'children': ['80']}; {'id': '80', 'type': 'subscript', 'children': ['81', '87']}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'string', 'children': [], 'value': "'.'"}; {'id': '87', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '88', 'type': 'else_clause', 'children': ['89']}; {'id': '89', 'type': 'block', 'children': ['90']}; {'id': '90', 'type': 'for_statement', 'children': ['91', '92', '95']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'run_'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'functions'}; {'id': '95', 'type': 'block', 'children': ['96', '107']}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'assignment', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'mod_test'}; {'id': '99', 'type': 'subscript', 'children': ['100', '106']}; {'id': '100', 'type': 'call', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '104', 'type': 'argument_list', 'children': ['105']}; {'id': '105', 'type': 'string', 'children': [], 'value': "'.'"}; {'id': '106', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '107', 'type': 'if_statement', 'children': ['108', '111']}; {'id': '108', 'type': 'comparison_operator', 'children': ['109', '110'], 'value': '=='}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'mod_test'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '111', 'type': 'block', 'children': ['112']}; {'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': 'runners'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '117', 'type': 'argument_list', 'children': ['118']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'mod_test'}; {'id': '119', 'type': 'return_statement', 'children': ['120']}; {'id': '120', 'type': 'call', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'runners'}
List the runners loaded on the minion .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' sys.list_runners Runner names can be specified as globs. .. versionadded:: 2015.5.0 .. code-block:: bash salt '*' sys.list_runners 'm*'
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'listen'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '6', 'type': 'float', 'children': [], 'value': '6.0'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'BOOT_PORT'}; {'id': '10', 'type': 'block', 'children': ['11', '25', '38', '47', '54']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'AF_INET'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'SOCK_DGRAM'}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'setsockopt'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '34', '37']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'SOL_SOCKET'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'SO_REUSEADDR'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'bind'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'tuple', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': "'0.0.0.0'"}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'port'}; {'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': 's'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'settimeout'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '54', 'type': 'try_statement', 'children': ['55', '71']}; {'id': '55', 'type': 'block', 'children': ['56', '69']}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '63']}; {'id': '58', 'type': 'pattern_list', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '60', 'type': 'tuple_pattern', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'ipaddr'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'recvfrom'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'integer', 'children': [], 'value': '512'}; {'id': '69', 'type': 'return_statement', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'ipaddr'}; {'id': '71', 'type': 'except_clause', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '75', 'type': 'block', 'children': ['76']}; {'id': '76', 'type': 'return_statement', 'children': ['77']}; {'id': '77', 'type': 'None', 'children': []}
Listen for a 'ping' broadcast message from an unbooted SpiNNaker board. Unbooted SpiNNaker boards send out a UDP broadcast message every 4-ish seconds on port 54321. This function listens for such messages and reports the IP address that it came from. Parameters ---------- timeout : float Number of seconds to wait for a message to arrive. port : int The port number to listen on. Returns ------- str or None The IP address of the SpiNNaker board from which a ping was received or None if no ping was observed.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'parallel'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'processes'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'threads'}; {'id': '6', 'type': 'block', 'children': ['7', '14', '22', '28']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'pool'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'multithread'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'threads'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'pool'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'map'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'run_process'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'processes'}; {'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': 'pool'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '27', 'type': 'argument_list', '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': 'pool'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '33', 'type': 'argument_list', 'children': []}
execute jobs in processes using N threads
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ems'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'string', 'children': [], 'value': "'Gap'"}; {'id': '11', 'type': 'block', 'children': ['12', '17', '28']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'raise_not_number'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'gap'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'string', 'children': [], 'value': "'{}em'"}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}
Set the margin in ems.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'weld_iloc_indices_with_missing'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'weld_type'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '7', 'type': 'block', 'children': ['8', '14', '22', '30', '37', '55', '79']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'weld_obj'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'create_empty_weld_object'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'weld_obj_id_array'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'get_weld_obj_id'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'weld_obj'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'weld_obj_id_indices'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'get_weld_obj_id'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'weld_obj'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'missing_literal'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'default_missing_data_literal'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'weld_type'}; {'id': '37', 'type': 'if_statement', 'children': ['38', '46']}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '40'], 'value': '=='}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'weld_type'}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'WeldVec'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'WeldChar'}; {'id': '45', 'type': 'argument_list', 'children': []}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'missing_literal'}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'get_weld_obj_id'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'weld_obj'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'missing_literal'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'weld_template'}; {'id': '58', 'type': 'assignment', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'weld_obj'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'weld_code'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'weld_template'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '70', '73', '76']}; {'id': '67', 'type': 'keyword_argument', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'weld_obj_id_array'}; {'id': '70', 'type': 'keyword_argument', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'weld_obj_id_indices'}; {'id': '73', 'type': 'keyword_argument', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'weld_type'}; {'id': '76', 'type': 'keyword_argument', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'missing'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'missing_literal'}; {'id': '79', 'type': 'return_statement', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'weld_obj'}
Retrieve the values at indices. Indices greater than array length get replaced with a corresponding-type missing value literal. Parameters ---------- array : numpy.ndarray or WeldObject Input data. Assumed to be bool data. weld_type : WeldType The WeldType of the array data. indices : numpy.ndarray or WeldObject The indices to lookup. Returns ------- WeldObject Representation of this computation.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reverse'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'points'}; {'id': '6', 'type': 'dictionary_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '8', 'type': 'block', 'children': ['9', '25', '46']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '15']}; {'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': 'points'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'batch_reverse'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'points'}; {'id': '23', 'type': 'dictionary_splat', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '25', 'type': 'if_statement', 'children': ['26', '31', '38']}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '30'], 'value': '=='}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '30', 'type': 'string', 'children': [], 'value': '"lat"'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '37']}; {'id': '34', 'type': 'pattern_list', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'points'}; {'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', '45']}; {'id': '42', 'type': 'pattern_list', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'points'}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'reverse_point'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '53', '54']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '54', 'type': 'dictionary_splat', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
General method for reversing addresses, either a single address or multiple. *args should either be a longitude/latitude pair or a list of such pairs:: >>> multiple_locations = reverse([(40, -19), (43, 112)]) >>> single_location = reverse((40, -19))
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'import_env'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'list_splat_pattern', 'children': ['5']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'envs'}; {'id': '6', 'type': 'block', 'children': ['7', '9']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': "'import environment variables from host'"}; {'id': '9', 'type': 'for_statement', 'children': ['10', '11', '12']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'envs'}; {'id': '12', 'type': 'block', 'children': ['13', '23', '43', '54']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': "':'"}; {'id': '22', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '23', 'type': 'if_statement', 'children': ['24', '30', '35']}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '29'], 'value': '=='}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '29', 'type': 'integer', 'children': [], 'value': '1'}; {'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': 'export_as'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '35', 'type': 'else_clause', 'children': ['36']}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '42']}; {'id': '39', 'type': 'pattern_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'export_as'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'env_val'}; {'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': 'os'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '54', 'type': 'if_statement', 'children': ['55', '58']}; {'id': '55', 'type': 'comparison_operator', 'children': ['56', '57'], 'value': 'is not'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'env_val'}; {'id': '57', 'type': 'None', 'children': []}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'yield', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'{}={}'"}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'export_as'}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'shlex'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'quote'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'env_val'}
import environment variables from host
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'skip'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'roman_numeral'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'skip'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '8', 'type': 'block', 'children': ['9', '20']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '12', 'type': 'binary_operator', 'children': ['13', '19'], 'value': '+'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'numerals'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'roman_numeral'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'skip'}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'subscript', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'numerals'}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '25'], 'value': '%'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '7'}
Skip the given places to the next roman numeral. Examples: >>> skip('I') 'II' >>> skip('VII') 'I' >>> skip('I', 2) 'III'
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_construct_from_json'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '28', '45']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'delete'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'for_statement', 'children': ['14', '15', '18']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'required_key'}; {'id': '15', 'type': 'list', 'children': ['16', '17'], 'value': "['dagobah_id', 'created_jobs']"}; {'id': '16', 'type': 'string', 'children': [], 'value': "'dagobah_id'"}; {'id': '17', 'type': 'string', 'children': [], 'value': "'created_jobs'"}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'setattr'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24', '25']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'required_key'}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'required_key'}; {'id': '28', 'type': 'for_statement', 'children': ['29', '30', '37']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'job_json'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36']}; {'id': '35', 'type': 'string', 'children': [], 'value': "'jobs'"}; {'id': '36', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '_add_job_from_spec'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'job_json'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'commit'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'keyword_argument', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'cascade'}; {'id': '53', 'type': 'True', 'children': []}
Construct this Dagobah instance from a JSON document.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'bootstrap'}; {'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': 'mc_bit'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0x10'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'seed'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '26', '37', '56', '75', '94', '113', '132', '147']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '16']}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '15'], 'value': 'is not'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'seed'}; {'id': '15', 'type': 'None', 'children': []}; {'id': '16', 'type': 'block', 'children': ['17']}; {'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': 'np'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'random'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'seed'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'seed'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'deepcopy'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '40', 'type': 'call', 'children': ['41', '46']}; {'id': '41', 'type': 'attribute', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'random'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'randint'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48', '52']}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '70']}; {'id': '58', 'type': 'subscript', 'children': ['59', '68']}; {'id': '59', 'type': 'subscript', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '61', 'type': 'subscript', 'children': ['62', '67']}; {'id': '62', 'type': 'subscript', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '66', 'type': 'string', 'children': [], 'value': "'catalog'"}; {'id': '67', 'type': 'string', 'children': [], 'value': "'mag_1_field'"}; {'id': '68', 'type': 'slice', 'children': ['69']}; {'id': '69', 'type': 'colon', 'children': []}; {'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': 'mag_1'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '89']}; {'id': '77', 'type': 'subscript', 'children': ['78', '87']}; {'id': '78', 'type': 'subscript', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '80', 'type': 'subscript', 'children': ['81', '86']}; {'id': '81', 'type': 'subscript', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '85', 'type': 'string', 'children': [], 'value': "'catalog'"}; {'id': '86', 'type': 'string', 'children': [], 'value': "'mag_err_1_field'"}; {'id': '87', 'type': 'slice', 'children': ['88']}; {'id': '88', 'type': 'colon', 'children': []}; {'id': '89', 'type': 'subscript', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'mag_err_1'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '108']}; {'id': '96', 'type': 'subscript', 'children': ['97', '106']}; {'id': '97', 'type': 'subscript', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '99', 'type': 'subscript', 'children': ['100', '105']}; {'id': '100', 'type': 'subscript', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '104', 'type': 'string', 'children': [], 'value': "'catalog'"}; {'id': '105', 'type': 'string', 'children': [], 'value': "'mag_2_field'"}; {'id': '106', 'type': 'slice', 'children': ['107']}; {'id': '107', 'type': 'colon', 'children': []}; {'id': '108', 'type': 'subscript', 'children': ['109', '112']}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'mag_2'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'assignment', 'children': ['115', '127']}; {'id': '115', 'type': 'subscript', 'children': ['116', '125']}; {'id': '116', 'type': 'subscript', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '118', 'type': 'subscript', 'children': ['119', '124']}; {'id': '119', 'type': 'subscript', 'children': ['120', '123']}; {'id': '120', 'type': 'attribute', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '123', 'type': 'string', 'children': [], 'value': "'catalog'"}; {'id': '124', 'type': 'string', 'children': [], 'value': "'mag_err_2_field'"}; {'id': '125', 'type': 'slice', 'children': ['126']}; {'id': '126', 'type': 'colon', 'children': []}; {'id': '127', 'type': 'subscript', 'children': ['128', '131']}; {'id': '128', 'type': 'attribute', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'mag_err_2'}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '132', 'type': 'expression_statement', 'children': ['133']}; {'id': '133', 'type': 'augmented_assignment', 'children': ['134', '146'], 'value': '|='}; {'id': '134', 'type': 'subscript', 'children': ['135', '144']}; {'id': '135', 'type': 'subscript', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '137', 'type': 'subscript', 'children': ['138', '143']}; {'id': '138', 'type': 'subscript', 'children': ['139', '142']}; {'id': '139', 'type': 'attribute', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '142', 'type': 'string', 'children': [], 'value': "'catalog'"}; {'id': '143', 'type': 'string', 'children': [], 'value': "'mc_source_id_field'"}; {'id': '144', 'type': 'slice', 'children': ['145']}; {'id': '145', 'type': 'colon', 'children': []}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'mc_bit'}; {'id': '147', 'type': 'return_statement', 'children': ['148']}; {'id': '148', 'type': 'call', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'Catalog'}; {'id': '150', 'type': 'argument_list', 'children': ['151', '154']}; {'id': '151', 'type': 'attribute', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '154', 'type': 'keyword_argument', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'data'}
Return a random catalog by boostrapping the colors of the objects in the current catalog.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_keys'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '5', 'type': 'block', 'children': ['6', '27']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12', '19']}; {'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': 'expr'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'SequenceExpr'}; {'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': 'dtype'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '19', 'type': 'else_clause', 'children': ['20']}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'value_type'}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'composite_op'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32', '33']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'DictKeys'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'df_types'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'key_type'}
Retrieve keys of a dict :param expr: dict sequence / scalar :return:
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'delete_by_id'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'webhook'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '8', 'type': 'dictionary', 'children': []}; {'id': '9', 'type': 'dictionary_splat_pattern', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '11', 'type': 'block', 'children': ['12', '19']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '17'], 'value': '%'}; {'id': '16', 'type': 'string', 'children': [], 'value': '"/webhooks/%s"'}; {'id': '17', 'type': '()', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'webhook'}; {'id': '19', 'type': 'return_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': 'client'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'delete'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28', '29']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '29', 'type': 'dictionary_splat', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'options'}
This method permanently removes a webhook. Note that it may be possible to receive a request that was already in flight after deleting the webhook, but no further requests will be issued. Parameters ---------- webhook : {Id} The webhook to delete.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'as_dot'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'type', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'return_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '24']}; {'id': '10', 'type': 'attribute', 'children': ['11', '23']}; {'id': '11', 'type': 'call', 'children': ['12', '19']}; {'id': '12', 'type': 'attribute', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'nx'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'drawing'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'nx_pydot'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'to_pydot'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_graph'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'to_string'}; {'id': '24', 'type': 'argument_list', 'children': []}
Return as a string the dot version of the graph.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_extract'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '43', '52']}; {'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': 'log'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'string', 'children': [], 'value': '"Extracting emails from text content"'}; {'id': '15', 'type': 'for_statement', 'children': ['16', '17', '20']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '20', 'type': 'block', 'children': ['21', '34']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'emails'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'extract_emails'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28', '31']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'domain'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'fuzzy'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', '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': 'results'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'emails'}; {'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': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'string', 'children': [], 'value': '"Email extraction completed"'}; {'id': '52', 'type': 'return_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'results'}
Extract email addresses from results. Text content from all crawled pages are ran through a simple email extractor. Data is cleaned prior to running pattern expressions.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dfs_back_edges'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'start_node'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '19', '78']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'visited'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'finished'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'function_definition', 'children': ['20', '21', '23']}; {'id': '20', 'type': 'function_name', 'children': [], 'value': '_dfs_back_edges_core'}; {'id': '21', 'type': 'parameters', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '23', 'type': 'block', 'children': ['24', '31', '71']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'visited'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '31', 'type': 'for_statement', 'children': ['32', '33', '39']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'iter'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'if_statement', 'children': ['41', '44']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '43'], 'value': 'not in'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'finished'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'if_statement', 'children': ['46', '49', '55']}; {'id': '46', 'type': 'comparison_operator', 'children': ['47', '48'], 'value': 'in'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'visited'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'yield', 'children': ['52']}; {'id': '52', 'type': 'expression_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '55', 'type': 'else_clause', 'children': ['56']}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'for_statement', 'children': ['58', '61', '65']}; {'id': '58', 'type': 'pattern_list', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': '_dfs_back_edges_core'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'yield', 'children': ['68']}; {'id': '68', 'type': 'expression_list', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 't'}; {'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': 'finished'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '78', 'type': 'for_statement', 'children': ['79', '82', '86']}; {'id': '79', 'type': 'pattern_list', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '82', 'type': 'call', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': '_dfs_back_edges_core'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'start_node'}; {'id': '86', 'type': 'block', 'children': ['87']}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'yield', 'children': ['89']}; {'id': '89', 'type': 'expression_list', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 't'}
Do a DFS traversal of the graph, and return with the back edges. Note: This is just a naive recursive implementation, feel free to replace it. I couldn't find anything in networkx to do this functionality. Although the name suggest it, but `dfs_labeled_edges` is doing something different. :param graph: The graph to traverse. :param node: The node where to start the traversal :returns: An iterator of 'backward' edges
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'remove_object'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'bucket_name'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'object_name'}; {'id': '7', 'type': 'block', 'children': ['8', '13', '18']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'is_valid_bucket_name'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'bucket_name'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'is_non_empty_string'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'object_name'}; {'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': '_url_open'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25', '28']}; {'id': '24', 'type': 'string', 'children': [], 'value': "'DELETE'"}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'bucket_name'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'bucket_name'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'object_name'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'object_name'}
Remove an object from the bucket. :param bucket_name: Bucket of object to remove :param object_name: Name of object to remove :return: None
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '20']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'hdf_filename'}; {'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': 'os'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_dump_dirname'}; {'id': '19', 'type': 'string', 'children': [], 'value': "'result.h5'"}; {'id': '20', 'type': 'if_statement', 'children': ['21', '29', '133']}; {'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': 'os'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'isfile'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'hdf_filename'}; {'id': '29', 'type': 'block', 'children': ['30', '42', '50']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'HDFStore'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'hdf_filename'}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'mode'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '49', 'type': 'argument_list', 'children': []}; {'id': '50', 'type': 'if_statement', 'children': ['51', '55', '64']}; {'id': '51', 'type': 'comparison_operator', 'children': ['52', '53'], 'value': '=='}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '53', 'type': 'list', 'children': ['54'], 'value': "['/df']"}; {'id': '54', 'type': 'string', 'children': [], 'value': "'/df'"}; {'id': '55', 'type': 'block', 'children': ['56']}; {'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': 'result'}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '63', 'type': 'string', 'children': [], 'value': "'df'"}; {'id': '64', 'type': 'else_clause', 'children': ['65']}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'if_statement', 'children': ['67', '91', '113']}; {'id': '67', 'type': 'comparison_operator', 'children': ['68', '72'], 'value': '=='}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'map'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '84']}; {'id': '78', 'type': 'lambda', 'children': ['79', '81']}; {'id': '79', 'type': 'lambda_parameters', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '81', 'type': 'binary_operator', 'children': ['82', '83'], 'value': '%'}; {'id': '82', 'type': 'string', 'children': [], 'value': "'/%s'"}; {'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': 'call', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '91', 'type': 'block', 'children': ['92']}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'assignment', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '97', 'type': 'list_comprehension', 'children': ['98', '104']}; {'id': '98', 'type': 'subscript', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '100', 'type': 'call', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '102', 'type': 'argument_list', 'children': ['103']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '104', 'type': 'for_in_clause', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '106', 'type': 'call', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '108', 'type': 'argument_list', 'children': ['109']}; {'id': '109', 'type': 'call', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '113', 'type': 'else_clause', 'children': ['114']}; {'id': '114', 'type': 'block', 'children': ['115']}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'assignment', 'children': ['117', '120']}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '120', 'type': 'dictionary_comprehension', 'children': ['121', '130']}; {'id': '121', 'type': 'pair', 'children': ['122', '127']}; {'id': '122', 'type': 'subscript', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '124', 'type': 'slice', 'children': ['125', '126']}; {'id': '125', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '126', 'type': 'colon', 'children': []}; {'id': '127', 'type': 'subscript', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '130', 'type': 'for_in_clause', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '133', 'type': 'else_clause', 'children': ['134']}; {'id': '134', 'type': 'block', 'children': ['135']}; {'id': '135', 'type': 'expression_statement', 'children': ['136']}; {'id': '136', 'type': 'assignment', 'children': ['137', '140']}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '140', 'type': 'call', 'children': ['141', '144']}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'joblib'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'load'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'call', 'children': ['146', '151']}; {'id': '146', 'type': 'attribute', 'children': ['147', '150']}; {'id': '147', 'type': 'attribute', 'children': ['148', '149']}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '151', 'type': 'argument_list', 'children': ['152', '155', '156']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': '_output_dirname'}; {'id': '155', 'type': 'string', 'children': [], 'value': "'dump'"}; {'id': '156', 'type': 'string', 'children': [], 'value': "'result.pkl'"}
Load this step's result from its dump directory
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'save'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'try_statement', 'children': ['8', '31']}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'with_statement', 'children': ['10', '20']}; {'id': '10', 'type': 'with_clause', 'children': ['11']}; {'id': '11', 'type': 'with_item', 'children': ['12']}; {'id': '12', 'type': 'as_pattern', 'children': ['13', '18']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"w"'}; {'id': '18', 'type': 'as_pattern_target', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'f'}; {'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': 'f'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'except_clause', 'children': ['32', '36']}; {'id': '32', 'type': 'as_pattern', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '34', 'type': 'as_pattern_target', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ex'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'binary_operator', 'children': ['42', '45'], 'value': '+'}; {'id': '42', 'type': 'binary_operator', 'children': ['43', '44'], 'value': '+'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'ERROR = cant save grid results to '"}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'ex'}
saves a grid to file as ASCII text
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ProcessMessages'}; {'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': 'msgs'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '21', '45']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '19']}; {'id': '13', 'type': 'not_operator', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'data_store'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'AFF4Enabled'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'return_statement', 'children': []}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'filestore_fd'}; {'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': 'aff4'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'FACTORY'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'Create'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '36', '39', '42']}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'legacy_filestore'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'FileStore'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'PATH'}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'legacy_filestore'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'FileStore'}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'mode'}; {'id': '41', 'type': 'string', 'children': [], 'value': '"w"'}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '45', 'type': 'for_statement', 'children': ['46', '47', '48']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'vfs_urn'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'msgs'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'with_statement', 'children': ['50', '69']}; {'id': '50', 'type': 'with_clause', 'children': ['51']}; {'id': '51', 'type': 'with_item', 'children': ['52']}; {'id': '52', 'type': 'as_pattern', 'children': ['53', '67']}; {'id': '53', 'type': 'call', 'children': ['54', '59']}; {'id': '54', 'type': 'attribute', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'aff4'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'FACTORY'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'Open'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '61', '64']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'vfs_urn'}; {'id': '61', 'type': 'keyword_argument', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'mode'}; {'id': '63', 'type': 'string', 'children': [], 'value': '"rw"'}; {'id': '64', 'type': 'keyword_argument', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '67', 'type': 'as_pattern_target', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'vfs_fd'}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'try_statement', 'children': ['71', '79']}; {'id': '71', 'type': 'block', 'children': ['72']}; {'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': 'filestore_fd'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'AddFile'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'vfs_fd'}; {'id': '79', 'type': 'except_clause', 'children': ['80', '84']}; {'id': '80', 'type': 'as_pattern', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '82', 'type': 'as_pattern_target', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '84', 'type': 'block', 'children': ['85']}; {'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': 'logging'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'exception'}; {'id': '90', 'type': 'argument_list', 'children': ['91', '92']}; {'id': '91', 'type': 'string', 'children': [], 'value': '"Exception while adding file to filestore: %s"'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'e'}
Process the new file and add to the file store.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'baseglob'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'pat'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'return_statement', 'children': ['8']}; {'id': '8', 'type': 'list_comprehension', 'children': ['9', '10', '16']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '10', 'type': 'for_in_clause', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'glob'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'pat'}; {'id': '16', 'type': 'if_clause', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'base'}
Given a pattern and a base, return files that match the glob pattern and also contain the base.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'patch_stdout_context'}; {'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': 'raw'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'patch_stdout'}; {'id': '10', 'type': 'True', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'patch_stderr'}; {'id': '13', 'type': 'True', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_PatchStdoutContext'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '27', '30']}; {'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': 'stdout_proxy'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'raw'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'raw'}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'patch_stdout'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'patch_stdout'}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'patch_stderr'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'patch_stderr'}
Return a context manager that will replace ``sys.stdout`` with a proxy that makes sure that all printed text will appear above the prompt, and that it doesn't destroy the output from the renderer. :param patch_stdout: Replace `sys.stdout`. :param patch_stderr: Replace `sys.stderr`.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_redis_server'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'block', 'children': ['8', '10', '15', '25', '77']}; {'id': '8', 'type': 'global_statement', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'REDIS_SERVER'}; {'id': '10', 'type': 'if_statement', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'REDIS_SERVER'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'REDIS_SERVER'}; {'id': '15', 'type': 'if_statement', 'children': ['16', '18']}; {'id': '16', 'type': 'not_operator', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'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': 'opts'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_get_redis_cache_opts'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'if_statement', 'children': ['26', '29', '46']}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'cluster_mode'"}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'REDIS_SERVER'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'StrictRedisCluster'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '41']}; {'id': '36', 'type': 'keyword_argument', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'startup_nodes'}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '40', 'type': 'string', 'children': [], 'value': "'startup_nodes'"}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'skip_full_coverage_check'}; {'id': '43', 'type': 'subscript', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '45', 'type': 'string', 'children': [], 'value': "'skip_full_coverage_check'"}; {'id': '46', 'type': 'else_clause', 'children': ['47']}; {'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': 'REDIS_SERVER'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'redis'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'StrictRedis'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '59', '62', '67', '72']}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '58', 'type': 'string', 'children': [], 'value': "'host'"}; {'id': '59', 'type': 'subscript', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '61', 'type': 'string', 'children': [], 'value': "'port'"}; {'id': '62', 'type': 'keyword_argument', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'unix_socket_path'}; {'id': '64', 'type': 'subscript', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '66', 'type': 'string', 'children': [], 'value': "'unix_socket_path'"}; {'id': '67', 'type': 'keyword_argument', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'db'}; {'id': '69', 'type': 'subscript', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '71', 'type': 'string', 'children': [], 'value': "'db'"}; {'id': '72', 'type': 'keyword_argument', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '74', 'type': 'subscript', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '76', 'type': 'string', 'children': [], 'value': "'password'"}; {'id': '77', 'type': 'return_statement', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'REDIS_SERVER'}
Return the Redis server instance. Caching the object instance.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_institutes_trend_graph_urls'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '43']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'graph_list'}; {'id': '10', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '11', 'type': 'for_statement', 'children': ['12', '13', '20']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'institute'}; {'id': '13', 'type': 'call', 'children': ['14', '19']}; {'id': '14', 'type': 'attribute', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'Institute'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'objects'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21', '30', '36']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'urls'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'get_institute_trend_graph_url'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28', '29']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'institute'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '35']}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'urls'}; {'id': '34', 'type': 'string', 'children': [], 'value': "'institute'"}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'institute'}; {'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': 'graph_list'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'urls'}; {'id': '43', 'type': 'return_statement', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'graph_list'}
Get all institute trend graphs.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_chance'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'solution'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'pdf'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'return_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': '_prod'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'list_comprehension', 'children': ['12', '20']}; {'id': '12', 'type': 'binary_operator', 'children': ['13', '14'], 'value': '-'}; {'id': '13', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'binary_operator', 'children': ['18', '19'], 'value': '-'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'bit'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '20', 'type': 'for_in_clause', 'children': ['21', '24']}; {'id': '21', 'type': 'pattern_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'bit'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'solution'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'pdf'}
Return the chance of obtaining a solution from a pdf. The probability of many independant weighted "coin flips" (one for each bit)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_stddevs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'C'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'stddev_types'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'num_sites'}; {'id': '8', 'type': 'block', 'children': ['9', '22', '35', '39', '100']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sigma_inter'}; {'id': '12', 'type': 'binary_operator', 'children': ['13', '16'], 'value': '+'}; {'id': '13', 'type': 'subscript', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'C'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'tau'"}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'zeros'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'num_sites'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sigma_intra'}; {'id': '25', 'type': 'binary_operator', 'children': ['26', '29'], 'value': '+'}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'C'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'sigma'"}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'zeros'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'num_sites'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'std'}; {'id': '38', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '39', 'type': 'for_statement', 'children': ['40', '41', '42']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'stddev_type'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'stddev_types'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'if_statement', 'children': ['44', '51', '68', '84']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '46'], 'value': '=='}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'stddev_type'}; {'id': '46', 'type': 'attribute', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'const'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'StdDev'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'TOTAL'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'augmented_assignment', 'children': ['54', '55'], 'value': '+='}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'std'}; {'id': '55', 'type': 'list', 'children': ['56'], 'value': '[np.sqrt(sigma_intra**2 + sigma_inter**2)]'}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'sqrt'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'binary_operator', 'children': ['62', '65'], 'value': '+'}; {'id': '62', 'type': 'binary_operator', 'children': ['63', '64'], 'value': '**'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'sigma_intra'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '67'], 'value': '**'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sigma_inter'}; {'id': '67', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '68', 'type': 'elif_clause', 'children': ['69', '76']}; {'id': '69', 'type': 'comparison_operator', 'children': ['70', '71'], 'value': '=='}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'stddev_type'}; {'id': '71', 'type': 'attribute', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'const'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'StdDev'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'INTRA_EVENT'}; {'id': '76', 'type': 'block', 'children': ['77']}; {'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': 'std'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'sigma_intra'}; {'id': '84', 'type': 'elif_clause', 'children': ['85', '92']}; {'id': '85', 'type': 'comparison_operator', 'children': ['86', '87'], 'value': '=='}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'stddev_type'}; {'id': '87', 'type': 'attribute', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'const'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'StdDev'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'INTER_EVENT'}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'std'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'sigma_inter'}; {'id': '100', 'type': 'return_statement', 'children': ['101']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'std'}
Return total standard deviation as described in paragraph 5.2 pag 200.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'mean_pressure_weighted'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'pressure'}; {'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', '12', '22', '32', '42', '46', '64', '70', '78', '100', '138']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'heights'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'string', 'children': [], 'value': "'heights'"}; {'id': '21', 'type': 'None', 'children': []}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'bottom'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'string', 'children': [], 'value': "'bottom'"}; {'id': '31', 'type': 'None', 'children': []}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'depth'}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'string', 'children': [], 'value': "'depth'"}; {'id': '41', 'type': 'None', 'children': []}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '45', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'layer_arg'}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'get_layer'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '53', '55', '58', '61']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'pressure'}; {'id': '53', 'type': 'list_splat', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '55', 'type': 'keyword_argument', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'heights'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'heights'}; {'id': '58', 'type': 'keyword_argument', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'bottom'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'bottom'}; {'id': '61', 'type': 'keyword_argument', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'depth'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'depth'}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'layer_p'}; {'id': '67', 'type': 'subscript', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'layer_arg'}; {'id': '69', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'layer_arg'}; {'id': '73', 'type': 'subscript', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'layer_arg'}; {'id': '75', 'type': 'slice', 'children': ['76', '77']}; {'id': '76', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '77', 'type': 'colon', 'children': []}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'pres_int'}; {'id': '81', 'type': 'binary_operator', 'children': ['82', '83'], 'value': '*'}; {'id': '82', 'type': 'float', 'children': [], 'value': '0.5'}; {'id': '83', 'type': '()', 'children': ['84']}; {'id': '84', 'type': 'binary_operator', 'children': ['85', '93'], 'value': '-'}; {'id': '85', 'type': 'binary_operator', 'children': ['86', '92'], 'value': '**'}; {'id': '86', 'type': 'attribute', 'children': ['87', '91']}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'layer_p'}; {'id': '89', 'type': 'unary_operator', 'children': ['90'], 'value': '-'}; {'id': '90', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'magnitude'}; {'id': '92', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '93', 'type': 'binary_operator', 'children': ['94', '99'], 'value': '**'}; {'id': '94', 'type': 'attribute', 'children': ['95', '98']}; {'id': '95', 'type': 'subscript', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'layer_p'}; {'id': '97', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'magnitude'}; {'id': '99', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '100', 'type': 'for_statement', 'children': ['101', '104', '108']}; {'id': '101', 'type': 'pattern_list', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'datavar'}; {'id': '104', 'type': 'call', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '108', 'type': 'block', 'children': ['109', '127']}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'assignment', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'arg_mean'}; {'id': '112', 'type': 'binary_operator', 'children': ['113', '126'], 'value': '/'}; {'id': '113', 'type': 'call', 'children': ['114', '117']}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'trapz'}; {'id': '117', 'type': 'argument_list', 'children': ['118', '123']}; {'id': '118', 'type': 'binary_operator', 'children': ['119', '122'], 'value': '*'}; {'id': '119', 'type': 'subscript', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'layer_arg'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'layer_p'}; {'id': '123', 'type': 'keyword_argument', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'layer_p'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'pres_int'}; {'id': '127', 'type': 'expression_statement', 'children': ['128']}; {'id': '128', 'type': 'call', 'children': ['129', '132']}; {'id': '129', 'type': 'attribute', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '132', 'type': 'argument_list', 'children': ['133']}; {'id': '133', 'type': 'binary_operator', 'children': ['134', '135'], 'value': '*'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'arg_mean'}; {'id': '135', 'type': 'attribute', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'datavar'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'units'}; {'id': '138', 'type': 'return_statement', 'children': ['139']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'ret'}
r"""Calculate pressure-weighted mean of an arbitrary variable through a layer. Layer top and bottom specified in height or pressure. Parameters ---------- pressure : `pint.Quantity` Atmospheric pressure profile *args : `pint.Quantity` Parameters for which the pressure-weighted mean is to be calculated. heights : `pint.Quantity`, optional Heights from sounding. Standard atmosphere heights assumed (if needed) if no heights are given. bottom: `pint.Quantity`, optional The bottom of the layer in either the provided height coordinate or in pressure. Don't provide in meters AGL unless the provided height coordinate is meters AGL. Default is the first observation, assumed to be the surface. depth: `pint.Quantity`, optional The depth of the layer in meters or hPa. Returns ------- `pint.Quantity` u_mean: u-component of layer mean wind. `pint.Quantity` v_mean: v-component of layer mean wind.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'settings'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'dictionary_splat_pattern', 'children': ['5']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '6', 'type': 'block', 'children': ['7', '12', '16']}; {'id': '7', 'type': 'import_from_statement', 'children': ['8', '10']}; {'id': '8', 'type': 'dotted_name', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'pyemma'}; {'id': '10', 'type': 'dotted_name', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'old_settings'}; {'id': '15', 'type': 'dictionary', 'children': []}; {'id': '16', 'type': 'try_statement', 'children': ['17', '47']}; {'id': '17', 'type': 'block', 'children': ['18', '45']}; {'id': '18', 'type': 'for_statement', 'children': ['19', '22', '27']}; {'id': '19', 'type': 'pattern_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'block', 'children': ['28', '38']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '33']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'old_settings'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'setattr'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43', '44']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'yield', 'children': []}; {'id': '47', 'type': 'finally_clause', 'children': ['48']}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'for_statement', 'children': ['50', '53', '58']}; {'id': '50', 'type': 'pattern_list', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'old_settings'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '57', 'type': 'argument_list', 'children': []}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'setattr'}; {'id': '62', 'type': 'argument_list', 'children': ['63', '64', '65']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'v'}
apply given PyEMMA config values temporarily within the given context.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'register'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'g'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '20', '26', '52', '64', '77']}; {'id': '6', 'type': 'assert_statement', 'children': ['7']}; {'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': 'g'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'Generator'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'g'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '25']}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '__generators'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'g'}; {'id': '26', 'type': 'for_statement', 'children': ['27', '28', '38']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'unique'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'g'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'target_types'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '50']}; {'id': '41', 'type': 'attribute', 'children': ['42', '49']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': '__type_to_generators'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '48', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'g'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '55', 'type': 'subscript', 'children': ['56', '63']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62']}; {'id': '61', 'type': 'string', 'children': [], 'value': "'.'"}; {'id': '62', 'type': 'integer', 'children': [], 'value': '100'}; {'id': '63', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'call', 'children': ['66', '75']}; {'id': '66', 'type': 'attribute', 'children': ['67', '74']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': '__generators_for_toolset'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '73', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'g'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'invalidate_extendable_viable_source_target_type_cache'}; {'id': '80', 'type': 'argument_list', 'children': []}
Registers new generator instance 'g'.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'mdaZeros'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '10']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'shap'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '7', 'type': 'attribute', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'mask'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14', '22', '29', '35']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'MaskedDistArray'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'shap'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '28']}; {'id': '24', 'type': 'subscript', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '26', 'type': 'slice', 'children': ['27']}; {'id': '27', 'type': 'colon', 'children': []}; {'id': '28', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'mask'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'mask'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'res'}
Zero constructor for masked distributed array @param shap the shape of the array @param dtype the numpy data type @param mask mask array (or None if all data elements are valid)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'netHours'}; {'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', '12', '17', '55']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is not'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'specifiedHours'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'specifiedHours'}; {'id': '17', 'type': 'elif_clause', 'children': ['18', '31']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '22'], 'value': 'in'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'category'}; {'id': '22', 'type': 'list', 'children': ['23', '27'], 'value': "[getConstant('general__eventStaffCategoryAssistant'),getConstant('general__eventStaffCategoryInstructor')]"}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'getConstant'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'string', 'children': [], 'value': "'general__eventStaffCategoryAssistant'"}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'getConstant'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'string', 'children': [], 'value': "'general__eventStaffCategoryInstructor'"}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'binary_operator', 'children': ['34', '39'], 'value': '-'}; {'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': 'event'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'duration'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'list_comprehension', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sub'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'netHours'}; {'id': '46', 'type': 'for_in_clause', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sub'}; {'id': '48', 'type': 'call', 'children': ['49', '54']}; {'id': '49', 'type': 'attribute', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'replacementFor'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '54', 'type': 'argument_list', 'children': []}; {'id': '55', 'type': 'else_clause', 'children': ['56']}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'return_statement', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'list_comprehension', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'duration'}; {'id': '65', 'type': 'for_in_clause', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '67', 'type': 'call', 'children': ['68', '73']}; {'id': '68', 'type': 'attribute', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'occurrences'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'keyword_argument', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'cancelled'}; {'id': '76', 'type': 'False', 'children': []}
For regular event staff, this is the net hours worked for financial purposes. For Instructors, netHours is caclulated net of any substitutes.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'We'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '24']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'We'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'trapz_loglog'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '19']}; {'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': '_gam'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_nelec'}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '23'], 'value': '*'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_gam'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'mec2'}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'We'}
Total energy in electrons used for the radiative calculation
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'make_pre_build_hook'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'extra_compiler_config_params'}; {'id': '5', 'type': 'block', 'children': ['6', '40']}; {'id': '6', 'type': 'function_definition', 'children': ['7', '8', '11']}; {'id': '7', 'type': 'function_name', 'children': [], 'value': 'pre_build_hook'}; {'id': '8', 'type': 'parameters', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'build_context'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '11', 'type': 'block', 'children': ['12', '23']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'compiler_config'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'CompilerConfig'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21', '22']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'build_context'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'extra_compiler_config_params'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '32']}; {'id': '25', 'type': 'subscript', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'props'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_internal_dict_'}; {'id': '31', 'type': 'string', 'children': [], 'value': "'compiler_config'"}; {'id': '32', 'type': '()', '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': 'target'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'compiler_config'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'as_dict'}; {'id': '39', 'type': 'argument_list', 'children': []}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'pre_build_hook'}
Return a pre-build hook function for C++ builders. When called, during graph build, it computes and stores the compiler-config object on the target, as well as adding it to the internal_dict prop for hashing purposes.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'calculate'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'transaction'}; {'id': '7', 'type': 'block', 'children': ['8', '18']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'cost_per_share'}; {'id': '11', 'type': 'binary_operator', 'children': ['12', '15'], 'value': '*'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'transaction'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'price'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'cost_per_dollar'}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '26'], 'value': '*'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'transaction'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'amount'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'cost_per_share'}
Pay commission based on dollar value of shares.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'tuple'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '26', '36', '46']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '13']}; {'id': '9', 'type': 'pattern_list', 'children': ['10', '11', '12']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '21']}; {'id': '18', 'type': 'pattern_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'divmod'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 't'}; {'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': 'r'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'divmod'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '41']}; {'id': '38', 'type': 'pattern_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'divmod'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'expression_list', 'children': ['48', '49', '50', '51']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'k'}
Converts the linear_index `q` into an chimera_index Parameters ---------- r : int The linear_index node label Returns ------- q : tuple The chimera_index node label corresponding to r
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'read'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'num_bytes'}; {'id': '6', 'type': 'block', 'children': ['7', '13']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'check_pyb'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'try_statement', 'children': ['14', '26']}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '24']}; {'id': '17', 'type': 'attribute', 'children': ['18', '23']}; {'id': '18', 'type': 'attribute', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'pyb'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'serial'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'num_bytes'}; {'id': '26', 'type': 'except_clause', 'children': ['27', '34']}; {'id': '27', 'type': 'tuple', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'serial'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'serialutil'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'SerialException'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '34', 'type': 'block', 'children': ['35', '41']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'raise_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'DeviceError'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '47'], 'value': '%'}; {'id': '46', 'type': 'string', 'children': [], 'value': "'serial port %s closed'"}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'dev_name_short'}
Reads data from the pyboard over the serial port.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'callback'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'timestamp'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'try_statement', 'children': ['10', '87']}; {'id': '10', 'type': 'block', 'children': ['11', '17', '34', '75']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '14', 'type': 'tuple', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'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': 'LOG'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '26']}; {'id': '23', 'type': 'concatenated_string', 'children': ['24', '25']}; {'id': '24', 'type': 'string', 'children': [], 'value': "'RX NOTIFICATION ==>\\nevent_type: %(event)s, '"}; {'id': '25', 'type': 'string', 'children': [], 'value': "'payload: %(payload)s\\n'"}; {'id': '26', 'type': '()', 'children': ['27']}; {'id': '27', 'type': 'dictionary', 'children': ['28', '31']}; {'id': '28', 'type': 'pair', 'children': ['29', '30']}; {'id': '29', 'type': 'string', 'children': [], 'value': "'event'"}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '31', 'type': 'pair', 'children': ['32', '33']}; {'id': '32', 'type': 'string', 'children': [], 'value': "'payload'"}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '34', 'type': 'if_statement', 'children': ['35', '38', '45', '56', '67']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': 'in'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'create'"}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'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': 'pri'}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': '_create_pri'}; {'id': '45', 'type': 'elif_clause', 'children': ['46', '49']}; {'id': '46', 'type': 'comparison_operator', 'children': ['47', '48'], 'value': 'in'}; {'id': '47', 'type': 'string', 'children': [], 'value': "'delete'"}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'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': 'pri'}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': '_delete_pri'}; {'id': '56', 'type': 'elif_clause', 'children': ['57', '60']}; {'id': '57', 'type': 'comparison_operator', 'children': ['58', '59'], 'value': 'in'}; {'id': '58', 'type': 'string', 'children': [], 'value': "'update'"}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'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': 'pri'}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_update_pri'}; {'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': 'pri'}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': '_delete_pri'}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '82']}; {'id': '77', 'type': 'attribute', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': '_pq'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'put'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'tuple', 'children': ['84', '85', '86']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'pri'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'timestamp'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '87', 'type': 'except_clause', 'children': ['88', '92']}; {'id': '88', 'type': 'as_pattern', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '90', 'type': 'as_pattern_target', 'children': ['91']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'LOG'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'exception'}; {'id': '98', 'type': 'argument_list', 'children': ['99', '100']}; {'id': '99', 'type': 'string', 'children': [], 'value': "'Error: %(err)s for event %(event)s'"}; {'id': '100', 'type': 'dictionary', 'children': ['101', '107']}; {'id': '101', 'type': 'pair', 'children': ['102', '103']}; {'id': '102', 'type': 'string', 'children': [], 'value': "'err'"}; {'id': '103', 'type': 'call', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '107', 'type': 'pair', 'children': ['108', '109']}; {'id': '108', 'type': 'string', 'children': [], 'value': "'event'"}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'event_type'}
Callback method for processing events in notification queue. :param timestamp: time the message is received. :param event_type: event type in the notification queue such as identity.project.created, identity.project.deleted. :param payload: Contains information of an event
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'Pop'}; {'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': 'index'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'block', 'children': ['9', '21', '82', '88']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '13']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': '<'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '12', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'augmented_assignment', 'children': ['16', '17'], 'value': '+='}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '25', '58']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '24'], 'value': '=='}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '25', 'type': 'block', 'children': ['26', '34', '45']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'SetRawData'}; {'id': '39', 'type': 'argument_list', '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': 'GetRawData'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'SetRawData'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '57']}; {'id': '52', 'type': 'attribute', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'nested_path'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'GetRawData'}; {'id': '57', 'type': 'argument_list', 'children': []}; {'id': '58', 'type': 'else_clause', 'children': ['59']}; {'id': '59', 'type': 'block', 'children': ['60', '68', '74']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'previous'}; {'id': '63', 'type': 'subscript', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '67'], 'value': '-'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '67', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'previous'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'nested_path'}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'assignment', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'previous'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'nested_path'}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'nested_path'}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'nested_path'}; {'id': '87', 'type': 'None', 'children': []}; {'id': '88', 'type': 'return_statement', 'children': ['89']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'result'}
Removes and returns the pathspec at the specified index.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'writeint2dnorm'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'Intensity'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'Error'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '17', '28']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'whattosave'}; {'id': '13', 'type': 'dictionary', 'children': ['14']}; {'id': '14', 'type': 'pair', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': "'Intensity'"}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'Intensity'}; {'id': '17', 'type': 'if_statement', 'children': ['18', '21']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '20'], 'value': 'is not'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'Error'}; {'id': '20', 'type': 'None', 'children': []}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '27']}; {'id': '24', 'type': 'subscript', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'whattosave'}; {'id': '26', 'type': 'string', 'children': [], 'value': "'Error'"}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'Error'}; {'id': '28', 'type': 'if_statement', 'children': ['29', '39', '49', '71']}; {'id': '29', 'type': 'call', 'children': ['30', '37']}; {'id': '30', 'type': 'attribute', 'children': ['31', '36']}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'string', 'children': [], 'value': "'.NPZ'"}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'savez'}; {'id': '45', 'type': 'argument_list', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '47', 'type': 'dictionary_splat', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'whattosave'}; {'id': '49', 'type': 'elif_clause', 'children': ['50', '60']}; {'id': '50', 'type': 'call', 'children': ['51', '58']}; {'id': '51', 'type': 'attribute', 'children': ['52', '57']}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '56', 'type': 'argument_list', 'children': []}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'string', 'children': [], 'value': "'.MAT'"}; {'id': '60', 'type': 'block', 'children': ['61']}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'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': 'scipy'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'io'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'savemat'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'whattosave'}; {'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', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'savetxt'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'Intensity'}; {'id': '81', 'type': 'if_statement', 'children': ['82', '85']}; {'id': '82', 'type': 'comparison_operator', 'children': ['83', '84'], 'value': 'is not'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'Error'}; {'id': '84', 'type': 'None', 'children': []}; {'id': '85', 'type': 'block', 'children': ['86', '99']}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '91']}; {'id': '88', 'type': 'pattern_list', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '91', 'type': 'call', 'children': ['92', '97']}; {'id': '92', 'type': 'attribute', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'splitext'}; {'id': '97', 'type': 'argument_list', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'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': 'np'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'savetxt'}; {'id': '104', 'type': 'argument_list', 'children': ['105', '110']}; {'id': '105', 'type': 'binary_operator', 'children': ['106', '109'], 'value': '+'}; {'id': '106', 'type': 'binary_operator', 'children': ['107', '108'], 'value': '+'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '108', 'type': 'string', 'children': [], 'value': "'_error'"}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'Error'}
Save the intensity and error matrices to a file Inputs ------ filename: string the name of the file Intensity: np.ndarray the intensity matrix Error: np.ndarray, optional the error matrix (can be ``None``, if no error matrix is to be saved) Output ------ None
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'tokenize_by_number'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '95']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'find_number'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '13', 'type': 'if_statement', 'children': ['14', '17', '21']}; {'id': '14', 'type': 'comparison_operator', 'children': ['15', '16'], 'value': '=='}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'list', 'children': ['20'], 'value': '[ s ]'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '21', 'type': 'else_clause', 'children': ['22']}; {'id': '22', 'type': 'block', 'children': ['23', '27', '48', '67', '93']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '26', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '27', 'type': 'if_statement', 'children': ['28', '33']}; {'id': '28', 'type': 'comparison_operator', 'children': ['29', '32'], 'value': '>'}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '32', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'subscript', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '42', 'type': 'slice', 'children': ['43', '44', '45']}; {'id': '43', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '44', 'type': 'colon', 'children': []}; {'id': '45', 'type': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'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': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '59', 'type': 'slice', 'children': ['60', '63', '64']}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '63', 'type': 'colon', 'children': []}; {'id': '64', 'type': 'subscript', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '66', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '67', 'type': 'if_statement', 'children': ['68', '76']}; {'id': '68', 'type': 'comparison_operator', 'children': ['69', '72'], 'value': '<'}; {'id': '69', 'type': 'subscript', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '76', 'type': 'block', 'children': ['77']}; {'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': 'tokens'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'tokenize_by_number'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '88', 'type': 'slice', 'children': ['89', '92']}; {'id': '89', 'type': 'subscript', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '91', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '92', 'type': 'colon', 'children': []}; {'id': '93', 'type': 'return_statement', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '95', 'type': 'assert_statement', 'children': ['96']}; {'id': '96', 'type': 'False', 'children': []}
splits a string into a list of tokens each is either a string containing no numbers or a float
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reset'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '15', '21', '34', '43', '49', '57']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': '"Close the current failed connection and prepare for a new one"'}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'string', 'children': [], 'value': '"resetting client"'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'rpc_client'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_rpc_client'}; {'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': '_addrs'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'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': '_peer'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'addr'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '__init__'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '_addrs'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': '_rpc_client'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'rpc_client'}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '56']}; {'id': '51', 'type': 'attribute', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '_dispatcher'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'rpc_client'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'rpc_client'}; {'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': 'rpc_client'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': '_client'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'weakref'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'self'}
Close the current failed connection and prepare for a new one
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'config_delete'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '5', 'type': 'block', 'children': ['6', '26', '36']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'fapi'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'delete_workspace_config'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '17', '20', '23']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'project'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'workspace'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'config'}; {'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': 'fapi'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_check_response_code'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '33', 'type': 'list', 'children': ['34', '35'], 'value': '[200,204]'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '200'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '204'}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'conditional_expression', 'children': ['38', '41', '44'], 'value': 'if'}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '44', 'type': 'None', 'children': []}
Remove a method config from a workspace
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'remove'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'coll'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '6', 'type': 'block', 'children': ['7', '13']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'coll_class'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'coll'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'coll_class'}; {'id': '16', 'type': 'generator_expression', 'children': ['17', '18', '21']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '18', 'type': 'for_in_clause', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'coll'}; {'id': '21', 'type': 'if_clause', 'children': ['22']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '24'], 'value': '!='}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'value'}
Remove all the occurrences of a given value :param coll: a collection :param value: the value to remove :returns: a list >>> data = ('NA', 0, 1, 'NA', 1, 2, 3, 'NA', 5) >>> remove(data, 'NA') (0, 1, 1, 2, 3, 5)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'deactivate'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'node_id'}; {'id': '6', 'type': 'block', 'children': ['7', '15']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'node'}; {'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': 'node_list'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'node_id'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '22']}; {'id': '17', 'type': 'subscript', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'node_list'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'node_id'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_replace'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'active'}; {'id': '29', 'type': 'False', 'children': []}
Deactivate the node identified by node_id. Deactivates the node corresponding to node_id, which means that it can never be the output of a nearest_point query. Note: The node is not removed from the tree, its data is steel available. Args: node_id (int): The node identifier (given to the user after its insertion).
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '__set_document_signals'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '23', '38', '55']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '17']}; {'id': '8', 'type': 'attribute', 'children': ['9', '16']}; {'id': '9', 'type': 'attribute', 'children': ['10', '15']}; {'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': 'document'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'contentsChanged'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'connect'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'attribute', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'contents_changed'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'emit'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '34']}; {'id': '25', 'type': 'attribute', 'children': ['26', '33']}; {'id': '26', 'type': 'attribute', 'children': ['27', '32']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'document'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'contentsChanged'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'connect'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '__document__contents_changed'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '49']}; {'id': '40', 'type': 'attribute', 'children': ['41', '48']}; {'id': '41', 'type': 'attribute', 'children': ['42', '47']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'document'}; {'id': '46', 'type': 'argument_list', 'children': []}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'modificationChanged'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'connect'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'attribute', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'modification_changed'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'emit'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '66']}; {'id': '57', 'type': 'attribute', 'children': ['58', '65']}; {'id': '58', 'type': 'attribute', 'children': ['59', '64']}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'document'}; {'id': '63', 'type': 'argument_list', 'children': []}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'modificationChanged'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'connect'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': '__document__modification_changed'}
Connects the editor document signals.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'root'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'reference_labels'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'estimated_labels'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '27', '37', '51', '68']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'validate'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'reference_labels'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'estimated_labels'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '18']}; {'id': '15', 'type': 'pattern_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ref_roots'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'ref_semitones'}; {'id': '18', 'type': 'subscript', 'children': ['19', '24']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'encode_many'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'reference_labels'}; {'id': '23', 'type': 'False', 'children': []}; {'id': '24', 'type': 'slice', 'children': ['25', '26']}; {'id': '25', 'type': 'colon', 'children': []}; {'id': '26', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'est_roots'}; {'id': '30', 'type': 'subscript', 'children': ['31', '36']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'encode_many'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'estimated_labels'}; {'id': '35', 'type': 'False', 'children': []}; {'id': '36', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'comparison_scores'}; {'id': '40', 'type': 'call', 'children': ['41', '47']}; {'id': '41', 'type': 'attribute', 'children': ['42', '46']}; {'id': '42', 'type': '()', 'children': ['43']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': '=='}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'ref_roots'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'est_roots'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '66']}; {'id': '53', 'type': 'subscript', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'comparison_scores'}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'any'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '63']}; {'id': '60', 'type': 'comparison_operator', 'children': ['61', '62'], 'value': '<'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'ref_semitones'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '63', 'type': 'keyword_argument', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '65', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '66', 'type': 'unary_operator', 'children': ['67'], 'value': '-'}; {'id': '67', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '68', 'type': 'return_statement', 'children': ['69']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'comparison_scores'}
Compare chords according to roots. Examples -------- >>> (ref_intervals, ... ref_labels) = mir_eval.io.load_labeled_intervals('ref.lab') >>> (est_intervals, ... est_labels) = mir_eval.io.load_labeled_intervals('est.lab') >>> est_intervals, est_labels = mir_eval.util.adjust_intervals( ... est_intervals, est_labels, ref_intervals.min(), ... ref_intervals.max(), mir_eval.chord.NO_CHORD, ... mir_eval.chord.NO_CHORD) >>> (intervals, ... ref_labels, ... est_labels) = mir_eval.util.merge_labeled_intervals( ... ref_intervals, ref_labels, est_intervals, est_labels) >>> durations = mir_eval.util.intervals_to_durations(intervals) >>> comparisons = mir_eval.chord.root(ref_labels, est_labels) >>> score = mir_eval.chord.weighted_accuracy(comparisons, durations) Parameters ---------- reference_labels : list, len=n Reference chord labels to score against. estimated_labels : list, len=n Estimated chord labels to score against. Returns ------- comparison_scores : np.ndarray, shape=(n,), dtype=float Comparison scores, in [0.0, 1.0], or -1 if the comparison is out of gamut.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'is_deletion'}; {'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': 'boolean_operator', 'children': ['8', '22'], 'value': 'and'}; {'id': '8', 'type': '()', 'children': ['9']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '16'], 'value': '>'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'len'}; {'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': 'alt'}; {'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': 'ref'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'alt'}
Does this variant represent the deletion of nucleotides from the reference genome?
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'query_by_account'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'account_id'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'end_time'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'start_time'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13', '17', '21', '25', '31', '42', '53', '74']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '16', 'type': 'dictionary', 'children': []}; {'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': []}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '24', 'type': 'dictionary', 'children': []}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '30']}; {'id': '27', 'type': 'subscript', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '29', 'type': 'string', 'children': [], 'value': '"account_id"'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'account_id'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '35']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': 'is not'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'start_time'}; {'id': '34', 'type': 'None', 'children': []}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '41']}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '40', 'type': 'string', 'children': [], 'value': '"start_time"'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'start_time'}; {'id': '42', 'type': 'if_statement', 'children': ['43', '46']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': 'is not'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'end_time'}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '52']}; {'id': '49', 'type': 'subscript', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '51', 'type': 'string', 'children': [], 'value': '"end_time"'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'end_time'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '60']}; {'id': '55', 'type': 'attribute', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': '"GET /api/v1/audit/authentication/accounts/{account_id} with query params: {params} and form data: {data}"'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '69', '72']}; {'id': '66', 'type': 'keyword_argument', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '69', 'type': 'keyword_argument', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '72', 'type': 'dictionary_splat', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '74', 'type': 'return_statement', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'generic_request'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '81', '88', '91', '94']}; {'id': '80', 'type': 'string', 'children': [], 'value': '"GET"'}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'string', 'children': [], 'value': '"/api/v1/audit/authentication/accounts/{account_id}"'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'dictionary_splat', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '88', 'type': 'keyword_argument', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '91', 'type': 'keyword_argument', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '94', 'type': 'keyword_argument', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'no_data'}; {'id': '96', 'type': 'True', 'children': []}
Query by account. List authentication events for a given account.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'clear_build_directory'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '17', '26']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'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': 'build_directory'}; {'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': 'shutil'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'rmtree'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'build_directory'}; {'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': 'os'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'makedirs'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'build_directory'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'st_mode'}
Clear the build directory where pip unpacks the source distribution archives.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_merge'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '6', 'type': 'block', 'children': ['7', '21', '29', '33', '93', '117']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '18']}; {'id': '8', 'type': 'boolean_operator', 'children': ['9', '12'], 'value': 'and'}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': 'is not'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'not_operator', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '26']}; {'id': '22', 'type': 'not_operator', 'children': ['23']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_pairs'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'dictionary', 'children': []}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'collected'}; {'id': '32', 'type': 'dictionary', 'children': []}; {'id': '33', 'type': 'for_statement', 'children': ['34', '37', '40']}; {'id': '34', 'type': 'pattern_list', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'k_validator'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'v_validator'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '_pairs'}; {'id': '40', 'type': 'block', 'children': ['41', '50', '56', '74', '83']}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'k_default'}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'k_validator'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'get_default_for'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'None', 'children': []}; {'id': '50', 'type': 'if_statement', 'children': ['51', '54']}; {'id': '51', 'type': 'comparison_operator', 'children': ['52', '53'], 'value': 'is'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'k_default'}; {'id': '53', 'type': 'None', 'children': []}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'continue_statement', 'children': []}; {'id': '56', 'type': 'if_statement', 'children': ['57', '58', '68']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'value'}; {'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': 'v_for_this_k'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'k_default'}; {'id': '68', 'type': 'else_clause', 'children': ['69']}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'v_for_this_k'}; {'id': '73', 'type': 'None', 'children': []}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'assignment', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'v_default'}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'v_validator'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'get_default_for'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'v_for_this_k'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'collected'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'dictionary', 'children': ['90']}; {'id': '90', 'type': 'pair', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'k_default'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'v_default'}; {'id': '93', 'type': 'if_statement', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '95', 'type': 'block', 'children': ['96']}; {'id': '96', 'type': 'for_statement', 'children': ['97', '100', '105']}; {'id': '97', 'type': 'pattern_list', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '100', 'type': 'call', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '104', 'type': 'argument_list', 'children': []}; {'id': '105', 'type': 'block', 'children': ['106']}; {'id': '106', 'type': 'if_statement', 'children': ['107', '110']}; {'id': '107', 'type': 'comparison_operator', 'children': ['108', '109'], 'value': 'not in'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'collected'}; {'id': '110', 'type': 'block', 'children': ['111']}; {'id': '111', 'type': 'expression_statement', 'children': ['112']}; {'id': '112', 'type': 'assignment', 'children': ['113', '116']}; {'id': '113', 'type': 'subscript', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'collected'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '117', 'type': 'return_statement', 'children': ['118']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'collected'}
Returns a dictionary based on `value` with each value recursively merged with `spec`.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'etcd'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7', '10']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'DEFAULT_URL'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'mock'}; {'id': '9', 'type': 'False', 'children': []}; {'id': '10', 'type': 'dictionary_splat_pattern', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '12', 'type': 'block', 'children': ['13', '40']}; {'id': '13', 'type': 'if_statement', 'children': ['14', '15', '27']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'mock'}; {'id': '15', 'type': 'block', 'children': ['16', '23']}; {'id': '16', 'type': 'import_from_statement', 'children': ['17', '21']}; {'id': '17', 'type': 'dotted_name', 'children': ['18', '19', '20']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'etc'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'adapters'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'mock'}; {'id': '21', 'type': 'dotted_name', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'MockAdapter'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'adapter_class'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'MockAdapter'}; {'id': '27', 'type': 'else_clause', 'children': ['28']}; {'id': '28', 'type': 'block', 'children': ['29', '36']}; {'id': '29', 'type': 'import_from_statement', 'children': ['30', '34']}; {'id': '30', 'type': 'dotted_name', 'children': ['31', '32', '33']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'etc'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'adapters'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'etcd'}; {'id': '34', 'type': 'dotted_name', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'EtcdAdapter'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'adapter_class'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'EtcdAdapter'}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'Client'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'adapter_class'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '48', 'type': 'dictionary_splat', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
Creates an etcd client.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_by_name'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'opname'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'operators'}; {'id': '6', 'type': 'block', 'children': ['7', '21', '59', '65']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'ret_op_classes'}; {'id': '10', 'type': 'list_comprehension', 'children': ['11', '12', '15']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '12', 'type': 'for_in_clause', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'operators'}; {'id': '15', 'type': 'if_clause', 'children': ['16']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '20'], 'value': '=='}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'opname'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '28', '39']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '27'], 'value': '=='}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'ret_op_classes'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'raise_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'string', 'children': [], 'value': "'Cannot found operator {} in operator dictionary'"}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'opname'}; {'id': '39', 'type': 'elif_clause', 'children': ['40', '46']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '45'], 'value': '>'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'ret_op_classes'}; {'id': '45', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'raise_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '57']}; {'id': '52', 'type': 'attribute', 'children': ['53', '56']}; {'id': '53', 'type': 'concatenated_string', 'children': ['54', '55']}; {'id': '54', 'type': 'string', 'children': [], 'value': "'Found duplicate operators {} in operator dictionary. Please check '"}; {'id': '55', 'type': 'string', 'children': [], 'value': "'your dictionary file.'"}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'opname'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'ret_op_class'}; {'id': '62', 'type': 'subscript', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'ret_op_classes'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'ret_op_class'}
Return operator class instance by name. Parameters ---------- opname: str Name of the sklearn class that belongs to a TPOT operator operators: list List of operator classes from operator library Returns ------- ret_op_class: class An operator class
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'is_iterable'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'maybe_iter'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'unless'}; {'id': '7', 'type': 'tuple', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'string_types'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '10', 'type': 'block', 'children': ['11', '23']}; {'id': '11', 'type': 'try_statement', 'children': ['12', '18']}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'iter'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'maybe_iter'}; {'id': '18', 'type': 'except_clause', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'return_statement', 'children': ['22']}; {'id': '22', 'type': 'False', 'children': []}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'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': 'maybe_iter'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'unless'}
Return whether ``maybe_iter`` is an iterable, unless it's an instance of one of the base class, or tuple of base classes, given in ``unless``. Example:: >>> is_iterable('foo') False >>> is_iterable(['foo']) True >>> is_iterable(['foo'], unless=list) False >>> is_iterable(xrange(5)) True
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'turn_on_nightlight'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '18', '26', '32', '57']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'helpers'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'req_body'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'manager'}; {'id': '17', 'type': 'string', 'children': [], 'value': "'devicestatus'"}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '23']}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'uuid'"}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'uuid'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '31']}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'mode'"}; {'id': '31', 'type': 'string', 'children': [], 'value': "'auto'"}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '37']}; {'id': '34', 'type': 'pattern_list', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'helpers'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'call_api'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43', '44', '54']}; {'id': '42', 'type': 'string', 'children': [], 'value': "'/15a/v1/device/nightlightstatus'"}; {'id': '43', 'type': 'string', 'children': [], 'value': "'put'"}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'helpers'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'req_headers'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'manager'}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '57', 'type': 'return_statement', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'helpers'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'check_response'}; {'id': '62', 'type': 'argument_list', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '64', 'type': 'string', 'children': [], 'value': "'15a_ntlight'"}
Turn on nightlight
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_assignable_repository_ids'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'repository_id'}; {'id': '6', 'type': 'block', 'children': ['7', '19', '32', '40', '44', '59']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'mgr'}; {'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': '_get_provider_manager'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': "'REPOSITORY'"}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'local'}; {'id': '18', 'type': 'True', 'children': []}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'mgr'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'get_repository_lookup_session'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'proxy'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_proxy'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'repositories'}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'get_repositories'}; {'id': '39', 'type': 'argument_list', 'children': []}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'id_list'}; {'id': '43', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '44', 'type': 'for_statement', 'children': ['45', '46', '47']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'repository'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'repositories'}; {'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': 'id_list'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'repository'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'get_id'}; {'id': '58', 'type': 'argument_list', 'children': []}; {'id': '59', 'type': 'return_statement', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'IdList'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'id_list'}
Gets a list of repositories including and under the given repository node in which any asset can be assigned. arg: repository_id (osid.id.Id): the ``Id`` of the ``Repository`` return: (osid.id.IdList) - list of assignable repository ``Ids`` raise: NullArgument - ``repository_id`` is ``null`` raise: OperationFailed - unable to complete request *compliance: mandatory -- This method must be implemented.*
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_populate_comptparms'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'img_array'}; {'id': '6', 'type': 'block', 'children': ['7', '26', '35', '68', '163']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '15', '20']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': '=='}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'img_array'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'uint8'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'comp_prec'}; {'id': '19', 'type': 'integer', 'children': [], 'value': '8'}; {'id': '20', 'type': 'else_clause', 'children': ['21']}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'comp_prec'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '16'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '32']}; {'id': '28', 'type': 'pattern_list', 'children': ['29', '30', '31']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'numrows'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'numcols'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'num_comps'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'img_array'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '35', 'type': 'if_statement', 'children': ['36', '43', '55']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '42'], 'value': '=='}; {'id': '37', 'type': 'subscript', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'openjpeg_version_tuple'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '1'}; {'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': 'comptparms'}; {'id': '47', 'type': 'call', 'children': ['48', '54']}; {'id': '48', 'type': '()', 'children': ['49']}; {'id': '49', 'type': 'binary_operator', 'children': ['50', '53'], 'value': '*'}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'opj'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'ImageComptParmType'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'num_comps'}; {'id': '54', 'type': 'argument_list', 'children': []}; {'id': '55', 'type': 'else_clause', 'children': ['56']}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '60', 'type': 'call', 'children': ['61', '67']}; {'id': '61', 'type': '()', 'children': ['62']}; {'id': '62', 'type': 'binary_operator', 'children': ['63', '66'], 'value': '*'}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'opj2'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'ImageComptParmType'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'num_comps'}; {'id': '67', 'type': 'argument_list', 'children': []}; {'id': '68', 'type': 'for_statement', 'children': ['69', '70', '74']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'num_comps'}; {'id': '74', 'type': 'block', 'children': ['75', '87', '99', '107', '115', '127', '139', '147', '155']}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '82']}; {'id': '77', 'type': 'attribute', 'children': ['78', '81']}; {'id': '78', 'type': 'subscript', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'dx'}; {'id': '82', 'type': 'attribute', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': '_cparams'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'subsampling_dx'}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'assignment', 'children': ['89', '94']}; {'id': '89', 'type': 'attribute', 'children': ['90', '93']}; {'id': '90', 'type': 'subscript', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'dy'}; {'id': '94', 'type': 'attribute', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': '_cparams'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'subsampling_dy'}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'assignment', 'children': ['101', '106']}; {'id': '101', 'type': 'attribute', 'children': ['102', '105']}; {'id': '102', 'type': 'subscript', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'w'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'numcols'}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'assignment', 'children': ['109', '114']}; {'id': '109', 'type': 'attribute', 'children': ['110', '113']}; {'id': '110', 'type': 'subscript', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'numrows'}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'assignment', 'children': ['117', '122']}; {'id': '117', 'type': 'attribute', 'children': ['118', '121']}; {'id': '118', 'type': 'subscript', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '122', 'type': 'attribute', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': '_cparams'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'image_offset_x0'}; {'id': '127', 'type': 'expression_statement', 'children': ['128']}; {'id': '128', 'type': 'assignment', 'children': ['129', '134']}; {'id': '129', 'type': 'attribute', 'children': ['130', '133']}; {'id': '130', 'type': 'subscript', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '134', 'type': 'attribute', 'children': ['135', '138']}; {'id': '135', 'type': 'attribute', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': '_cparams'}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'image_offset_y0'}; {'id': '139', 'type': 'expression_statement', 'children': ['140']}; {'id': '140', 'type': 'assignment', 'children': ['141', '146']}; {'id': '141', 'type': 'attribute', 'children': ['142', '145']}; {'id': '142', 'type': 'subscript', 'children': ['143', '144']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'prec'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'comp_prec'}; {'id': '147', 'type': 'expression_statement', 'children': ['148']}; {'id': '148', 'type': 'assignment', 'children': ['149', '154']}; {'id': '149', 'type': 'attribute', 'children': ['150', '153']}; {'id': '150', 'type': 'subscript', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'bpp'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'comp_prec'}; {'id': '155', 'type': 'expression_statement', 'children': ['156']}; {'id': '156', 'type': 'assignment', 'children': ['157', '162']}; {'id': '157', 'type': 'attribute', 'children': ['158', '161']}; {'id': '158', 'type': 'subscript', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'comptparms'}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'sgnd'}; {'id': '162', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '163', 'type': 'expression_statement', 'children': ['164']}; {'id': '164', 'type': 'assignment', 'children': ['165', '168']}; {'id': '165', 'type': 'attribute', 'children': ['166', '167']}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '167', 'type': 'identifier', 'children': [], 'value': '_comptparms'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'comptparms'}
Instantiate and populate comptparms structure. This structure defines the image components. Parameters ---------- img_array : ndarray Image data to be written to file.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_parse_xml'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'xml'}; {'id': '6', 'type': 'block', 'children': ['7', '13']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'vms'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '12']}; {'id': '11', 'type': 'string', 'children': [], 'value': '"Parsing <static> XML child tag."'}; {'id': '12', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '13', 'type': 'for_statement', 'children': ['14', '15', '16']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'xml'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'if_statement', 'children': ['18', '29']}; {'id': '18', 'type': 'boolean_operator', 'children': ['19', '24'], 'value': 'and'}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '21'], 'value': 'in'}; {'id': '20', 'type': 'string', 'children': [], 'value': '"path"'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'attrib'}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '26'], 'value': 'in'}; {'id': '25', 'type': 'string', 'children': [], 'value': '"target"'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'attrib'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'if_statement', 'children': ['31', '36', '60']}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '35'], 'value': '=='}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"file"'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'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': 'files'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'dictionary', 'children': ['46', '53']}; {'id': '46', 'type': 'pair', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': '"source"'}; {'id': '48', 'type': 'subscript', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'attrib'}; {'id': '52', 'type': 'string', 'children': [], 'value': '"path"'}; {'id': '53', 'type': 'pair', 'children': ['54', '55']}; {'id': '54', 'type': 'string', 'children': [], 'value': '"target"'}; {'id': '55', 'type': 'subscript', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'attrib'}; {'id': '59', 'type': 'string', 'children': [], 'value': '"target"'}; {'id': '60', 'type': 'elif_clause', 'children': ['61', '66']}; {'id': '61', 'type': 'comparison_operator', 'children': ['62', '65'], 'value': '=='}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '65', 'type': 'string', 'children': [], 'value': '"folder"'}; {'id': '66', 'type': 'block', 'children': ['67']}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '74']}; {'id': '69', 'type': 'attribute', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'folders'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'dictionary', 'children': ['76', '83']}; {'id': '76', 'type': 'pair', 'children': ['77', '78']}; {'id': '77', 'type': 'string', 'children': [], 'value': '"source"'}; {'id': '78', 'type': 'subscript', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'attrib'}; {'id': '82', 'type': 'string', 'children': [], 'value': '"path"'}; {'id': '83', 'type': 'pair', 'children': ['84', '85']}; {'id': '84', 'type': 'string', 'children': [], 'value': '"target"'}; {'id': '85', 'type': 'subscript', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'attrib'}; {'id': '89', 'type': 'string', 'children': [], 'value': '"target"'}
Extracts objects representing and interacting with the settings in the xml tag.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'execute_scenario'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'scenario'}; {'id': '5', 'type': 'block', 'children': ['6', '20']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '8', '11']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'action'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'scenario'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'execute_subcommand'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'scenario'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'action'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '26']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '23'], 'value': 'in'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'destroy'"}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'scenario'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'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': 'scenario'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'prune'}; {'id': '32', 'type': 'argument_list', 'children': []}
Execute each command in the given scenario's configured sequence. :param scenario: The scenario to execute. :returns: None
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'pick_tile_size'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'seg_size'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'data_lengths'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'valid_chunks'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'valid_lengths'}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '17', '29']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '16'], 'value': '=='}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'valid_lengths'}; {'id': '16', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'expression_list', 'children': ['20', '23', '26']}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'data_lengths'}; {'id': '22', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '23', 'type': 'subscript', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'valid_chunks'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'valid_lengths'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '29', 'type': 'else_clause', 'children': ['30']}; {'id': '30', 'type': 'block', 'children': ['31', '37', '52', '84']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'target_size'}; {'id': '34', 'type': 'binary_operator', 'children': ['35', '36'], 'value': '/'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'seg_size'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '42']}; {'id': '39', 'type': 'pattern_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'pick'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'pick_diff'}; {'id': '42', 'type': 'expression_list', 'children': ['43', '44']}; {'id': '43', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'binary_operator', 'children': ['48', '51'], 'value': '-'}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'valid_lengths'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'target_size'}; {'id': '52', 'type': 'for_statement', 'children': ['53', '56', '60']}; {'id': '53', 'type': 'pattern_list', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'valid_lengths'}; {'id': '60', 'type': 'block', 'children': ['61']}; {'id': '61', 'type': 'if_statement', 'children': ['62', '70']}; {'id': '62', 'type': 'comparison_operator', 'children': ['63', '69'], 'value': '<'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'binary_operator', 'children': ['67', '68'], 'value': '-'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'target_size'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'pick_diff'}; {'id': '70', 'type': 'block', 'children': ['71']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '76']}; {'id': '73', 'type': 'pattern_list', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'pick'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'pick_diff'}; {'id': '76', 'type': 'expression_list', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'binary_operator', 'children': ['82', '83'], 'value': '-'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'target_size'}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'expression_list', 'children': ['86', '89', '92']}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'data_lengths'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'pick'}; {'id': '89', 'type': 'subscript', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'valid_chunks'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'pick'}; {'id': '92', 'type': 'subscript', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'valid_lengths'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'pick'}
Choose job tiles size based on science segment length
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'is_refreshable_url'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '22', '40']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'backend_session'}; {'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': 'request'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'BACKEND_SESSION_KEY'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'is_oidc_enabled'}; {'id': '21', 'type': 'True', 'children': []}; {'id': '22', 'type': 'if_statement', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'backend_session'}; {'id': '24', 'type': 'block', 'children': ['25', '32']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'auth_backend'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'import_string'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'backend_session'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'is_oidc_enabled'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'issubclass'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'auth_backend'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'OIDCAuthenticationBackend'}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': '()', 'children': ['42']}; {'id': '42', 'type': 'boolean_operator', 'children': ['43', '57'], 'value': 'and'}; {'id': '43', 'type': 'boolean_operator', 'children': ['44', '56'], 'value': 'and'}; {'id': '44', 'type': 'boolean_operator', 'children': ['45', '50'], 'value': 'and'}; {'id': '45', 'type': 'comparison_operator', 'children': ['46', '49'], 'value': '=='}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '49', 'type': 'string', 'children': [], 'value': "'GET'"}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'is_authenticated'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'is_oidc_enabled'}; {'id': '57', 'type': 'comparison_operator', 'children': ['58', '61'], 'value': 'not in'}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'exempt_urls'}
Takes a request and returns whether it triggers a refresh examination :arg HttpRequest request: :returns: boolean
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'broadcast'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'channel'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '8', 'type': 'block', 'children': ['9', '21']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'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': '_server'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'serialize_event'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '21', 'type': 'for_statement', 'children': ['22', '23', '32']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'socket_id'}; {'id': '23', 'type': 'call', 'children': ['24', '29']}; {'id': '24', 'type': 'attribute', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'subscriptions'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'channel'}; {'id': '31', 'type': 'tuple', 'children': []}; {'id': '32', 'type': 'block', 'children': ['33', '46']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'rv'}; {'id': '36', 'type': 'call', 'children': ['37', '44']}; {'id': '37', 'type': 'attribute', 'children': ['38', '43']}; {'id': '38', 'type': 'attribute', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_server'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sockets'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'socket_id'}; {'id': '46', 'type': 'if_statement', 'children': ['47', '50']}; {'id': '47', 'type': 'comparison_operator', 'children': ['48', '49'], 'value': 'is not'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'rv'}; {'id': '49', 'type': 'None', 'children': []}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'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': 'rv'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'send'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'payload'}
Broadcasts an event to all sockets listening on a channel.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'configure'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'dictionary_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '7', 'type': 'block', 'children': ['8', '12', '35', '54', '64', '88']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '11', 'type': 'dictionary', 'children': []}; {'id': '12', 'type': 'for_statement', 'children': ['13', '14', '18']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '14', 'type': 'tuple', 'children': ['15', '16', '17']}; {'id': '15', 'type': 'string', 'children': [], 'value': "'prefix'"}; {'id': '16', 'type': 'string', 'children': [], 'value': "'handle_uniqueness'"}; {'id': '17', 'type': 'string', 'children': [], 'value': "'key'"}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'if_statement', 'children': ['20', '23']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '22'], 'value': 'in'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '29']}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '35', 'type': 'if_statement', 'children': ['36', '39']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '38'], 'value': 'in'}; {'id': '37', 'type': 'string', 'children': [], 'value': "'transform'"}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '45']}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '44', 'type': 'string', 'children': [], 'value': "'transform'"}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'staticmethod'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'string', 'children': [], 'value': "'transform'"}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '63']}; {'id': '62', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '63', 'type': 'None', 'children': []}; {'id': '64', 'type': 'if_statement', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '66', 'type': 'block', 'children': ['67']}; {'id': '67', 'type': 'raise_statement', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'binary_operator', 'children': ['72', '73'], 'value': '%'}; {'id': '72', 'type': 'string', 'children': [], 'value': "'%s.configure only accepts these named arguments: %s'"}; {'id': '73', 'type': 'tuple', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'string', 'children': [], 'value': "', '"}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'tuple', 'children': ['83', '84', '85', '86', '87']}; {'id': '83', 'type': 'string', 'children': [], 'value': "'prefix'"}; {'id': '84', 'type': 'string', 'children': [], 'value': "'transform'"}; {'id': '85', 'type': 'string', 'children': [], 'value': "'handle_uniqueness'"}; {'id': '86', 'type': 'string', 'children': [], 'value': "'key'"}; {'id': '87', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '88', 'type': 'return_statement', 'children': ['89']}; {'id': '89', 'type': 'call', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '91', 'type': 'argument_list', 'children': ['92', '104', '106']}; {'id': '92', 'type': 'call', 'children': ['93', '98']}; {'id': '93', 'type': '()', 'children': ['94']}; {'id': '94', 'type': 'conditional_expression', 'children': ['95', '96', '97'], 'value': 'if'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'PY3'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'oldstr'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'boolean_operator', 'children': ['100', '101'], 'value': 'or'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '104', 'type': 'tuple', 'children': ['105']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'attrs'}
Create a new index class with the given info This allow to avoid creating a new class when only few changes are to be made Parameters ---------- kwargs: dict prefix: str The string part to use in the collection, before the normal suffix. For example `foo` to filter on `myfiled__foo__eq=` This prefix will also be used by the indexes to store the data at a different place than the same index without prefix. transform: callable A function that will transform the value to be used as the reference for the index, before the call to `normalize_value`. If can be extraction of a date, or any computation. The filter in the collection will then have to use a transformed value, for example `birth_date__year=1976` if the transform take a date and transform it to a year. handle_uniqueness: bool To make the index handle or not the uniqueness key: str To override the key used by the index. Two indexes for the same field of the same type must not have the same key or data will be saved at the same place. Note that the default key is None for `EqualIndex`, `text-range` for `TextRangeIndex` and `number-range` for `NumberRangeIndex` name: str The name of the new multi-index class. If not set, it will be the same as the current class Returns ------- type A new class based on `cls`, with the new attributes set
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_forbidden'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '7', 'type': 'block', 'children': ['8', '23', '71']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '14']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '13'], 'value': '=='}; {'id': '10', 'type': 'subscript', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '12', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '13', 'type': 'string', 'children': [], 'value': "'/'"}; {'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': 'path'}; {'id': '18', 'type': 'subscript', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '20', 'type': 'slice', 'children': ['21', '22']}; {'id': '21', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '22', 'type': 'colon', 'children': []}; {'id': '23', 'type': 'for_statement', 'children': ['24', '25', '31']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'reversed'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'rules'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'if_statement', 'children': ['33', '42', '57']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '39']}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'string_types'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'if_statement', 'children': ['44', '51']}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'fnmatch'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'return_statement', 'children': ['53']}; {'id': '53', 'type': 'not_operator', 'children': ['54']}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '56', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '57', 'type': 'elif_clause', 'children': ['58', '65']}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'subscript', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '61', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '62', 'type': 'argument_list', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'return_statement', 'children': ['67']}; {'id': '67', 'type': 'not_operator', 'children': ['68']}; {'id': '68', 'type': 'subscript', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '70', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '71', 'type': 'return_statement', 'children': ['72']}; {'id': '72', 'type': 'True', 'children': []}
Is a stat forbidden? Goes through the rules to find one that applies. Chronologically newer rules are higher-precedence than older ones. If no rule applies, the stat is forbidden by default.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'parse_attribute_map'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'filenames'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '14', '64']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'forward'}; {'id': '9', 'type': 'dictionary', 'children': []}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'backward'}; {'id': '13', 'type': 'dictionary', 'children': []}; {'id': '14', 'type': 'for_statement', 'children': ['15', '16', '17']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'filenames'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'with_statement', 'children': ['19', '28']}; {'id': '19', 'type': 'with_clause', 'children': ['20']}; {'id': '20', 'type': 'with_item', 'children': ['21']}; {'id': '21', 'type': 'as_pattern', 'children': ['22', '26']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '26', 'type': 'as_pattern_target', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'for_statement', 'children': ['30', '31', '32']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '32', 'type': 'block', 'children': ['33', '48', '56']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '39']}; {'id': '35', 'type': 'tuple_pattern', 'children': ['36', '37', '38']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'friendly_name'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'name_format'}; {'id': '39', 'type': 'call', 'children': ['40', '47']}; {'id': '40', 'type': 'attribute', 'children': ['41', '46']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '45', 'type': 'argument_list', 'children': []}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '55']}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'forward'}; {'id': '52', 'type': 'tuple', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'name_format'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'friendly_name'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '61']}; {'id': '58', 'type': 'subscript', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'backward'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'friendly_name'}; {'id': '61', 'type': 'tuple', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'name_format'}; {'id': '64', 'type': 'return_statement', 'children': ['65']}; {'id': '65', 'type': 'expression_list', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'forward'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'backward'}
Expects a file with each line being composed of the oid for the attribute exactly one space, a user friendly name of the attribute and then the type specification of the name. :param filenames: List of filenames on mapfiles. :return: A 2-tuple, one dictionary with the oid as keys and the friendly names as values, the other one the other way around.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'matches'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '6', 'type': 'block', 'children': ['7', '23', '34']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'thread_query'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'string', 'children': [], 'value': "'thread:{tid} AND {subquery}'"}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '20']}; {'id': '15', 'type': 'keyword_argument', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'tid'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_id'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'subquery'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'num_matches'}; {'id': '26', 'type': 'call', 'children': ['27', '32']}; {'id': '27', 'type': 'attribute', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_dbman'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'count_messages'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'thread_query'}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': '>'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'num_matches'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '0'}
Check if this thread matches the given notmuch query. :param query: The query to check against :type query: string :returns: True if this thread matches the given query, False otherwise :rtype: bool
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'setup'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'app'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '14', '23']}; {'id': '6', 'type': 'import_statement', 'children': ['7']}; {'id': '7', 'type': 'dotted_name', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sphinxcontrib_django'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'docstrings'}; {'id': '10', 'type': 'import_statement', 'children': ['11']}; {'id': '11', 'type': 'dotted_name', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sphinxcontrib_django'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'roles'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '21']}; {'id': '16', 'type': 'attribute', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sphinxcontrib_django'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'docstrings'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'setup'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'app'}; {'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': 'sphinxcontrib_django'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'roles'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'setup'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'app'}
Allow this module to be used as sphinx extension. This attaches the Sphinx hooks. :type app: sphinx.application.Sphinx
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'from_dict'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'dictionary'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '19', '25', '32', '100', '104', '124']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'cookbooks'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'set'}; {'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': 'other'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'set'}; {'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': 'groups'}; {'id': '28', 'type': 'list', 'children': ['29', '30', '31'], 'value': '[sources, cookbooks, other]'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'cookbooks'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '32', 'type': 'for_statement', 'children': ['33', '36', '41']}; {'id': '33', 'type': 'pattern_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'dictionary'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'if_statement', 'children': ['43', '46', '70', '88']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': '=='}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '45', 'type': 'string', 'children': [], 'value': "'cookbook'"}; {'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': 'cookbooks'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'set_comprehension', 'children': ['54', '61']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'cookbook_statement'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'cbn'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'meta'}; {'id': '61', 'type': 'for_in_clause', 'children': ['62', '65']}; {'id': '62', 'type': 'pattern_list', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'cbn'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'meta'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '69', 'type': 'argument_list', 'children': []}; {'id': '70', 'type': 'elif_clause', 'children': ['71', '74']}; {'id': '71', 'type': 'comparison_operator', 'children': ['72', '73'], 'value': '=='}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '73', 'type': 'string', 'children': [], 'value': "'source'"}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'set_comprehension', 'children': ['82', '85']}; {'id': '82', 'type': 'binary_operator', 'children': ['83', '84'], 'value': '%'}; {'id': '83', 'type': 'string', 'children': [], 'value': '"source \'%s\'"'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '85', 'type': 'for_in_clause', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '88', 'type': 'elif_clause', 'children': ['89', '92']}; {'id': '89', 'type': 'comparison_operator', 'children': ['90', '91'], 'value': '=='}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '91', 'type': 'string', 'children': [], 'value': "'metadata'"}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'string', 'children': [], 'value': "'metadata'"}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '103', 'type': 'string', 'children': [], 'value': "''"}; {'id': '104', 'type': 'for_statement', 'children': ['105', '106', '107']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '107', 'type': 'block', 'children': ['108', '115']}; {'id': '108', 'type': 'if_statement', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '110', 'type': 'block', 'children': ['111']}; {'id': '111', 'type': 'expression_statement', 'children': ['112']}; {'id': '112', 'type': 'augmented_assignment', 'children': ['113', '114'], 'value': '+='}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '114', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'augmented_assignment', 'children': ['117', '118'], 'value': '+='}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '118', 'type': 'call', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '124', 'type': 'return_statement', 'children': ['125']}; {'id': '125', 'type': 'call', 'children': ['126', '129']}; {'id': '126', 'type': 'attribute', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'from_string'}; {'id': '129', 'type': 'argument_list', 'children': ['130']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'body'}
Create a Berksfile instance from a dict.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'many'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '8', '22']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'i'}; {'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': 'tc_requests'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'many'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '18', '19']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'api_type'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'api_entity'}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'yield', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'i'}
Gets all of the owners available. Args:
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create_mixin'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '164']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': '_builder'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'class_definition', 'children': ['11', '12', '14']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'CustomModelMixin'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'object'}; {'id': '14', 'type': 'block', 'children': ['15', '32', '60', '80', '109']}; {'id': '15', 'type': 'decorated_definition', 'children': ['16', '18']}; {'id': '16', 'type': 'decorator', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'cached_property'}; {'id': '18', 'type': 'function_definition', 'children': ['19', '20', '22']}; {'id': '19', 'type': 'function_name', 'children': [], 'value': '_content_type'}; {'id': '20', 'type': 'parameters', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'return_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': 'ContentType'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'objects'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'get_for_model'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'decorated_definition', 'children': ['33', '35']}; {'id': '33', 'type': 'decorator', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'classmethod'}; {'id': '35', 'type': 'function_definition', 'children': ['36', '37', '39']}; {'id': '36', 'type': 'function_name', 'children': [], 'value': 'get_model_custom_fields'}; {'id': '37', 'type': 'parameters', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '49']}; {'id': '42', 'type': 'attribute', 'children': ['43', '48']}; {'id': '43', 'type': 'attribute', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_builder'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'fields_model_class'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'objects'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'keyword_argument', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'content_type'}; {'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': 'ContentType'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'objects'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'get_for_model'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '60', 'type': 'function_definition', 'children': ['61', '62', '64']}; {'id': '61', 'type': 'function_name', 'children': [], 'value': 'get_custom_fields'}; {'id': '62', 'type': 'parameters', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'block', 'children': ['65']}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '74']}; {'id': '67', 'type': 'attribute', 'children': ['68', '73']}; {'id': '68', 'type': 'attribute', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': '_builder'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'fields_model_class'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'objects'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'keyword_argument', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'content_type'}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': '_content_type'}; {'id': '80', 'type': 'function_definition', 'children': ['81', '82', '85']}; {'id': '81', 'type': 'function_name', 'children': [], 'value': 'get_custom_value'}; {'id': '82', 'type': 'parameters', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '85', 'type': 'block', 'children': ['86']}; {'id': '86', 'type': 'return_statement', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '95']}; {'id': '88', 'type': 'attribute', 'children': ['89', '94']}; {'id': '89', 'type': 'attribute', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': '_builder'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'values_model_class'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'objects'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '95', 'type': 'argument_list', 'children': ['96', '99', '104']}; {'id': '96', 'type': 'keyword_argument', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'custom_field'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '99', 'type': 'keyword_argument', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'content_type'}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': '_content_type'}; {'id': '104', 'type': 'keyword_argument', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'object_id'}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'pk'}; {'id': '109', 'type': 'function_definition', 'children': ['110', '111', '115']}; {'id': '110', 'type': 'function_name', 'children': [], 'value': 'set_custom_value'}; {'id': '111', 'type': 'parameters', 'children': ['112', '113', '114']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '115', 'type': 'block', 'children': ['116', '144', '150', '156', '162']}; {'id': '116', 'type': 'expression_statement', 'children': ['117']}; {'id': '117', 'type': 'assignment', 'children': ['118', '121', '122']}; {'id': '118', 'type': 'pattern_list', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'custom_value'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'created'}; {'id': '121', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '122', 'type': 'call', 'children': ['123', '130']}; {'id': '123', 'type': 'attribute', 'children': ['124', '129']}; {'id': '124', 'type': 'attribute', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': '_builder'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'values_model_class'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'objects'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'get_or_create'}; {'id': '130', 'type': 'argument_list', 'children': ['131', '134', '139']}; {'id': '131', 'type': 'keyword_argument', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'custom_field'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '134', 'type': 'keyword_argument', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'content_type'}; {'id': '136', 'type': 'attribute', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '138', 'type': 'identifier', 'children': [], 'value': '_content_type'}; {'id': '139', 'type': 'keyword_argument', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'object_id'}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'pk'}; {'id': '144', 'type': 'expression_statement', 'children': ['145']}; {'id': '145', 'type': 'assignment', 'children': ['146', '149']}; {'id': '146', 'type': 'attribute', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'custom_value'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '150', 'type': 'expression_statement', 'children': ['151']}; {'id': '151', 'type': 'call', 'children': ['152', '155']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'custom_value'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'full_clean'}; {'id': '155', 'type': 'argument_list', 'children': []}; {'id': '156', 'type': 'expression_statement', 'children': ['157']}; {'id': '157', 'type': 'call', 'children': ['158', '161']}; {'id': '158', 'type': 'attribute', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'custom_value'}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'save'}; {'id': '161', 'type': 'argument_list', 'children': []}; {'id': '162', 'type': 'return_statement', 'children': ['163']}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'custom_value'}; {'id': '164', 'type': 'return_statement', 'children': ['165']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'CustomModelMixin'}
This will create the custom Model Mixin to attach to your custom field enabled model. :return:
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'undobutton_action'}; {'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', '15']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '14'], 'value': '>'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'history'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '15', 'type': 'block', 'children': ['16', '28', '34', '43']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'old'}; {'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': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'history'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'unary_operator', 'children': ['27'], 'value': '-'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'selection_array'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'old'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', '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': 'mask'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'set_data'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'old'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '52']}; {'id': '45', 'type': 'attribute', 'children': ['46', '51']}; {'id': '46', 'type': 'attribute', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'fig'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'canvas'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'draw_idle'}; {'id': '52', 'type': 'argument_list', 'children': []}
when undo is clicked, revert the thematic map to the previous state
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '18']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '10', '13', '16']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '9', 'type': 'string', 'children': [], 'value': "'HEAD'"}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'default_parameter', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'force'}; {'id': '15', 'type': 'False', 'children': []}; {'id': '16', 'type': 'dictionary_splat_pattern', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '18', 'type': 'block', 'children': ['19', '25', '34', '43', '55']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '22', 'type': 'tuple', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '25', 'type': 'if_statement', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '33']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'m'"}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '34', 'type': 'if_statement', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'force'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '42']}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'f'"}; {'id': '42', 'type': 'True', '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': 'repo'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'git'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '53']}; {'id': '51', 'type': 'list_splat', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '53', 'type': 'dictionary_splat', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'TagReference'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '60', 'type': 'binary_operator', 'children': ['61', '62'], 'value': '%'}; {'id': '61', 'type': 'string', 'children': [], 'value': '"%s/%s"'}; {'id': '62', 'type': 'tuple', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': '_common_path_default'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'path'}
Create a new tag reference. :param path: The name of the tag, i.e. 1.0 or releases/1.0. The prefix refs/tags is implied :param ref: A reference to the object you want to tag. It can be a commit, tree or blob. :param message: If not None, the message will be used in your tag object. This will also create an additional tag object that allows to obtain that information, i.e.:: tagref.tag.message :param force: If True, to force creation of a tag even though that tag already exists. :param kwargs: Additional keyword arguments to be passed to git-tag :return: A new TagReference
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'from_filename'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '38']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'base_directory'}; {'id': '16', 'type': 'if_statement', 'children': ['17', '26']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '23'], 'value': '!='}; {'id': '18', 'type': 'subscript', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '20', 'type': 'slice', 'children': ['21', '22']}; {'id': '21', 'type': 'colon', 'children': []}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'base_directory'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'raise_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'binary_operator', 'children': ['32', '33'], 'value': '%'}; {'id': '32', 'type': 'string', 'children': [], 'value': '\'Filename needs to start with "%s";\\nyou passed "%s".\''}; {'id': '33', 'type': 'tuple', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'base_directory'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '38', 'type': 'if_statement', 'children': ['39', '47']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'extension'}; {'id': '47', 'type': 'block', 'children': ['48', '74']}; {'id': '48', 'type': 'if_statement', 'children': ['49', '57', '68']}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '56'], 'value': '>'}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'extension'}; {'id': '56', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '61', 'type': 'unary_operator', 'children': ['62'], 'value': '-'}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'extension'}; {'id': '68', 'type': 'else_clause', 'children': ['69']}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '73', 'type': 'None', 'children': []}; {'id': '74', 'type': 'return_statement', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '81']}; {'id': '76', 'type': 'attribute', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'key_transformer'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'from_path'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'call', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'call', 'children': ['86', '99']}; {'id': '86', 'type': 'attribute', 'children': ['87', '98']}; {'id': '87', 'type': 'call', 'children': ['88', '96']}; {'id': '88', 'type': 'attribute', 'children': ['89', '95']}; {'id': '89', 'type': 'subscript', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '91', 'type': 'slice', 'children': ['92', '93', '94']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '93', 'type': 'colon', 'children': []}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'string', 'children': [], 'value': "'/'"}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'string', 'children': [], 'value': "'/'"}
Convert an absolute filename into key.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'configure'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'conf'}; {'id': '7', 'type': 'block', 'children': ['8', '20', '36', '44', '52', '60', '68']}; {'id': '8', 'type': 'expression_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': 'LeakDetectorPlugin'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'configure'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'conf'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'leak_detector_level'}; {'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': 'reporting_level'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'leak_detector_level'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'report_delta'}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'leak_detector_report_delta'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'patch_mock'}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'leak_detector_patch_mock'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'ignore_patterns'}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'leak_detector_ignore_patterns'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'save_traceback'}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'leak_detector_save_traceback'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'multiprocessing_enabled'}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80', '81']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '80', 'type': 'string', 'children': [], 'value': "'multiprocess_workers'"}; {'id': '81', 'type': 'False', 'children': []}
Configure plugin.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_submit_args'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '5', 'type': 'block', 'children': ['6', '47', '67']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'submit_args'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '17', '22', '27', '32', '37', '42']}; {'id': '12', 'type': 'keyword_argument', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'testrun_id'}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'testrun_id'}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'no_verify'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'no_verify'}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'verify_timeout'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'verify_timeout'}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'log_file'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'job_log'}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'dry_run'}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'dry_run'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'submit_args'}; {'id': '50', 'type': 'dictionary_comprehension', 'children': ['51', '54', '63']}; {'id': '51', 'type': 'pair', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '54', 'type': 'for_in_clause', 'children': ['55', '58']}; {'id': '55', 'type': 'pattern_list', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'submit_args'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '62', 'type': 'argument_list', 'children': []}; {'id': '63', 'type': 'if_clause', 'children': ['64']}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '66'], 'value': 'is not'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '66', 'type': 'None', 'children': []}; {'id': '67', 'type': 'return_statement', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'Box'}; {'id': '70', 'type': 'argument_list', 'children': ['71', '72', '75']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'submit_args'}; {'id': '72', 'type': 'keyword_argument', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'frozen_box'}; {'id': '74', 'type': 'True', 'children': []}; {'id': '75', 'type': 'keyword_argument', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'default_box'}; {'id': '77', 'type': 'True', 'children': []}
Gets arguments for the `submit_and_verify` method.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'serialize_job'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'job'}; {'id': '5', 'type': 'block', 'children': ['6', '47']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '19', '35', '42']}; {'id': '12', 'type': 'keyword_argument', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'job'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'get_id'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'uri'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'url_for'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25', '32']}; {'id': '24', 'type': 'string', 'children': [], 'value': "'jobs.get_job'"}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'job_id'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'job'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'get_id'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_external'}; {'id': '34', 'type': 'True', 'children': []}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'status'}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'job'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'get_status'}; {'id': '41', 'type': 'argument_list', 'children': []}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'job'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'd'}
Return a dictionary representing the job.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_process_terminal_state'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'job_record'}; {'id': '6', 'type': 'block', 'children': ['7', '33']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '10', 'type': 'call', 'children': ['11', '17']}; {'id': '11', 'type': 'attribute', 'children': ['12', '15', '16']}; {'id': '12', 'type': 'concatenated_string', 'children': ['13', '14']}; {'id': '13', 'type': 'string', 'children': [], 'value': "'Job {0} for {1}@{2} is in the terminal state {3}, '"}; {'id': '14', 'type': 'string', 'children': [], 'value': "'and is no further govern by the State Machine {4}'"}; {'id': '15', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '21', '24', '27', '30']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'job_record'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'db_id'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'job_record'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'process_name'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'job_record'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'timeperiod'}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'job_record'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'name'}; {'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': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_log_message'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40', '43', '46']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'WARNING'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'job_record'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'process_name'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'job_record'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'timeperiod'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'msg'}
method logs a warning message notifying that the job is no longer govern by this state machine
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_startup'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '8', '16']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'endpoint_name'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'hookenv'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'relation_types'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'block', 'children': ['17', '24', '36', '48', '67', '75', '83', '89', '95', '101']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'relf'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'relation_factory'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'endpoint_name'}; {'id': '24', 'type': 'if_statement', 'children': ['25', '34']}; {'id': '25', 'type': 'boolean_operator', 'children': ['26', '28'], 'value': 'or'}; {'id': '26', 'type': 'not_operator', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'relf'}; {'id': '28', 'type': 'not_operator', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'issubclass'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'relf'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'continue_statement', 'children': []}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'rids'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'hookenv'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'relation_ids'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'endpoint_name'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'rids'}; {'id': '51', 'type': 'list_comprehension', 'children': ['52', '64']}; {'id': '52', 'type': 'conditional_expression', 'children': ['53', '60', '63'], 'value': 'if'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'string', 'children': [], 'value': "'{}:{}'"}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'endpoint_name'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'rid'}; {'id': '60', 'type': 'comparison_operator', 'children': ['61', '62'], 'value': 'not in'}; {'id': '61', 'type': 'string', 'children': [], 'value': "':'"}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'rid'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'rid'}; {'id': '64', 'type': 'for_in_clause', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'rid'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'rids'}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'relf'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'endpoint_name'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'rids'}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '82']}; {'id': '77', 'type': 'subscript', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': '_endpoints'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'endpoint_name'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'register_triggers'}; {'id': '88', 'type': 'argument_list', 'children': []}; {'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': 'endpoint'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': '_manage_departed'}; {'id': '94', 'type': 'argument_list', 'children': []}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': '_manage_flags'}; {'id': '100', 'type': 'argument_list', 'children': []}; {'id': '101', 'type': 'for_statement', 'children': ['102', '103', '106']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'relation'}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'relations'}; {'id': '106', 'type': 'block', 'children': ['107']}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'call', 'children': ['109', '112']}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'hookenv'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'atexit'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'relation'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': '_flush_data'}
Create Endpoint instances and manage automatic flags.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_storage'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'block', 'children': ['11', '19', '27', '38']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '14', 'type': 'boolean_operator', 'children': ['15', '16'], 'value': 'or'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'STORAGE'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '22', 'type': 'boolean_operator', 'children': ['23', '24'], 'value': 'or'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'STORAGE_OPTIONS'}; {'id': '27', 'type': 'if_statement', 'children': ['28', '30']}; {'id': '28', 'type': 'not_operator', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'path'}; {'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': 'ImproperlyConfigured'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'concatenated_string', 'children': ['36', '37']}; {'id': '36', 'type': 'string', 'children': [], 'value': "'You must specify a storage class using '"}; {'id': '37', 'type': 'string', 'children': [], 'value': "'DBBACKUP_STORAGE settings.'"}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'Storage'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '43', 'type': 'dictionary_splat', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'options'}
Get the specified storage configured with options. :param path: Path in Python dot style to module containing the storage class. If empty settings.DBBACKUP_STORAGE will be used. :type path: ``str`` :param options: Parameters for configure the storage, if empty settings.DBBACKUP_STORAGE_OPTIONS will be used. :type options: ``dict`` :return: Storage configured :rtype: :class:`.Storage`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_reset'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '18', '24', '30', '36']}; {'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': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_in_declare'}; {'id': '11', 'type': 'False', 'children': []}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_is_create'}; {'id': '17', 'type': 'False', 'children': []}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_begin_depth'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'consume_ws'}; {'id': '29', 'type': 'False', 'children': []}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '35', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '0'}
Set the filter attributes to its default values
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'validate'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '10', '17']}; {'id': '7', 'type': 'pattern_list', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'val'}; {'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': 'grammar'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'try_statement', 'children': ['19', '27']}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'setattr'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25', '26']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '27', 'type': 'except_clause', 'children': ['28', '32']}; {'id': '28', 'type': 'as_pattern', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '30', 'type': 'as_pattern_target', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'raise_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ValidationError'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '39'], 'value': '+'}; {'id': '38', 'type': 'string', 'children': [], 'value': "'invalid contents: '"}; {'id': '39', 'type': 'subscript', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '43', 'type': 'integer', 'children': [], 'value': '0'}
Validate the contents of the object. This calls ``setattr`` for each of the class's grammar properties. It will catch ``ValueError``s raised by the grammar property's setters and re-raise them as :class:`ValidationError`.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_assessment_part_items'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'assessment_part_id'}; {'id': '6', 'type': 'block', 'children': ['7', '19', '32', '53', '66', '75', '88', '94']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'mgr'}; {'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': '_get_provider_manager'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': "'ASSESSMENT_AUTHORING'"}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'local'}; {'id': '18', 'type': 'True', 'children': []}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'mgr'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'get_assessment_part_lookup_session'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'proxy'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_proxy'}; {'id': '32', 'type': 'if_statement', 'children': ['33', '38', '45']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '37'], 'value': '=='}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_catalog_view'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ISOLATED'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'use_isolated_bank_view'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'else_clause', 'children': ['46']}; {'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': 'lookup_session'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'use_federated_bank_view'}; {'id': '52', 'type': 'argument_list', 'children': []}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'item_ids'}; {'id': '56', 'type': 'call', 'children': ['57', '65']}; {'id': '57', 'type': 'attribute', 'children': ['58', '64']}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'get_assessment_part'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'assessment_part_id'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'get_item_ids'}; {'id': '65', 'type': 'argument_list', 'children': []}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'assignment', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'mgr'}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': '_get_provider_manager'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'string', 'children': [], 'value': "'ASSESSMENT'"}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'mgr'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'get_item_lookup_session'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'keyword_argument', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'proxy'}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': '_proxy'}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'call', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'use_federated_bank_view'}; {'id': '93', 'type': 'argument_list', 'children': []}; {'id': '94', 'type': 'return_statement', 'children': ['95']}; {'id': '95', 'type': 'call', 'children': ['96', '99']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'get_items_by_ids'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'item_ids'}
Gets the list of items mapped to the given ``AssessmentPart``. In plenary mode, the returned list contains all known items or an error results. Otherwise, the returned list may contain only those items that are accessible through this session. arg: assessment_part_id (osid.id.Id): ``Id`` of the ``AssessmentPart`` return: (osid.assessment.ItemList) - list of items raise: NotFound - ``assessment_part_id`` not found raise: NullArgument - ``assessment_part_id`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure *compliance: mandatory -- This method is must be implemented.*
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'main'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'block', 'children': ['8', '19', '29', '37', '89', '107', '118', '137']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'argparse'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'ArgumentParser'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'Extracts metadata from a Fuel-converted HDF5 file.'"}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': '"filename"'}; {'id': '26', 'type': 'keyword_argument', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'help'}; {'id': '28', 'type': 'string', 'children': [], 'value': '"HDF5 file to analyze"'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'parse_args'}; {'id': '36', 'type': 'argument_list', 'children': []}; {'id': '37', 'type': 'with_statement', 'children': ['38', '52']}; {'id': '38', 'type': 'with_clause', 'children': ['39']}; {'id': '39', 'type': 'with_item', 'children': ['40']}; {'id': '40', 'type': 'as_pattern', 'children': ['41', '50']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'h5py'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'File'}; {'id': '45', 'type': 'argument_list', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '49', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '50', 'type': 'as_pattern_target', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'h5file'}; {'id': '52', 'type': 'block', 'children': ['53', '65', '77']}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'interface_version'}; {'id': '56', 'type': 'call', 'children': ['57', '62']}; {'id': '57', 'type': 'attribute', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'h5file'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '62', 'type': 'argument_list', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'h5py_interface_version'"}; {'id': '64', 'type': 'string', 'children': [], 'value': "'N/A'"}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'fuel_convert_version'}; {'id': '68', 'type': 'call', 'children': ['69', '74']}; {'id': '69', 'type': 'attribute', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'h5file'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '76']}; {'id': '75', 'type': 'string', 'children': [], 'value': "'fuel_convert_version'"}; {'id': '76', 'type': 'string', 'children': [], 'value': "'N/A'"}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'fuel_convert_command'}; {'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': 'h5file'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '88']}; {'id': '87', 'type': 'string', 'children': [], 'value': "'fuel_convert_command'"}; {'id': '88', 'type': 'string', 'children': [], 'value': "'N/A'"}; {'id': '89', 'type': 'expression_statement', 'children': ['90']}; {'id': '90', 'type': 'assignment', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'message_prefix'}; {'id': '92', 'type': 'call', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'message_prefix_template'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '103']}; {'id': '98', 'type': 'attribute', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'assignment', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'message_body'}; {'id': '110', 'type': 'call', 'children': ['111', '114']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'message_body_template'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '114', 'type': 'argument_list', 'children': ['115', '116', '117']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'fuel_convert_command'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'interface_version'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'fuel_convert_version'}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'assignment', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '121', 'type': 'call', 'children': ['122', '125']}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'string', 'children': [], 'value': "''"}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '125', 'type': 'argument_list', 'children': ['126']}; {'id': '126', 'type': 'list', 'children': ['127', '128', '129', '130', '136'], 'value': "['\\n', message_prefix, '\\n', '=' * len(message_prefix),\n message_body]"}; {'id': '127', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'message_prefix'}; {'id': '129', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '130', 'type': 'binary_operator', 'children': ['131', '132'], 'value': '*'}; {'id': '131', 'type': 'string', 'children': [], 'value': "'='"}; {'id': '132', 'type': 'call', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '134', 'type': 'argument_list', 'children': ['135']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'message_prefix'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'message_body'}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'call', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '140', 'type': 'argument_list', 'children': ['141']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'message'}
Entry point for `fuel-info` script. This function can also be imported and used from Python. Parameters ---------- args : iterable, optional (default: None) A list of arguments that will be passed to Fuel's information utility. If this argument is not specified, `sys.argv[1:]` will be used.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'deepcopy_strip'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '5', 'type': 'block', 'children': ['6', '29', '45']}; {'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': 'item'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'MutableMapping'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'dictionary_comprehension', 'children': ['15', '21']}; {'id': '15', 'type': 'pair', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'deepcopy_strip'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '21', 'type': 'for_in_clause', 'children': ['22', '25']}; {'id': '22', 'type': 'pattern_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'item'}; {'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': 'item'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'MutableSequence'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'list_comprehension', 'children': ['38', '42']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'deepcopy_strip'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '42', 'type': 'for_in_clause', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'item'}
Make a deep copy of list and dict objects. Intentionally do not copy attributes. This is to discard CommentedMap and CommentedSeq metadata which is very expensive with regular copy.deepcopy.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'predict'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'with_statement', 'children': ['8', '15']}; {'id': '8', 'type': 'with_clause', 'children': ['9']}; {'id': '9', 'type': 'with_item', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'log_start_finish'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'string', 'children': [], 'value': "'_FakeRegressionResults prediction'"}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '15', 'type': 'block', 'children': ['16', '31']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'model_design'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'dmatrix'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '25', '28']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_rhs'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'return_type'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'dataframe'"}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'attribute', 'children': ['33', '41']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'model_design'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'dot'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'values'}
Predict new values by running data through the fit model. Parameters ---------- data : pandas.DataFrame Table with columns corresponding to the RHS of `model_expression`. Returns ------- predicted : ndarray Array of predicted values.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'generate_dict_schema'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'valid'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '15', '65', '91']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '10', 'type': 'dictionary', 'children': []}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'generator_items'}; {'id': '14', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '15', 'type': 'for_statement', 'children': ['16', '17', '22']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '22', 'type': 'block', 'children': ['23', '41', '50', '56']}; {'id': '23', 'type': 'while_statement', 'children': ['24', '25']}; {'id': '24', 'type': 'True', 'children': []}; {'id': '25', 'type': 'block', 'children': ['26', '35']}; {'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': 'key_schema'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'key_generator'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'generate_random_schema'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'valid'}; {'id': '35', 'type': 'if_statement', 'children': ['36', '39']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '38'], 'value': 'not in'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'key_schema'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'break_statement', 'children': []}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '46']}; {'id': '43', 'type': 'pattern_list', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'value_schema'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'value_generator'}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'generate_random_schema'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'valid'}; {'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': 'schema'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'key_schema'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'value_schema'}; {'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': 'generator_items'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'tuple', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'key_generator'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'value_generator'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'generator'}; {'id': '68', 'type': 'generator_expression', 'children': ['69', '84']}; {'id': '69', 'type': 'dictionary_comprehension', 'children': ['70', '79']}; {'id': '70', 'type': 'pair', 'children': ['71', '75']}; {'id': '71', 'type': 'call', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'next'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'k_gen'}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'next'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'v_gen'}; {'id': '79', 'type': 'for_in_clause', 'children': ['80', '83']}; {'id': '80', 'type': 'pattern_list', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'k_gen'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'v_gen'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'generator_items'}; {'id': '84', 'type': 'for_in_clause', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'itertools'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '90', 'type': 'argument_list', 'children': []}; {'id': '91', 'type': 'return_statement', 'children': ['92']}; {'id': '92', 'type': 'expression_list', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'generator'}
Generate a schema dict of size `size` using library `lib`. In addition, it returns samples generator :param size: Schema size :type size: int :param samples: The number of samples to generate :type samples: int :param valid: Generate valid samples? :type valid: bool :returns
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_mapping'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7', '10']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '6', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'exported_at'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'app_name'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14', '27', '35']}; {'id': '14', 'type': 'if_statement', 'children': ['15', '18']}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '17'], 'value': 'is'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'exported_at'}; {'id': '17', 'type': 'None', 'children': []}; {'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': 'exported_at'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'now'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'app_name'}; {'id': '30', 'type': 'boolean_operator', 'children': ['31', '32'], 'value': 'or'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'app_name'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'HEROKU_CONNECT_APP_NAME'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'dictionary', 'children': ['37', '40', '58']}; {'id': '37', 'type': 'pair', 'children': ['38', '39']}; {'id': '38', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '40', 'type': 'pair', 'children': ['41', '42']}; {'id': '41', 'type': 'string', 'children': [], 'value': "'connection'"}; {'id': '42', 'type': 'dictionary', 'children': ['43', '48', '51']}; {'id': '43', 'type': 'pair', 'children': ['44', '45']}; {'id': '44', 'type': 'string', 'children': [], 'value': "'organization_id'"}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'HEROKU_CONNECT_ORGANIZATION_ID'}; {'id': '48', 'type': 'pair', 'children': ['49', '50']}; {'id': '49', 'type': 'string', 'children': [], 'value': "'app_name'"}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'app_name'}; {'id': '51', 'type': 'pair', 'children': ['52', '53']}; {'id': '52', 'type': 'string', 'children': [], 'value': "'exported_at'"}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'exported_at'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'isoformat'}; {'id': '57', 'type': 'argument_list', 'children': []}; {'id': '58', 'type': 'pair', 'children': ['59', '60']}; {'id': '59', 'type': 'string', 'children': [], 'value': "'mappings'"}; {'id': '60', 'type': 'list_comprehension', 'children': ['61', '66']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'get_heroku_connect_mapping'}; {'id': '65', 'type': 'argument_list', 'children': []}; {'id': '66', 'type': 'for_in_clause', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'get_heroku_connect_models'}; {'id': '70', 'type': 'argument_list', 'children': []}
Return Heroku Connect mapping for the entire project. Args: version (int): Version of the Heroku Connect mapping, default: ``1``. exported_at (datetime.datetime): Time the export was created, default is ``now()``. app_name (str): Name of Heroku application associated with Heroku Connect the add-on. Returns: dict: Heroku Connect mapping. Note: The version does not need to be incremented. Exports from the Heroku Connect website will always have the version number ``1``.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'aggregate'}; {'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': 'other'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '17', '23', '31']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '14']}; {'id': '10', 'type': 'not_operator', 'children': ['11']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'status'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'if_statement', 'children': ['18', '20']}; {'id': '18', 'type': 'not_operator', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'return_statement', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'if_statement', 'children': ['24', '28']}; {'id': '24', 'type': 'not_operator', 'children': ['25']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'status'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'Value'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36', '39', '46']}; {'id': '35', 'type': 'True', 'children': []}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '39', 'type': 'binary_operator', 'children': ['40', '43'], 'value': '+'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '46', 'type': 'None', 'children': []}
collect the furthest failure from self and other.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'require_Gtk'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'min_version'}; {'id': '6', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '7', 'type': 'block', 'children': ['8', '17', '27', '49', '55', '74']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '11']}; {'id': '9', 'type': 'not_operator', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_in_X'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'raise_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'RuntimeError'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'string', 'children': [], 'value': "'Not in X session.'"}; {'id': '17', 'type': 'if_statement', 'children': ['18', '21']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '20'], 'value': '<'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_has_Gtk'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'min_version'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'raise_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'RuntimeError'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'string', 'children': [], 'value': "'Module gi.repository.Gtk not available!'"}; {'id': '27', 'type': 'if_statement', 'children': ['28', '31']}; {'id': '28', 'type': 'comparison_operator', 'children': ['29', '30'], 'value': '=='}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_has_Gtk'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '42']}; {'id': '34', 'type': 'attribute', 'children': ['35', '41']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'warn'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'concatenated_string', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': '"Missing runtime dependency GTK 3. Falling back to GTK 2 "'}; {'id': '48', 'type': 'string', 'children': [], 'value': '"for password prompt"'}; {'id': '49', 'type': 'import_from_statement', 'children': ['50', '53']}; {'id': '50', 'type': 'dotted_name', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'gi'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'repository'}; {'id': '53', 'type': 'dotted_name', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'Gtk'}; {'id': '55', 'type': 'if_statement', 'children': ['56', '65']}; {'id': '56', 'type': 'not_operator', 'children': ['57']}; {'id': '57', 'type': 'subscript', 'children': ['58', '64']}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'Gtk'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'init_check'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'None', 'children': []}; {'id': '64', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'raise_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'RuntimeError'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'string', 'children': [], 'value': '"X server not connected!"'}; {'id': '74', 'type': 'return_statement', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'Gtk'}
Make sure Gtk is properly initialized. :raises RuntimeError: if Gtk can not be properly initialized
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'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']}; {'id': '10', 'type': 'try_statement', 'children': ['11', '26']}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '21']}; {'id': '14', 'type': 'attribute', 'children': ['15', '20']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'CloudBlockStorageManager'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'create'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '24']}; {'id': '22', 'type': 'list_splat', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '24', 'type': 'dictionary_splat', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '26', 'type': 'except_clause', 'children': ['27', '33']}; {'id': '27', 'type': 'as_pattern', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'BadRequest'}; {'id': '31', 'type': 'as_pattern_target', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '33', 'type': 'block', 'children': ['34', '40']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '44', '52']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '43'], 'value': 'in'}; {'id': '42', 'type': 'string', 'children': [], 'value': '"Clones currently must be >= original volume size"'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'raise_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'VolumeCloneTooSmall'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '52', 'type': 'else_clause', 'children': ['53']}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'raise_statement', 'children': []}
Catches errors that may be returned, and raises more informational exceptions.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'initialize'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'log_file'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'project_dir'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '16', '29', '38', '74', '86', '91']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'print_splash'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'setup_logging'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23', '26']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'log_file'}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'print_log_location'}; {'id': '25', 'type': 'False', 'children': []}; {'id': '26', 'type': 'keyword_argument', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'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': 'get_logger'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'string', 'children': [], 'value': "'pipeline'"}; {'id': '38', 'type': 'if_statement', 'children': ['39', '42']}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '41'], 'value': 'is not'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'project_dir'}; {'id': '41', 'type': 'None', 'children': []}; {'id': '42', 'type': 'block', 'children': ['43', '55', '67']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'make_dir'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '53']}; {'id': '48', 'type': 'attribute', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'normpath'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'project_dir'}; {'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': 'logger'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'PROJECT DIRECTORY: {}'"}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'project_dir'}; {'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': 'logger'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'string', 'children': [], 'value': "''"}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '79', 'type': 'argument_list', 'children': ['80']}; {'id': '80', 'type': 'call', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'string', 'children': [], 'value': "'LOG LOCATION: {}'"}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'log_file'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'string', 'children': [], 'value': "''"}; {'id': '91', 'type': 'return_statement', 'children': ['92']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'logger'}
Initializes an AbTools pipeline. Initialization includes printing the AbTools splash, setting up logging, creating the project directory, and logging both the project directory and the log location. Args: log_file (str): Path to the log file. Required. project_dir (str): Path to the project directory. If not provided, the project directory won't be created and the location won't be logged. debug (bool): If ``True``, the logging level will be set to ``logging.DEBUG``. Default is ``FALSE``, which logs at ``logging.INFO``. Returns: logger