sequence
stringlengths 902
12k
| docstring
stringlengths 4
15.2k
|
---|---|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_buildItem'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'elem'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'initpath'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13', '21', '35', '54', '69', '90', '104']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'initpath'}; {'id': '16', 'type': 'boolean_operator', 'children': ['17', '18'], 'value': 'or'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'initpath'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_initpath'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '25']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '24'], 'value': 'is not'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '24', 'type': 'None', 'children': []}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'return_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '33', '34']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_server'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'elem'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'initpath'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'etype'}; {'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': 'elem'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'attrib'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': "'type'"}; {'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': 'elem'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'attrib'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'string', 'children': [], 'value': "'streamType'"}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'ehash'}; {'id': '57', 'type': 'conditional_expression', 'children': ['58', '65', '66'], 'value': 'if'}; {'id': '58', 'type': 'binary_operator', 'children': ['59', '60'], 'value': '%'}; {'id': '59', 'type': 'string', 'children': [], 'value': "'%s.%s'"}; {'id': '60', 'type': 'tuple', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'elem'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'etype'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'etype'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'elem'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'ecls'}; {'id': '72', 'type': 'call', 'children': ['73', '78']}; {'id': '73', 'type': 'attribute', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'PLEXOBJECTS'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'ehash'}; {'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': 'utils'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'PLEXOBJECTS'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'elem'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '90', 'type': 'if_statement', 'children': ['91', '94']}; {'id': '91', 'type': 'comparison_operator', 'children': ['92', '93'], 'value': 'is not'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'ecls'}; {'id': '93', 'type': 'None', 'children': []}; {'id': '94', 'type': 'block', 'children': ['95']}; {'id': '95', 'type': 'return_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'ecls'}; {'id': '98', 'type': 'argument_list', 'children': ['99', '102', '103']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': '_server'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'elem'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'initpath'}; {'id': '104', 'type': 'raise_statement', 'children': ['105']}; {'id': '105', 'type': 'call', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'UnknownType'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'binary_operator', 'children': ['109', '110'], 'value': '%'}; {'id': '109', 'type': 'string', 'children': [], 'value': '"Unknown library type <%s type=\'%s\'../>"'}; {'id': '110', 'type': 'tuple', 'children': ['111', '114']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'elem'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'etype'}
|
Factory function to build objects based on registered PLEXOBJECTS.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'connectMSExchange'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'server'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '24', '33', '42', '46', '57', '65', '80', '94', '107', '123', '131', '146', '158', '167']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '9']}; {'id': '7', 'type': 'not_operator', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sspi'}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'return_statement', 'children': ['11']}; {'id': '11', 'type': 'expression_list', 'children': ['12', '13']}; {'id': '12', 'type': 'False', 'children': []}; {'id': '13', 'type': 'string', 'children': [], 'value': "'No sspi module found.'"}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '19']}; {'id': '16', 'type': 'pattern_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'server'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'ehlo'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'if_statement', 'children': ['25', '28']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': '!='}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'SMTP_EHLO_OKAY'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'expression_list', 'children': ['31', '32']}; {'id': '31', 'type': 'False', 'children': []}; {'id': '32', 'type': 'string', 'children': [], 'value': "'Server did not respond to EHLO command.'"}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sspi_client'}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'sspi'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'ClientAuth'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'string', 'children': [], 'value': "'NTLM'"}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sec_buffer'}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '51']}; {'id': '48', 'type': 'pattern_list', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'err'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'sec_buffer'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'sspi_client'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'authorize'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'sec_buffer'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'buffer'}; {'id': '60', 'type': 'attribute', 'children': ['61', '64']}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'sec_buffer'}; {'id': '63', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'Buffer'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'ntlm_message'}; {'id': '68', 'type': 'call', 'children': ['69', '77']}; {'id': '69', 'type': 'attribute', 'children': ['70', '76']}; {'id': '70', 'type': 'call', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'base64'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'encodestring'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'buffer'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '79']}; {'id': '78', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '79', 'type': 'string', 'children': [], 'value': "''"}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '85']}; {'id': '82', 'type': 'pattern_list', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'server'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'docmd'}; {'id': '89', 'type': 'argument_list', 'children': ['90', '91']}; {'id': '90', 'type': 'string', 'children': [], 'value': "'AUTH'"}; {'id': '91', 'type': 'binary_operator', 'children': ['92', '93'], 'value': '+'}; {'id': '92', 'type': 'string', 'children': [], 'value': "'NTLM '"}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'ntlm_message'}; {'id': '94', 'type': 'if_statement', 'children': ['95', '98']}; {'id': '95', 'type': 'comparison_operator', 'children': ['96', '97'], 'value': '!='}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'SMTP_AUTH_CHALLENGE'}; {'id': '98', 'type': 'block', 'children': ['99', '103']}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'assignment', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '102', 'type': 'string', 'children': [], 'value': "'Server did not respond as expected to NTLM negotiate message'"}; {'id': '103', 'type': 'return_statement', 'children': ['104']}; {'id': '104', 'type': 'expression_list', 'children': ['105', '106']}; {'id': '105', 'type': 'False', 'children': []}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'assignment', 'children': ['109', '112']}; {'id': '109', 'type': 'pattern_list', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'err'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'sec_buffer'}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'sspi_client'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'authorize'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'call', 'children': ['118', '121']}; {'id': '118', 'type': 'attribute', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'base64'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'decodestring'}; {'id': '121', 'type': 'argument_list', 'children': ['122']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '123', 'type': 'expression_statement', 'children': ['124']}; {'id': '124', 'type': 'assignment', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'buffer'}; {'id': '126', 'type': 'attribute', 'children': ['127', '130']}; {'id': '127', 'type': 'subscript', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'sec_buffer'}; {'id': '129', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'Buffer'}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'ntlm_message'}; {'id': '134', 'type': 'call', 'children': ['135', '143']}; {'id': '135', 'type': 'attribute', 'children': ['136', '142']}; {'id': '136', 'type': 'call', 'children': ['137', '140']}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'base64'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'encodestring'}; {'id': '140', 'type': 'argument_list', 'children': ['141']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'buffer'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '143', 'type': 'argument_list', 'children': ['144', '145']}; {'id': '144', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '145', 'type': 'string', 'children': [], 'value': "''"}; {'id': '146', 'type': 'expression_statement', 'children': ['147']}; {'id': '147', 'type': 'assignment', 'children': ['148', '151']}; {'id': '148', 'type': 'pattern_list', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '151', 'type': 'call', 'children': ['152', '155']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'server'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'docmd'}; {'id': '155', 'type': 'argument_list', 'children': ['156', '157']}; {'id': '156', 'type': 'string', 'children': [], 'value': "''"}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'ntlm_message'}; {'id': '158', 'type': 'if_statement', 'children': ['159', '162']}; {'id': '159', 'type': 'comparison_operator', 'children': ['160', '161'], 'value': '!='}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'SMTP_AUTH_OKAY'}; {'id': '162', 'type': 'block', 'children': ['163']}; {'id': '163', 'type': 'return_statement', 'children': ['164']}; {'id': '164', 'type': 'expression_list', 'children': ['165', '166']}; {'id': '165', 'type': 'False', 'children': []}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '167', 'type': 'return_statement', 'children': ['168']}; {'id': '168', 'type': 'expression_list', 'children': ['169', '170']}; {'id': '169', 'type': 'True', 'children': []}; {'id': '170', 'type': 'string', 'children': [], 'value': "''"}
|
Creates a connection for the inputted server to a Microsoft Exchange server.
:param server | <smtplib.SMTP>
:usage |>>> import smtplib
|>>> import projex.notify
|>>> smtp = smtplib.SMTP('mail.server.com')
|>>> projex.notify.connectMSExchange(smtp)
:return (<bool> success, <str> reason)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load_from_cache'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'user_path'}; {'id': '7', 'type': 'block', 'children': ['8', '13']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '11']}; {'id': '9', 'type': 'not_operator', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': []}; {'id': '13', 'type': 'try_statement', 'children': ['14', '50']}; {'id': '14', 'type': 'block', 'children': ['15', '39']}; {'id': '15', 'type': 'with_statement', 'children': ['16', '26']}; {'id': '16', 'type': 'with_clause', 'children': ['17']}; {'id': '17', 'type': 'with_item', 'children': ['18']}; {'id': '18', 'type': 'as_pattern', 'children': ['19', '24']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '23', 'type': 'string', 'children': [], 'value': "'rb'"}; {'id': '24', 'type': 'as_pattern_target', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '33']}; {'id': '29', 'type': 'pattern_list', 'children': ['30', '31', '32']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'dversion'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'mversion'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'pickle'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'load'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '39', 'type': 'if_statement', 'children': ['40', '47']}; {'id': '40', 'type': 'boolean_operator', 'children': ['41', '44'], 'value': 'and'}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '43'], 'value': '=='}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'dversion'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'data_version'}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '46'], 'value': '=='}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'mversion'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'module_version'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '50', 'type': 'except_clause', 'children': ['51', '55']}; {'id': '51', 'type': 'tuple', 'children': ['52', '53', '54']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'FileNotFoundError'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'EOFError'}; {'id': '55', 'type': 'block', 'children': ['56']}; {'id': '56', 'type': 'pass_statement', 'children': []}
|
Try to load category ranges from userlevel cache file.
:param path: path to userlevel cache file
:type path: str
:returns: category ranges dict or None
:rtype: None or dict of RangeGroup
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'convex_conj'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '17']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'conj_exp'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'conj_exponent'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'pointwise_norm'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'exponent'}; {'id': '17', 'type': 'return_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'IndicatorGroupL1UnitBall'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'domain'}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'exponent'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'conj_exp'}
|
The convex conjugate functional of the group L1-norm.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'extract'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '29', '40', '52', '60', '68', '76', '84', '92', '100', '108']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'article_candidates'}; {'id': '10', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '11', 'type': 'for_statement', 'children': ['12', '13', '16']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'extractor'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'extractor_list'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'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': 'article_candidates'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'extractor'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'extract'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'article_candidates'}; {'id': '32', 'type': 'call', 'children': ['33', '38']}; {'id': '33', 'type': 'attribute', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'cleaner'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'clean'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'article_candidates'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'article'}; {'id': '43', 'type': 'call', 'children': ['44', '49']}; {'id': '44', 'type': 'attribute', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'comparer'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'compare'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'article_candidates'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '57']}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '56', 'type': 'string', 'children': [], 'value': "'article_title'"}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'article'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '65']}; {'id': '62', 'type': 'subscript', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '64', 'type': 'string', 'children': [], 'value': "'article_description'"}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'article'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '73']}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '72', 'type': 'string', 'children': [], 'value': "'article_text'"}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'article'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '81']}; {'id': '78', 'type': 'subscript', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '80', 'type': 'string', 'children': [], 'value': "'article_image'"}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'article'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'topimage'}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '89']}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '88', 'type': 'string', 'children': [], 'value': "'article_author'"}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'article'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'author'}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'assignment', 'children': ['94', '97']}; {'id': '94', 'type': 'subscript', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '96', 'type': 'string', 'children': [], 'value': "'article_publish_date'"}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'article'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'publish_date'}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '105']}; {'id': '102', 'type': 'subscript', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '104', 'type': 'string', 'children': [], 'value': "'article_language'"}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'article'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '108', 'type': 'return_statement', 'children': ['109']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'item'}
|
Runs the HTML-response trough a list of initialized extractors, a cleaner and compares the results.
:param item: NewscrawlerItem to be processed.
:return: An updated NewscrawlerItem including the results of the extraction
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_ca_certs_paths'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '9', '27', '82', '117', '124']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'assignment', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'ca_certs'}; {'id': '8', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'embedded_root'}; {'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': 'os'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '25']}; {'id': '20', 'type': 'attribute', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'abspath'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '__file__'}; {'id': '27', 'type': 'for_statement', 'children': ['28', '29', '33', '75']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '33', 'type': 'block', 'children': ['34', '64']}; {'id': '34', 'type': 'if_statement', 'children': ['35', '45']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '44'], 'value': '=='}; {'id': '36', 'type': 'call', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'embedded_root'}; {'id': '44', 'type': 'string', 'children': [], 'value': "'embedded'"}; {'id': '45', 'type': 'block', 'children': ['46', '63']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'ca_certs'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '51', 'type': 'argument_list', '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': 'os'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '60', '61', '62']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'embedded_root'}; {'id': '60', 'type': 'string', 'children': [], 'value': "'ssl'"}; {'id': '61', 'type': 'string', 'children': [], 'value': "'certs'"}; {'id': '62', 'type': 'string', 'children': [], 'value': "'cacert.pem'"}; {'id': '63', 'type': 'break_statement', 'children': []}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'embedded_root'}; {'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': 'os'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'embedded_root'}; {'id': '75', 'type': 'else_clause', 'children': ['76']}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'raise_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'OSError'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'string', 'children': [], 'value': "'Unable to locate `embedded` directory. Please specify ca_certs in your http yaml configuration file.'"}; {'id': '82', 'type': 'try_statement', 'children': ['83', '87', '91']}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'import_statement', 'children': ['85']}; {'id': '85', 'type': 'dotted_name', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'tornado'}; {'id': '87', 'type': 'except_clause', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'ImportError'}; {'id': '89', 'type': 'block', 'children': ['90']}; {'id': '90', 'type': 'pass_statement', 'children': []}; {'id': '91', 'type': 'else_clause', 'children': ['92']}; {'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': 'ca_certs'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'call', 'children': ['100', '105']}; {'id': '100', 'type': 'attribute', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '105', 'type': 'argument_list', 'children': ['106', '116']}; {'id': '106', 'type': 'call', 'children': ['107', '112']}; {'id': '107', 'type': 'attribute', 'children': ['108', '111']}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'tornado'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': '__file__'}; {'id': '116', 'type': 'string', 'children': [], 'value': "'ca-certificates.crt'"}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'call', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'ca_certs'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'string', 'children': [], 'value': "'/etc/ssl/certs/ca-certificates.crt'"}; {'id': '124', 'type': 'return_statement', 'children': ['125']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'ca_certs'}
|
Get a list of possible paths containing certificates
Check is installed via pip to:
* Windows: embedded/lib/site-packages/datadog_checks/http_check
* Linux: embedded/lib/python2.7/site-packages/datadog_checks/http_check
Certificate is installed to:
* embedded/ssl/certs/cacert.pem
walk up to `embedded`, and back down to ssl/certs to find the certificate file
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'trigger_all_callbacks'}; {'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': 'callbacks'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'return_statement', 'children': ['10']}; {'id': '10', 'type': 'list_comprehension', 'children': ['11', '12', '15']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '12', 'type': 'for_in_clause', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'for_in_clause', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'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': 'trigger_callbacks'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'callbacks'}; {'id': '25', 'type': 'None', 'children': []}
|
Trigger callbacks for all keys on all or a subset of subscribers.
:param Iterable callbacks: list of callbacks or none for all subscribed
:rtype: Iterable[tornado.concurrent.Future]
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_parse_log_entry'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'entry_pb'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'try_statement', 'children': ['7', '13']}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'return_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'MessageToDict'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'entry_pb'}; {'id': '13', 'type': 'except_clause', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'if_statement', 'children': ['17', '23', '52']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'entry_pb'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'HasField'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'string', 'children': [], 'value': '"proto_payload"'}; {'id': '23', 'type': 'block', 'children': ['24', '30', '37', '44', '50']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'proto_payload'}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'entry_pb'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'proto_payload'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'entry_pb'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'ClearField'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'string', 'children': [], 'value': '"proto_payload"'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'entry_mapping'}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'MessageToDict'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'entry_pb'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '49']}; {'id': '46', 'type': 'subscript', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'entry_mapping'}; {'id': '48', 'type': 'string', 'children': [], 'value': '"protoPayload"'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'proto_payload'}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'entry_mapping'}; {'id': '52', 'type': 'else_clause', 'children': ['53']}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'raise_statement', 'children': []}
|
Special helper to parse ``LogEntry`` protobuf into a dictionary.
The ``proto_payload`` field in ``LogEntry`` is of type ``Any``. This
can be problematic if the type URL in the payload isn't in the
``google.protobuf`` registry. To help with parsing unregistered types,
this function will remove ``proto_payload`` before parsing.
:type entry_pb: :class:`.log_entry_pb2.LogEntry`
:param entry_pb: Log entry protobuf.
:rtype: dict
:returns: The parsed log entry. The ``protoPayload`` key may contain
the raw ``Any`` protobuf from ``entry_pb.proto_payload`` if
it could not be parsed.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '31']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ssl_context'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14', '17', '20', '23', '26', '29']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'cert_reqs'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'check_hostname'}; {'id': '13', 'type': 'False', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'certfile'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'keyfile'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'default_parameter', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'cafile'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'default_parameter', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'capath'}; {'id': '25', 'type': 'None', 'children': []}; {'id': '26', 'type': 'default_parameter', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'cadata'}; {'id': '28', 'type': 'None', 'children': []}; {'id': '29', 'type': 'dictionary_splat_pattern', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'kw'}; {'id': '31', 'type': 'block', 'children': ['32', '35', '41', '56', '97']}; {'id': '32', 'type': 'assert_statement', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'ssl'}; {'id': '34', 'type': 'string', 'children': [], 'value': "'SSL not supported'"}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'cafile'}; {'id': '38', 'type': 'boolean_operator', 'children': ['39', '40'], 'value': 'or'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'cafile'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'DEFAULT_CA_BUNDLE_PATH'}; {'id': '41', 'type': 'if_statement', 'children': ['42', '45']}; {'id': '42', 'type': 'comparison_operator', 'children': ['43', '44'], 'value': 'is'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '44', 'type': 'True', 'children': []}; {'id': '45', 'type': 'block', 'children': ['46', '52']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'cert_reqs'}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'ssl'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'CERT_REQUIRED'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'check_hostname'}; {'id': '55', 'type': 'True', 'children': []}; {'id': '56', 'type': 'if_statement', 'children': ['57', '62']}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '62', 'type': 'block', 'children': ['63', '69']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'cert_reqs'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'ssl'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'CERT_REQUIRED'}; {'id': '69', 'type': 'if_statement', 'children': ['70', '78', '83']}; {'id': '70', 'type': 'call', 'children': ['71', '76']}; {'id': '71', 'type': 'attribute', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'isfile'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '78', 'type': 'block', 'children': ['79']}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'cafile'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '83', 'type': 'elif_clause', 'children': ['84', '92']}; {'id': '84', 'type': 'call', 'children': ['85', '90']}; {'id': '85', 'type': 'attribute', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'isdir'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'assignment', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'capath'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '97', 'type': 'return_statement', 'children': ['98']}; {'id': '98', 'type': 'call', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'ssl'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': '_create_unverified_context'}; {'id': '102', 'type': 'argument_list', 'children': ['103', '106', '109', '112', '115', '118', '121']}; {'id': '103', 'type': 'keyword_argument', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'cert_reqs'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'cert_reqs'}; {'id': '106', 'type': 'keyword_argument', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'check_hostname'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'check_hostname'}; {'id': '109', 'type': 'keyword_argument', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'certfile'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'certfile'}; {'id': '112', 'type': 'keyword_argument', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'keyfile'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'keyfile'}; {'id': '115', 'type': 'keyword_argument', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'cafile'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'cafile'}; {'id': '118', 'type': 'keyword_argument', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'capath'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'capath'}; {'id': '121', 'type': 'keyword_argument', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'cadata'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'cadata'}
|
Create a SSL context object.
This method should not be called by from user code
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14', '16']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'empty_wav'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'wav_path'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'generic_type', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'Union'}; {'id': '9', 'type': 'type_parameter', 'children': ['10', '12']}; {'id': '10', 'type': 'type', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'Path'}; {'id': '12', 'type': 'type', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '14', 'type': 'type', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'with_statement', 'children': ['18', '33']}; {'id': '18', 'type': 'with_clause', 'children': ['19']}; {'id': '19', 'type': 'with_item', 'children': ['20']}; {'id': '20', 'type': 'as_pattern', 'children': ['21', '31']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'wave'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '30']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'wav_path'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'rb'"}; {'id': '31', 'type': 'as_pattern_target', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'wav_f'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '41'], 'value': '=='}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'wav_f'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'getnframes'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'integer', 'children': [], 'value': '0'}
|
Check if a wav contains data
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_general_setting'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'qsettings'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '20']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '13']}; {'id': '11', 'type': 'not_operator', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'qsettings'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'qsettings'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'QSettings'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'qsettings'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'setValue'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'deep_convert_dict'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'value'}
|
Set value to QSettings based on key.
:param key: Unique key for setting.
:type key: basestring
:param value: Value to be saved.
:type value: QVariant
:param qsettings: A custom QSettings to use. If it's not defined, it will
use the default one.
:type qsettings: qgis.PyQt.QtCore.QSettings
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'range_to_numeric'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'ranges'}; {'id': '5', 'type': 'block', 'children': ['6', '24', '45', '61', '82']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '11']}; {'id': '8', 'type': 'pattern_list', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'units'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'list_splat', 'children': ['15']}; {'id': '15', 'type': 'generator_expression', 'children': ['16', '21']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'for_in_clause', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'ranges'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'unit'}; {'id': '27', 'type': 'call', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'commonprefix'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'list_comprehension', 'children': ['35', '42']}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '37', 'type': 'slice', 'children': ['38', '39', '40']}; {'id': '38', 'type': 'colon', 'children': []}; {'id': '39', 'type': 'colon', 'children': []}; {'id': '40', 'type': 'unary_operator', 'children': ['41'], 'value': '-'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '42', 'type': 'for_in_clause', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'units'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'prefixes'}; {'id': '48', 'type': 'generator_expression', 'children': ['49', '58']}; {'id': '49', 'type': 'subscript', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '51', 'type': 'slice', 'children': ['52', '53']}; {'id': '52', 'type': 'colon', 'children': []}; {'id': '53', 'type': 'unary_operator', 'children': ['54'], 'value': '-'}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'unit'}; {'id': '58', 'type': 'for_in_clause', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'units'}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '64', 'type': 'list_comprehension', 'children': ['65', '73']}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '70'], 'value': '*'}; {'id': '66', 'type': 'call', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'SI_PREFIX'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '73', 'type': 'for_in_clause', 'children': ['74', '77']}; {'id': '74', 'type': 'pattern_list', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '77', 'type': 'call', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'prefixes'}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'values'}
|
Converts a sequence of string ranges to a sequence of floats.
E.g.::
>>> range_to_numeric(['1 uV', '2 mV', '1 V'])
[1E-6, 0.002, 1.0]
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'photparse'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'tab'}; {'id': '5', 'type': 'block', 'children': ['6', '22', '26', '56', '60', '79']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '16']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '9'], 'value': 'not in'}; {'id': '8', 'type': 'string', 'children': [], 'value': "'source_id'"}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'subscript', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'tab'}; {'id': '13', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'raise_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'phot=TRUE requires the source_id columb be included'"}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'uniqueid'}; {'id': '25', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '26', 'type': 'for_statement', 'children': ['27', '28', '35']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'tab'}; {'id': '35', 'type': 'block', 'children': ['36', '44']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'tmpid'}; {'id': '39', 'type': 'subscript', 'children': ['40', '43']}; {'id': '40', 'type': 'subscript', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'tab'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'source_id'"}; {'id': '44', 'type': 'if_statement', 'children': ['45', '48']}; {'id': '45', 'type': 'comparison_operator', 'children': ['46', '47'], 'value': 'not in'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'tmpid'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'uniqueid'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'uniqueid'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'tmpid'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'newtab'}; {'id': '59', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '60', 'type': 'for_statement', 'children': ['61', '62', '63']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'sourceid'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'uniqueid'}; {'id': '63', 'type': 'block', 'children': ['64', '72']}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'tmpdict'}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'photaddline'}; {'id': '69', 'type': 'argument_list', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'tab'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'sourceid'}; {'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': 'newtab'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'tmpdict'}; {'id': '79', 'type': 'return_statement', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'newtab'}
|
Parse through a photometry table to group by source_id
Parameters
----------
tab: list
SQL query dictionary list from running query_dict.execute()
Returns
-------
newtab: list
Dictionary list after parsing to group together sources
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_unique_scan_parameter_combinations'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'meta_data_array'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'scan_parameters'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'scan_parameter_columns_only'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '43', '58']}; {'id': '12', 'type': 'try_statement', 'children': ['13', '27']}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'last_not_parameter_column'}; {'id': '17', 'type': 'call', 'children': ['18', '25']}; {'id': '18', 'type': 'attribute', 'children': ['19', '24']}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'meta_data_array'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'string', 'children': [], 'value': "'error_code'"}; {'id': '27', 'type': 'except_clause', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'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': 'last_not_parameter_column'}; {'id': '33', 'type': 'call', 'children': ['34', '41']}; {'id': '34', 'type': 'attribute', 'children': ['35', '40']}; {'id': '35', 'type': 'attribute', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'meta_data_array'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'string', 'children': [], 'value': "'error'"}; {'id': '43', 'type': 'if_statement', 'children': ['44', '56']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '46'], 'value': '=='}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'last_not_parameter_column'}; {'id': '46', 'type': 'binary_operator', 'children': ['47', '55'], 'value': '-'}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'attribute', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'meta_data_array'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '55', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'return_statement', 'children': []}; {'id': '58', 'type': 'if_statement', 'children': ['59', '62', '85']}; {'id': '59', 'type': 'comparison_operator', 'children': ['60', '61'], 'value': 'is'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'scan_parameters'}; {'id': '61', 'type': 'None', 'children': []}; {'id': '62', 'type': 'block', 'children': ['63']}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'unique_row'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '68', '82']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'meta_data_array'}; {'id': '68', 'type': 'keyword_argument', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'use_columns'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '74']}; {'id': '73', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'attribute', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'meta_data_array'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '82', 'type': 'keyword_argument', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'selected_columns_only'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'scan_parameter_columns_only'}; {'id': '85', 'type': 'else_clause', 'children': ['86']}; {'id': '86', 'type': 'block', 'children': ['87', '91', '132']}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'assignment', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'use_columns'}; {'id': '90', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '91', 'type': 'for_statement', 'children': ['92', '93', '94']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'scan_parameter'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'scan_parameters'}; {'id': '94', 'type': 'block', 'children': ['95']}; {'id': '95', 'type': 'try_statement', 'children': ['96', '113']}; {'id': '96', 'type': 'block', 'children': ['97']}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'call', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'use_columns'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '102', 'type': 'argument_list', 'children': ['103']}; {'id': '103', 'type': 'call', 'children': ['104', '111']}; {'id': '104', 'type': 'attribute', 'children': ['105', '110']}; {'id': '105', 'type': 'attribute', 'children': ['106', '109']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'meta_data_array'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'scan_parameter'}; {'id': '113', 'type': 'except_clause', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '115', 'type': 'block', 'children': ['116', '127']}; {'id': '116', 'type': 'expression_statement', 'children': ['117']}; {'id': '117', 'type': 'call', 'children': ['118', '121']}; {'id': '118', 'type': 'attribute', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '121', 'type': 'argument_list', 'children': ['122']}; {'id': '122', 'type': 'binary_operator', 'children': ['123', '126'], 'value': '+'}; {'id': '123', 'type': 'binary_operator', 'children': ['124', '125'], 'value': '+'}; {'id': '124', 'type': 'string', 'children': [], 'value': "'No scan parameter '"}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'scan_parameter'}; {'id': '126', 'type': 'string', 'children': [], 'value': "' found'"}; {'id': '127', 'type': 'raise_statement', 'children': ['128']}; {'id': '128', 'type': 'call', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'RuntimeError'}; {'id': '130', 'type': 'argument_list', 'children': ['131']}; {'id': '131', 'type': 'string', 'children': [], 'value': "'Scan parameter not found'"}; {'id': '132', 'type': 'return_statement', 'children': ['133']}; {'id': '133', 'type': 'call', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'unique_row'}; {'id': '135', 'type': 'argument_list', 'children': ['136', '137', '140']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'meta_data_array'}; {'id': '137', 'type': 'keyword_argument', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'use_columns'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'use_columns'}; {'id': '140', 'type': 'keyword_argument', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'selected_columns_only'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'scan_parameter_columns_only'}
|
Takes the numpy meta data array and returns the first rows with unique combinations of different scan parameter values for selected scan parameters.
If selected columns only is true, the returned histogram only contains the selected columns.
Parameters
----------
meta_data_array : numpy.ndarray
scan_parameters : list of string, None
Scan parameter names taken. If None all are used.
selected_columns_only : bool
Returns
-------
numpy.Histogram
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'command'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'with_statement', 'children': ['7', '15']}; {'id': '7', 'type': 'with_clause', 'children': ['8']}; {'id': '8', 'type': 'with_item', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'cd'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'remote_path'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sudo'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '27']}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '24'], 'value': '+'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'python'}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '26'], 'value': '%'}; {'id': '25', 'type': 'string', 'children': [], 'value': "' manage.py %s'"}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'remote_user'}
|
Run custom Django management command
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'are_budget_data_package_fields_filled_in'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'resource'}; {'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': 'fields'}; {'id': '10', 'type': 'list', 'children': ['11', '12', '13', '14'], 'value': "['country', 'currency', 'year', 'status']"}; {'id': '11', 'type': 'string', 'children': [], 'value': "'country'"}; {'id': '12', 'type': 'string', 'children': [], 'value': "'currency'"}; {'id': '13', 'type': 'string', 'children': [], 'value': "'year'"}; {'id': '14', 'type': 'string', 'children': [], 'value': "'status'"}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'list_comprehension', 'children': ['20', '27']}; {'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': 'in_resource'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'resource'}; {'id': '27', 'type': 'for_in_clause', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'fields'}
|
Check if the budget data package fields are all filled in because
if not then this can't be a budget data package
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load_data'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '7', 'type': 'block', 'children': ['8', '15', '22', '30', '38', '47', '52', '96', '116']}; {'id': '8', 'type': 'import_from_statement', 'children': ['9', '13']}; {'id': '9', 'type': 'dotted_name', 'children': ['10', '11', '12']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'spyder_kernels'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'iofuncs'}; {'id': '13', 'type': 'dotted_name', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'iofunctions'}; {'id': '15', 'type': 'import_from_statement', 'children': ['16', '20']}; {'id': '16', 'type': 'dotted_name', 'children': ['17', '18', '19']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'spyder_kernels'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'misc'}; {'id': '20', 'type': 'dotted_name', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'fix_reference_name'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'glbs'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_mglobals'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'load_func'}; {'id': '33', 'type': 'subscript', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'iofunctions'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'load_funcs'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '43']}; {'id': '40', 'type': 'pattern_list', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'error_message'}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'load_func'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '47', 'type': 'if_statement', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'error_message'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'error_message'}; {'id': '52', 'type': 'for_statement', 'children': ['53', '54', '62']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '61', 'type': 'argument_list', 'children': []}; {'id': '62', 'type': 'block', 'children': ['63', '80']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'new_key'}; {'id': '66', 'type': 'call', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'fix_reference_name'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '70', 'type': 'keyword_argument', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'blacklist'}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'glbs'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '79', 'type': 'argument_list', 'children': []}; {'id': '80', 'type': 'if_statement', 'children': ['81', '84']}; {'id': '81', 'type': 'comparison_operator', 'children': ['82', '83'], 'value': '!='}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'new_key'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '84', 'type': 'block', 'children': ['85']}; {'id': '85', 'type': 'expression_statement', 'children': ['86']}; {'id': '86', 'type': 'assignment', 'children': ['87', '90']}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'new_key'}; {'id': '90', 'type': 'call', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '96', 'type': 'try_statement', 'children': ['97', '105']}; {'id': '97', 'type': 'block', 'children': ['98']}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'glbs'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '105', 'type': 'except_clause', 'children': ['106', '110']}; {'id': '106', 'type': 'as_pattern', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '108', 'type': 'as_pattern_target', 'children': ['109']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '110', 'type': 'block', 'children': ['111']}; {'id': '111', 'type': 'return_statement', 'children': ['112']}; {'id': '112', 'type': 'call', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '114', 'type': 'argument_list', 'children': ['115']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '116', 'type': 'return_statement', 'children': ['117']}; {'id': '117', 'type': 'None', 'children': []}
|
Load data from filename
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'src_paths'}; {'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': 'set_comprehension', 'children': ['8', '9', '22']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '9', 'type': 'for_in_clause', 'children': ['10', '13']}; {'id': '10', 'type': 'pattern_list', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'summary'}; {'id': '13', 'type': 'call', 'children': ['14', '21']}; {'id': '14', 'type': 'attribute', 'children': ['15', '20']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_diff_violations'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'if_clause', 'children': ['23']}; {'id': '23', 'type': 'comparison_operator', 'children': ['24', '30'], 'value': '>'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'summary'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'measured_lines'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '0'}
|
Return a list of source files in the diff
for which we have coverage information.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'explain'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '75', '84', '109']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '18', '69']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ir'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'Expr'}; {'id': '18', 'type': 'block', 'children': ['19', '32', '42', '57']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'context'}; {'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': 'dialect'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'make_context'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'query_ast'}; {'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': '_build_ast'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '42', 'type': 'if_statement', 'children': ['43', '51']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '50'], 'value': '>'}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'query_ast'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'queries'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'raise_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'string', 'children': [], 'value': "'Multi-query expression'"}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '60', 'type': 'call', 'children': ['61', '68']}; {'id': '61', 'type': 'attribute', 'children': ['62', '67']}; {'id': '62', 'type': 'subscript', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'query_ast'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'queries'}; {'id': '66', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'compile'}; {'id': '68', 'type': 'argument_list', 'children': []}; {'id': '69', 'type': 'else_clause', 'children': ['70']}; {'id': '70', 'type': 'block', 'children': ['71']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'statement'}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'string', 'children': [], 'value': "'EXPLAIN {0}'"}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '84', 'type': 'with_statement', 'children': ['85', '99']}; {'id': '85', 'type': 'with_clause', 'children': ['86']}; {'id': '86', 'type': 'with_item', 'children': ['87']}; {'id': '87', 'type': 'as_pattern', 'children': ['88', '97']}; {'id': '88', 'type': 'call', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': '_execute'}; {'id': '92', 'type': 'argument_list', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'statement'}; {'id': '94', 'type': 'keyword_argument', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '96', 'type': 'True', 'children': []}; {'id': '97', 'type': 'as_pattern_target', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'cur'}; {'id': '99', 'type': 'block', 'children': ['100']}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '103', 'type': 'call', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': '_get_list'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'cur'}; {'id': '109', 'type': 'return_statement', 'children': ['110']}; {'id': '110', 'type': 'call', 'children': ['111', '114']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'string', 'children': [], 'value': "'Query:\\n{0}\\n\\n{1}'"}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '114', 'type': 'argument_list', 'children': ['115', '122']}; {'id': '115', 'type': 'call', 'children': ['116', '119']}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'util'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '119', 'type': 'argument_list', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '121', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '122', 'type': 'call', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '126', 'type': 'argument_list', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'result'}
|
Query for and return the query plan associated with the indicated
expression or SQL query.
Returns
-------
plan : string
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '17']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'DEFINE_boolean'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '12', '15']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'default'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'help'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'flag_values'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_flagvalues'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'FLAGS'}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'module_name'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'dictionary_splat_pattern', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'DEFINE_flag'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '32', '33']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_flag'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'BooleanFlag'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28', '29', '30']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'default'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'help'}; {'id': '30', 'type': 'dictionary_splat', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'flag_values'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'module_name'}
|
Registers a boolean flag.
Such a boolean flag does not take an argument. If a user wants to
specify a false value explicitly, the long option beginning with 'no'
must be used: i.e. --noflag
This flag will have a value of None, True or False. None is possible
if default=None and the user does not specify the flag on the command
line.
Args:
name: str, the flag name.
default: bool|str|None, the default value of the flag.
help: str, the help message.
flag_values: FlagValues, the FlagValues instance with which the flag will
be registered. This should almost never need to be overridden.
module_name: str, the name of the Python module declaring this flag.
If not provided, it will be computed using the stack trace of this call.
**args: dict, the extra keyword args that are passed to Flag __init__.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'upload_file'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'abspath'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'cloud_filename'}; {'id': '7', 'type': 'block', 'children': ['8', '114', '120']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '13']}; {'id': '9', 'type': 'not_operator', 'children': ['10']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'test_run'}; {'id': '13', 'type': 'block', 'children': ['14', '22', '30', '38', '74']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'abspath'}; {'id': '21', 'type': 'string', 'children': [], 'value': '"rb"'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'content_type'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'get_content_type'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'cloud_filename'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'get_headers'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'cloud_filename'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'content_type'}; {'id': '38', 'type': 'if_statement', 'children': ['39', '47', '61']}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '46'], 'value': '=='}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"Content-Encoding"'}; {'id': '46', 'type': 'string', 'children': [], 'value': '"gzip"'}; {'id': '47', 'type': 'block', 'children': ['48', '55']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'get_gzipped_contents'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '61', 'type': 'else_clause', 'children': ['62']}; {'id': '62', 'type': 'block', 'children': ['63']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '66', 'type': 'attribute', 'children': ['67', '73']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'abspath'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'st_size'}; {'id': '74', 'type': 'expression_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': 'container'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'create'}; {'id': '81', 'type': 'argument_list', 'children': ['82', '85', '88', '91', '94', '103', '106', '111']}; {'id': '82', 'type': 'keyword_argument', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'obj_name'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'cloud_filename'}; {'id': '85', 'type': 'keyword_argument', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '88', 'type': 'keyword_argument', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'content_type'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'content_type'}; {'id': '91', 'type': 'keyword_argument', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'content_length'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '94', 'type': 'keyword_argument', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'content_encoding'}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '100', 'type': 'argument_list', 'children': ['101', '102']}; {'id': '101', 'type': 'string', 'children': [], 'value': '"Content-Encoding"'}; {'id': '102', 'type': 'None', 'children': []}; {'id': '103', 'type': 'keyword_argument', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '106', 'type': 'keyword_argument', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'ttl'}; {'id': '108', 'type': 'subscript', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'CUMULUS'}; {'id': '110', 'type': 'string', 'children': [], 'value': '"FILE_TTL"'}; {'id': '111', 'type': 'keyword_argument', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'etag'}; {'id': '113', 'type': 'None', 'children': []}; {'id': '114', 'type': 'expression_statement', 'children': ['115']}; {'id': '115', 'type': 'augmented_assignment', 'children': ['116', '119'], 'value': '+='}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'upload_count'}; {'id': '119', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '120', 'type': 'if_statement', 'children': ['121', '131']}; {'id': '121', 'type': 'boolean_operator', 'children': ['122', '126'], 'value': 'or'}; {'id': '122', 'type': 'not_operator', 'children': ['123']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'quiet'}; {'id': '126', 'type': 'comparison_operator', 'children': ['127', '130'], 'value': '>'}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'verbosity'}; {'id': '130', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '131', 'type': 'block', 'children': ['132']}; {'id': '132', 'type': 'expression_statement', 'children': ['133']}; {'id': '133', 'type': 'call', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '135', 'type': 'argument_list', 'children': ['136']}; {'id': '136', 'type': 'call', 'children': ['137', '140']}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'string', 'children': [], 'value': '"Uploaded: {0}"'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '140', 'type': 'argument_list', 'children': ['141']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'cloud_filename'}
|
Uploads a file to the container.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'GetIndex'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '46', '64', '81']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'if_statement', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '19', 'type': 'block', 'children': ['20', '36']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '25']}; {'id': '22', 'type': 'pattern_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'ui'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'chmlib'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'chm_resolve_object'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '36', 'type': 'if_statement', 'children': ['37', '43']}; {'id': '37', 'type': '()', 'children': ['38']}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '40'], 'value': '!='}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'chmlib'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'CHM_RESOLVE_SUCCESS'}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '51']}; {'id': '48', 'type': 'pattern_list', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'chmlib'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'chm_retrieve_object'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '59', '60', '61']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'ui'}; {'id': '60', 'type': 'integer', 'children': [], 'value': '0l'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'ui'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '64', 'type': 'if_statement', 'children': ['65', '69']}; {'id': '65', 'type': '()', 'children': ['66']}; {'id': '66', 'type': 'comparison_operator', 'children': ['67', '68'], 'value': '=='}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '69', 'type': 'block', 'children': ['70', '79']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '77']}; {'id': '72', 'type': 'attribute', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'stderr'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'string', 'children': [], 'value': "'GetIndex: file size = 0\\n'"}; {'id': '79', 'type': 'return_statement', 'children': ['80']}; {'id': '80', 'type': 'None', 'children': []}; {'id': '81', 'type': 'return_statement', 'children': ['82']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'text'}
|
Reads and returns the index tree.
This auxiliary function reads and returns the index tree file
contents for the CHM archive.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'info'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '20', '40', '55', '69', '87']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'controller'}; {'id': '9', 'type': 'subscript', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '13', 'type': 'string', 'children': [], 'value': "'controller'"}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'controller'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'click'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'echo'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'OATH version: {}.{}.{}'"}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '34', '37']}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '33', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '39', 'type': 'integer', 'children': [], 'value': '2'}; {'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': 'click'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'echo'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'binary_operator', 'children': ['47', '48'], 'value': '+'}; {'id': '47', 'type': 'string', 'children': [], 'value': "'Password protection '"}; {'id': '48', 'type': '()', 'children': ['49']}; {'id': '49', 'type': 'conditional_expression', 'children': ['50', '51', '54'], 'value': 'if'}; {'id': '50', 'type': 'string', 'children': [], 'value': "'enabled'"}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'controller'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'locked'}; {'id': '54', 'type': 'string', 'children': [], 'value': "'disabled'"}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '58', 'type': 'call', 'children': ['59', '66']}; {'id': '59', 'type': 'attribute', 'children': ['60', '65']}; {'id': '60', 'type': 'subscript', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '64', 'type': 'string', 'children': [], 'value': "'settings'"}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '68']}; {'id': '67', 'type': 'string', 'children': [], 'value': "'keys'"}; {'id': '68', 'type': 'dictionary', 'children': []}; {'id': '69', 'type': 'if_statement', 'children': ['70', '79']}; {'id': '70', 'type': 'boolean_operator', 'children': ['71', '74'], 'value': 'and'}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'controller'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'locked'}; {'id': '74', 'type': 'comparison_operator', 'children': ['75', '78'], 'value': 'in'}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'controller'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'click'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'echo'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'string', 'children': [], 'value': "'The password for this YubiKey is remembered by ykman.'"}; {'id': '87', 'type': 'if_statement', 'children': ['88', '95']}; {'id': '88', 'type': 'attribute', 'children': ['89', '94']}; {'id': '89', 'type': 'subscript', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '93', 'type': 'string', 'children': [], 'value': "'dev'"}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'is_fips'}; {'id': '95', 'type': 'block', 'children': ['96']}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'click'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'echo'}; {'id': '101', 'type': 'argument_list', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'string', 'children': [], 'value': "'FIPS Approved Mode: {}'"}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'conditional_expression', 'children': ['108', '109', '112'], 'value': 'if'}; {'id': '108', 'type': 'string', 'children': [], 'value': "'Yes'"}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'controller'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'is_in_fips_mode'}; {'id': '112', 'type': 'string', 'children': [], 'value': "'No'"}
|
Display status of OATH application.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'export_for_training'}; {'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': 'file_path'}; {'id': '7', 'type': 'string', 'children': [], 'value': "'./export.json'"}; {'id': '8', 'type': 'block', 'children': ['9', '12', '23']}; {'id': '9', 'type': 'import_statement', 'children': ['10']}; {'id': '10', 'type': 'dotted_name', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'export'}; {'id': '15', 'type': 'dictionary', 'children': ['16']}; {'id': '16', 'type': 'pair', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'conversations'"}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_generate_export_data'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'with_statement', 'children': ['24', '34']}; {'id': '24', 'type': 'with_clause', 'children': ['25']}; {'id': '25', 'type': 'with_item', 'children': ['26']}; {'id': '26', 'type': 'as_pattern', 'children': ['27', '32']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'file_path'}; {'id': '31', 'type': 'string', 'children': [], 'value': "'w+'"}; {'id': '32', 'type': 'as_pattern_target', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'jsonfile'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'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': 'json'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'dump'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '42', '43']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'export'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'jsonfile'}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'ensure_ascii'}; {'id': '45', 'type': 'False', 'children': []}
|
Create a file from the database that can be used to
train other chat bots.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'subtract'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'range2'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '33', '55', '74', '120', '166']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'outranges'}; {'id': '10', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '11', 'type': 'if_statement', 'children': ['12', '19']}; {'id': '12', 'type': 'comparison_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': 'chr'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'range2'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'chr'}; {'id': '19', 'type': 'block', 'children': ['20', '31']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'outranges'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '30', 'type': 'argument_list', 'children': []}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'outranges'}; {'id': '33', 'type': 'if_statement', 'children': ['34', '41']}; {'id': '34', 'type': 'not_operator', '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': 'overlaps'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'range2'}; {'id': '41', 'type': 'block', 'children': ['42', '53']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'outranges'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'append'}; {'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': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '52', 'type': 'argument_list', 'children': []}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'outranges'}; {'id': '55', 'type': 'if_statement', 'children': ['56', '71']}; {'id': '56', 'type': 'boolean_operator', 'children': ['57', '64'], 'value': 'and'}; {'id': '57', 'type': 'comparison_operator', 'children': ['58', '61'], 'value': '<='}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'range2'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '68'], 'value': '>='}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'range2'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'return_statement', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'outranges'}; {'id': '74', 'type': 'if_statement', 'children': ['75', '82']}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '79'], 'value': '>'}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'range2'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '82', 'type': 'block', 'children': ['83', '113']}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'assignment', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'nrng'}; {'id': '86', 'type': 'call', 'children': ['87', '91']}; {'id': '87', 'type': 'call', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '91', 'type': 'argument_list', 'children': ['92', '95', '102', '107', '110']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'chr'}; {'id': '95', 'type': 'binary_operator', 'children': ['96', '99'], 'value': '+'}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': '_start_offset'}; {'id': '102', 'type': 'binary_operator', 'children': ['103', '106'], 'value': '-'}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'range2'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '106', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'dir'}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'call', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'outranges'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'nrng'}; {'id': '120', 'type': 'if_statement', 'children': ['121', '128']}; {'id': '121', 'type': 'comparison_operator', 'children': ['122', '125'], 'value': '<'}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'range2'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '128', 'type': 'block', 'children': ['129', '159']}; {'id': '129', 'type': 'expression_statement', 'children': ['130']}; {'id': '130', 'type': 'assignment', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'nrng'}; {'id': '132', 'type': 'call', 'children': ['133', '137']}; {'id': '133', 'type': 'call', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '135', 'type': 'argument_list', 'children': ['136']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '137', 'type': 'argument_list', 'children': ['138', '141', '150', '153', '156']}; {'id': '138', 'type': 'attribute', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'chr'}; {'id': '141', 'type': 'binary_operator', 'children': ['142', '147'], 'value': '+'}; {'id': '142', 'type': 'binary_operator', 'children': ['143', '146'], 'value': '+'}; {'id': '143', 'type': 'attribute', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'range2'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '146', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '147', 'type': 'attribute', 'children': ['148', '149']}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': '_start_offset'}; {'id': '150', 'type': 'attribute', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '153', 'type': 'attribute', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '156', 'type': 'attribute', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'dir'}; {'id': '159', 'type': 'expression_statement', 'children': ['160']}; {'id': '160', 'type': 'call', 'children': ['161', '164']}; {'id': '161', 'type': 'attribute', 'children': ['162', '163']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'outranges'}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '164', 'type': 'argument_list', 'children': ['165']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'nrng'}; {'id': '166', 'type': 'return_statement', 'children': ['167']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'outranges'}
|
Take another range, and list of ranges after removing range2, keep options from self
:param range2:
:type range2: GenomicRange
:return: List of Genomic Ranges
:rtype: GenomicRange[]
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'close'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'keyword_separator', 'children': []}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'force_after'}; {'id': '8', 'type': 'integer', 'children': [], 'value': '30'}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'transport'}; {'id': '14', 'type': 'block', 'children': ['15', '23']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'transport'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'try_statement', 'children': ['24', '42']}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'with_statement', 'children': ['26', '32']}; {'id': '26', 'type': 'with_clause', 'children': ['27']}; {'id': '27', 'type': 'with_item', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'timeout_after'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'force_after'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'await', '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': 'closed_event'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'wait'}; {'id': '41', 'type': 'argument_list', 'children': []}; {'id': '42', 'type': 'except_clause', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'TaskTimeout'}; {'id': '44', 'type': 'block', 'children': ['45', '51']}; {'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': 'abort'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'await', 'children': ['53']}; {'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': 'self'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'closed_event'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'wait'}; {'id': '59', 'type': 'argument_list', 'children': []}
|
Close the connection and return when closed.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'validate_contents'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'file_contents'}; {'id': '5', 'type': 'block', 'children': ['6', '53']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '10', '15']}; {'id': '7', 'type': 'pattern_list', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'contents'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'file_contents'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '31', '37']}; {'id': '16', 'type': 'if_statement', 'children': ['17', '29']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '28'], 'value': '!='}; {'id': '18', 'type': 'subscript', 'children': ['19', '27']}; {'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': 'os'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'splitext'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'.ipynb'"}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'continue_statement', 'children': []}; {'id': '31', 'type': 'if_statement', 'children': ['32', '34']}; {'id': '32', 'type': 'not_operator', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'contents'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'False', 'children': []}; {'id': '37', 'type': 'try_statement', 'children': ['38', '48']}; {'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': 'json_object'}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'loads'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'contents'}; {'id': '48', 'type': 'except_clause', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'False', 'children': []}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'True', 'children': []}
|
Ensures that all ipynb files in FILE_CONTENTS
are valid JSON files.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'stop_actions'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '22']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '13']}; {'id': '8', 'type': 'pattern_list', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_stop_actions'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'value'}; {'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': 'get_attr_set'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_stop_actions'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'stop_actions'"}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'value'}
|
Gets a list of stop actions. Valid values are `coast`
and `brake`.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_gap'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'src_interval'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'tar_interval'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '20', '24', '36', '48', '54', '91']}; {'id': '7', 'type': 'assert_statement', 'children': ['8', '15']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': '=='}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'src_interval'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'bits'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'tar_interval'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'bits'}; {'id': '15', 'type': 'string', 'children': [], 'value': '"Number of bits should be same for operands"'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'src_interval'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'tar_interval'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '29']}; {'id': '26', 'type': 'tuple_pattern', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '29', 'type': 'tuple', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'lower_bound'}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'upper_bound'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '41']}; {'id': '38', 'type': 'tuple_pattern', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '41', 'type': 'tuple', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'lower_bound'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'upper_bound'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'w'}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'bits'}; {'id': '54', 'type': 'if_statement', 'children': ['55', '72']}; {'id': '55', 'type': 'boolean_operator', 'children': ['56', '64'], 'value': 'and'}; {'id': '56', 'type': '()', 'children': ['57']}; {'id': '57', 'type': 'not_operator', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': '_surrounds_member'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '64', 'type': '()', 'children': ['65']}; {'id': '65', 'type': 'not_operator', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': '_surrounds_member'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '72', 'type': 'block', 'children': ['73']}; {'id': '73', 'type': 'return_statement', 'children': ['74']}; {'id': '74', 'type': 'attribute', 'children': ['75', '90']}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'StridedInterval'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '81', '84', '87']}; {'id': '78', 'type': 'keyword_argument', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'lower_bound'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '81', 'type': 'keyword_argument', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'upper_bound'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '84', 'type': 'keyword_argument', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'bits'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'w'}; {'id': '87', 'type': 'keyword_argument', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'stride'}; {'id': '89', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'complement'}; {'id': '91', 'type': 'return_statement', 'children': ['92']}; {'id': '92', 'type': 'call', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'StridedInterval'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'empty'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'w'}
|
Refer section 3.1; gap function.
:param src_interval: first argument or interval 1
:param tar_interval: second argument or interval 2
:return: Interval representing gap between two intervals
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'calc_across_paths_textnodes'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'paths_nodes'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'dbg'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'for_statement', 'children': ['10', '11', '12']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'path_nodes'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'paths_nodes'}; {'id': '12', 'type': 'block', 'children': ['13', '24', '42', '50', '58', '68']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'cnt'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'subscript', 'children': ['20', '23']}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'path_nodes'}; {'id': '22', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'ttl'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'list_comprehension', 'children': ['31', '35']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '35', 'type': 'for_in_clause', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '37', 'type': 'subscript', 'children': ['38', '41']}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'paths_nodes'}; {'id': '40', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '49']}; {'id': '44', 'type': 'subscript', 'children': ['45', '48']}; {'id': '45', 'type': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'path_nodes'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'cnt'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '57']}; {'id': '52', 'type': 'subscript', 'children': ['53', '56']}; {'id': '53', 'type': 'subscript', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'path_nodes'}; {'id': '55', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '56', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'ttl'}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '65']}; {'id': '60', 'type': 'subscript', 'children': ['61', '64']}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'path_nodes'}; {'id': '63', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '67'], 'value': '/'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'ttl'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'cnt'}; {'id': '68', 'type': 'if_statement', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'dbg'}; {'id': '70', 'type': 'block', 'children': ['71']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'subscript', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'path_nodes'}; {'id': '77', 'type': 'integer', 'children': [], 'value': '1'}
|
Given a list of parent paths tupled with children textnodes, plus
initialized feature values, we calculate the total and average string
length of the parent's children textnodes.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'group'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '6', 'type': 'block', 'children': ['7', '17']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': '<='}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '0'}; {'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': 'ValueError'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'string', 'children': [], 'value': '"n must be a positive integer"'}; {'id': '17', 'type': 'return_statement', 'children': ['18']}; {'id': '18', 'type': 'list_comprehension', 'children': ['19', '27']}; {'id': '19', 'type': 'subscript', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '21', 'type': 'slice', 'children': ['22', '23', '24']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '23', 'type': 'colon', 'children': []}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '26'], 'value': '+'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '27', 'type': 'for_in_clause', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33', '37']}; {'id': '32', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'size'}
|
Group ``text`` into blocks of ``size``.
Example:
>>> group("test", 2)
['te', 'st']
Args:
text (str): text to separate
size (int): size of groups to split the text into
Returns:
List of n-sized groups of text
Raises:
ValueError: If n is non positive
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'destroy'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '20', '31', '74']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_running'}; {'id': '11', 'type': 'False', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': []}; {'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': '_running'}; {'id': '19', 'type': 'False', 'children': []}; {'id': '20', 'type': 'if_statement', 'children': ['21', '26']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'schedule'"}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'delete_statement', 'children': ['28']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'schedule'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '43']}; {'id': '32', 'type': 'boolean_operator', 'children': ['33', '38'], 'value': 'and'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'string', 'children': [], 'value': "'pub_channel'"}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '42'], 'value': 'is not'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'pub_channel'}; {'id': '42', 'type': 'None', 'children': []}; {'id': '43', 'type': 'block', 'children': ['44', '53', '70']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'call', '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': 'pub_channel'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'on_recv'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'None', 'children': []}; {'id': '53', 'type': 'if_statement', 'children': ['54', '61']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '56', 'type': 'argument_list', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'pub_channel'}; {'id': '60', 'type': 'string', 'children': [], 'value': "'close'"}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '69']}; {'id': '64', 'type': 'attribute', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'pub_channel'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '69', 'type': 'argument_list', 'children': []}; {'id': '70', 'type': 'delete_statement', 'children': ['71']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'pub_channel'}; {'id': '74', 'type': 'if_statement', 'children': ['75', '80']}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '79', 'type': 'string', 'children': [], 'value': "'periodic_callbacks'"}; {'id': '80', 'type': 'block', 'children': ['81']}; {'id': '81', 'type': 'for_statement', 'children': ['82', '83', '91']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'cb'}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'itervalues'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'periodic_callbacks'}; {'id': '91', 'type': 'block', 'children': ['92']}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'cb'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '97', 'type': 'argument_list', 'children': []}
|
Tear down the minion
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'pint_multiply'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'da'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'q'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'out_units'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '19', '29', '41', '49', '62']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '13', 'type': 'binary_operator', 'children': ['14', '15'], 'value': '*'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'units2pint'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'da'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '22', 'type': 'binary_operator', 'children': ['23', '24'], 'value': '*'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'q'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'to_base_units'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'if_statement', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'out_units'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'to'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'out_units'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '44', 'type': 'binary_operator', 'children': ['45', '46'], 'value': '*'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'da'}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'magnitude'}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '56']}; {'id': '51', 'type': 'subscript', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '55', 'type': 'string', 'children': [], 'value': "'units'"}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'pint2cfunits'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'units'}; {'id': '62', 'type': 'return_statement', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'out'}
|
Multiply xarray.DataArray by pint.Quantity.
Parameters
----------
da : xr.DataArray
Input array.
q : pint.Quantity
Multiplicating factor.
out_units : str
Units the output array should be converted into.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_to_dict'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '25']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'physical_prop_names'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'find_PhysicalProperty'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'physical_prop_vals'}; {'id': '16', 'type': 'list_comprehension', 'children': ['17', '22']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'prop'}; {'id': '22', 'type': 'for_in_clause', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'prop'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'physical_prop_names'}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'physical_prop_names'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'physical_prop_vals'}
|
Return a dictionary representation of the current object.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'category'}; {'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', '29']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11', '23']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': 'in'}; {'id': '9', 'type': 'string', 'children': [], 'value': "'series'"}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '11', 'type': 'block', 'children': ['12', '19']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'string', 'children': [], 'value': "'series'"}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'series'"}; {'id': '23', 'type': 'else_clause', 'children': ['24']}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '28', 'type': 'None', 'children': []}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '36']}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'Fred'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'category'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '38', 'type': 'dictionary_splat', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
|
Get a category.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_dicts'}; {'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']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'counters'}; {'id': '10', 'type': 'list_comprehension', 'children': ['11', '15']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'Counter'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'arg'}; {'id': '15', 'type': 'for_in_clause', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'arg'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'reduce'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'counters'}
|
Adds two or more dicts together. Common keys will have their values added.
For example::
>>> t1 = {'a':1, 'b':2}
>>> t2 = {'b':1, 'c':3}
>>> t3 = {'d':4}
>>> add_dicts(t1, t2, t3)
{'a': 1, 'c': 3, 'b': 3, 'd': 4}
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'rename_dimension'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'old_name'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'new_name'}; {'id': '7', 'type': 'block', 'children': ['8', '24']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '14']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': 'not in'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'old_name'}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'dimension_names'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'raise_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '21'], 'value': '%'}; {'id': '20', 'type': 'string', 'children': [], 'value': '"Shape %s does not have dimension named %s"'}; {'id': '21', 'type': 'tuple', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'old_name'}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'Shape'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'list_comprehension', 'children': ['29', '43']}; {'id': '29', 'type': 'conditional_expression', 'children': ['30', '37', '42'], 'value': 'if'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'Dimension'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'new_name'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '37', 'type': 'comparison_operator', 'children': ['38', '41'], 'value': '=='}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'old_name'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '43', 'type': 'for_in_clause', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'dims'}
|
Returns a copy where one dimension is renamed.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_dst_resolution'}; {'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': 'dst_res'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '27']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '13']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': 'is'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'dst_res'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'dst_res'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'min'}; {'id': '19', 'type': 'argument_list', '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': '_res_indices'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'dst_res'}
|
Get default resolution, i.e. the highest resolution or smallest cell size.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_instance'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'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': 'EventInstance'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '14', '15']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_version'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '15', 'type': 'keyword_argument', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'workspace_sid'}; {'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': '_solution'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'workspace_sid'"}
|
Build an instance of EventInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.event.EventInstance
:rtype: twilio.rest.taskrouter.v1.workspace.event.EventInstance
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_find_unchanged'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'old'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'new'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '26', '41', '60']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'edges'}; {'id': '10', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'old_edges'}; {'id': '14', 'type': 'list_comprehension', 'children': ['15', '19']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'edge'}; {'id': '19', 'type': 'for_in_clause', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'edge'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'old'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'edges'}; {'id': '25', 'type': 'argument_list', 'children': []}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'new_edges'}; {'id': '29', 'type': 'list_comprehension', 'children': ['30', '34']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'edge'}; {'id': '34', 'type': 'for_in_clause', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'edge'}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'new'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'edges'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'for_statement', 'children': ['42', '43', '44']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'old_edge'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'old_edges'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'if_statement', 'children': ['46', '49']}; {'id': '46', 'type': 'comparison_operator', 'children': ['47', '48'], 'value': 'in'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'old_edge'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'new_edges'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'edges'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'append'}; {'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': 'identifier', 'children': [], 'value': 'old_edge'}; {'id': '60', 'type': 'return_statement', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'edges'}
|
returns edges that are in both old and new
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'hazard_extra_keyword'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'keyword'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'feature'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '7', 'type': 'block', 'children': ['8', '14', '33', '42', '51', '60', '100']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '11', 'type': 'expression_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'feature'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'hazard_layer_path'}; {'id': '17', 'type': 'call', 'children': ['18', '31']}; {'id': '18', 'type': 'attribute', 'children': ['19', '30']}; {'id': '19', 'type': 'call', 'children': ['20', '24']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22', '23']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'QgsExpressionContextUtils'}; {'id': '22', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'projectScope'}; {'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': 'QgsProject'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'variable'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': "'hazard_layer'"}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'hazard_layer'}; {'id': '36', 'type': 'subscript', 'children': ['37', '41']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'load_layer'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'hazard_layer_path'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'keywords'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'KeywordIO'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'read_keywords'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'hazard_layer'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'extra_keywords'}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'keywords'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'string', 'children': [], 'value': "'extra_keywords'"}; {'id': '60', 'type': 'if_statement', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'extra_keywords'}; {'id': '62', 'type': 'block', 'children': ['63', '72']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'extra_keywords'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'keyword'}; {'id': '72', 'type': 'if_statement', 'children': ['73', '74', '91']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '74', 'type': 'block', 'children': ['75', '82', '89']}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'value_definition'}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'definition'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '82', 'type': 'if_statement', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'value_definition'}; {'id': '84', 'type': 'block', 'children': ['85']}; {'id': '85', 'type': 'return_statement', 'children': ['86']}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'value_definition'}; {'id': '88', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '89', 'type': 'return_statement', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '91', 'type': 'else_clause', 'children': ['92']}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'return_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'tr'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'binary_operator', 'children': ['98', '99'], 'value': '%'}; {'id': '98', 'type': 'string', 'children': [], 'value': "'Keyword %s is not found'"}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'keyword'}; {'id': '100', 'type': 'return_statement', 'children': ['101']}; {'id': '101', 'type': 'call', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'tr'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'string', 'children': [], 'value': "'No extra keywords found'"}
|
Given a keyword, it will return the value of the keyword
from the hazard layer's extra keywords.
For instance:
* hazard_extra_keyword( 'depth' ) -> will return the value of 'depth'
in current hazard layer's extra keywords.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'parse'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'showToc'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '18']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'Parser'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'keyword_argument', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'show_toc'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'showToc'}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'parse'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'text'}
|
Returns HTML from MediaWiki markup
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'handle_request'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'start_response'}; {'id': '7', 'type': 'block', 'children': ['8', '19']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'urls'}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'url_map'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'bind_to_environ'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '19', 'type': 'try_statement', 'children': ['20', '57', '87']}; {'id': '20', 'type': 'block', 'children': ['21', '31', '42', '51']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '26']}; {'id': '23', 'type': 'pattern_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'urls'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '30', 'type': 'argument_list', 'children': []}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '36']}; {'id': '33', 'type': 'subscript', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '35', 'type': 'string', 'children': [], 'value': "'pywb.app_prefix'"}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'string', 'children': [], 'value': "'SCRIPT_NAME'"}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '49', 'type': 'dictionary_splat', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'start_response'}; {'id': '57', 'type': 'except_clause', 'children': ['58', '62']}; {'id': '58', 'type': 'as_pattern', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'HTTPException'}; {'id': '60', 'type': 'as_pattern_target', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '62', 'type': 'block', 'children': ['63', '72', '81']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'redir'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': '_check_refer_redirect'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '72', 'type': 'if_statement', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'redir'}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'return_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'redir'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'start_response'}; {'id': '81', 'type': 'return_statement', 'children': ['82']}; {'id': '82', 'type': 'call', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '84', 'type': 'argument_list', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'start_response'}; {'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': 'e'}; {'id': '92', 'type': 'block', 'children': ['93', '104', '122']}; {'id': '93', 'type': 'if_statement', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '97', 'type': 'block', 'children': ['98']}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'traceback'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'print_exc'}; {'id': '103', 'type': 'argument_list', 'children': []}; {'id': '104', 'type': 'expression_statement', 'children': ['105']}; {'id': '105', 'type': 'assignment', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '107', 'type': 'call', 'children': ['108', '113']}; {'id': '108', 'type': 'attribute', 'children': ['109', '112']}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'rewriterapp'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': '_error_response'}; {'id': '113', 'type': 'argument_list', 'children': ['114', '115', '121']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '115', 'type': 'binary_operator', 'children': ['116', '117'], 'value': '+'}; {'id': '116', 'type': 'string', 'children': [], 'value': "'Internal Error: '"}; {'id': '117', 'type': 'call', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '119', 'type': 'argument_list', 'children': ['120']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '121', 'type': 'string', 'children': [], 'value': "'500 Server Error'"}; {'id': '122', 'type': 'return_statement', 'children': ['123']}; {'id': '123', 'type': 'call', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '125', 'type': 'argument_list', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'start_response'}
|
Retrieves the route handler and calls the handler returning its the response
:param dict environ: The WSGI environment dictionary for the request
:param start_response:
:return: The WbResponse for the request
:rtype: WbResponse
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getLiteral'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '18', '88']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'chars'}; {'id': '9', 'type': 'string', 'children': [], 'value': "u''"}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'c'}; {'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': 'current'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'while_statement', 'children': ['19', '20']}; {'id': '19', 'type': 'True', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21', '62', '80']}; {'id': '21', 'type': 'if_statement', 'children': ['22', '27', '44', '56']}; {'id': '22', 'type': 'boolean_operator', 'children': ['23', '24'], 'value': 'and'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '26'], 'value': '=='}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '26', 'type': 'string', 'children': [], 'value': 'u"\\\\"'}; {'id': '27', 'type': 'block', 'children': ['28', '36', '43']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'next'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'if_statement', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'augmented_assignment', 'children': ['41', '42'], 'value': '+='}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'chars'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '43', 'type': 'continue_statement', 'children': []}; {'id': '44', 'type': 'elif_clause', 'children': ['45', '54']}; {'id': '45', 'type': 'boolean_operator', 'children': ['46', '48'], 'value': 'or'}; {'id': '46', 'type': 'not_operator', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '48', 'type': '()', 'children': ['49']}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '51'], 'value': 'in'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'meta_chars'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'break_statement', 'children': []}; {'id': '56', 'type': 'else_clause', 'children': ['57']}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'augmented_assignment', 'children': ['60', '61'], 'value': '+='}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'chars'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '62', 'type': 'if_statement', 'children': ['63', '78']}; {'id': '63', 'type': 'boolean_operator', 'children': ['64', '69'], 'value': 'and'}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'lookahead'}; {'id': '68', 'type': 'argument_list', 'children': []}; {'id': '69', 'type': 'comparison_operator', 'children': ['70', '75'], 'value': 'in'}; {'id': '70', 'type': 'call', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'lookahead'}; {'id': '74', 'type': 'argument_list', 'children': []}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'meta_chars'}; {'id': '78', 'type': 'block', 'children': ['79']}; {'id': '79', 'type': 'break_statement', 'children': []}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'next'}; {'id': '87', 'type': 'argument_list', 'children': []}; {'id': '88', 'type': 'return_statement', 'children': ['89']}; {'id': '89', 'type': 'call', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'StringGenerator'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'Literal'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'chars'}
|
Get a sequence of non-special characters.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dump'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'inst'}; {'id': '10', 'type': 'block', 'children': ['11', '13']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'string', 'children': [], 'value': '"Save the object instance to the stash."'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '20']}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'stash'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'dump'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'inst'}
|
Save the object instance to the stash.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'u8'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'align'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'uint'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20', '21', '22']}; {'id': '19', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'align'}
|
Add an unsigned 1 byte integer field to template.
This is an convenience method that simply calls `Uint` keyword with predefined length.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'filter_thumbnail_files'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'chan_path'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'filenames'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'metadata_provider'}; {'id': '7', 'type': 'block', 'children': ['8', '16', '20', '66']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'thumbnail_files_to_skip'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'metadata_provider'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'get_thumbnail_paths'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'filenames_cleaned'}; {'id': '19', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '20', 'type': 'for_statement', 'children': ['21', '22', '23']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'filenames'}; {'id': '23', 'type': 'block', 'children': ['24', '28', '40', '47', '56']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'keep'}; {'id': '27', 'type': 'True', 'children': []}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'chan_filepath'}; {'id': '31', 'type': 'call', 'children': ['32', '37']}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'chan_path'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'chan_filepath_tuple'}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'path_to_tuple'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'chan_filepath'}; {'id': '47', 'type': 'if_statement', 'children': ['48', '51']}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '50'], 'value': 'in'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'chan_filepath_tuple'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'thumbnail_files_to_skip'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'keep'}; {'id': '55', 'type': 'False', 'children': []}; {'id': '56', 'type': 'if_statement', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'keep'}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'filenames_cleaned'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '66', 'type': 'return_statement', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'filenames_cleaned'}
|
We don't want to create `ContentNode` from thumbnail files.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'deprecated_attr'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'replacement'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '19']}; {'id': '10', 'type': 'attribute', 'children': ['11', '18']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_deprecated_attrs'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '17', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'tuple', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'replacement'}
|
Marks a module level attribute as deprecated. Accessing it will emit
a PyGIDeprecationWarning warning.
e.g. for ``deprecated_attr("GObject", "STATUS_FOO", "GLib.Status.FOO")``
accessing GObject.STATUS_FOO will emit:
"GObject.STATUS_FOO is deprecated; use GLib.Status.FOO instead"
:param str namespace:
The namespace of the override this is called in.
:param str namespace:
The attribute name (which gets added to __all__).
:param str replacement:
The replacement text which will be included in the warning.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'debug_sql'}; {'id': '3', 'type': 'parameters', 'children': ['4', '8']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sql'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '8', 'type': 'typed_parameter', 'children': ['9', '11']}; {'id': '9', 'type': 'list_splat_pattern', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'Any'}; {'id': '13', 'type': 'type', 'children': ['14']}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '25']}; {'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': 'debug'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'binary_operator', 'children': ['23', '24'], 'value': '%'}; {'id': '23', 'type': 'string', 'children': [], 'value': '"SQL: %s"'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sql'}; {'id': '25', 'type': 'if_statement', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'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': 'log'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'binary_operator', 'children': ['35', '36'], 'value': '%'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"Args: %r"'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'args'}
|
Writes SQL and arguments to the log.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'imagenet50'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'display'}; {'id': '6', 'type': 'False', 'children': []}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'resolution'}; {'id': '9', 'type': 'integer', 'children': [], 'value': '224'}; {'id': '10', 'type': 'block', 'children': ['11', '17', '42', '56']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '14', 'type': 'binary_operator', 'children': ['15', '16'], 'value': '+'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'github_data_url'}; {'id': '16', 'type': 'string', 'children': [], 'value': '"imagenet50_"'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '20', 'type': 'call', 'children': ['21', '38']}; {'id': '21', 'type': 'attribute', 'children': ['22', '37']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'load'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'cache'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'binary_operator', 'children': ['31', '32'], 'value': '+'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '32', 'type': 'binary_operator', 'children': ['33', '34'], 'value': '%'}; {'id': '33', 'type': 'string', 'children': [], 'value': '"%sx%s.npy"'}; {'id': '34', 'type': 'tuple', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'resolution'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'resolution'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'float32'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'loadtxt'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'cache'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'binary_operator', 'children': ['54', '55'], 'value': '+'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '55', 'type': 'string', 'children': [], 'value': '"labels.csv"'}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'expression_list', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'y'}
|
This is a set of 50 images representative of ImageNet images.
This dataset was collected by randomly finding a working ImageNet link and then pasting the
original ImageNet image into Google image search restricted to images licensed for reuse. A
similar image (now with rights to reuse) was downloaded as a rough replacment for the original
ImageNet image. The point is to have a random sample of ImageNet for use as a background
distribution for explaining models trained on ImageNet data.
Note that because the images are only rough replacements the labels might no longer be correct.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'GetFormatterObject'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '79']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'if_statement', 'children': ['16', '21']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '18'], 'value': 'not in'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_formatter_objects'}; {'id': '21', 'type': 'block', 'children': ['22', '26', '47', '71']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'formatter_object'}; {'id': '25', 'type': 'None', 'children': []}; {'id': '26', 'type': 'if_statement', 'children': ['27', '32']}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '29'], 'value': 'in'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_formatter_classes'}; {'id': '32', 'type': 'block', 'children': ['33', '41']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'formatter_class'}; {'id': '36', 'type': 'subscript', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '_formatter_classes'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'formatter_object'}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'formatter_class'}; {'id': '46', 'type': 'argument_list', 'children': []}; {'id': '47', 'type': 'if_statement', 'children': ['48', '50']}; {'id': '48', 'type': 'not_operator', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'formatter_object'}; {'id': '50', 'type': 'block', 'children': ['51', '63']}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'string', 'children': [], 'value': "'Using default formatter for data type: {0:s}'"}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'formatter_object'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'default'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'DefaultFormatter'}; {'id': '70', 'type': 'argument_list', 'children': []}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '78']}; {'id': '73', 'type': 'subscript', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': '_formatter_objects'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'formatter_object'}; {'id': '79', 'type': 'return_statement', 'children': ['80']}; {'id': '80', 'type': 'subscript', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': '_formatter_objects'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'data_type'}
|
Retrieves the formatter object for a specific data type.
Args:
data_type (str): data type.
Returns:
EventFormatter: corresponding formatter or the default formatter if
not available.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'jenkins_rao'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'throat_perimeter'}; {'id': '7', 'type': 'string', 'children': [], 'value': "'throat.perimeter'"}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'throat_area'}; {'id': '10', 'type': 'string', 'children': [], 'value': "'throat.area'"}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'throat_diameter'}; {'id': '13', 'type': 'string', 'children': [], 'value': "'throat.indiameter'"}; {'id': '14', 'type': 'block', 'children': ['15', '17', '23', '29', '37', '49']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'P'}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'throat_perimeter'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'A'}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'throat_area'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '32', 'type': 'binary_operator', 'children': ['33', '36'], 'value': '/'}; {'id': '33', 'type': 'subscript', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'throat_diameter'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '45'], 'value': '/'}; {'id': '41', 'type': '()', 'children': ['42']}; {'id': '42', 'type': 'binary_operator', 'children': ['43', '44'], 'value': '/'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'P'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'A'}; {'id': '45', 'type': '()', 'children': ['46']}; {'id': '46', 'type': 'binary_operator', 'children': ['47', '48'], 'value': '/'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'value'}
|
r"""
Jenkins and Rao relate the capillary pressure in an eliptical throat to
the aspect ratio
References
----------
Jenkins, R.G. and Rao, M.B., The effect of elliptical pores on
mercury porosimetry results. Powder technology, 38(2), pp.177-180. (1984)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_status_descr_by_id'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'status_id'}; {'id': '5', 'type': 'block', 'children': ['6', '31']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '10', '16']}; {'id': '7', 'type': 'pattern_list', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'status_name'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'status_data'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'LINODE_STATUS'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'if_statement', 'children': ['18', '26']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '22'], 'value': '=='}; {'id': '19', 'type': 'subscript', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'status_data'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'code'"}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'status_id'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'status_data'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'descr'"}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'LINODE_STATUS'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'status_id'}; {'id': '38', 'type': 'None', 'children': []}
|
Return linode status by ID
status_id
linode VM status ID
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'info'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '42']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '14', '17']}; {'id': '11', 'type': 'pattern_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'prior_model_name'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'prior_model'}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'prior_model_tuples'}; {'id': '17', 'type': 'block', 'children': ['18', '29']}; {'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': 'info'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '28'], 'value': '+'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'prior_model'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'list_comprehension', 'children': ['36', '37']}; {'id': '36', 'type': 'string', 'children': [], 'value': 'f"{prior_model_name}_{item}"'}; {'id': '37', 'type': 'for_in_clause', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'prior_model'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'info'}
|
Use the priors that make up the model_mapper to generate information on each parameter of the overall model.
This information is extracted from each priors *model_info* property.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'attribute_exists'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'block', 'children': ['7', '25']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': 'in'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '22']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'issubclass'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '21']}; {'id': '16', 'type': 'attribute', 'children': ['17', '20']}; {'id': '17', 'type': 'subscript', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'Attribute'}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'True', 'children': []}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'False', 'children': []}
|
Returns if given attribute exists in the node.
Usage::
>>> node_a = AbstractNode("MyNodeA", attributeA=Attribute(), attributeB=Attribute())
>>> node_a.attribute_exists("attributeA")
True
>>> node_a.attribute_exists("attributeC")
False
:param name: Attribute name.
:type name: unicode
:return: Attribute exists.
:rtype: bool
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_node'}; {'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', '14', '27', '46', '59']}; {'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': 'non_terminated_nodes'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'dictionary', 'children': []}; {'id': '14', 'type': 'if_statement', 'children': ['15', '20']}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '17'], 'value': 'in'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'node_id'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'cached_nodes'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'return_statement', 'children': ['22']}; {'id': '22', 'type': 'subscript', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'cached_nodes'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'node_id'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'matches'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '41']}; {'id': '34', 'type': 'attribute', 'children': ['35', '40']}; {'id': '35', 'type': 'attribute', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ec2'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'instances'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'InstanceIds'}; {'id': '44', 'type': 'list', 'children': ['45'], 'value': '[node_id]'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'node_id'}; {'id': '46', 'type': 'assert_statement', 'children': ['47', '53']}; {'id': '47', 'type': 'comparison_operator', 'children': ['48', '52'], 'value': '=='}; {'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': 'matches'}; {'id': '52', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'string', 'children': [], 'value': '"Invalid instance id {}"'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'node_id'}; {'id': '59', 'type': 'return_statement', 'children': ['60']}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'matches'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '0'}
|
Refresh and get info for this node, updating the cache.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'find_specs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'directory'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '22', '42']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'specs'}; {'id': '10', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'spec_files'}; {'id': '14', 'type': 'call', 'children': ['15', '20']}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'file_finder'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'find'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'directory'}; {'id': '22', 'type': 'for_statement', 'children': ['23', '24', '25']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'spec_file'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'spec_files'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'specs'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '38']}; {'id': '33', 'type': 'attribute', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'spec_finder'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'find'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'spec_file'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'module'}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'specs'}
|
Finds all specs in a given directory. Returns a list of
Example and ExampleGroup instances.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'interface_direct_class'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'data_class'}; {'id': '5', 'type': 'block', 'children': ['6', '80']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '10', '17', '28', '39', '50', '61', '72']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '9'], 'value': 'in'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'data_class'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'ASSET'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'AssetsInterface'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'elif_clause', 'children': ['18', '21']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '20'], 'value': 'in'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'data_class'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'PARTY'}; {'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': 'interface'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'PartiesInterface'}; {'id': '27', 'type': 'argument_list', 'children': []}; {'id': '28', 'type': 'elif_clause', 'children': ['29', '32']}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '31'], 'value': 'in'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'data_class'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'BOOK'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'BooksInterface'}; {'id': '38', 'type': 'argument_list', 'children': []}; {'id': '39', 'type': 'elif_clause', 'children': ['40', '43']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '42'], 'value': 'in'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'data_class'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'CORPORATE_ACTION'}; {'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': 'interface'}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'CorporateActionsInterface'}; {'id': '49', 'type': 'argument_list', 'children': []}; {'id': '50', 'type': 'elif_clause', 'children': ['51', '54']}; {'id': '51', 'type': 'comparison_operator', 'children': ['52', '53'], 'value': 'in'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'data_class'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'MARKET_DATA'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'MarketDataInterface'}; {'id': '60', 'type': 'argument_list', 'children': []}; {'id': '61', 'type': 'elif_clause', 'children': ['62', '65']}; {'id': '62', 'type': 'comparison_operator', 'children': ['63', '64'], 'value': 'in'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'data_class'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'TRANSACTION'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'assignment', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'TransactionsInterface'}; {'id': '71', 'type': 'argument_list', 'children': []}; {'id': '72', 'type': 'else_clause', 'children': ['73']}; {'id': '73', 'type': 'block', 'children': ['74']}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'assignment', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '77', 'type': 'call', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'AssetManagersInterface'}; {'id': '79', 'type': 'argument_list', 'children': []}; {'id': '80', 'type': 'return_statement', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'interface'}
|
help to direct to the correct interface interacting with DB by class name only
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_xyz_2d'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9', '10']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'xcoord'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'ycoord'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '11', 'type': 'block', 'children': ['12', '32', '48', '57', '63']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'xy'}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '23'], 'value': '+'}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'xcoord'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'ravel'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '25'], 'value': '*'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '1j'}; {'id': '25', 'type': 'call', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'ycoord'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'ravel'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'dist'}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '42'], 'value': '-'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'xy'}; {'id': '42', 'type': '()', 'children': ['43']}; {'id': '43', 'type': 'binary_operator', 'children': ['44', '45'], 'value': '+'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '47'], 'value': '*'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1j'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'imin'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'nanargmin'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'dist'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'xy_min'}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'xy'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'imin'}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'tuple', 'children': ['65', '68', '71', '80']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'xy_min'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'real'}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'xy_min'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'imag'}; {'id': '71', 'type': 'subscript', 'children': ['72', '79']}; {'id': '72', 'type': 'call', 'children': ['73', '78']}; {'id': '73', 'type': 'attribute', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'ravel'}; {'id': '78', 'type': 'argument_list', 'children': []}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'imin'}; {'id': '80', 'type': 'subscript', 'children': ['81', '88']}; {'id': '81', 'type': 'call', 'children': ['82', '87']}; {'id': '82', 'type': 'attribute', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'ravel'}; {'id': '87', 'type': 'argument_list', 'children': []}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'imin'}
|
Get closest x, y and z for the given `x` and `y` in `data` for
2d coords
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'write_xml'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'xmlfile'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '19', '27', '40', '120', '128']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'ElementTree'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'Element'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'string', 'children': [], 'value': "'source_library'"}; {'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': 'root'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': "'title'"}; {'id': '26', 'type': 'string', 'children': [], 'value': "'source_library'"}; {'id': '27', 'type': 'for_statement', 'children': ['28', '29', '32']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_srcs'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'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': 's'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'write_xml'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '44', '105']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '43'], 'value': 'is not'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'block', 'children': ['45', '54', '66']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'srcs'}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'create_diffuse_srcs'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'diffuse_srcs'}; {'id': '57', 'type': 'dictionary_comprehension', 'children': ['58', '63']}; {'id': '58', 'type': 'pair', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '63', 'type': 'for_in_clause', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'srcs'}; {'id': '66', 'type': 'for_statement', 'children': ['67', '68', '71']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': '_diffuse_srcs'}; {'id': '71', 'type': 'block', 'children': ['72', '89', '98']}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'deepcopy'}; {'id': '79', 'type': 'argument_list', 'children': ['80']}; {'id': '80', 'type': 'call', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'diffuse_srcs'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '84', 'type': 'argument_list', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 's'}; {'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': 'src'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'update_spectral_pars'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'spectral_pars'}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'write_xml'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '105', 'type': 'else_clause', 'children': ['106']}; {'id': '106', 'type': 'block', 'children': ['107']}; {'id': '107', 'type': 'for_statement', 'children': ['108', '109', '112']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': '_diffuse_srcs'}; {'id': '112', 'type': 'block', 'children': ['113']}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'call', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'write_xml'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '120', 'type': 'expression_statement', 'children': ['121']}; {'id': '121', 'type': 'assignment', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'output_file'}; {'id': '123', 'type': 'call', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '125', 'type': 'argument_list', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'xmlfile'}; {'id': '127', 'type': 'string', 'children': [], 'value': "'w'"}; {'id': '128', 'type': 'expression_statement', 'children': ['129']}; {'id': '129', 'type': 'call', 'children': ['130', '133']}; {'id': '130', 'type': 'attribute', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'output_file'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '133', 'type': 'argument_list', 'children': ['134']}; {'id': '134', 'type': 'call', 'children': ['135', '138']}; {'id': '135', 'type': 'attribute', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'prettify_xml'}; {'id': '138', 'type': 'argument_list', 'children': ['139']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'root'}
|
Save the ROI model as an XML file.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'change_to_workdir'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '16', '25', '73']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'string', 'children': [], 'value': '"Changing working directory to: %s"'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'workdir'}; {'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': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'check_dir'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'workdir'}; {'id': '25', 'type': 'try_statement', 'children': ['26', '36']}; {'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': 'os'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'chdir'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'workdir'}; {'id': '36', 'type': 'except_clause', 'children': ['37', '41']}; {'id': '37', 'type': 'as_pattern', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'OSError'}; {'id': '39', 'type': 'as_pattern_target', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'exp'}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'exit_on_error'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '70']}; {'id': '48', 'type': 'binary_operator', 'children': ['49', '53'], 'value': '%'}; {'id': '49', 'type': 'concatenated_string', 'children': ['50', '51', '52']}; {'id': '50', 'type': 'string', 'children': [], 'value': '"Error changing to working directory: %s. Error: %s. "'}; {'id': '51', 'type': 'string', 'children': [], 'value': '"Check the existence of %s and the %s/%s account "'}; {'id': '52', 'type': 'string', 'children': [], 'value': '"permissions on this directory."'}; {'id': '53', 'type': 'tuple', 'children': ['54', '57', '61', '64', '67']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'workdir'}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'exp'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'workdir'}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '70', 'type': 'keyword_argument', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'exit_code'}; {'id': '72', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '80']}; {'id': '75', 'type': 'attribute', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'pre_log'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'tuple', 'children': ['82', '83']}; {'id': '82', 'type': 'string', 'children': [], 'value': '"INFO"'}; {'id': '83', 'type': 'binary_operator', 'children': ['84', '85'], 'value': '%'}; {'id': '84', 'type': 'string', 'children': [], 'value': '"Using working directory: %s"'}; {'id': '85', 'type': 'call', 'children': ['86', '91']}; {'id': '86', 'type': 'attribute', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'abspath'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'workdir'}
|
Change working directory to working attribute
:return: None
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'convert_html_to_xml'}; {'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', '18', '38']}; {'id': '7', 'type': 'boolean_operator', 'children': ['8', '13'], 'value': 'and'}; {'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': "'content'"}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '17'], 'value': '!='}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '17', 'type': 'string', 'children': [], 'value': "''"}; {'id': '18', 'type': 'block', 'children': ['19', '23', '36']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'regex'}; {'id': '22', 'type': 'string', 'children': [], 'value': "r'<(?!/)(?!!)'"}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'xml_content'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'sub'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32', '33']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'regex'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'<xhtml:'"}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'xml_content'}; {'id': '38', 'type': 'else_clause', 'children': ['39']}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'string', 'children': [], 'value': "''"}
|
Parses the HTML parsed texts and converts its tags to XML valid tags.
:returns: HTML enabled text in a XML valid format.
:rtype: str
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'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': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'mx'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'nd'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'save'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '27'], 'value': '+'}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '24'], 'value': '+'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'label'}
|
Saves the dataset to a binary .npy file.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_local_roles_for'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'brain_or_object'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '16', '25']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'get_user_id'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'api'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'get_object'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'brain_or_object'}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'get_local_roles_for_userid'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'user_id'}
|
Get the local defined roles on the context
Code extracted from `IRoleManager.get_local_roles_for_userid`
:param brain_or_object: Catalog brain or object
:param user: A user ID, user object or None (for the current user)
:returns: List of granted local roles on the given object
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'maybe_transactional'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '5', 'type': 'block', 'children': ['6', '48']}; {'id': '6', 'type': 'decorated_definition', 'children': ['7', '12']}; {'id': '7', 'type': 'decorator', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'wraps'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '12', 'type': 'function_definition', 'children': ['13', '14', '19']}; {'id': '13', 'type': 'function_name', 'children': [], 'value': 'wrapper'}; {'id': '14', 'type': 'parameters', 'children': ['15', '17']}; {'id': '15', 'type': 'list_splat_pattern', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '17', 'type': 'dictionary_splat_pattern', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '19', 'type': 'block', 'children': ['20', '30']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'commit'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': '"commit"'}; {'id': '29', 'type': 'True', 'children': []}; {'id': '30', 'type': 'with_statement', 'children': ['31', '39']}; {'id': '31', 'type': 'with_clause', 'children': ['32']}; {'id': '32', 'type': 'with_item', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'transaction'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'keyword_argument', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'commit'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'commit'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '46']}; {'id': '44', 'type': 'list_splat', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '46', 'type': 'dictionary_splat', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'wrapper'}
|
Variant of `transactional` that will not commit if there's an argument `commit` with a falsey value.
Useful for dry-run style operations.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'random_integers'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'seed'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '36']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '14']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '13'], 'value': 'is'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'seed'}; {'id': '13', 'type': 'None', 'children': []}; {'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': 'seed'}; {'id': '18', 'type': 'binary_operator', 'children': ['19', '32'], 'value': '%'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'hash'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'binary_operator', 'children': ['26', '27'], 'value': '%'}; {'id': '26', 'type': 'string', 'children': [], 'value': '"%0.20f"'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': '()', 'children': ['33']}; {'id': '33', 'type': 'binary_operator', 'children': ['34', '35'], 'value': '**'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '31'}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '46']}; {'id': '38', 'type': 'attribute', 'children': ['39', '45']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'from_sequence'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'hash'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'seed'}
|
Returns an SArray with random integer values.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_ord_to_str'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'ordinal'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'weights'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '50']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'chars'}; {'id': '10', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '11', 'type': 'for_statement', 'children': ['12', '13', '14']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'weight'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'weights'}; {'id': '14', 'type': 'block', 'children': ['15', '27', '31', '41']}; {'id': '15', 'type': 'if_statement', 'children': ['16', '19']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '18'], 'value': '=='}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'ordinal'}; {'id': '18', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': '""'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'chars'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'augmented_assignment', 'children': ['29', '30'], 'value': '-='}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'ordinal'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '36']}; {'id': '33', 'type': 'pattern_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ordinal'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'divmod'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'ordinal'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'weight'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'chars'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': '_ALPHABET'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'string', 'children': [], 'value': '""'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'chars'}
|
Reverse function of _str_to_ord.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_driver'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'driver_type'}; {'id': '5', 'type': 'block', 'children': ['6', '24']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '10']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '9'], 'value': '=='}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'driver_type'}; {'id': '9', 'type': 'string', 'children': [], 'value': "'phantomjs'"}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'webdriver'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'PhantomJS'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'service_log_path'}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'devnull'}; {'id': '24', 'type': 'if_statement', 'children': ['25', '28', '38', '71']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': '=='}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'driver_type'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'firefox'"}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'webdriver'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'Firefox'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'firefox_options'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'FIREFOXOPTIONS'}; {'id': '38', 'type': 'elif_clause', 'children': ['39', '42']}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '41'], 'value': '=='}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'driver_type'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'chrome'"}; {'id': '42', 'type': 'block', 'children': ['43', '51', '62']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'chrome_options'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'webdriver'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'ChromeOptions'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'for_statement', 'children': ['52', '53', '54']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'arg'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'CHROME_WEBDRIVER_ARGS'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'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': 'chrome_options'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'arg'}; {'id': '62', 'type': 'return_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'webdriver'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'Chrome'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'keyword_argument', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'chrome_options'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'chrome_options'}; {'id': '71', 'type': 'else_clause', 'children': ['72']}; {'id': '72', 'type': 'block', 'children': ['73']}; {'id': '73', 'type': 'raise_statement', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'USPSError'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'string', 'children': [], 'value': "'{} not supported'"}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'driver_type'}
|
Get webdriver.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'show_form_for_method'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'view'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '9', 'type': 'block', 'children': ['10', '18', '47']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '16']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '13'], 'value': 'not in'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'view'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'allowed_methods'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'return_statement', 'children': []}; {'id': '18', 'type': 'try_statement', 'children': ['19', '40']}; {'id': '19', 'type': 'block', 'children': ['20', '27']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'view'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'check_permissions'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '27', 'type': 'if_statement', 'children': ['28', '31']}; {'id': '28', 'type': 'comparison_operator', 'children': ['29', '30'], 'value': 'is not'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '30', 'type': 'None', 'children': []}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'view'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'check_object_permissions'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '40', 'type': 'except_clause', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'exceptions'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'APIException'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'False', 'children': []}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'True', 'children': []}
|
Returns True if a form should be shown for this method.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getUTC'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'utcoffset'}; {'id': '6', 'type': 'block', 'children': ['7', '20']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'newTime'}; {'id': '10', 'type': 'binary_operator', 'children': ['11', '19'], 'value': '%'}; {'id': '11', 'type': '()', 'children': ['12']}; {'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': 'value'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'utcoffset'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '19', 'type': 'integer', 'children': [], 'value': '24'}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'Time'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'newTime'}
|
Returns a new Time object set to UTC given
an offset Time object.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'custom_server_error'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'template_name'}; {'id': '7', 'type': 'string', 'children': [], 'value': "'500.html'"}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'admin_template_name'}; {'id': '10', 'type': 'string', 'children': [], 'value': "'500A.html'"}; {'id': '11', 'type': 'block', 'children': ['12', '16', '91', '111', '120']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'trace'}; {'id': '15', 'type': 'None', 'children': []}; {'id': '16', 'type': 'if_statement', 'children': ['17', '37']}; {'id': '17', 'type': 'boolean_operator', 'children': ['18', '25'], 'value': 'and'}; {'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': 'request'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'is_authenticated'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': '()', 'children': ['26']}; {'id': '26', 'type': 'boolean_operator', 'children': ['27', '32'], 'value': 'or'}; {'id': '27', 'type': 'attribute', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'is_staff'}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'is_superuser'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'try_statement', 'children': ['39', '88']}; {'id': '39', 'type': 'block', 'children': ['40', '45', '60', '79']}; {'id': '40', 'type': 'import_statement', 'children': ['41', '43']}; {'id': '41', 'type': 'dotted_name', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'traceback'}; {'id': '43', 'type': 'dotted_name', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'trace'}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'traceback'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'format_exception'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'list_splat', 'children': ['54']}; {'id': '54', 'type': '()', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'exc_info'}; {'id': '59', 'type': 'argument_list', 'children': []}; {'id': '60', 'type': 'if_statement', 'children': ['61', '69']}; {'id': '61', 'type': 'boolean_operator', 'children': ['62', '68'], 'value': 'and'}; {'id': '62', 'type': 'not_operator', 'children': ['63']}; {'id': '63', 'type': 'attribute', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'is_superuser'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'trace'}; {'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': 'trace'}; {'id': '73', 'type': 'subscript', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'trace'}; {'id': '75', 'type': 'slice', 'children': ['76', '78']}; {'id': '76', 'type': 'unary_operator', 'children': ['77'], 'value': '-'}; {'id': '77', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '78', 'type': 'colon', 'children': []}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'trace'}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'trace'}; {'id': '88', 'type': 'except_clause', 'children': ['89']}; {'id': '89', 'type': 'block', 'children': ['90']}; {'id': '90', 'type': 'pass_statement', 'children': []}; {'id': '91', 'type': 'if_statement', 'children': ['92', '106']}; {'id': '92', 'type': 'call', 'children': ['93', '98']}; {'id': '93', 'type': 'attribute', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'binary_operator', 'children': ['100', '101'], 'value': '%'}; {'id': '100', 'type': 'string', 'children': [], 'value': "'/%s'"}; {'id': '101', 'type': 'attribute', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'admin'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'site'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '106', 'type': 'block', 'children': ['107']}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'assignment', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'template_name'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'admin_template_name'}; {'id': '111', 'type': 'expression_statement', 'children': ['112']}; {'id': '112', 'type': 'assignment', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '114', 'type': 'call', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'loader'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'get_template'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'template_name'}; {'id': '120', 'type': 'return_statement', 'children': ['121']}; {'id': '121', 'type': 'call', 'children': ['122', '125']}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'http'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'HttpResponseServerError'}; {'id': '125', 'type': 'argument_list', 'children': ['126']}; {'id': '126', 'type': 'call', 'children': ['127', '130']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'render'}; {'id': '130', 'type': 'argument_list', 'children': ['131']}; {'id': '131', 'type': 'call', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'Context'}; {'id': '133', 'type': 'argument_list', 'children': ['134']}; {'id': '134', 'type': 'dictionary', 'children': ['135']}; {'id': '135', 'type': 'pair', 'children': ['136', '137']}; {'id': '136', 'type': 'string', 'children': [], 'value': "'trace'"}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'trace'}
|
500 error handler. Displays a full trackback for superusers and the first line of the
traceback for staff members.
Templates: `500.html` or `500A.html` (admin)
Context: trace
Holds the traceback information for debugging.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_option'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '25', '34']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '10']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '9'], 'value': 'in'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': '__opts__'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'subscript', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '__opts__'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'master_opts'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '__pillar__'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': "'master'"}; {'id': '24', 'type': 'dictionary', 'children': []}; {'id': '25', 'type': 'if_statement', 'children': ['26', '29']}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '28'], 'value': 'in'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'master_opts'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'return_statement', 'children': ['31']}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'master_opts'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '34', 'type': 'if_statement', 'children': ['35', '38']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': 'in'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '__pillar__'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'return_statement', 'children': ['40']}; {'id': '40', 'type': 'subscript', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '__pillar__'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'value'}
|
Look up the value for an option.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'value'}; {'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', '28']}; {'id': '7', 'type': 'try_statement', 'children': ['8', '21']}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'struct'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'pack'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '20']}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '17'], 'value': '+'}; {'id': '16', 'type': 'string', 'children': [], 'value': "'>'"}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'conf'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'TYPE_CHAR'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '21', 'type': 'except_clause', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'struct'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'raise_statement', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'IllegalDataValueError'}; {'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': '_value'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'value'}
|
Value to be written on register.
:param value: An integer.
:raises: IllegalDataValueError when value isn't in range.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'visit_object'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '6', 'type': 'block', 'children': ['7', '33']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'current_app'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'tags'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'comment'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'string', 'children': [], 'value': "'no implementation in {} to render {}'"}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '22', 'type': 'argument_list', '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': '__class__'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'string', 'children': [], 'value': "''"}
|
Fallback rendering for objects.
If the current application is in debug-mode
(``flask.current_app.debug`` is ``True``), an ``<!-- HTML comment
-->`` will be rendered, indicating which class is missing a visitation
function.
Outside of debug-mode, returns an empty string.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'image_tasks'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '27']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'uri'}; {'id': '9', 'type': 'binary_operator', 'children': ['10', '11'], 'value': '%'}; {'id': '10', 'type': 'string', 'children': [], 'value': '"/%s/tasks"'}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'uri_base'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '19']}; {'id': '16', 'type': 'pattern_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'resp'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'resp_body'}; {'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': 'api'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'method_get'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'uri'}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'resp_body'}
|
Returns a json-schema document that represents a container of tasks
entities.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'read'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'config_values'}; {'id': '5', 'type': 'block', 'children': ['6', '20', '27', '31', '92']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '9']}; {'id': '7', 'type': 'not_operator', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'config_values'}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'raise_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'RheaError'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'string', 'children': [], 'value': "'Cannot read config_value: `{}`'"}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'config_values'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'config_values'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'to_list'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'config_values'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '30', 'type': 'dictionary', 'children': []}; {'id': '31', 'type': 'for_statement', 'children': ['32', '33', '34']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'config_value'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'config_values'}; {'id': '34', 'type': 'block', 'children': ['35', '46', '52', '60']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'config_value'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'ConfigSpec'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'get_from'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'config_value'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'config_value'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'check_type'}; {'id': '51', 'type': 'argument_list', 'children': []}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'config_results'}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'config_value'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '59', 'type': 'argument_list', 'children': []}; {'id': '60', 'type': 'if_statement', 'children': ['61', '68', '77']}; {'id': '61', 'type': 'boolean_operator', 'children': ['62', '63'], 'value': 'and'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'config_results'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'config_results'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'Mapping'}; {'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': 'config'}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'deep_update'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'config_results'}; {'id': '77', 'type': 'elif_clause', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'config_value'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'check_if_exists'}; {'id': '81', 'type': 'block', 'children': ['82']}; {'id': '82', 'type': 'raise_statement', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'RheaError'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'string', 'children': [], 'value': "'Cannot read config_value: `{}`'"}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'config_value'}; {'id': '92', 'type': 'return_statement', 'children': ['93']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'config'}
|
Reads an ordered list of configuration values and deep merge the values in reverse order.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'proportional_weights'}; {'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': 'fraction_stdev'}; {'id': '7', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'wmax'}; {'id': '10', 'type': 'float', 'children': [], 'value': '100.0'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'leave_zero'}; {'id': '13', 'type': 'True', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15', '19', '88']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'new_weights'}; {'id': '18', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '19', 'type': 'for_statement', 'children': ['20', '23', '36']}; {'id': '20', 'type': 'pattern_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'oval'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'ow'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'observation_data'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'obsval'}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'observation_data'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'weight'}; {'id': '36', 'type': 'block', 'children': ['37', '81']}; {'id': '37', 'type': 'if_statement', 'children': ['38', '43', '48', '57']}; {'id': '38', 'type': 'boolean_operator', 'children': ['39', '40'], 'value': 'and'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'leave_zero'}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '42'], 'value': '=='}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'ow'}; {'id': '42', 'type': 'float', 'children': [], 'value': '0.0'}; {'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': 'ow'}; {'id': '47', 'type': 'float', 'children': [], 'value': '0.0'}; {'id': '48', 'type': 'elif_clause', 'children': ['49', '52']}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '51'], 'value': '=='}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'oval'}; {'id': '51', 'type': 'float', 'children': [], 'value': '0.0'}; {'id': '52', 'type': 'block', 'children': ['53']}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'ow'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'wmax'}; {'id': '57', 'type': 'else_clause', 'children': ['58']}; {'id': '58', 'type': 'block', 'children': ['59', '73']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'nw'}; {'id': '62', 'type': 'binary_operator', 'children': ['63', '64'], 'value': '/'}; {'id': '63', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '64', 'type': '()', 'children': ['65']}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '72'], 'value': '*'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'oval'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'fraction_stdev'}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'assignment', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'ow'}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'min'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'wmax'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'nw'}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'new_weights'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'ow'}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'assignment', 'children': ['90', '95']}; {'id': '90', 'type': 'attribute', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'observation_data'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'weight'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'new_weights'}
|
setup weights inversely proportional to the observation value
Parameters
----------
fraction_stdev : float
the fraction portion of the observation
val to treat as the standard deviation. set to 1.0 for
inversely proportional
wmax : float
maximum weight to allow
leave_zero : bool
flag to leave existing zero weights
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_resources_to_registry'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '11', '20', '29', '38', '47', '56', '62', '68', '74', '80', '86', '92', '98']}; {'id': '5', 'type': 'import_from_statement', 'children': ['6', '9']}; {'id': '6', 'type': 'dotted_name', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'deform'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'widget'}; {'id': '9', 'type': 'dotted_name', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'default_resource_registry'}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'default_resource_registry'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'set_js_resources'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18', '19']}; {'id': '17', 'type': 'string', 'children': [], 'value': '"jqueryui"'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'default_resource_registry'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'set_js_resources'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27', '28']}; {'id': '26', 'type': 'string', 'children': [], 'value': '"datetimepicker"'}; {'id': '27', 'type': 'None', 'children': []}; {'id': '28', 'type': 'None', 'children': []}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'default_resource_registry'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'set_js_resources'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36', '37']}; {'id': '35', 'type': 'string', 'children': [], 'value': '"custom_dates"'}; {'id': '36', 'type': 'None', 'children': []}; {'id': '37', 'type': 'None', 'children': []}; {'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': 'default_resource_registry'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'set_js_resources'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45', '46']}; {'id': '44', 'type': 'string', 'children': [], 'value': '"radio_choice_toggle"'}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'None', 'children': []}; {'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': 'default_resource_registry'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'set_js_resources'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54', '55']}; {'id': '53', 'type': 'string', 'children': [], 'value': '"checkbox_toggle"'}; {'id': '54', 'type': 'None', 'children': []}; {'id': '55', 'type': 'None', 'children': []}; {'id': '56', 'type': 'import_from_statement', 'children': ['57', '60']}; {'id': '57', 'type': 'dotted_name', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'js'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'deform'}; {'id': '60', 'type': 'dotted_name', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'resource_mapping'}; {'id': '62', 'type': 'import_from_statement', 'children': ['63', '66']}; {'id': '63', 'type': 'dotted_name', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'js'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'select2'}; {'id': '66', 'type': 'dotted_name', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'select2'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '73']}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'resource_mapping'}; {'id': '72', 'type': 'string', 'children': [], 'value': "'select2'"}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'select2'}; {'id': '74', 'type': 'import_from_statement', 'children': ['75', '78']}; {'id': '75', 'type': 'dotted_name', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'js'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'jquery_timepicker_addon'}; {'id': '78', 'type': 'dotted_name', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'timepicker'}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '85']}; {'id': '82', 'type': 'subscript', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'resource_mapping'}; {'id': '84', 'type': 'string', 'children': [], 'value': "'datetimepicker'"}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'timepicker'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '91']}; {'id': '88', 'type': 'subscript', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'resource_mapping'}; {'id': '90', 'type': 'string', 'children': [], 'value': "'custom_dates'"}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'custom_dates'}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'assignment', 'children': ['94', '97']}; {'id': '94', 'type': 'subscript', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'resource_mapping'}; {'id': '96', 'type': 'string', 'children': [], 'value': "'radio_choice_toggle'"}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'radio_choice_toggle'}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'assignment', 'children': ['100', '103']}; {'id': '100', 'type': 'subscript', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'resource_mapping'}; {'id': '102', 'type': 'string', 'children': [], 'value': "'checkbox_toggle'"}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'checkbox_toggle'}
|
Add resources to the deform registry
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15', '17']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_user'}; {'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': 'user'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'generic_type', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'Union'}; {'id': '10', 'type': 'type_parameter', 'children': ['11', '13']}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'User'}; {'id': '13', 'type': 'type', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '15', 'type': 'type', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'User'}; {'id': '17', 'type': 'block', 'children': ['18', '29', '46', '108']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21', '23']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '21', 'type': 'type', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27', '28']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'user_id'"}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'discovery_room'}; {'id': '32', 'type': 'call', 'children': ['33', '38']}; {'id': '33', 'type': 'attribute', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_global_rooms'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'make_room_alias'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'network_id'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'DISCOVERY_DEFAULT_ROOM'}; {'id': '46', 'type': 'if_statement', 'children': ['47', '54', '89']}; {'id': '47', 'type': 'boolean_operator', 'children': ['48', '49'], 'value': 'and'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'discovery_room'}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '51'], 'value': 'in'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'discovery_room'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': '_members'}; {'id': '54', 'type': 'block', 'children': ['55', '63', '85']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'duser'}; {'id': '58', 'type': 'subscript', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'discovery_room'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': '_members'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '63', 'type': 'if_statement', 'children': ['64', '70']}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '68', '69']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '68', 'type': 'string', 'children': [], 'value': "'displayname'"}; {'id': '69', 'type': 'None', 'children': []}; {'id': '70', 'type': 'block', 'children': ['71', '77']}; {'id': '71', 'type': 'assert_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'User'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'duser'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'displayname'}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'displayname'}; {'id': '85', 'type': 'expression_statement', 'children': ['86']}; {'id': '86', 'type': 'assignment', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'duser'}; {'id': '89', 'type': 'elif_clause', 'children': ['90', '96']}; {'id': '90', 'type': 'not_operator', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '93', 'type': 'argument_list', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'User'}; {'id': '96', 'type': 'block', 'children': ['97']}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'assignment', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '100', 'type': 'call', 'children': ['101', '106']}; {'id': '101', 'type': 'attribute', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': '_client'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'get_user'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '108', 'type': 'return_statement', 'children': ['109']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'user'}
|
Creates an User from an user_id, if none, or fetch a cached User
As all users are supposed to be in discovery room, its members dict is used for caching
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'file_md5'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '8192'}; {'id': '8', 'type': 'block', 'children': ['9', '11', '19', '43']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'string', 'children': [], 'value': '"Calculates the MD5 of a file."'}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'md5'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'hashlib'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'md5'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'while_statement', 'children': ['20', '21']}; {'id': '20', 'type': 'True', 'children': []}; {'id': '21', 'type': 'block', 'children': ['22', '31', '36']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '34']}; {'id': '32', 'type': 'not_operator', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'break_statement', 'children': []}; {'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': 'md5'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '43', 'type': 'return_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'md5'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'hexdigest'}; {'id': '48', 'type': 'argument_list', 'children': []}
|
Calculates the MD5 of a file.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_output_variable'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'var'}; {'id': '6', 'type': 'block', 'children': ['7', '14']}; {'id': '7', 'type': 'assert_statement', 'children': ['8']}; {'id': '8', 'type': '()', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'var'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'Variable'}; {'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': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'output_variable_list'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'var'}
|
Adds the argument variable as one of the output variable
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'decode'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'dct'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'intype'}; {'id': '7', 'type': 'string', 'children': [], 'value': "'json'"}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'raise_error'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '124']}; {'id': '12', 'type': 'for_statement', 'children': ['13', '14', '22']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '14', 'type': 'call', 'children': ['15', '21']}; {'id': '15', 'type': 'attribute', 'children': ['16', '20']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'get_plugins'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'string', 'children': [], 'value': "'decoders'"}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'if_statement', 'children': ['24', '61', '77']}; {'id': '24', 'type': '()', 'children': ['25']}; {'id': '25', 'type': 'boolean_operator', 'children': ['26', '55'], 'value': 'and'}; {'id': '26', 'type': 'boolean_operator', 'children': ['27', '45'], 'value': 'and'}; {'id': '27', 'type': 'call', 'children': ['28', '39']}; {'id': '28', 'type': 'attribute', 'children': ['29', '38']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'dict_signature'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'issubset'}; {'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': 'dct'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'string', 'children': [], 'value': "'from_{}'"}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'intype'}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59', '60']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '59', 'type': 'string', 'children': [], 'value': "'allow_other_keys'"}; {'id': '60', 'type': 'False', 'children': []}; {'id': '61', 'type': 'block', 'children': ['62', '76']}; {'id': '62', 'type': 'return_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '74']}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'string', 'children': [], 'value': "'from_{}'"}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'intype'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'dct'}; {'id': '76', 'type': 'break_statement', 'children': []}; {'id': '77', 'type': 'elif_clause', 'children': ['78', '108']}; {'id': '78', 'type': '()', 'children': ['79']}; {'id': '79', 'type': 'boolean_operator', 'children': ['80', '98'], 'value': 'and'}; {'id': '80', 'type': 'comparison_operator', 'children': ['81', '90'], 'value': '=='}; {'id': '81', 'type': 'call', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'dict_signature'}; {'id': '90', 'type': 'call', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '92', 'type': 'argument_list', 'children': ['93']}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'dct'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '97', 'type': 'argument_list', 'children': []}; {'id': '98', 'type': 'call', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '100', 'type': 'argument_list', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'string', 'children': [], 'value': "'from_{}'"}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'intype'}; {'id': '108', 'type': 'block', 'children': ['109', '123']}; {'id': '109', 'type': 'return_statement', 'children': ['110']}; {'id': '110', 'type': 'call', 'children': ['111', '121']}; {'id': '111', 'type': 'call', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '113', 'type': 'argument_list', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '115', 'type': 'call', 'children': ['116', '119']}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'string', 'children': [], 'value': "'from_{}'"}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '119', 'type': 'argument_list', 'children': ['120']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'intype'}; {'id': '121', 'type': 'argument_list', 'children': ['122']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'dct'}; {'id': '123', 'type': 'break_statement', 'children': []}; {'id': '124', 'type': 'if_statement', 'children': ['125', '126', '137']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'raise_error'}; {'id': '126', 'type': 'block', 'children': ['127']}; {'id': '127', 'type': 'raise_statement', 'children': ['128']}; {'id': '128', 'type': 'call', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '130', 'type': 'argument_list', 'children': ['131']}; {'id': '131', 'type': 'call', 'children': ['132', '135']}; {'id': '132', 'type': 'attribute', 'children': ['133', '134']}; {'id': '133', 'type': 'string', 'children': [], 'value': "'no suitable plugin found for: {}'"}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '135', 'type': 'argument_list', 'children': ['136']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'dct'}; {'id': '137', 'type': 'else_clause', 'children': ['138']}; {'id': '138', 'type': 'block', 'children': ['139']}; {'id': '139', 'type': 'return_statement', 'children': ['140']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'dct'}
|
decode dict objects, via decoder plugins, to new type
Parameters
----------
intype: str
use decoder method from_<intype> to encode
raise_error : bool
if True, raise ValueError if no suitable plugin found
Examples
--------
>>> load_builtin_plugins('decoders')
[]
>>> from decimal import Decimal
>>> decode({'_python_Decimal_':'1.3425345'})
Decimal('1.3425345')
>>> unload_all_plugins()
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'find_sink_variables'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '22', '46']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'is_sink'}; {'id': '9', 'type': 'dictionary_comprehension', 'children': ['10', '13']}; {'id': '10', 'type': 'pair', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '12', 'type': 'True', 'children': []}; {'id': '13', 'type': 'for_in_clause', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'name'}; {'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': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'variables'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'for_statement', 'children': ['23', '24', '31']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'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': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'operators'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '30', 'type': 'argument_list', 'children': []}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'for_statement', 'children': ['33', '34', '37']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'variable'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'inputs'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '45']}; {'id': '40', 'type': 'subscript', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'is_sink'}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'variable'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'onnx_name'}; {'id': '45', 'type': 'False', 'children': []}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'list_comprehension', 'children': ['48', '49', '60']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'variable'}; {'id': '49', 'type': 'for_in_clause', 'children': ['50', '53']}; {'id': '50', 'type': 'pattern_list', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'variable'}; {'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': 'self'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'variables'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '59', 'type': 'argument_list', 'children': []}; {'id': '60', 'type': 'if_clause', 'children': ['61']}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'is_sink'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'name'}
|
Find sink variables in this scope
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'uploads'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '39']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': '=='}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'syncEnabled'}; {'id': '11', 'type': 'True', 'children': []}; {'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': 'Uploads'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '24', '29', '34']}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'url'}; {'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': '_url'}; {'id': '23', 'type': 'string', 'children': [], 'value': '"/uploads"'}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'securityHandler'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_securityHandler'}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'proxy_url'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_proxy_url'}; {'id': '34', 'type': 'keyword_argument', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'proxy_port'}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '_proxy_port'}; {'id': '39', 'type': 'return_statement', 'children': ['40']}; {'id': '40', 'type': 'None', 'children': []}
|
returns the class to perform the upload function. it will
only return the uploads class if syncEnabled is True.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_decoder'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'image'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'shrink'}; {'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': 'decoder'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'dmtxDecodeCreate'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'image'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'shrink'}; {'id': '15', 'type': 'if_statement', 'children': ['16', '18', '24']}; {'id': '16', 'type': 'not_operator', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'raise_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'PyLibDMTXError'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'string', 'children': [], 'value': "'Could not create decoder'"}; {'id': '24', 'type': 'else_clause', 'children': ['25']}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'try_statement', 'children': ['27', '31']}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'yield', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'decoder'}; {'id': '31', 'type': 'finally_clause', 'children': ['32']}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'dmtxDecodeDestroy'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'byref'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'decoder'}
|
A context manager for `DmtxDecode`, created and destroyed by
`dmtxDecodeCreate` and `dmtxDecodeDestroy`.
Args:
image (POINTER(DmtxImage)):
shrink (int):
Yields:
POINTER(DmtxDecode): The created decoder
Raises:
PyLibDMTXError: If the decoder could not be created.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_ParseSignatureIdentifiers'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data_location'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'signature_identifiers'}; {'id': '7', 'type': 'block', 'children': ['8', '13', '22', '34', '55', '86', '94', '111', '121']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '11']}; {'id': '9', 'type': 'not_operator', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'signature_identifiers'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': []}; {'id': '13', 'type': 'if_statement', 'children': ['14', '16']}; {'id': '14', 'type': 'not_operator', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'data_location'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'raise_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'Missing data location.'"}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '25', 'type': 'call', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'data_location'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'signatures.conf'"}; {'id': '34', 'type': 'if_statement', 'children': ['35', '44']}; {'id': '35', 'type': 'not_operator', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'raise_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'IOError'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'string', 'children': [], 'value': "'No such format specification file: {0:s}'"}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '55', 'type': 'try_statement', 'children': ['56', '66']}; {'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': 'specification_store'}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': '_ReadSpecificationFile'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '66', 'type': 'except_clause', 'children': ['67', '71']}; {'id': '67', 'type': 'as_pattern', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'IOError'}; {'id': '69', 'type': 'as_pattern_target', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'exception'}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'raise_statement', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'IOError'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '83']}; {'id': '77', 'type': 'attribute', 'children': ['78', '82']}; {'id': '78', 'type': '()', 'children': ['79']}; {'id': '79', 'type': 'concatenated_string', 'children': ['80', '81']}; {'id': '80', 'type': 'string', 'children': [], 'value': "'Unable to read format specification file: {0:s} with error: '"}; {'id': '81', 'type': 'string', 'children': [], 'value': "'{1!s}'"}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '83', 'type': 'argument_list', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'exception'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'signature_identifiers'}; {'id': '89', 'type': 'call', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'signature_identifiers'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '93', 'type': 'argument_list', 'children': []}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'signature_identifiers'}; {'id': '97', 'type': 'list_comprehension', 'children': ['98', '103']}; {'id': '98', 'type': 'call', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '102', 'type': 'argument_list', 'children': []}; {'id': '103', 'type': 'for_in_clause', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '105', 'type': 'call', 'children': ['106', '109']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'signature_identifiers'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '109', 'type': 'argument_list', 'children': ['110']}; {'id': '110', 'type': 'string', 'children': [], 'value': "','"}; {'id': '111', 'type': 'expression_statement', 'children': ['112']}; {'id': '112', 'type': 'assignment', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'file_entry_filter'}; {'id': '114', 'type': 'call', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'file_entry_filters'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'SignaturesFileEntryFilter'}; {'id': '118', 'type': 'argument_list', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'specification_store'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'signature_identifiers'}; {'id': '121', 'type': 'expression_statement', 'children': ['122']}; {'id': '122', 'type': 'call', 'children': ['123', '128']}; {'id': '123', 'type': 'attribute', 'children': ['124', '127']}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': '_filter_collection'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'AddFilter'}; {'id': '128', 'type': 'argument_list', 'children': ['129']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'file_entry_filter'}
|
Parses the signature identifiers.
Args:
data_location (str): location of the format specification file, for
example, "signatures.conf".
signature_identifiers (str): comma separated signature identifiers.
Raises:
IOError: if the format specification file could not be read from
the specified data location.
OSError: if the format specification file could not be read from
the specified data location.
ValueError: if no data location was specified.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dumps'}; {'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': 'bucket'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'return_statement', 'children': ['10']}; {'id': '10', 'type': 'list_comprehension', 'children': ['11', '32']}; {'id': '11', 'type': 'call', 'children': ['12', '31']}; {'id': '12', 'type': 'attribute', 'children': ['13', '30']}; {'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': 'file_cls'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'o'}; {'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': 'filesmap'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '29', 'type': 'dictionary', 'children': []}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'for_in_clause', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sorted_files_from_bucket'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '42']}; {'id': '37', 'type': 'boolean_operator', 'children': ['38', '39'], 'value': 'or'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'bucket'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'bucket'}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'keys'}
|
Serialize files from a bucket.
:param bucket: Instance of files
:class:`invenio_files_rest.models.Bucket`. (Default:
``self.bucket``)
:returns: List of serialized files.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'centroid'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '5', 'type': 'block', 'children': ['6', '23']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'C'}; {'id': '9', 'type': 'binary_operator', 'children': ['10', '19'], 'value': '/'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '18', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'C'}
|
Calculate the centroid from a matrix X
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_compile_rules'}; {'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': 'state'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'table'}; {'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': 'RULES'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18', '24', '30', '36', '116', '137']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'patterns'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'nextstates'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'for_statement', 'children': ['37', '40', '44']}; {'id': '37', 'type': 'pattern_list', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'table'}; {'id': '44', 'type': 'block', 'children': ['45', '95', '102', '109']}; {'id': '45', 'type': 'if_statement', 'children': ['46', '52', '63', '78']}; {'id': '46', 'type': 'comparison_operator', 'children': ['47', '51'], 'value': '=='}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '51', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '52', 'type': 'block', 'children': ['53', '59']}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '58']}; {'id': '55', 'type': 'pattern_list', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': '_action'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'nextstate'}; {'id': '62', 'type': 'None', 'children': []}; {'id': '63', 'type': 'elif_clause', 'children': ['64', '70']}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '69'], 'value': '=='}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '69', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '70', 'type': 'block', 'children': ['71']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '77']}; {'id': '73', 'type': 'pattern_list', 'children': ['74', '75', '76']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': '_action'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'nextstate'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '78', 'type': 'else_clause', 'children': ['79']}; {'id': '79', 'type': 'block', 'children': ['80', '84']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'fstr'}; {'id': '83', 'type': 'string', 'children': [], 'value': '"invalid RULES: state {}, row {}"'}; {'id': '84', 'type': 'raise_statement', 'children': ['85']}; {'id': '85', 'type': 'call', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'CompileError'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'call', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'fstr'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '92', 'type': 'argument_list', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'i'}; {'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': 'patterns'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '100', 'type': 'argument_list', 'children': ['101']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'call', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': '_action'}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'call', 'children': ['111', '114']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'nextstates'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '114', 'type': 'argument_list', 'children': ['115']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'nextstate'}; {'id': '116', 'type': 'expression_statement', 'children': ['117']}; {'id': '117', 'type': 'assignment', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'reobj'}; {'id': '119', 'type': 'call', 'children': ['120', '123']}; {'id': '120', 'type': 'attribute', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'compile'}; {'id': '123', 'type': 'argument_list', 'children': ['124']}; {'id': '124', 'type': 'call', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'string', 'children': [], 'value': "'|'"}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '128', 'type': 'generator_expression', 'children': ['129', '134']}; {'id': '129', 'type': 'binary_operator', 'children': ['130', '133'], 'value': '+'}; {'id': '130', 'type': 'binary_operator', 'children': ['131', '132'], 'value': '+'}; {'id': '131', 'type': 'string', 'children': [], 'value': '"("'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '133', 'type': 'string', 'children': [], 'value': '")"'}; {'id': '134', 'type': 'for_in_clause', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'patterns'}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'assignment', 'children': ['139', '144']}; {'id': '139', 'type': 'subscript', 'children': ['140', '143']}; {'id': '140', 'type': 'attribute', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': '_rules'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '144', 'type': 'tuple', 'children': ['145', '146', '147']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'reobj'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'nextstates'}
|
Compile the rules into the internal lexer state.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_store_credentials'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'remember'}; {'id': '9', 'type': 'False', 'children': []}; {'id': '10', 'type': 'block', 'children': ['11', '72']}; {'id': '11', 'type': 'if_statement', 'children': ['12', '17']}; {'id': '12', 'type': 'boolean_operator', 'children': ['13', '16'], 'value': 'and'}; {'id': '13', 'type': 'boolean_operator', 'children': ['14', '15'], 'value': 'and'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'remember'}; {'id': '17', 'type': 'block', 'children': ['18', '27']}; {'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': 'CONF'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25', '26']}; {'id': '24', 'type': 'string', 'children': [], 'value': "'main'"}; {'id': '25', 'type': 'string', 'children': [], 'value': "'report_error/username'"}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '27', 'type': 'try_statement', 'children': ['28', '38']}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'keyring'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'set_password'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36', '37']}; {'id': '35', 'type': 'string', 'children': [], 'value': "'github'"}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '38', 'type': 'except_clause', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '40', 'type': 'block', 'children': ['41', '68']}; {'id': '41', 'type': 'if_statement', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': '_show_msgbox'}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'QMessageBox'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '55', '59']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'parent_widget'}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'string', 'children': [], 'value': "'Failed to store password'"}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'concatenated_string', 'children': ['63', '64', '65', '66', '67']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'It was not possible to securely '"}; {'id': '64', 'type': 'string', 'children': [], 'value': "'save your password. You will be '"}; {'id': '65', 'type': 'string', 'children': [], 'value': "'prompted for your Github '"}; {'id': '66', 'type': 'string', 'children': [], 'value': "'credentials next time you want '"}; {'id': '67', 'type': 'string', 'children': [], 'value': "'to report an issue.'"}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'remember'}; {'id': '71', 'type': 'False', 'children': []}; {'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': 'CONF'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '79', '80']}; {'id': '78', 'type': 'string', 'children': [], 'value': "'main'"}; {'id': '79', 'type': 'string', 'children': [], 'value': "'report_error/remember_me'"}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'remember'}
|
Store credentials for future use.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'update'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9', '10']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'new_email_address'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'custom_fields'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'resubscribe'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'consent_to_track'}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'restart_subscription_based_autoresponders'}; {'id': '12', 'type': 'False', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14', '19', '28', '50', '74']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'validate_consent_to_track'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'consent_to_track'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '22', 'type': 'dictionary', 'children': ['23']}; {'id': '23', 'type': 'pair', 'children': ['24', '25']}; {'id': '24', 'type': 'string', 'children': [], 'value': '"email"'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'email_address'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '31', 'type': 'dictionary', 'children': ['32', '35', '38', '41', '44', '47']}; {'id': '32', 'type': 'pair', 'children': ['33', '34']}; {'id': '33', 'type': 'string', 'children': [], 'value': '"EmailAddress"'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'new_email_address'}; {'id': '35', 'type': 'pair', 'children': ['36', '37']}; {'id': '36', 'type': 'string', 'children': [], 'value': '"Name"'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '38', 'type': 'pair', 'children': ['39', '40']}; {'id': '39', 'type': 'string', 'children': [], 'value': '"CustomFields"'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'custom_fields'}; {'id': '41', 'type': 'pair', 'children': ['42', '43']}; {'id': '42', 'type': 'string', 'children': [], 'value': '"Resubscribe"'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'resubscribe'}; {'id': '44', 'type': 'pair', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"ConsentToTrack"'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'consent_to_track'}; {'id': '47', 'type': 'pair', 'children': ['48', '49']}; {'id': '48', 'type': 'string', 'children': [], 'value': '"RestartSubscriptionBasedAutoresponders"'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'restart_subscription_based_autoresponders'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_put'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '63', '71']}; {'id': '58', 'type': 'binary_operator', 'children': ['59', '60'], 'value': '%'}; {'id': '59', 'type': 'string', 'children': [], 'value': '"/subscribers/%s.json"'}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'list_id'}; {'id': '63', 'type': 'keyword_argument', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '71', 'type': 'keyword_argument', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'params'}; {'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': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'email_address'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'new_email_address'}
|
Updates any aspect of a subscriber, including email address, name, and
custom field data if supplied.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_groups'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '22']}; {'id': '6', 'type': 'function_definition', 'children': ['7', '8', '10']}; {'id': '7', 'type': 'function_name', 'children': [], 'value': 'process_result'}; {'id': '8', 'type': 'parameters', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'list_comprehension', 'children': ['13', '19']}; {'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': 'get_group'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '19', 'type': 'for_in_clause', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'Command'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27', '29']}; {'id': '26', 'type': 'string', 'children': [], 'value': "'get'"}; {'id': '27', 'type': 'list', 'children': ['28'], 'value': '[ROOT_GROUPS]'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'ROOT_GROUPS'}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'process_result'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'process_result'}
|
Return the groups linked to the gateway.
Returns a Command.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'update_type_lookups'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '23']}; {'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': 'type_to_typestring'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'types'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'python_type_strings'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'typestring_to_type'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'python_type_strings'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'types'}
|
Update type and typestring lookup dicts.
Must be called once the ``types`` and ``python_type_strings``
attributes are set so that ``type_to_typestring`` and
``typestring_to_type`` are constructed.
.. versionadded:: 0.2
Notes
-----
Subclasses need to call this function explicitly.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_read_opt_ilnp'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '6', 'type': 'keyword_separator', 'children': []}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '8', 'type': 'block', 'children': ['9', '18', '27', '36', '56']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_type'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_read_opt_type'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_size'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_read_unpack'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_nval'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_read_fileng'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '_size'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'opt'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '45', '48', '53']}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '45', 'type': 'keyword_argument', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': '_type'}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '50', 'type': 'binary_operator', 'children': ['51', '52'], 'value': '+'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': '_size'}; {'id': '52', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '53', 'type': 'keyword_argument', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': '_nval'}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'opt'}
|
Read HOPOPT ILNP Nonce option.
Structure of HOPOPT ILNP Nonce option [RFC 6744]:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header | Hdr Ext Len | Option Type | Option Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Nonce Value /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Octets Bits Name Description
0 0 hopopt.ilnp.type Option Type
0 0 hopopt.ilnp.type.value Option Number
0 0 hopopt.ilnp.type.action Action (10)
0 2 hopopt.ilnp.type.change Change Flag (0)
1 8 hopopt.ilnp.length Length of Option Data
2 16 hopopt.ilnp.value Nonce Value
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'normalize_json'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '36', '40', '49', '62']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'parse_cloudformation_template'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'json_str'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22', '25', '28', '31']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'sort_keys'}; {'id': '24', 'type': 'True', 'children': []}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'default'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'separators'}; {'id': '33', 'type': 'tuple', 'children': ['34', '35']}; {'id': '34', 'type': 'string', 'children': [], 'value': "','"}; {'id': '35', 'type': 'string', 'children': [], 'value': "': '"}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '39', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'json_str'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '49', 'type': 'for_statement', 'children': ['50', '51', '52']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '52', 'type': 'block', 'children': ['53']}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '61'], 'value': '+'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '61', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '62', 'type': 'return_statement', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'result'}
|
Normalize our template for diffing.
Args:
template(str): string representing the template
Returns:
list: json representation of the parameters
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'group_members'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'group_id'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'include_orphans'}; {'id': '8', 'type': 'False', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '24', '40']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '13', 'type': 'dictionary', 'children': ['14']}; {'id': '14', 'type': 'pair', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': "'includeOrphans'"}; {'id': '16', 'type': 'call', 'children': ['17', '23']}; {'id': '17', 'type': 'attribute', 'children': ['18', '22']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'include_orphans'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'url'}; {'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': '_service_url'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '37']}; {'id': '32', 'type': 'list', 'children': ['33', '34', '35', '36'], 'value': "['triggers', 'groups', group_id, 'members']"}; {'id': '33', 'type': 'string', 'children': [], 'value': "'triggers'"}; {'id': '34', 'type': 'string', 'children': [], 'value': "'groups'"}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'group_id'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'members'"}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'Trigger'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'list_to_object_list'}; {'id': '45', 'type': 'argument_list', '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': '_get'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'url'}
|
Find all group member trigger definitions
:param group_id: group trigger id
:param include_orphans: If True, include orphan members
:return: list of asociated group members as trigger objects
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create_html'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'api_key'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '6', 'type': 'block', 'children': ['7', '17', '41', '54', '74', '78']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'gif'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'get_gif'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'api_key'}; {'id': '14', 'type': 'subscript', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '16', 'type': 'string', 'children': [], 'value': "'gif_id'"}; {'id': '17', 'type': 'if_statement', 'children': ['18', '25']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '20'], 'value': 'not in'}; {'id': '19', 'type': 'string', 'children': [], 'value': "'alt'"}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'block', 'children': ['26']}; {'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': 'attrs'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'alt'"}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'string', 'children': [], 'value': "'source: {}'"}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'subscript', 'children': ['37', '40']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'gif'}; {'id': '39', 'type': 'string', 'children': [], 'value': "'data'"}; {'id': '40', 'type': 'string', 'children': [], 'value': "'source'"}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'html_out'}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'string', 'children': [], 'value': '\'<a href="{}">\''}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'subscript', 'children': ['50', '53']}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'gif'}; {'id': '52', 'type': 'string', 'children': [], 'value': "'data'"}; {'id': '53', 'type': 'string', 'children': [], 'value': "'url'"}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'augmented_assignment', 'children': ['56', '57'], 'value': '+='}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'html_out'}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'string', 'children': [], 'value': '\'<img src="{}" alt="{}">\''}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '71']}; {'id': '62', 'type': 'subscript', 'children': ['63', '70']}; {'id': '63', 'type': 'subscript', 'children': ['64', '69']}; {'id': '64', 'type': 'subscript', 'children': ['65', '68']}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'gif'}; {'id': '67', 'type': 'string', 'children': [], 'value': "'data'"}; {'id': '68', 'type': 'string', 'children': [], 'value': "'images'"}; {'id': '69', 'type': 'string', 'children': [], 'value': "'original'"}; {'id': '70', 'type': 'string', 'children': [], 'value': "'url'"}; {'id': '71', 'type': 'subscript', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'attrs'}; {'id': '73', 'type': 'string', 'children': [], 'value': "'alt'"}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'augmented_assignment', 'children': ['76', '77'], 'value': '+='}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'html_out'}; {'id': '77', 'type': 'string', 'children': [], 'value': "'</a>'"}; {'id': '78', 'type': 'return_statement', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'html_out'}
|
Returns complete html tag string.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'run_async'}; {'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', '15', '28', '34']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'init_runner'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'dictionary_splat', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'runner_thread'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'threading'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'Thread'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'run'}; {'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': 'runner_thread'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'expression_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'runner_thread'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'r'}
|
Runs an Ansible Runner task in the background which will start immediately. Returns the thread object and a Runner object.
This uses the same parameters as :py:func:`ansible_runner.interface.run`
:returns: A tuple containing a :py:class:`threading.Thread` object and a :py:class:`ansible_runner.runner.Runner` object
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'transceive'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '25', '37', '55']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'string', 'children': [], 'value': '">> {0}"'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'hexlify'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '28', 'type': 'call', 'children': ['29', '34']}; {'id': '29', 'type': 'attribute', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_dep'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'exchange'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"<< {0}"'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'conditional_expression', 'children': ['49', '53', '54'], 'value': 'if'}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'hexlify'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '54', 'type': 'string', 'children': [], 'value': '"None"'}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'data'}
|
Transmit arbitrary data and receive the response.
This is a low level method to send arbitrary data to the
tag. While it should almost always be better to use
:meth:`send_apdu` this is the only way to force a specific
timeout value (which is otherwise derived from the Tag's
answer to select). The *timeout* value is expected as a float
specifying the seconds to wait.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'convert_to_mb'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '5', 'type': 'block', 'children': ['6', '14']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'try_statement', 'children': ['15', '82']}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'if_statement', 'children': ['17', '23', '40', '66']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'G'"}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'binary_operator', 'children': ['26', '39'], 'value': '*'}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '38']}; {'id': '30', 'type': 'attribute', 'children': ['31', '37']}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '33', 'type': 'slice', 'children': ['34', '35']}; {'id': '34', 'type': 'colon', 'children': []}; {'id': '35', 'type': 'unary_operator', 'children': ['36'], 'value': '-'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '38', 'type': 'argument_list', 'children': []}; {'id': '39', 'type': 'integer', 'children': [], 'value': '1024'}; {'id': '40', 'type': 'elif_clause', 'children': ['41', '47']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'string', 'children': [], 'value': "'T'"}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'binary_operator', 'children': ['50', '65'], 'value': '*'}; {'id': '50', 'type': 'binary_operator', 'children': ['51', '64'], 'value': '*'}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '63']}; {'id': '55', 'type': 'attribute', 'children': ['56', '62']}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '58', 'type': 'slice', 'children': ['59', '60']}; {'id': '59', 'type': 'colon', 'children': []}; {'id': '60', 'type': 'unary_operator', 'children': ['61'], 'value': '-'}; {'id': '61', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '63', 'type': 'argument_list', 'children': []}; {'id': '64', 'type': 'integer', 'children': [], 'value': '1024'}; {'id': '65', 'type': 'integer', 'children': [], 'value': '1024'}; {'id': '66', 'type': 'else_clause', 'children': ['67']}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'return_statement', 'children': ['69']}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '81']}; {'id': '73', 'type': 'attribute', 'children': ['74', '80']}; {'id': '74', 'type': 'subscript', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '76', 'type': 'slice', 'children': ['77', '78']}; {'id': '77', 'type': 'colon', 'children': []}; {'id': '78', 'type': 'unary_operator', 'children': ['79'], 'value': '-'}; {'id': '79', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '81', 'type': 'argument_list', 'children': []}; {'id': '82', 'type': 'except_clause', 'children': ['83', '88']}; {'id': '83', 'type': 'tuple', 'children': ['84', '85', '86', '87']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'IndexError'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '88', 'type': 'block', 'children': ['89', '96']}; {'id': '89', 'type': 'expression_statement', 'children': ['90']}; {'id': '90', 'type': 'assignment', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'errmsg'}; {'id': '92', 'type': 'binary_operator', 'children': ['93', '95'], 'value': '%'}; {'id': '93', 'type': '()', 'children': ['94']}; {'id': '94', 'type': 'string', 'children': [], 'value': '"Invalid memory format: %s"'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '96', 'type': 'raise_statement', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'exception'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'SDKInternalError'}; {'id': '101', 'type': 'argument_list', 'children': ['102']}; {'id': '102', 'type': 'keyword_argument', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'errmsg'}
|
Convert memory size from GB to MB.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.