sequence
stringlengths 902
12k
| docstring
stringlengths 4
15.2k
|
---|---|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'merge_all_sections'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'prnt_sctns'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'child_sctns'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'style'}; {'id': '7', 'type': 'block', 'children': ['8', '12', '28', '46', '76']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'doc'}; {'id': '11', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'prnt_only_raises'}; {'id': '15', 'type': 'boolean_operator', 'children': ['16', '19'], 'value': 'and'}; {'id': '16', 'type': 'subscript', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'prnt_sctns'}; {'id': '18', 'type': 'string', 'children': [], 'value': '"Raises"'}; {'id': '19', 'type': 'not_operator', 'children': ['20']}; {'id': '20', 'type': '()', 'children': ['21']}; {'id': '21', 'type': 'boolean_operator', 'children': ['22', '25'], 'value': 'or'}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'prnt_sctns'}; {'id': '24', 'type': 'string', 'children': [], 'value': '"Returns"'}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'prnt_sctns'}; {'id': '27', 'type': 'string', 'children': [], 'value': '"Yields"'}; {'id': '28', 'type': 'if_statement', 'children': ['29', '39']}; {'id': '29', 'type': 'boolean_operator', 'children': ['30', '31'], 'value': 'and'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'prnt_only_raises'}; {'id': '31', 'type': '()', 'children': ['32']}; {'id': '32', 'type': 'boolean_operator', 'children': ['33', '36'], 'value': 'or'}; {'id': '33', 'type': 'subscript', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'child_sctns'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"Returns"'}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'child_sctns'}; {'id': '38', 'type': 'string', 'children': [], 'value': '"Yields"'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '45']}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'prnt_sctns'}; {'id': '44', 'type': 'string', 'children': [], 'value': '"Raises"'}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'for_statement', 'children': ['47', '48', '49']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'prnt_sctns'}; {'id': '49', 'type': 'block', 'children': ['50', '64']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'sect'}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'merge_section'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '57', '60', '63']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'prnt_sctns'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'child_sctns'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'style'}; {'id': '64', 'type': 'if_statement', 'children': ['65', '68']}; {'id': '65', 'type': 'comparison_operator', 'children': ['66', '67'], 'value': 'is not'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sect'}; {'id': '67', 'type': 'None', 'children': []}; {'id': '68', 'type': 'block', 'children': ['69']}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'call', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'doc'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'sect'}; {'id': '76', 'type': 'return_statement', 'children': ['77']}; {'id': '77', 'type': 'conditional_expression', 'children': ['78', '84', '85'], 'value': 'if'}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'string', 'children': [], 'value': '"\\n\\n"'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'doc'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'doc'}; {'id': '85', 'type': 'None', 'children': []}
|
Merge the doc-sections of the parent's and child's attribute into a single docstring.
Parameters
----------
prnt_sctns: OrderedDict[str, Union[None,str]]
child_sctns: OrderedDict[str, Union[None,str]]
Returns
-------
str
Output docstring of the merged docstrings.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'default'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '51', '69', '105']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'ZONE_NAME'}; {'id': '8', 'type': 'block', 'children': ['9', '23', '35']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': '"Getting or creating default environment for zone with name \'{0}\'"'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'DEFAULT_ENV_NAME'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'zone_id'}; {'id': '26', 'type': 'attribute', 'children': ['27', '34']}; {'id': '27', 'type': 'subscript', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'organization'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'zones'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'ZONE_NAME'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'organization'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'get_or_create_environment'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '48']}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'DEFAULT_ENV_NAME'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'zone'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'zone_id'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'def_envs'}; {'id': '54', 'type': 'list_comprehension', 'children': ['55', '58', '65']}; {'id': '55', 'type': 'subscript', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'env_j'}; {'id': '57', 'type': 'string', 'children': [], 'value': '"id"'}; {'id': '58', 'type': 'for_in_clause', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'env_j'}; {'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': 'json'}; {'id': '64', 'type': 'argument_list', 'children': []}; {'id': '65', 'type': 'if_clause', 'children': ['66']}; {'id': '66', 'type': 'subscript', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'env_j'}; {'id': '68', 'type': 'string', 'children': [], 'value': '"isDefault"'}; {'id': '69', 'type': 'if_statement', 'children': ['70', '76', '91']}; {'id': '70', 'type': 'comparison_operator', 'children': ['71', '75'], 'value': '>'}; {'id': '71', 'type': 'call', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'def_envs'}; {'id': '75', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '76', 'type': 'block', 'children': ['77', '84']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'string', 'children': [], 'value': "'Found more than one default environment. Picking last.'"}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'subscript', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'def_envs'}; {'id': '89', 'type': 'unary_operator', 'children': ['90'], 'value': '-'}; {'id': '90', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '91', 'type': 'elif_clause', 'children': ['92', '98']}; {'id': '92', 'type': 'comparison_operator', 'children': ['93', '97'], 'value': '=='}; {'id': '93', 'type': 'call', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'def_envs'}; {'id': '97', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '98', 'type': 'block', 'children': ['99']}; {'id': '99', 'type': 'return_statement', 'children': ['100']}; {'id': '100', 'type': 'subscript', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '102', 'type': 'subscript', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'def_envs'}; {'id': '104', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '105', 'type': 'raise_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'exceptions'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'NotFoundError'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'string', 'children': [], 'value': "'Unable to get default environment'"}
|
Returns environment marked as default.
When Zone is set marked default makes no sense, special env with proper Zone is returned.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_items_to_message'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'log_dict'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '31']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '11', 'type': 'for_statement', 'children': ['12', '15', '20']}; {'id': '12', 'type': 'pattern_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'log_dict'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'augmented_assignment', 'children': ['23', '24'], 'value': '+='}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'string', 'children': [], 'value': '" {}={}"'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'out'}
|
Utility function to add dictionary items to a log message.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'is_already_locked'}; {'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': 'get_username'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'get_username_from_request'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '24', '34', '43']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'user_blocked'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'is_user_already_locked'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'boolean_operator', 'children': ['19', '20'], 'value': 'or'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'get_username'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'ip_blocked'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'is_source_ip_already_locked'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'get_ip'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '34', 'type': 'if_statement', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'LOCKOUT_BY_IP_USERNAME'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'return_statement', 'children': ['40']}; {'id': '40', 'type': 'boolean_operator', 'children': ['41', '42'], 'value': 'and'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'ip_blocked'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'user_blocked'}; {'id': '43', 'type': 'return_statement', 'children': ['44']}; {'id': '44', 'type': 'boolean_operator', 'children': ['45', '46'], 'value': 'or'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'ip_blocked'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'user_blocked'}
|
Parse the username & IP from the request, and see if it's
already locked.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'json_file'}; {'id': '6', 'type': 'block', 'children': ['7', '19', '58', '66', '99']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'cart_file'}; {'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': 'os'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'CART_LOCATION'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'json_file'}; {'id': '19', 'type': 'try_statement', 'children': ['20', '32']}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'cart_body'}; {'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': 'juicer'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'read_json_document'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'cart_file'}; {'id': '32', 'type': 'except_clause', 'children': ['33', '37']}; {'id': '33', 'type': 'as_pattern', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'IOError'}; {'id': '35', 'type': 'as_pattern_target', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '37', 'type': 'block', 'children': ['38', '51']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '47']}; {'id': '40', 'type': 'attribute', 'children': ['41', '46']}; {'id': '41', 'type': 'attribute', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'juicer'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'Log'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'log_error'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'binary_operator', 'children': ['49', '50'], 'value': '%'}; {'id': '49', 'type': 'string', 'children': [], 'value': "'an error occured while accessing %s:'"}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'cart_file'}; {'id': '51', 'type': 'raise_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'JuicerError'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'cart_name'}; {'id': '63', 'type': 'subscript', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'cart_body'}; {'id': '65', 'type': 'string', 'children': [], 'value': "'_id'"}; {'id': '66', 'type': 'if_statement', 'children': ['67', '72', '89']}; {'id': '67', 'type': 'comparison_operator', 'children': ['68', '71'], 'value': '=='}; {'id': '68', 'type': 'subscript', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'cart_body'}; {'id': '70', 'type': 'string', 'children': [], 'value': "'current_env'"}; {'id': '71', 'type': 'string', 'children': [], 'value': "''"}; {'id': '72', 'type': 'block', 'children': ['73']}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'assignment', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'current_env'}; {'id': '78', 'type': 'subscript', 'children': ['79', '88']}; {'id': '79', 'type': 'subscript', 'children': ['80', '87']}; {'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': 'juicer'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'get_login_info'}; {'id': '86', 'type': 'argument_list', 'children': []}; {'id': '87', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '88', 'type': 'string', 'children': [], 'value': "'start_in'"}; {'id': '89', 'type': 'else_clause', 'children': ['90']}; {'id': '90', 'type': 'block', 'children': ['91']}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'current_env'}; {'id': '96', 'type': 'subscript', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'cart_body'}; {'id': '98', 'type': 'string', 'children': [], 'value': "'current_env'"}; {'id': '99', 'type': 'for_statement', 'children': ['100', '103', '110']}; {'id': '100', 'type': 'pattern_list', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '103', 'type': 'call', 'children': ['104', '109']}; {'id': '104', 'type': 'attribute', 'children': ['105', '108']}; {'id': '105', 'type': 'subscript', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'cart_body'}; {'id': '107', 'type': 'string', 'children': [], 'value': "'repos_items'"}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '109', 'type': 'argument_list', 'children': []}; {'id': '110', 'type': 'block', 'children': ['111']}; {'id': '111', 'type': 'expression_statement', 'children': ['112']}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'add_repo'}; {'id': '116', 'type': 'argument_list', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'items'}
|
Build a cart from a json file
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_remove_unit_rule'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'g'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '6', 'type': 'block', 'children': ['7', '21', '41', '53']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'new_rules'}; {'id': '10', 'type': 'list_comprehension', 'children': ['11', '12', '17']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '12', 'type': 'for_in_clause', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'g'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'rules'}; {'id': '17', 'type': 'if_clause', 'children': ['18']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '20'], 'value': '!='}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'refs'}; {'id': '24', 'type': 'list_comprehension', 'children': ['25', '26', '31']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '26', 'type': 'for_in_clause', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'g'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'rules'}; {'id': '31', 'type': 'if_clause', 'children': ['32']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '36'], 'value': '=='}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'lhs'}; {'id': '36', 'type': 'subscript', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'rhs'}; {'id': '40', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'augmented_assignment', 'children': ['43', '44'], 'value': '+='}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'new_rules'}; {'id': '44', 'type': 'list_comprehension', 'children': ['45', '50']}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'build_unit_skiprule'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '50', 'type': 'for_in_clause', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'refs'}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'Grammar'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'new_rules'}
|
Removes 'rule' from 'g' without changing the langugage produced by 'g'.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'to_obj'}; {'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': 'ns_info'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '19', '29', '37', '115', '122']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ns_info'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'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': 'ns_info'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'collect'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '26']}; {'id': '20', 'type': 'not_operator', 'children': ['21']}; {'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': '"_binding_class"'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'None', 'children': []}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'entity_obj'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '_binding_class'}; {'id': '36', 'type': 'argument_list', 'children': []}; {'id': '37', 'type': 'for_statement', 'children': ['38', '41', '49']}; {'id': '38', 'type': 'pattern_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': '_fields'}; {'id': '49', 'type': 'block', 'children': ['50', '106']}; {'id': '50', 'type': 'if_statement', 'children': ['51', '63', '68', '95']}; {'id': '51', 'type': 'boolean_operator', 'children': ['52', '57'], 'value': 'and'}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'EntityList'}; {'id': '57', 'type': 'comparison_operator', 'children': ['58', '62'], 'value': '=='}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '67', 'type': 'None', 'children': []}; {'id': '68', 'type': 'elif_clause', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'multiple'}; {'id': '72', 'type': 'block', 'children': ['73']}; {'id': '73', 'type': 'if_statement', 'children': ['74', '75', '89']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '75', 'type': 'block', 'children': ['76']}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '79', 'type': 'list_comprehension', 'children': ['80', '86']}; {'id': '80', 'type': 'call', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': '_objectify'}; {'id': '82', 'type': 'argument_list', 'children': ['83', '84', '85']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'ns_info'}; {'id': '86', 'type': 'for_in_clause', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '89', 'type': 'else_clause', 'children': ['90']}; {'id': '90', 'type': 'block', 'children': ['91']}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '94', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '95', 'type': 'else_clause', 'children': ['96']}; {'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': 'val'}; {'id': '100', 'type': 'call', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': '_objectify'}; {'id': '102', 'type': 'argument_list', 'children': ['103', '104', '105']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'ns_info'}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'setattr'}; {'id': '109', 'type': 'argument_list', 'children': ['110', '111', '114']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'entity_obj'}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'call', 'children': ['117', '120']}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': '_finalize_obj'}; {'id': '120', 'type': 'argument_list', 'children': ['121']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'entity_obj'}; {'id': '122', 'type': 'return_statement', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'entity_obj'}
|
Convert to a GenerateDS binding object.
Subclasses can override this function.
Returns:
An instance of this Entity's ``_binding_class`` with properties
set from this Entity.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'hpo_genes'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'phenotype_ids'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '7', 'type': 'block', 'children': ['8', '41']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'phenotype_ids'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'try_statement', 'children': ['12', '36']}; {'id': '12', 'type': 'block', 'children': ['13', '24']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'query_phenomizer'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22', '23']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'phenotype_ids'}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'list_comprehension', 'children': ['26', '27', '30']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '27', 'type': 'for_in_clause', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '30', 'type': 'if_clause', 'children': ['31']}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '35'], 'value': 'is not'}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '34', 'type': 'string', 'children': [], 'value': "'p_value'"}; {'id': '35', 'type': 'None', 'children': []}; {'id': '36', 'type': 'except_clause', 'children': ['37', '38', '39']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'SystemExit'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'RuntimeError'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'pass_statement', 'children': []}; {'id': '41', 'type': 'return_statement', 'children': ['42']}; {'id': '42', 'type': 'None', 'children': []}
|
Return list of HGNC symbols matching HPO phenotype ids.
Args:
phenotype_ids (list): list of phenotype ids
username (str): username to connect to phenomizer
password (str): password to connect to phenomizer
Returns:
query_result: a list of dictionaries on the form
{
'p_value': float,
'gene_id': str,
'omim_id': int,
'orphanet_id': int,
'decipher_id': int,
'any_id': int,
'mode_of_inheritance': str,
'description': str,
'raw_line': str
}
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_broadcast_transactions'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7', '10']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'coin_symbol'}; {'id': '6', 'type': 'string', 'children': [], 'value': "'btc'"}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '9', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'api_key'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14', '22', '26', '35', '44', '62', '69', '73', '97']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'make_url'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'coin_symbol'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'txs'"}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '25', 'type': 'dictionary', 'children': []}; {'id': '26', 'type': 'if_statement', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'api_key'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '34']}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'token'"}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'api_key'}; {'id': '35', 'type': 'if_statement', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '43']}; {'id': '40', 'type': 'subscript', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '42', 'type': 'string', 'children': [], 'value': "'limit'"}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'requests'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '53', '56', '59']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '53', 'type': 'keyword_argument', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '56', 'type': 'keyword_argument', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '58', 'type': 'True', 'children': []}; {'id': '59', 'type': 'keyword_argument', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'TIMEOUT_IN_SECONDS'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'response_dict'}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'get_valid_json'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'unconfirmed_txs'}; {'id': '72', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '73', 'type': 'for_statement', 'children': ['74', '75', '76']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'unconfirmed_tx'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'response_dict'}; {'id': '76', 'type': 'block', 'children': ['77', '90']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '82']}; {'id': '79', 'type': 'subscript', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'unconfirmed_tx'}; {'id': '81', 'type': 'string', 'children': [], 'value': "'received'"}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'parse'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'unconfirmed_tx'}; {'id': '89', 'type': 'string', 'children': [], 'value': "'received'"}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'unconfirmed_txs'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'unconfirmed_tx'}; {'id': '97', 'type': 'return_statement', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'unconfirmed_txs'}
|
Get a list of broadcast but unconfirmed transactions
Similar to bitcoind's getrawmempool method
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'OnCellSelected'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '6', 'type': 'block', 'children': ['7', '27', '37', '46', '86', '97', '105', '124', '133', '142', '150']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '10', 'type': 'assignment', 'children': ['11', '15']}; {'id': '11', 'type': 'pattern_list', 'children': ['12', '13', '14']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'tab'}; {'id': '15', 'type': 'expression_list', 'children': ['16', '19', '22']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'Row'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'Col'}; {'id': '22', 'type': 'attribute', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'current_table'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'cell_attributes'}; {'id': '30', 'type': 'attribute', 'children': ['31', '36']}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'code_array'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'cell_attributes'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'merging_cell'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'cell_attributes'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'get_merging_cell'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '46', 'type': 'if_statement', 'children': ['47', '54']}; {'id': '47', 'type': 'boolean_operator', 'children': ['48', '51'], 'value': 'and'}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '50'], 'value': 'is not'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'merging_cell'}; {'id': '50', 'type': 'None', 'children': []}; {'id': '51', 'type': 'comparison_operator', 'children': ['52', '53'], 'value': '!='}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'merging_cell'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '54', 'type': 'block', 'children': ['55', '70', '85']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'post_command_event'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '62', '67']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '62', 'type': 'attribute', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'GotoCellMsg'}; {'id': '67', 'type': 'keyword_argument', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'merging_cell'}; {'id': '70', 'type': 'if_statement', 'children': ['71', '76']}; {'id': '71', 'type': 'subscript', 'children': ['72', '75']}; {'id': '72', 'type': 'subscript', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'cell_attributes'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'merging_cell'}; {'id': '75', 'type': 'string', 'children': [], 'value': '"button_cell"'}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '84']}; {'id': '79', 'type': 'attribute', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'EnableCellEditControl'}; {'id': '84', 'type': 'argument_list', 'children': []}; {'id': '85', 'type': 'return_statement', 'children': []}; {'id': '86', 'type': 'if_statement', 'children': ['87', '95']}; {'id': '87', 'type': 'not_operator', 'children': ['88']}; {'id': '88', 'type': 'call', 'children': ['89', '94']}; {'id': '89', 'type': 'attribute', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'IsEditable'}; {'id': '94', 'type': 'argument_list', 'children': []}; {'id': '95', 'type': 'block', 'children': ['96']}; {'id': '96', 'type': 'return_statement', 'children': []}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'call', 'children': ['99', '104']}; {'id': '99', 'type': 'attribute', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'ForceRefresh'}; {'id': '104', 'type': 'argument_list', 'children': []}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'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': 'self'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'lock_entry_line'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'subscript', 'children': ['114', '123']}; {'id': '114', 'type': 'subscript', 'children': ['115', '122']}; {'id': '115', 'type': 'attribute', 'children': ['116', '121']}; {'id': '116', 'type': 'attribute', 'children': ['117', '120']}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'code_array'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'cell_attributes'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '123', 'type': 'string', 'children': [], 'value': '"locked"'}; {'id': '124', 'type': 'expression_statement', 'children': ['125']}; {'id': '125', 'type': 'call', 'children': ['126', '131']}; {'id': '126', 'type': 'attribute', 'children': ['127', '130']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'update_entry_line'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '133', 'type': 'expression_statement', 'children': ['134']}; {'id': '134', 'type': 'call', 'children': ['135', '140']}; {'id': '135', 'type': 'attribute', 'children': ['136', '139']}; {'id': '136', 'type': 'attribute', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'update_attribute_toolbar'}; {'id': '140', 'type': 'argument_list', 'children': ['141']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '142', 'type': 'expression_statement', 'children': ['143']}; {'id': '143', 'type': 'assignment', 'children': ['144', '149']}; {'id': '144', 'type': 'attribute', 'children': ['145', '148']}; {'id': '145', 'type': 'attribute', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': '_last_selected_cell'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '150', 'type': 'expression_statement', 'children': ['151']}; {'id': '151', 'type': 'call', 'children': ['152', '155']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'Skip'}; {'id': '155', 'type': 'argument_list', 'children': []}
|
Cell selection event handler
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'generateDHCPOptionsTemplate'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'address_family'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '17', '31']}; {'id': '7', 'type': 'import_from_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'dotted_name', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'ns1'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ipam'}; {'id': '11', 'type': 'dotted_name', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'DHCPOptions'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '16', 'type': 'dictionary', 'children': []}; {'id': '17', 'type': 'for_statement', 'children': ['18', '19', '24']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'option'}; {'id': '19', 'type': 'subscript', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'DHCPOptions'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'OPTIONS'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'address_family'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '30']}; {'id': '27', 'type': 'subscript', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'option'}; {'id': '30', 'type': 'string', 'children': [], 'value': '""'}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'options'}
|
Generate boilerplate dictionary to hold dhcp options
:param str address_family: dhcpv4 or dhcpv6
:return: dict containing valid option set for address family
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'doseigs'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '22', '26', '79']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'A'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 's2a'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '18']}; {'id': '15', 'type': 'pattern_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'tau'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'V'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'tauV'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'A'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'Vdirs'}; {'id': '25', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '26', 'type': 'for_statement', 'children': ['27', '28', '29']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'V'}; {'id': '29', 'type': 'block', 'children': ['30', '37', '66']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'Vdir'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'cart2dir'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '37', 'type': 'if_statement', 'children': ['38', '43']}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '42'], 'value': '<'}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'Vdir'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '43', 'type': 'block', 'children': ['44', '53']}; {'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': 'Vdir'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '49', 'type': 'unary_operator', 'children': ['50'], 'value': '-'}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'Vdir'}; {'id': '52', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '58']}; {'id': '55', 'type': 'subscript', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'Vdir'}; {'id': '57', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '58', 'type': 'binary_operator', 'children': ['59', '65'], 'value': '%'}; {'id': '59', 'type': '()', 'children': ['60']}; {'id': '60', 'type': 'binary_operator', 'children': ['61', '64'], 'value': '+'}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'Vdir'}; {'id': '63', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '64', 'type': 'float', 'children': [], 'value': '180.'}; {'id': '65', 'type': 'float', 'children': [], 'value': '360.'}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'Vdirs'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'list', 'children': ['73', '76'], 'value': '[Vdir[0], Vdir[1]]'}; {'id': '73', 'type': 'subscript', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'Vdir'}; {'id': '75', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '76', 'type': 'subscript', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'Vdir'}; {'id': '78', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '79', 'type': 'return_statement', 'children': ['80']}; {'id': '80', 'type': 'expression_list', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'tau'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'Vdirs'}
|
convert s format for eigenvalues and eigenvectors
Parameters
__________
s=[x11,x22,x33,x12,x23,x13] : the six tensor elements
Return
__________
tau : [t1,t2,t3]
tau is an list of eigenvalues in decreasing order:
V : [[V1_dec,V1_inc],[V2_dec,V2_inc],[V3_dec,V3_inc]]
is an list of the eigenvector directions
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'crc_ihex'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'hexstr'}; {'id': '5', 'type': 'block', 'children': ['6', '21', '25', '36']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'crc'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'bytearray'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'binascii'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'unhexlify'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'hexstr'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'augmented_assignment', 'children': ['23', '24'], 'value': '&='}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'crc'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '0xff'}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'crc'}; {'id': '28', 'type': '()', 'children': ['29']}; {'id': '29', 'type': 'binary_operator', 'children': ['30', '35'], 'value': '&'}; {'id': '30', 'type': '()', 'children': ['31']}; {'id': '31', 'type': 'binary_operator', 'children': ['32', '34'], 'value': '+'}; {'id': '32', 'type': 'unary_operator', 'children': ['33'], 'value': '~'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'crc'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '0xff'}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'crc'}
|
Calculate the CRC for given Intel HEX hexstring.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'maximum_size_estimated'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sz'}; {'id': '6', 'type': 'block', 'children': ['7', '22']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '14']}; {'id': '8', 'type': 'not_operator', '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': 'sz'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'str'}; {'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': 'sz'}; {'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': 'sz'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '29']}; {'id': '24', 'type': 'subscript', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_attributes'}; {'id': '28', 'type': 'string', 'children': [], 'value': '"sz"'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'sz'}
|
Set the CoRE Link Format sz attribute of the resource.
:param sz: the CoRE Link Format sz attribute
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_works'}; {'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', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'Work'}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_session'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'get_class'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'subscript', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'surf'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'ns'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'EFRBROO'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'F1_Work'"}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'Work'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '31', 'type': 'argument_list', 'children': []}
|
Return the author's works.
:return: a list of `HucitWork` instances.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'id'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '34', '43', '52', '61', '70', '79', '88', '97', '106']}; {'id': '6', 'type': 'function_definition', 'children': ['7', '8', '11']}; {'id': '7', 'type': 'function_name', 'children': [], 'value': 'normalize'}; {'id': '8', 'type': 'parameters', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'table'}; {'id': '11', 'type': 'block', 'children': ['12', '26']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '15', 'type': 'call', 'children': ['16', '23']}; {'id': '16', 'type': 'attribute', 'children': ['17', '22']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '25', 'type': 'string', 'children': [], 'value': "'_'"}; {'id': '26', 'type': 'return_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'table'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'os_release_attr'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '43', 'type': 'if_statement', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'normalize'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'NORMALIZED_OS_ID'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'lsb_release_attr'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'string', 'children': [], 'value': "'distributor_id'"}; {'id': '61', 'type': 'if_statement', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'return_statement', 'children': ['65']}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'normalize'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'NORMALIZED_LSB_ID'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'distro_release_attr'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '79', 'type': 'if_statement', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '81', 'type': 'block', 'children': ['82']}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'normalize'}; {'id': '85', 'type': 'argument_list', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'NORMALIZED_DISTRO_ID'}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'assignment', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'uname_attr'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '97', 'type': 'if_statement', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '99', 'type': 'block', 'children': ['100']}; {'id': '100', 'type': 'return_statement', 'children': ['101']}; {'id': '101', 'type': 'call', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'normalize'}; {'id': '103', 'type': 'argument_list', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'distro_id'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'NORMALIZED_DISTRO_ID'}; {'id': '106', 'type': 'return_statement', 'children': ['107']}; {'id': '107', 'type': 'string', 'children': [], 'value': "''"}
|
Return the distro ID of the OS distribution, as a string.
For details, see :func:`distro.id`.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'startswith'}; {'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': 'ignore_case'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '51']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '11', '32']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ignore_case'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'compiled'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'compile'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '29']}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '22'], 'value': '%'}; {'id': '21', 'type': 'string', 'children': [], 'value': '"^%s"'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': '"\\\\"'}; {'id': '28', 'type': 'string', 'children': [], 'value': '"\\\\\\\\"'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'IGNORECASE'}; {'id': '32', 'type': 'else_clause', 'children': ['33']}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'compiled'}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'compile'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'binary_operator', 'children': ['43', '44'], 'value': '%'}; {'id': '43', 'type': 'string', 'children': [], 'value': '"^%s"'}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '48', 'type': 'argument_list', 'children': ['49', '50']}; {'id': '49', 'type': 'string', 'children': [], 'value': '"\\\\"'}; {'id': '50', 'type': 'string', 'children': [], 'value': '"\\\\\\\\"'}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'dictionary', 'children': ['53']}; {'id': '53', 'type': 'pair', 'children': ['54', '55']}; {'id': '54', 'type': 'string', 'children': [], 'value': '"$regex"'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'compiled'}
|
Test if a string-field start with ``text``.
Example::
filters = {"path": Text.startswith(r"C:\\")}
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'try_acquire'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'permits'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '11', 'type': 'block', 'children': ['12', '18']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'check_not_negative'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'permits'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"Permits cannot be negative!"'}; {'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': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_encode_invoke'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25', '28']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'semaphore_try_acquire_codec'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'permits'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'permits'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'to_millis'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'timeout'}
|
Tries to acquire one or the given number of permits, if they are available, and returns immediately, with the
value ``true``, reducing the number of available permits by the given amount.
If there are insufficient permits and a timeout is provided, the current thread becomes disabled for thread
scheduling purposes and lies dormant until one of following happens:
* some other thread invokes the release() method for this semaphore and the current thread is next to be
assigned a permit, or
* some other thread interrupts the current thread, or
* the specified waiting time elapses.
If there are insufficient permits and no timeout is provided, this method will return immediately with the value
``false`` and the number of available permits is unchanged.
:param permits: (int), the number of permits to acquire (optional).
:param timeout: (long), the maximum time in seconds to wait for the permit(s) (optional).
:return: (bool), ``true`` if desired amount of permits was acquired, ``false`` otherwise.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'p0'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '18', '40']}; {'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': '_p0'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'raise_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'string', 'children': [], 'value': '"initial positions not set; run set_p0"'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'p0'}; {'id': '21', 'type': 'dictionary_comprehension', 'children': ['22', '30']}; {'id': '22', 'type': 'pair', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'param'}; {'id': '24', 'type': 'subscript', 'children': ['25', '28', '29']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_p0'}; {'id': '28', 'type': 'ellipsis', 'children': [], 'value': '...'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '30', 'type': 'for_in_clause', 'children': ['31', '34']}; {'id': '31', 'type': 'tuple_pattern', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'param'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sampling_params'}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'p0'}
|
A dictionary of the initial position of the walkers.
This is set by using ``set_p0``. If not set yet, a ``ValueError`` is
raised when the attribute is accessed.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'imethodcallPayload'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'methodname'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'localnsp'}; {'id': '7', 'type': 'dictionary_splat_pattern', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '9', 'type': 'block', 'children': ['10', '37', '86']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'param_list'}; {'id': '13', 'type': 'list_comprehension', 'children': ['14', '30']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'pywbem'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'IPARAMVALUE'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '22']}; {'id': '19', 'type': 'subscript', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '21', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'pywbem'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'tocimxml'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'subscript', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '29', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '30', 'type': 'for_in_clause', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '36', 'type': 'argument_list', 'children': []}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'cim_xml'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'CIM'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '84', '85']}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'cim_xml'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'MESSAGE'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '82', '83']}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'cim_xml'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'SIMPLEREQ'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'cim_xml'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'IMETHODCALL'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '61', '81']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'methodname'}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'cim_xml'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'LOCALNAMESPACEPATH'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'list_comprehension', 'children': ['67', '73']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'cim_xml'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'NAMESPACE'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'ns'}; {'id': '73', 'type': 'for_in_clause', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'ns'}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'localnsp'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '79', 'type': 'argument_list', 'children': ['80']}; {'id': '80', 'type': 'string', 'children': [], 'value': "'/'"}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'param_list'}; {'id': '82', 'type': 'string', 'children': [], 'value': "'1001'"}; {'id': '83', 'type': 'string', 'children': [], 'value': "'1.0'"}; {'id': '84', 'type': 'string', 'children': [], 'value': "'2.0'"}; {'id': '85', 'type': 'string', 'children': [], 'value': "'2.0'"}; {'id': '86', 'type': 'return_statement', 'children': ['87']}; {'id': '87', 'type': 'binary_operator', 'children': ['88', '91'], 'value': '+'}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'xml_header'}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'toxml'}; {'id': '95', 'type': 'argument_list', 'children': []}
|
Generate the XML payload for an intrinsic methodcall.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getProvIden'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'provstack'}; {'id': '6', 'type': 'block', 'children': ['7', '14', '20', '40', '51', '71', '84']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'iden'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_providen'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'provstack'}; {'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': 'misc'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'frames'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'provstack'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'dictframes'}; {'id': '23', 'type': 'list_comprehension', 'children': ['24', '35']}; {'id': '24', 'type': 'tuple', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'typ'}; {'id': '26', 'type': 'dictionary_comprehension', 'children': ['27', '30']}; {'id': '27', 'type': 'pair', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '30', 'type': 'for_in_clause', 'children': ['31', '34']}; {'id': '31', 'type': 'tuple_pattern', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '35', 'type': 'for_in_clause', 'children': ['36', '39']}; {'id': '36', 'type': 'tuple_pattern', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'typ'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'frames'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'bytz'}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 's_msgpack'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'en'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'tuple', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'misc'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'dictframes'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'didwrite'}; {'id': '54', 'type': 'call', 'children': ['55', '60']}; {'id': '55', 'type': 'attribute', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'slab'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'put'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62', '63', '66']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'iden'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'bytz'}; {'id': '63', 'type': 'keyword_argument', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'overwrite'}; {'id': '65', 'type': 'False', 'children': []}; {'id': '66', 'type': 'keyword_argument', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'db'}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'db'}; {'id': '71', 'type': 'if_statement', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'didwrite'}; {'id': '73', 'type': 'block', 'children': ['74']}; {'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': 'provseq'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'save'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'list', 'children': ['83'], 'value': '[iden]'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'iden'}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'iden'}
|
Returns the iden corresponding to a provenance stack and stores if it hasn't seen it before
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'scene_velocity'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'frames'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '40', '52']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'MessageReader'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'frames'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '16', 'type': 'call', 'children': ['17', '39']}; {'id': '17', 'type': 'attribute', 'children': ['18', '38']}; {'id': '18', 'type': 'call', 'children': ['19', '37']}; {'id': '19', 'type': 'attribute', 'children': ['20', '36']}; {'id': '20', 'type': 'call', 'children': ['21', '34']}; {'id': '21', 'type': 'attribute', 'children': ['22', '33']}; {'id': '22', 'type': 'call', 'children': ['23', '31']}; {'id': '23', 'type': 'attribute', 'children': ['24', '30']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'string'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"command"'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'uint32'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': '"scene_id"'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'uint32'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'string', 'children': [], 'value': '"velocity"'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'assert_end'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '39', 'type': 'argument_list', 'children': []}; {'id': '40', 'type': 'if_statement', 'children': ['41', '46']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '45'], 'value': '!='}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '45', 'type': 'string', 'children': [], 'value': '"scene.velocity"'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'raise_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'MessageParserError'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'string', 'children': [], 'value': '"Command is not \'scene.velocity\'"'}; {'id': '52', 'type': 'return_statement', 'children': ['53']}; {'id': '53', 'type': 'tuple', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'scene_id'}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '61'], 'value': '/'}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'velocity'}; {'id': '61', 'type': 'integer', 'children': [], 'value': '1000'}
|
parse a scene.velocity message
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'available'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '27', '33']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'assignment', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'proc'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'popen_multiple'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '12', '14', '19', '24']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'COMMANDS'}; {'id': '12', 'type': 'list', 'children': ['13'], 'value': "['-version']"}; {'id': '13', 'type': 'string', 'children': [], 'value': "'-version'"}; {'id': '14', 'type': 'keyword_argument', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'stdout'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'PIPE'}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'stderr'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'PIPE'}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'creationflags'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'PROC_FLAGS'}; {'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': 'proc'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'wait'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': '()', 'children': ['35']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '39'], 'value': '=='}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'proc'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'returncode'}; {'id': '39', 'type': 'integer', 'children': [], 'value': '0'}
|
Detect if the FFmpeg backend can be used on this system.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'parse_geometry'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'geometry'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'ratio'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '20']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '13']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': 'not in'}; {'id': '11', 'type': 'string', 'children': [], 'value': '"%"'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'geometry'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'xy_geometry_parser'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'geometry'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'ratio'}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'binary_operator', 'children': ['22', '31'], 'value': '/'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'float'}; {'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': 'geometry'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'string', 'children': [], 'value': '"%"'}; {'id': '31', 'type': 'float', 'children': [], 'value': '100.0'}
|
Enhanced parse_geometry parser with percentage support.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '10']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'expires'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'with_statement', 'children': ['15', '20']}; {'id': '15', 'type': 'with_clause', 'children': ['16']}; {'id': '16', 'type': 'with_item', 'children': ['17']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_lock'}; {'id': '20', 'type': 'block', 'children': ['21', '65']}; {'id': '21', 'type': 'try_statement', 'children': ['22', '40']}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '32']}; {'id': '25', 'type': 'attribute', 'children': ['26', '31']}; {'id': '26', 'type': 'subscript', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_dict'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34', '37']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '34', 'type': 'keyword_argument', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'expires'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'expires'}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '40', 'type': 'except_clause', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '50']}; {'id': '45', 'type': 'subscript', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': '_dict'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'moment'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54', '57', '60']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'expires'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'expires'}; {'id': '57', 'type': 'keyword_argument', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '60', 'type': 'keyword_argument', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'lock'}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': '_lock'}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'value'}
|
Set a value
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'updateAARText'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '21', '34']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'Updates the displayed airspeed, altitude, climb rate Text'"}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'airspeedText'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'set_text'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'binary_operator', 'children': ['17', '18'], 'value': '%'}; {'id': '17', 'type': 'string', 'children': [], 'value': "'AR: %.1f m/s'"}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'airspeed'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'altitudeText'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'set_text'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'binary_operator', 'children': ['30', '31'], 'value': '%'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'ALT: %.1f m '"}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'relAlt'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '41']}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'climbRateText'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'set_text'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'binary_operator', 'children': ['43', '44'], 'value': '%'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'CR: %.1f m/s'"}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'climbRate'}
|
Updates the displayed airspeed, altitude, climb rate Text
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'receive'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '7', 'type': 'block', 'children': ['8', '23', '44', '55', '71']}; {'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': '_reorder'}; {'id': '13', 'type': 'block', 'children': ['14', '22']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_callback'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'list_splat', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '22', 'type': 'return_statement', 'children': []}; {'id': '23', 'type': 'if_statement', 'children': ['24', '35']}; {'id': '24', 'type': 'boolean_operator', 'children': ['25', '30'], 'value': 'and'}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '29'], 'value': 'is not'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_next_expected'}; {'id': '29', 'type': 'None', 'children': []}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': '<'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '_next_expected'}; {'id': '35', 'type': 'block', 'children': ['36', '43']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '42'], 'value': '%'}; {'id': '41', 'type': 'string', 'children': [], 'value': '"Dropping out of order packet, seq=%d"'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '43', 'type': 'return_statement', 'children': []}; {'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': '_out_of_order'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'tuple', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '62']}; {'id': '57', 'type': 'attribute', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': '_out_of_order'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'keyword_argument', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '65', 'type': 'lambda', 'children': ['66', '68']}; {'id': '66', 'type': 'lambda_parameters', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '68', 'type': 'subscript', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '70', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '71', 'type': 'while_statement', 'children': ['72', '80']}; {'id': '72', 'type': 'comparison_operator', 'children': ['73', '79'], 'value': '>'}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': '_out_of_order'}; {'id': '79', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '80', 'type': 'block', 'children': ['81', '91', '105', '113', '122']}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'assignment', 'children': ['83', '86']}; {'id': '83', 'type': 'pattern_list', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '86', 'type': 'subscript', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': '_out_of_order'}; {'id': '90', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '91', 'type': 'if_statement', 'children': ['92', '103']}; {'id': '92', 'type': 'boolean_operator', 'children': ['93', '98'], 'value': 'and'}; {'id': '93', 'type': 'comparison_operator', 'children': ['94', '97'], 'value': 'is not'}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': '_next_expected'}; {'id': '97', 'type': 'None', 'children': []}; {'id': '98', 'type': 'comparison_operator', 'children': ['99', '100'], 'value': '!='}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': '_next_expected'}; {'id': '103', 'type': 'block', 'children': ['104']}; {'id': '104', 'type': 'return_statement', 'children': []}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': '_callback'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'list_splat', 'children': ['112']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'call', 'children': ['115', '120']}; {'id': '115', 'type': 'attribute', 'children': ['116', '119']}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': '_out_of_order'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '120', 'type': 'argument_list', 'children': ['121']}; {'id': '121', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '122', 'type': 'expression_statement', 'children': ['123']}; {'id': '123', 'type': 'assignment', 'children': ['124', '127']}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': '_next_expected'}; {'id': '127', 'type': 'binary_operator', 'children': ['128', '129'], 'value': '+'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '129', 'type': 'integer', 'children': [], 'value': '1'}
|
Receive one packet
If the sequence number is one we've already seen before, it is dropped.
If it is not the next expected sequence number, it is put into the
_out_of_order queue to be processed once the holes in sequence number
are filled in.
Args:
sequence (int): The sequence number of the received packet
args (list): The list of packet contents that will be passed to callback
as callback(*args)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '23']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'list_buckets'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14', '17', '20']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'max_results'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'page_token'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'projection'}; {'id': '16', 'type': 'string', 'children': [], 'value': '"noAcl"'}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'default_parameter', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'project'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'block', 'children': ['24', '35', '45', '52', '63', '69', '80']}; {'id': '24', 'type': 'if_statement', 'children': ['25', '28']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': 'is'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'project'}; {'id': '27', 'type': 'None', 'children': []}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'project'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'project'}; {'id': '35', 'type': 'if_statement', 'children': ['36', '39']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '38'], 'value': 'is'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'project'}; {'id': '38', 'type': 'None', 'children': []}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'raise_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'string', 'children': [], 'value': '"Client project not set: pass an explicit project."'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'extra_params'}; {'id': '48', 'type': 'dictionary', 'children': ['49']}; {'id': '49', 'type': 'pair', 'children': ['50', '51']}; {'id': '50', 'type': 'string', 'children': [], 'value': '"project"'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'project'}; {'id': '52', 'type': 'if_statement', 'children': ['53', '56']}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '55'], 'value': 'is not'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '55', 'type': 'None', 'children': []}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '62']}; {'id': '59', 'type': 'subscript', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'extra_params'}; {'id': '61', 'type': 'string', 'children': [], 'value': '"prefix"'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '68']}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'extra_params'}; {'id': '67', 'type': 'string', 'children': [], 'value': '"projection"'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'projection'}; {'id': '69', 'type': 'if_statement', 'children': ['70', '73']}; {'id': '70', 'type': 'comparison_operator', 'children': ['71', '72'], 'value': 'is not'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '72', 'type': 'None', 'children': []}; {'id': '73', 'type': 'block', 'children': ['74']}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'assignment', 'children': ['76', '79']}; {'id': '76', 'type': 'subscript', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'extra_params'}; {'id': '78', 'type': 'string', 'children': [], 'value': '"fields"'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '80', 'type': 'return_statement', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'page_iterator'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'HTTPIterator'}; {'id': '85', 'type': 'argument_list', 'children': ['86', '89', '96', '99', '102', '105', '108']}; {'id': '86', 'type': 'keyword_argument', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '89', 'type': 'keyword_argument', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'api_request'}; {'id': '91', 'type': 'attribute', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': '_connection'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'api_request'}; {'id': '96', 'type': 'keyword_argument', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '98', 'type': 'string', 'children': [], 'value': '"/b"'}; {'id': '99', 'type': 'keyword_argument', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'item_to_value'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': '_item_to_bucket'}; {'id': '102', 'type': 'keyword_argument', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'page_token'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'page_token'}; {'id': '105', 'type': 'keyword_argument', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'max_results'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'max_results'}; {'id': '108', 'type': 'keyword_argument', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'extra_params'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'extra_params'}
|
Get all buckets in the project associated to the client.
This will not populate the list of blobs available in each
bucket.
.. literalinclude:: snippets.py
:start-after: [START list_buckets]
:end-before: [END list_buckets]
This implements "storage.buckets.list".
:type max_results: int
:param max_results: Optional. The maximum number of buckets to return.
:type page_token: str
:param page_token:
Optional. If present, return the next batch of buckets, using the
value, which must correspond to the ``nextPageToken`` value
returned in the previous response. Deprecated: use the ``pages``
property of the returned iterator instead of manually passing the
token.
:type prefix: str
:param prefix: Optional. Filter results to buckets whose names begin
with this prefix.
:type projection: str
:param projection:
(Optional) Specifies the set of properties to return. If used, must
be 'full' or 'noAcl'. Defaults to 'noAcl'.
:type fields: str
:param fields:
(Optional) Selector specifying which fields to include in a partial
response. Must be a list of fields. For example to get a partial
response with just the next page token and the language of each
bucket returned: 'items/id,nextPageToken'
:type project: str
:param project: (Optional) the project whose buckets are to be listed.
If not passed, uses the project set on the client.
:rtype: :class:`~google.api_core.page_iterator.Iterator`
:raises ValueError: if both ``project`` is ``None`` and the client's
project is also ``None``.
:returns: Iterator of all :class:`~google.cloud.storage.bucket.Bucket`
belonging to this project.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'remote_pdb_handler'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'signum'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '6', 'type': 'block', 'children': ['7', '47']}; {'id': '7', 'type': 'try_statement', 'children': ['8', '35']}; {'id': '8', 'type': 'block', 'children': ['9', '14', '26']}; {'id': '9', 'type': 'import_from_statement', 'children': ['10', '12']}; {'id': '10', 'type': 'dotted_name', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'remote_pdb'}; {'id': '12', 'type': 'dotted_name', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'RemotePdb'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'rdb'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'RemotePdb'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '23']}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'host'}; {'id': '22', 'type': 'string', 'children': [], 'value': '"127.0.0.1"'}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '0'}; {'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': 'rdb'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'set_trace'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '35', 'type': 'except_clause', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ImportError'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'concatenated_string', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"remote_pdb unavailable. Please install remote_pdb to "'}; {'id': '46', 'type': 'string', 'children': [], 'value': '"allow remote debugging."'}; {'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': 'signal'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'signal'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'signum'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'remote_pdb_handler'}
|
Handler to drop us into a remote debugger upon receiving SIGUSR1
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_read_header'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '5', 'type': 'block', 'children': ['6', '92']}; {'id': '6', 'type': 'with_statement', 'children': ['7', '18']}; {'id': '7', 'type': 'with_clause', 'children': ['8']}; {'id': '8', 'type': 'with_item', 'children': ['9']}; {'id': '9', 'type': 'as_pattern', 'children': ['10', '16']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'string', 'children': [], 'value': "'rb'"}; {'id': '16', 'type': 'as_pattern_target', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '18', 'type': 'block', 'children': ['19', '32', '36']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '22', 'type': 'call', 'children': ['23', '31']}; {'id': '23', 'type': 'attribute', 'children': ['24', '30']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'HDR_LENGTH'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'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': 'header'}; {'id': '35', 'type': 'dictionary', 'children': []}; {'id': '36', 'type': 'for_statement', 'children': ['37', '38', '44']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'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': 'string', 'children': [], 'value': "'='"}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '49', 'type': 'block', 'children': ['50', '61', '73', '86']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '55']}; {'id': '52', 'type': 'pattern_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'string', 'children': [], 'value': "' = '"}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '64', 'type': 'subscript', 'children': ['65', '70']}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '69', 'type': 'argument_list', 'children': []}; {'id': '70', 'type': 'slice', 'children': ['71', '72']}; {'id': '71', 'type': 'integer', 'children': [], 'value': '7'}; {'id': '72', 'type': 'colon', 'children': []}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'assignment', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '76', 'type': 'subscript', 'children': ['77', '82']}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '81', 'type': 'argument_list', 'children': []}; {'id': '82', 'type': 'slice', 'children': ['83', '84']}; {'id': '83', 'type': 'colon', 'children': []}; {'id': '84', 'type': 'unary_operator', 'children': ['85'], 'value': '-'}; {'id': '85', 'type': 'integer', 'children': [], 'value': '1'}; {'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': 'header'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '92', 'type': 'return_statement', 'children': ['93']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'header'}
|
Read the text header for each file
Parameters
----------
channel_file : Path
path to single filename with the header
Returns
-------
dict
header
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'make_response'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '5', 'type': 'block', 'children': ['6', '26']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '19']}; {'id': '7', 'type': 'boolean_operator', 'children': ['8', '13', '14'], 'value': 'or'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'unicode'}; {'id': '13', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '23', 'type': 'tuple', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'text/html'"}; {'id': '26', 'type': 'return_statement', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'response'}
|
Make response tuple
Potential features to be added
- Parameters validation
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'delete_vlan_entry'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'vlan_id'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'with_statement', 'children': ['8', '20']}; {'id': '8', 'type': 'with_clause', 'children': ['9']}; {'id': '9', 'type': 'with_item', 'children': ['10']}; {'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': 'session'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'begin'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'subtransactions'}; {'id': '19', 'type': 'True', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'try_statement', 'children': ['22', '45']}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '44']}; {'id': '25', 'type': 'attribute', 'children': ['26', '43']}; {'id': '26', 'type': 'call', 'children': ['27', '39']}; {'id': '27', 'type': 'attribute', 'children': ['28', '38']}; {'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': 'session'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ucsm_model'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'PortProfile'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'filter_by'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'keyword_argument', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'vlan_id'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'vlan_id'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'delete'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'except_clause', 'children': ['46', '51']}; {'id': '46', 'type': 'attribute', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'orm'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'NoResultFound'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'return_statement', 'children': []}
|
Deletes entry for a vlan_id if it exists.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'has_group'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'group_name'}; {'id': '6', 'type': 'block', 'children': ['7', '25']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '22']}; {'id': '8', 'type': 'call', 'children': ['9', '21']}; {'id': '9', 'type': 'attribute', 'children': ['10', '20']}; {'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': 'user'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'group_name'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'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': []}
|
This allows specification group-based permissions in templates.
In most instances, creating model-based permissions and giving
them to the desired group is preferable.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getFilepaths'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'return_statement', 'children': ['8']}; {'id': '8', 'type': 'tuple', 'children': ['9', '22']}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '21']}; {'id': '16', 'type': 'subscript', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '20', 'type': 'string', 'children': [], 'value': "'HOME'"}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'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': 'os'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '28', 'type': 'argument_list', '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': 'mackup'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'mackup_folder'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'filename'}
|
Get home and mackup filepaths for given file
Args:
filename (str)
Returns:
home_filepath, mackup_filepath (str, str)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_sources'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'plate'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'plate_value'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'block', 'children': ['11', '20', '84', '121']}; {'id': '11', 'type': 'if_statement', 'children': ['12', '15']}; {'id': '12', 'type': 'comparison_operator', 'children': ['13', '14'], 'value': 'is'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '19', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'for_statement', 'children': ['26', '29', '35']}; {'id': '26', 'type': 'pattern_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'si'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'if_statement', 'children': ['37', '51', '63', '81']}; {'id': '37', 'type': 'boolean_operator', 'children': ['38', '46'], 'value': 'and'}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '45'], 'value': '=='}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'streams'}; {'id': '45', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '46', 'type': 'comparison_operator', 'children': ['47', '48'], 'value': 'in'}; {'id': '47', 'type': 'None', 'children': []}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'streams'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'subscript', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'streams'}; {'id': '62', 'type': 'None', 'children': []}; {'id': '63', 'type': 'elif_clause', 'children': ['64', '69']}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '66'], 'value': 'in'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'plate_value'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'streams'}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'subscript', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'streams'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'plate_value'}; {'id': '81', 'type': 'else_clause', 'children': ['82']}; {'id': '82', 'type': 'block', 'children': ['83']}; {'id': '83', 'type': 'pass_statement', 'children': []}; {'id': '84', 'type': 'if_statement', 'children': ['85', '89']}; {'id': '85', 'type': 'not_operator', 'children': ['86']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'plate'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'is_root'}; {'id': '89', 'type': 'block', 'children': ['90', '108']}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'assignment', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'parent_plate_value'}; {'id': '93', 'type': 'call', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '95', 'type': 'generator_expression', 'children': ['96', '97', '100']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'pv'}; {'id': '97', 'type': 'for_in_clause', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'pv'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'plate_value'}; {'id': '100', 'type': 'if_clause', 'children': ['101']}; {'id': '101', 'type': 'comparison_operator', 'children': ['102', '105'], 'value': '!='}; {'id': '102', 'type': 'subscript', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'pv'}; {'id': '104', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'plate'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'meta_data_id'}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'assignment', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '111', 'type': 'call', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'get_sources'}; {'id': '115', 'type': 'argument_list', 'children': ['116', '119', '120']}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'plate'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'parent_plate_value'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '121', 'type': 'return_statement', 'children': ['122']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'sources'}
|
Gets the source streams for a given plate value on a plate.
Also populates with source streams that are valid for the parent plates of this plate,
with the appropriate meta-data for the parent plate.
:param plate: The plate being operated on
:param plate_value: The specific plate value of interest
:param sources: The currently found sources (for recursion)
:return: The appropriate source streams
:type plate: Plate
:type plate_value: tuple
:type sources: list[Stream] | None
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_by_id'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'dictionary_splat_pattern', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ctx_options'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '27']}; {'id': '14', 'type': 'attribute', 'children': ['15', '26']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_get_by_id_async'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21', '24']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '21', 'type': 'keyword_argument', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '24', 'type': 'dictionary_splat', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'ctx_options'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'get_result'}; {'id': '27', 'type': 'argument_list', 'children': []}
|
Returns an instance of Model class by ID.
This is really just a shorthand for Key(cls, id, ...).get().
Args:
id: A string or integer key ID.
parent: Optional parent key of the model to get.
namespace: Optional namespace.
app: Optional app ID.
**ctx_options: Context options.
Returns:
A model instance or None if not found.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'deriv2'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '6', 'type': 'block', 'children': ['7', '21', '36']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'numer'}; {'id': '10', 'type': 'unary_operator', 'children': ['11'], 'value': '-'}; {'id': '11', 'type': '()', 'children': ['12']}; {'id': '12', 'type': 'binary_operator', 'children': ['13', '14'], 'value': '+'}; {'id': '13', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '14', 'type': 'binary_operator', 'children': ['15', '20'], 'value': '*'}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '17'], 'value': '*'}; {'id': '16', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'alpha'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'denom'}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '35'], 'value': '**'}; {'id': '25', 'type': '()', 'children': ['26']}; {'id': '26', 'type': 'binary_operator', 'children': ['27', '28'], 'value': '+'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '28', 'type': 'binary_operator', 'children': ['29', '32'], 'value': '*'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'alpha'}; {'id': '32', 'type': 'binary_operator', 'children': ['33', '34'], 'value': '**'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '39'], 'value': '/'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'numer'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'denom'}
|
Second derivative of the negative binomial link function.
Parameters
----------
p : array-like
Mean parameters
Returns
-------
g''(p) : array
The second derivative of the negative binomial transform link
function
Notes
-----
g''(x) = -(1+2*alpha*x)/(x+alpha*x^2)^2
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dewpoint_temperature'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'temp'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'hum'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '24', '35', '47', '78', '112']}; {'id': '7', 'type': 'assert_statement', 'children': ['8']}; {'id': '8', 'type': '()', 'children': ['9']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '13'], 'value': '=='}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'temp'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'hum'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'vap_press'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'vapor_pressure'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'temp'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'hum'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'positives'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': '>='}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'temp'}; {'id': '34', 'type': 'float', 'children': [], 'value': '273.15'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'dewpoint_temp'}; {'id': '38', 'type': 'binary_operator', 'children': ['39', '44'], 'value': '*'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'temp'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'nan'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '52']}; {'id': '49', 'type': 'subscript', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'dewpoint_temp'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'positives'}; {'id': '52', 'type': 'binary_operator', 'children': ['53', '65'], 'value': '/'}; {'id': '53', 'type': 'binary_operator', 'children': ['54', '55'], 'value': '*'}; {'id': '54', 'type': 'float', 'children': [], 'value': '243.12'}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'binary_operator', 'children': ['61', '64'], 'value': '/'}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'vap_press'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'positives'}; {'id': '64', 'type': 'float', 'children': [], 'value': '6.112'}; {'id': '65', 'type': '()', 'children': ['66']}; {'id': '66', 'type': 'binary_operator', 'children': ['67', '68'], 'value': '-'}; {'id': '67', 'type': 'float', 'children': [], 'value': '17.62'}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'binary_operator', 'children': ['74', '77'], 'value': '/'}; {'id': '74', 'type': 'subscript', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'vap_press'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'positives'}; {'id': '77', 'type': 'float', 'children': [], 'value': '6.112'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '84']}; {'id': '80', 'type': 'subscript', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'dewpoint_temp'}; {'id': '82', 'type': 'unary_operator', 'children': ['83'], 'value': '~'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'positives'}; {'id': '84', 'type': 'binary_operator', 'children': ['85', '98'], 'value': '/'}; {'id': '85', 'type': 'binary_operator', 'children': ['86', '87'], 'value': '*'}; {'id': '86', 'type': 'float', 'children': [], 'value': '272.62'}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'binary_operator', 'children': ['93', '97'], 'value': '/'}; {'id': '93', 'type': 'subscript', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'vap_press'}; {'id': '95', 'type': 'unary_operator', 'children': ['96'], 'value': '~'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'positives'}; {'id': '97', 'type': 'float', 'children': [], 'value': '6.112'}; {'id': '98', 'type': '()', 'children': ['99']}; {'id': '99', 'type': 'binary_operator', 'children': ['100', '101'], 'value': '-'}; {'id': '100', 'type': 'float', 'children': [], 'value': '22.46'}; {'id': '101', 'type': 'call', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'binary_operator', 'children': ['107', '111'], 'value': '/'}; {'id': '107', 'type': 'subscript', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'vap_press'}; {'id': '109', 'type': 'unary_operator', 'children': ['110'], 'value': '~'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'positives'}; {'id': '111', 'type': 'float', 'children': [], 'value': '6.112'}; {'id': '112', 'type': 'return_statement', 'children': ['113']}; {'id': '113', 'type': 'binary_operator', 'children': ['114', '115'], 'value': '+'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'dewpoint_temp'}; {'id': '115', 'type': 'float', 'children': [], 'value': '273.15'}
|
computes the dewpoint temperature
Parameters
----
temp : temperature [K]
hum : relative humidity
Returns
dewpoint temperature in K
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '__argument'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'ttype'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'tvalue'}; {'id': '7', 'type': 'block', 'children': ['8', '30', '52', '80', '95', '116']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '14']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': 'in'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ttype'}; {'id': '11', 'type': 'list', 'children': ['12', '13'], 'value': '["multiline", "string"]'}; {'id': '12', 'type': 'string', 'children': [], 'value': '"multiline"'}; {'id': '13', 'type': 'string', 'children': [], 'value': '"string"'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_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': '__curcommand'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'check_next_arg'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': '"string"'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'tvalue'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"utf-8"'}; {'id': '30', 'type': 'if_statement', 'children': ['31', '36']}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '33'], 'value': 'in'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'ttype'}; {'id': '33', 'type': 'list', 'children': ['34', '35'], 'value': '["number", "tag"]'}; {'id': '34', 'type': 'string', 'children': [], 'value': '"number"'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"tag"'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '44']}; {'id': '39', 'type': 'attribute', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '__curcommand'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'check_next_arg'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'ttype'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'tvalue'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'string', 'children': [], 'value': '"ascii"'}; {'id': '52', 'type': 'if_statement', 'children': ['53', '56']}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '55'], 'value': '=='}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'ttype'}; {'id': '55', 'type': 'string', 'children': [], 'value': '"left_bracket"'}; {'id': '56', 'type': 'block', 'children': ['57', '65', '71', '78']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': '__cstate'}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': '__stringlist'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': '__curstringlist'}; {'id': '70', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': '__set_expected'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'string', 'children': [], 'value': '"string"'}; {'id': '78', 'type': 'return_statement', 'children': ['79']}; {'id': '79', 'type': 'True', 'children': []}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'condition'}; {'id': '83', 'type': '()', 'children': ['84']}; {'id': '84', 'type': 'boolean_operator', 'children': ['85', '90'], 'value': 'and'}; {'id': '85', 'type': 'comparison_operator', 'children': ['86', '87'], 'value': 'in'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'ttype'}; {'id': '87', 'type': 'list', 'children': ['88', '89'], 'value': '["left_cbracket", "comma"]'}; {'id': '88', 'type': 'string', 'children': [], 'value': '"left_cbracket"'}; {'id': '89', 'type': 'string', 'children': [], 'value': '"comma"'}; {'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': '__curcommand'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'non_deterministic_args'}; {'id': '95', 'type': 'if_statement', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'condition'}; {'id': '97', 'type': 'block', 'children': ['98', '106', '114']}; {'id': '98', 'type': 'expression_statement', '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': 'self'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': '__curcommand'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'reassign_arguments'}; {'id': '105', 'type': 'argument_list', 'children': []}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'augmented_assignment', 'children': ['108', '113'], 'value': '-='}; {'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': 'lexer'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '113', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '114', 'type': 'return_statement', 'children': ['115']}; {'id': '115', 'type': 'True', 'children': []}; {'id': '116', 'type': 'return_statement', 'children': ['117']}; {'id': '117', 'type': 'False', 'children': []}
|
Argument parsing method
This method acts as an entry point for 'argument' parsing.
Syntax:
string-list / number / tag
:param ttype: current token type
:param tvalue: current token value
:return: False if an error is encountered, True otherwise
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '41']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '11', 'type': 'argument_list', 'children': []}; {'id': '12', 'type': 'for_statement', 'children': ['13', '16', '25']}; {'id': '13', 'type': 'pattern_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '36']}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'cget'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'string', 'children': [], 'value': "'text'"}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'return_statement', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'data'}
|
Retrieve the GUI elements for program use.
:return: a dictionary containing all \
of the data from the key/value entries
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ListOf'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'element_type'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'element_none_value'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '17', '24']}; {'id': '9', 'type': 'import_from_statement', 'children': ['10', '15']}; {'id': '10', 'type': 'dotted_name', 'children': ['11', '12', '13', '14']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'pyws'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'functions'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'types'}; {'id': '15', 'type': 'dotted_name', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'TypeFactory'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'element_type'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'TypeFactory'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'element_type'}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '33', '35']}; {'id': '28', 'type': 'binary_operator', 'children': ['29', '32'], 'value': '+'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'element_type'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'List'"}; {'id': '33', 'type': 'tuple', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '35', 'type': 'dictionary', 'children': ['36', '39']}; {'id': '36', 'type': 'pair', 'children': ['37', '38']}; {'id': '37', 'type': 'string', 'children': [], 'value': "'element_type'"}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'element_type'}; {'id': '39', 'type': 'pair', 'children': ['40', '41']}; {'id': '40', 'type': 'string', 'children': [], 'value': "'element_none_value'"}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'element_none_value'}
|
This function creates a list type with element type ``element_type`` and an
empty element value ``element_none_value``.
>>> from pyws.functions.args import Integer, ListOf
>>> lst = ListOf(int)
>>> issubclass(lst, List)
True
>>> lst.__name__
'IntegerList'
>>> lst.element_type == Integer
True
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'read_locations'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '35', '50', '54', '118']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ConfigParser'}; {'id': '11', 'type': 'argument_list', 'children': []}; {'id': '12', 'type': 'if_statement', 'children': ['13', '16', '26']}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '15'], 'value': '=='}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'-'"}; {'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': 'data'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'read_file'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'stdin'}; {'id': '26', 'type': 'else_clause', 'children': ['27']}; {'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': 'data'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '35', 'type': 'if_statement', 'children': ['36', '42']}; {'id': '36', 'type': 'not_operator', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sections'}; {'id': '41', 'type': 'argument_list', 'children': []}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'string', 'children': [], 'value': "'Config file is empty'"}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'locations'}; {'id': '53', 'type': 'dictionary', 'children': []}; {'id': '54', 'type': 'for_statement', 'children': ['55', '56', '61']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'sections'}; {'id': '60', 'type': 'argument_list', 'children': []}; {'id': '61', 'type': 'block', 'children': ['62', '110']}; {'id': '62', 'type': 'if_statement', 'children': ['63', '70', '88']}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'has_option'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '69', 'type': 'string', 'children': [], 'value': "'locator'"}; {'id': '70', 'type': 'block', 'children': ['71']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '76']}; {'id': '73', 'type': 'pattern_list', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'latitude'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'longitude'}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'from_grid_locator'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '85', 'type': 'argument_list', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '87', 'type': 'string', 'children': [], 'value': "'locator'"}; {'id': '88', 'type': 'else_clause', 'children': ['89']}; {'id': '89', 'type': 'block', 'children': ['90', '100']}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'assignment', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'latitude'}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'getfloat'}; {'id': '97', 'type': 'argument_list', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '99', 'type': 'string', 'children': [], 'value': "'latitude'"}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'longitude'}; {'id': '103', 'type': 'call', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'getfloat'}; {'id': '107', 'type': 'argument_list', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '109', 'type': 'string', 'children': [], 'value': "'longitude'"}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'assignment', 'children': ['112', '115']}; {'id': '112', 'type': 'subscript', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'locations'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '115', 'type': 'tuple', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'latitude'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'longitude'}; {'id': '118', 'type': 'return_statement', 'children': ['119']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'locations'}
|
Pull locations from a user's config file.
Args:
filename (str): Config file to parse
Returns:
dict: List of locations from config file
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'make_directory'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'try_statement', 'children': ['7', '25']}; {'id': '7', 'type': 'block', 'children': ['8', '13']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'makedirs'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'path'}; {'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': 'logging'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'Directory created: {0}'"}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '25', 'type': 'except_clause', 'children': ['26', '30']}; {'id': '26', 'type': 'as_pattern', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'OSError'}; {'id': '28', 'type': 'as_pattern_target', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '30', 'type': 'block', 'children': ['31']}; {'id': '31', 'type': 'if_statement', 'children': ['32', '39']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '36'], 'value': '!='}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'errno'}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'errno'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'EEXIST'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'raise_statement', 'children': []}
|
Create directory if that not exists.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '19', '27']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_description'}; {'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': 'args'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'Tuple'}; {'id': '9', 'type': 'typed_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'generic_type', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'Dict'}; {'id': '14', 'type': 'type_parameter', 'children': ['15', '17']}; {'id': '15', 'type': 'type', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '17', 'type': 'type', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'Any'}; {'id': '19', 'type': 'type', 'children': ['20']}; {'id': '20', 'type': 'generic_type', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'Dict'}; {'id': '22', 'type': 'type_parameter', 'children': ['23', '25']}; {'id': '23', 'type': 'type', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '25', 'type': 'type', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'Any'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'dictionary', 'children': ['30', '37', '40', '43', '48', '55', '62', '69', '79']}; {'id': '30', 'type': 'pair', 'children': ['31', '32']}; {'id': '31', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'uuid1'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'hex'}; {'id': '37', 'type': 'pair', 'children': ['38', '39']}; {'id': '38', 'type': 'string', 'children': [], 'value': "'args'"}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '40', 'type': 'pair', 'children': ['41', '42']}; {'id': '41', 'type': 'string', 'children': [], 'value': "'kwargs'"}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '43', 'type': 'pair', 'children': ['44', '45']}; {'id': '44', 'type': 'string', 'children': [], 'value': "'module'"}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': '_module_name'}; {'id': '48', 'type': 'pair', 'children': ['49', '50']}; {'id': '49', 'type': 'string', 'children': [], 'value': "'function'"}; {'id': '50', 'type': 'attribute', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '55', 'type': 'pair', 'children': ['56', '57']}; {'id': '56', 'type': 'string', 'children': [], 'value': "'sender_hostname'"}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'gethostname'}; {'id': '61', 'type': 'argument_list', 'children': []}; {'id': '62', 'type': 'pair', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'sender_pid'"}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'getpid'}; {'id': '68', 'type': 'argument_list', 'children': []}; {'id': '69', 'type': 'pair', 'children': ['70', '71']}; {'id': '70', 'type': 'string', 'children': [], 'value': "'sender_cmd'"}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'argv'}; {'id': '79', 'type': 'pair', 'children': ['80', '81']}; {'id': '80', 'type': 'string', 'children': [], 'value': "'sender_timestamp'"}; {'id': '81', 'type': 'subscript', 'children': ['82', '91']}; {'id': '82', 'type': 'call', 'children': ['83', '90']}; {'id': '83', 'type': 'attribute', 'children': ['84', '89']}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'utcnow'}; {'id': '88', 'type': 'argument_list', 'children': []}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'isoformat'}; {'id': '90', 'type': 'argument_list', 'children': []}; {'id': '91', 'type': 'slice', 'children': ['92', '93']}; {'id': '92', 'type': 'colon', 'children': []}; {'id': '93', 'type': 'integer', 'children': [], 'value': '19'}
|
Return the dictionary to be sent to the queue.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'fromOctetString'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'internalFormat'}; {'id': '8', 'type': 'False', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'prepend'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'padding'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '15', 'type': 'block', 'children': ['16', '42', '78', '89']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '19', 'type': 'call', 'children': ['20', '33']}; {'id': '20', 'type': 'attribute', 'children': ['21', '32']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'SizedInteger'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '31'], 'value': '>>'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'integer'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'from_bytes'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'padding'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'setBitLength'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'binary_operator', 'children': ['35', '41'], 'value': '-'}; {'id': '35', 'type': 'binary_operator', 'children': ['36', '40'], 'value': '*'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '40', 'type': 'integer', 'children': [], 'value': '8'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'padding'}; {'id': '42', 'type': 'if_statement', 'children': ['43', '46']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': 'is not'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'prepend'}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '50', 'type': 'call', 'children': ['51', '68']}; {'id': '51', 'type': 'attribute', 'children': ['52', '67']}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'SizedInteger'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'binary_operator', 'children': ['56', '66'], 'value': '|'}; {'id': '56', 'type': '()', 'children': ['57']}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '62'], 'value': '<<'}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'SizedInteger'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'prepend'}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'setBitLength'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'binary_operator', 'children': ['70', '74'], 'value': '+'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'prepend'}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '78', 'type': 'if_statement', 'children': ['79', '81']}; {'id': '79', 'type': 'not_operator', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'internalFormat'}; {'id': '81', 'type': 'block', 'children': ['82']}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '85', 'type': 'call', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '89', 'type': 'return_statement', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'value'}
|
Create a |ASN.1| object initialized from a string.
Parameters
----------
value: :class:`str` (Py2) or :class:`bytes` (Py3)
Text string like '\\\\x01\\\\xff' (Py2) or b'\\\\x01\\\\xff' (Py3)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'release'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'deploy'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'test'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '13', 'type': 'string', 'children': [], 'value': "''"}; {'id': '14', 'type': 'block', 'children': ['15', '28']}; {'id': '15', 'type': 'if_statement', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'test'}; {'id': '17', 'type': 'block', 'children': ['18', '23']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'string', 'children': [], 'value': '"python setup.py check"'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'string', 'children': [], 'value': '"python setup.py register sdist upload --dry-run"'}; {'id': '28', 'type': 'if_statement', 'children': ['29', '30', '76']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'deploy'}; {'id': '30', 'type': 'block', 'children': ['31', '36']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'string', 'children': [], 'value': '"python setup.py check"'}; {'id': '36', 'type': 'if_statement', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '38', 'type': 'block', 'children': ['39', '44', '56', '61', '66', '71']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'string', 'children': [], 'value': '"git checkout master"'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'string', 'children': [], 'value': '"git tag -a v{ver} -m \'v{ver}\'"'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'keyword_argument', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'ver'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'string', 'children': [], 'value': '"git push"'}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'string', 'children': [], 'value': '"git push origin --tags"'}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'string', 'children': [], 'value': '"python setup.py sdist bdist_wheel"'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'string', 'children': [], 'value': '"twine upload --skip-existing dist/*"'}; {'id': '76', 'type': 'else_clause', 'children': ['77']}; {'id': '77', 'type': 'block', 'children': ['78', '83', '88', '93', '98', '103', '108', '113', '118']}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'string', 'children': [], 'value': '"- Have you updated the version?"'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'string', 'children': [], 'value': '"- Have you updated CHANGELOG.md, README.md, and AUTHORS.md?"'}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'call', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'string', 'children': [], 'value': '"- Have you fixed any last minute bugs?"'}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'string', 'children': [], 'value': '"- Have you merged changes for release into the master branch?"'}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'call', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '101', 'type': 'argument_list', 'children': ['102']}; {'id': '102', 'type': 'string', 'children': [], 'value': '"If you answered yes to all of the above questions,"'}; {'id': '103', 'type': 'expression_statement', 'children': ['104']}; {'id': '104', 'type': 'call', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'string', 'children': [], 'value': '"then run `inv release --deploy -vX.YY.ZZ` to:"'}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'call', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'string', 'children': [], 'value': '"- Checkout master"'}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'call', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'string', 'children': [], 'value': '"- Tag the git release with provided vX.YY.ZZ version"'}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'call', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '121', 'type': 'argument_list', 'children': ['122']}; {'id': '122', 'type': 'string', 'children': [], 'value': '"- Push the master branch and tags to repo"'}
|
Tag release, run Travis-CI, and deploy to PyPI
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '22']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dumps'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14', '17', '20']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'spacer'}; {'id': '10', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'quote'}; {'id': '13', 'type': 'string', 'children': [], 'value': '\'"\''}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'newlinechar'}; {'id': '16', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'end_comment'}; {'id': '19', 'type': 'False', 'children': []}; {'id': '20', 'type': 'dictionary_splat_pattern', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_pprint'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28', '29', '30', '31', '32', '33']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'spacer'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'quote'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'newlinechar'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'end_comment'}; {'id': '33', 'type': 'dictionary_splat', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
|
Output a Mapfile dictionary as a string
Parameters
----------
d: dict
A Python dictionary based on the the mappyfile schema
indent: int
The number of ``spacer`` characters to indent structures in the Mapfile
spacer: string
The character to use for indenting structures in the Mapfile. Typically
spaces or tab characters (``\\t``)
quote: string
The quote character to use in the Mapfile (double or single quotes)
newlinechar: string
The character used to insert newlines in the Mapfile
end_comment: bool
Add a comment with the block type at each closing END
statement e.g. END # MAP
Returns
-------
string
The Mapfile as a string
Example
-------
To open a Mapfile from a string, and then print it back out
as a string using tabs::
s = '''MAP NAME "TEST" END'''
d = mappyfile.loads(s)
print(mappyfile.dumps(d, indent=1, spacer="\\t"))
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'collect_publications'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '32']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'pubs'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'sub_publications'}; {'id': '15', 'type': 'for_statement', 'children': ['16', '17', '20']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sub_tree'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'sub_trees'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'pubs'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'sub_tree'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'collect_publications'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'pubs'}
|
Recursively collect list of all publications referenced in this
tree and all sub-trees.
Returns:
list: List of UUID strings.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_combine_nt_vals'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'lst0_lstn'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'flds'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'dflt_null'}; {'id': '7', 'type': 'block', 'children': ['8', '12', '59']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'vals'}; {'id': '11', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '12', 'type': 'for_statement', 'children': ['13', '14', '15']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'fld'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'flds'}; {'id': '15', 'type': 'block', 'children': ['16', '20', '47']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'fld_seen'}; {'id': '19', 'type': 'False', 'children': []}; {'id': '20', 'type': 'for_statement', 'children': ['21', '22', '23']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'nt_curr'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'lst0_lstn'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'if_statement', 'children': ['25', '30']}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'nt_curr'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'fld'}; {'id': '30', 'type': 'block', 'children': ['31', '42', '46']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'vals'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'nt_curr'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'fld'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'fld_seen'}; {'id': '45', 'type': 'True', 'children': []}; {'id': '46', 'type': 'break_statement', 'children': []}; {'id': '47', 'type': 'if_statement', 'children': ['48', '51']}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '50'], 'value': 'is'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'fld_seen'}; {'id': '50', 'type': 'False', 'children': []}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'vals'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'dflt_null'}; {'id': '59', 'type': 'return_statement', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'vals'}
|
Given a list of lists of nts, return a single namedtuple.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'value'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '56']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_value'}; {'id': '12', 'type': 'if_statement', 'children': ['13', '22']}; {'id': '13', 'type': 'boolean_operator', 'children': ['14', '17'], 'value': 'and'}; {'id': '14', 'type': 'comparison_operator', 'children': ['15', '16'], 'value': 'is'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '21'], 'value': 'is not'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_svalue'}; {'id': '21', 'type': 'None', 'children': []}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'try_statement', 'children': ['24', '37']}; {'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': 'result'}; {'id': '28', 'type': 'assignment', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_value'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'resolve'}; {'id': '36', 'type': 'argument_list', 'children': []}; {'id': '37', 'type': 'except_clause', 'children': ['38', '42']}; {'id': '38', 'type': 'as_pattern', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '40', 'type': 'as_pattern_target', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'reraise'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'Parameter'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'Error'}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'Parameter'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'Error'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'string', 'children': [], 'value': '\'Call the method "resolve" first.\''}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'result'}
|
Get parameter value.
If this cached value is None and this serialized value is not None,
calculate the new value from the serialized one.
:return: parameter value.
:raises: TypeError if serialized value is not an instance of self ptype
. ParserError if parsing step raised an error.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '19']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'rsum'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '9', '14']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'time_period'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '9', 'type': 'typed_default_parameter', 'children': ['10', '11', '13']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'num_col'}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '13', 'type': 'string', 'children': [], 'value': '"Number"'}; {'id': '14', 'type': 'typed_default_parameter', 'children': ['15', '16', '18']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'dateindex'}; {'id': '16', 'type': 'type', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'try_statement', 'children': ['21', '52']}; {'id': '21', 'type': 'block', 'children': ['22', '34', '40']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'df'}; {'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': '_resample_'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31', '32', '33']}; {'id': '30', 'type': 'string', 'children': [], 'value': '"sum"'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'time_period'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'num_col'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'dateindex'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '44']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '43'], 'value': 'is'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'block', 'children': ['45']}; {'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': 'err'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'string', 'children': [], 'value': '"Can not sum data"'}; {'id': '52', 'type': 'except_clause', 'children': ['53', '57']}; {'id': '53', 'type': 'as_pattern', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'Exceptions'}; {'id': '55', 'type': 'as_pattern_target', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'err'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '65', 'type': 'string', 'children': [], 'value': '"Can not sum data"'}
|
Resample and add a sum the main dataframe to a time period
:param time_period: unit + period: periods are Y, M, D, H, Min, S
:param time_period: str
:param num_col: number of the new column, defaults to "Number"
:param num_col: str, optional
:param dateindex: column name to use as date index, defaults to None
:param dateindex: str, optional
:example: ``ds.rsum("1D")``
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_seek_to_extent'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'extent'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '14']}; {'id': '9', 'type': 'attribute', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_cdfp'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'seek'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '17'], 'value': '*'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'extent'}; {'id': '17', 'type': 'call', 'children': ['18', '23']}; {'id': '18', 'type': 'attribute', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'pvd'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'logical_block_size'}; {'id': '23', 'type': 'argument_list', 'children': []}
|
An internal method to seek to a particular extent on the input ISO.
Parameters:
extent - The extent to seek to.
Returns:
Nothing.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'port_manager'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '23']}; {'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': '_port_manager'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_port_manager'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'PortManager'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '_port_manager'}
|
Returns the port manager.
:returns: Port manager
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'pack'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '21', '43']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '13']}; {'id': '8', 'type': 'attribute', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'string', 'children': [], 'value': "'content-length'"}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'headerparts'}; {'id': '24', 'type': 'generator_expression', 'children': ['25', '32']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': '"{0}:{1}\\n"'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '32', 'type': 'for_in_clause', 'children': ['33', '36']}; {'id': '33', 'type': 'pattern_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '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': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '42', 'type': 'argument_list', 'children': []}; {'id': '43', 'type': 'return_statement', 'children': ['44']}; {'id': '44', 'type': 'binary_operator', 'children': ['45', '87'], 'value': '+'}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '65'], 'value': '+'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'string', 'children': [], 'value': '"{0}\\n{1}\\n"'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'string', 'children': [], 'value': '""'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'headerparts'}; {'id': '65', 'type': '()', 'children': ['66']}; {'id': '66', 'type': 'conditional_expression', 'children': ['67', '70', '79'], 'value': 'if'}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'binary_type'}; {'id': '79', 'type': 'call', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'string', 'children': [], 'value': "'\\x00'"}
|
Create a string representation from object state.
@return: The string (bytes) for this stomp frame.
@rtype: C{str}
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'devices'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '20', '53']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'devices'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '13', 'type': 'call', 'children': ['14', '19']}; {'id': '14', 'type': 'attribute', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'tdGetNumberOfDevices'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'for_statement', 'children': ['21', '22', '26']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '26', 'type': 'block', 'children': ['27', '46']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'device'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'DeviceFactory'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '41']}; {'id': '33', 'type': 'call', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'tdGetDeviceId'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'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': 'devices'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'device'}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'devices'}
|
Return all known devices.
:return: list of :class:`Device` or :class:`DeviceGroup` instances.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'run'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '22', '41', '72', '82', '97', '105']}; {'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': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_initialize_run'}; {'id': '11', 'type': 'argument_list', 'children': []}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'stimuli'}; {'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': 'protocol_model'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'allTests'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'acq_thread'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'threading'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'Thread'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '37']}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_worker'}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '39', 'type': 'tuple', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'stimuli'}; {'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': 'save_data'}; {'id': '45', 'type': 'block', 'children': ['46', '60']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '49', 'type': 'dictionary', 'children': ['50', '55']}; {'id': '50', 'type': 'pair', 'children': ['51', '52']}; {'id': '51', 'type': 'string', 'children': [], 'value': "'calibration_used'"}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'calname'}; {'id': '55', 'type': 'pair', 'children': ['56', '57']}; {'id': '56', 'type': 'string', 'children': [], 'value': "'calibration_range'"}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'cal_frange'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '67']}; {'id': '62', 'type': 'attribute', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'datafile'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'set_metadata'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'current_dataset_name'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'start_time'}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '81', 'type': 'argument_list', 'children': []}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'last_tick'}; {'id': '87', 'type': 'binary_operator', 'children': ['88', '91'], 'value': '-'}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'start_time'}; {'id': '91', 'type': '()', 'children': ['92']}; {'id': '92', 'type': 'binary_operator', 'children': ['93', '96'], 'value': '/'}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'interval'}; {'id': '96', 'type': 'integer', 'children': [], 'value': '1000'}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'call', 'children': ['99', '104']}; {'id': '99', 'type': 'attribute', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'acq_thread'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '104', 'type': 'argument_list', 'children': []}; {'id': '105', 'type': 'return_statement', 'children': ['106']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'acq_thread'}
|
Runs the acquisition
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_legacy_storage_path'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '27', '39']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'config_dir'}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '24']}; {'id': '17', 'type': 'attribute', 'children': ['18', '23']}; {'id': '18', 'type': 'attribute', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'py3_wrapper'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': '"i3status_config_path"'}; {'id': '26', 'type': 'string', 'children': [], 'value': '"/tmp"'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'storage_path'}; {'id': '30', 'type': 'call', 'children': ['31', '36']}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'config_dir'}; {'id': '38', 'type': 'string', 'children': [], 'value': '"py3status.data"'}; {'id': '39', 'type': 'if_statement', 'children': ['40', '48', '51']}; {'id': '40', 'type': 'call', 'children': ['41', '46']}; {'id': '41', 'type': 'attribute', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'storage_path'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'storage_path'}; {'id': '51', 'type': 'else_clause', 'children': ['52']}; {'id': '52', 'type': 'block', 'children': ['53']}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'None', 'children': []}
|
Detect and return existing legacy storage path.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_rest_doc'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'start_response'}; {'id': '7', 'type': 'block', 'children': ['8', '16', '24', '35', '63', '72', '103']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'api'}; {'id': '11', 'type': 'subscript', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'body_json'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'api'"}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '19', 'type': 'subscript', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'body_json'}; {'id': '23', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'generator'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'discovery_generator'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'DiscoveryGenerator'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'services'}; {'id': '38', 'type': 'list_comprehension', 'children': ['39', '40', '47']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '40', 'type': 'for_in_clause', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '42', 'type': 'attribute', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_backend'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'api_services'}; {'id': '47', 'type': 'if_clause', 'children': ['48']}; {'id': '48', 'type': 'boolean_operator', 'children': ['49', '56'], 'value': 'and'}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '55'], 'value': '=='}; {'id': '50', 'type': 'attribute', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'api_info'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'api'}; {'id': '56', 'type': 'comparison_operator', 'children': ['57', '62'], 'value': '=='}; {'id': '57', 'type': 'attribute', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'api_info'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'api_version'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'doc'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'generator'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'pretty_print_config_to_json'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'services'}; {'id': '72', 'type': 'if_statement', 'children': ['73', '75']}; {'id': '73', 'type': 'not_operator', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'doc'}; {'id': '75', 'type': 'block', 'children': ['76', '87', '95']}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'error_msg'}; {'id': '79', 'type': 'binary_operator', 'children': ['80', '84'], 'value': '%'}; {'id': '80', 'type': '()', 'children': ['81']}; {'id': '81', 'type': 'concatenated_string', 'children': ['82', '83']}; {'id': '82', 'type': 'string', 'children': [], 'value': "'Failed to convert .api to discovery doc for '"}; {'id': '83', 'type': 'string', 'children': [], 'value': "'version %s of api %s'"}; {'id': '84', 'type': 'tuple', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'api'}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'call', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': '_logger'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '92', 'type': 'argument_list', 'children': ['93', '94']}; {'id': '93', 'type': 'string', 'children': [], 'value': "'%s'"}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'error_msg'}; {'id': '95', 'type': 'return_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'util'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'send_wsgi_error_response'}; {'id': '100', 'type': 'argument_list', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'error_msg'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'start_response'}; {'id': '103', 'type': 'return_statement', 'children': ['104']}; {'id': '104', 'type': 'call', 'children': ['105', '108']}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': '_send_success_response'}; {'id': '108', 'type': 'argument_list', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'doc'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'start_response'}
|
Sends back HTTP response with API directory.
This calls start_response and returns the response body. It will return
the discovery doc for the requested api/version.
Args:
request: An ApiRequest, the transformed request sent to the Discovery API.
start_response: A function with semantics defined in PEP-333.
Returns:
A string, the response body.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_status'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'status'}; {'id': '6', 'type': 'block', 'children': ['7', '13']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'status'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'status'}; {'id': '13', 'type': 'for_statement', 'children': ['14', '15', '18']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'callback'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_update_status_callbacks'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'callback'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}
|
Save the new status and call all defined callbacks
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '__plain_bfs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'adj'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '18']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'seen'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'nextlevel'}; {'id': '16', 'type': 'set', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '18', 'type': 'while_statement', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'nextlevel'}; {'id': '20', 'type': 'block', 'children': ['21', '25', '31']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'thislevel'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'nextlevel'}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'nextlevel'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '30', 'type': 'argument_list', 'children': []}; {'id': '31', 'type': 'for_statement', 'children': ['32', '33', '34']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'thislevel'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'if_statement', 'children': ['36', '39']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '38'], 'value': 'not in'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'seen'}; {'id': '39', 'type': 'block', 'children': ['40', '43', '50']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'yield', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'seen'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'v'}; {'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': 'nextlevel'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'adj'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'v'}
|
modified NX fast BFS node generator
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'compose_capability'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '5', 'type': 'list_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '7', 'type': 'block', 'children': ['8', '20', '33', '53', '60', '66', '78']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': '_debug'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'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': 'compose_capability'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_debug'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18', '19']}; {'id': '17', 'type': 'string', 'children': [], 'value': '"compose_capability %r %r"'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '27']}; {'id': '21', 'type': 'not_operator', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'issubclass'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'Collector'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'raise_statement', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': '"base must be a subclass of Collector"'}; {'id': '33', 'type': 'for_statement', 'children': ['34', '35', '36']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'if_statement', 'children': ['38', '44']}; {'id': '38', 'type': 'not_operator', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'issubclass'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'Capability'}; {'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': 'TypeError'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'binary_operator', 'children': ['50', '51'], 'value': '%'}; {'id': '50', 'type': 'string', 'children': [], 'value': '"%s is not a Capability subclass"'}; {'id': '51', 'type': 'tuple', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'bases'}; {'id': '56', 'type': 'binary_operator', 'children': ['57', '59'], 'value': '+'}; {'id': '57', 'type': 'tuple', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '66', 'type': 'for_statement', 'children': ['67', '68', '69']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'augmented_assignment', 'children': ['72', '73'], 'value': '+='}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '73', 'type': 'binary_operator', 'children': ['74', '75'], 'value': '+'}; {'id': '74', 'type': 'string', 'children': [], 'value': "'+'"}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '78', 'type': 'return_statement', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '81', 'type': 'argument_list', 'children': ['82', '83', '84']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'bases'}; {'id': '84', 'type': 'dictionary', 'children': []}
|
Create a new class starting with the base and adding capabilities.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'tableNames'}; {'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': 'dbName'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '13', '26']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': 'is'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'dbName'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'list_comprehension', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '17', 'type': 'for_in_clause', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'name'}; {'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': '_ssql_ctx'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'tableNames'}; {'id': '25', 'type': 'argument_list', 'children': []}; {'id': '26', 'type': 'else_clause', 'children': ['27']}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'list_comprehension', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '31', 'type': 'for_in_clause', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '33', 'type': 'call', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_ssql_ctx'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'tableNames'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'dbName'}
|
Returns a list of names of tables in the database ``dbName``.
:param dbName: string, name of the database to use. Default to the current database.
:return: list of table names, in string
>>> sqlContext.registerDataFrameAsTable(df, "table1")
>>> "table1" in sqlContext.tableNames()
True
>>> "table1" in sqlContext.tableNames("default")
True
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'on'}; {'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': 'val'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '13', '22', '36']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': 'is'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '12', 'type': 'False', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'raise_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ParameterError'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'concatenated_string', 'children': ['19', '20', '21']}; {'id': '19', 'type': 'string', 'children': [], 'value': '"Turning the ValuedParameter on with value "'}; {'id': '20', 'type': 'string', 'children': [], 'value': '"False is the same as turning it off. Use "'}; {'id': '21', 'type': 'string', 'children': [], 'value': '"another value."'}; {'id': '22', 'type': 'elif_clause', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'IsPath'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'Value'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'FilePath'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '36', 'type': 'else_clause', 'children': ['37']}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'Value'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'val'}
|
Turns the MixedParameter ON by setting its Value to val
An attempt to turn the parameter on with value 'False' will result
in an error, since this is the same as turning the parameter off.
Turning the MixedParameter ON without a value or with value 'None'
will let the parameter behave as a flag.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_paths_argument'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '10']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'argname'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'help_'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14', '24', '70', '91']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'prefixed'}; {'id': '17', 'type': 'binary_operator', 'children': ['18', '19'], 'value': '%'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'%s-%s'"}; {'id': '19', 'type': 'tuple', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'argument_prefix'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'argname'}; {'id': '24', 'type': 'if_statement', 'children': ['25', '28', '54']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': 'is'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '27', 'type': 'None', 'children': []}; {'id': '28', 'type': 'block', 'children': ['29', '39']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'prefixed'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '38']}; {'id': '37', 'type': 'string', 'children': [], 'value': "'-'"}; {'id': '38', 'type': 'string', 'children': [], 'value': "'_'"}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'final_dest'}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '44', 'type': 'slice', 'children': ['45', '53']}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '52'], 'value': '+'}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'argument_prefix'}; {'id': '52', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '53', 'type': 'colon', 'children': []}; {'id': '54', 'type': 'else_clause', 'children': ['55']}; {'id': '55', 'type': 'block', 'children': ['56', '60']}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'final_dest'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '63', 'type': 'binary_operator', 'children': ['64', '65'], 'value': '%'}; {'id': '64', 'type': 'string', 'children': [], 'value': "'%s_%s'"}; {'id': '65', 'type': 'tuple', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'argument_prefix'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '75', 'type': 'argument_list', 'children': ['76', '79', '82', '85', '88']}; {'id': '76', 'type': 'binary_operator', 'children': ['77', '78'], 'value': '%'}; {'id': '77', 'type': 'string', 'children': [], 'value': "'--%s'"}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'prefixed'}; {'id': '79', 'type': 'keyword_argument', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'action'}; {'id': '81', 'type': 'string', 'children': [], 'value': "'store'"}; {'id': '82', 'type': 'keyword_argument', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'nargs'}; {'id': '84', 'type': 'string', 'children': [], 'value': "'+'"}; {'id': '85', 'type': 'keyword_argument', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '88', 'type': 'keyword_argument', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'help'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'help_'}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '98']}; {'id': '93', 'type': 'subscript', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'paths_arguments'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'final_dest'}
|
Subclasses may call this to expose a paths argument.
Args:
group: arparse.ArgumentGroup, the extension argument group
argname: str, the name of the argument, will be namespaced.
dest: str, similar to the `dest` argument of
`argparse.ArgumentParser.add_argument`, will be namespaced.
help_: str, similar to the `help` argument of
`argparse.ArgumentParser.add_argument`.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'items'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '27', '38', '56']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '18']}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '18', 'type': 'keyword_argument', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '20', 'type': 'dictionary', 'children': ['21', '24']}; {'id': '21', 'type': 'pair', 'children': ['22', '23']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'User-Agent'"}; {'id': '23', 'type': 'string', 'children': [], 'value': '"Magic Browser"'}; {'id': '24', 'type': 'pair', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': '"origin_req_host"'}; {'id': '26', 'type': 'string', 'children': [], 'value': '"thepiratebay.se"'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'html'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'fromstring'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '41', 'type': 'list_comprehension', 'children': ['42', '48']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_build_torrent'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '48', 'type': 'for_in_clause', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': '_get_torrent_rows'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '56', 'type': 'for_statement', 'children': ['57', '58', '59']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'yield', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'item'}
|
Request URL and parse response. Yield a ``Torrent`` for every torrent
on page.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'local_scope'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '18']}; {'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': 'scope'}; {'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': 'scope'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'new_child'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'try_statement', 'children': ['19', '25']}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'yield', 'children': ['22']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '25', 'type': 'finally_clause', 'children': ['26']}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'parents'}
|
Assign symbols to local variables.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'main'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'argv'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '25', '36', '44', '52', '60', '68', '77', '90', '117', '121', '140', '146', '159', '172']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'argparse'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'ArgumentParser'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21', '22']}; {'id': '20', 'type': 'string', 'children': [], 'value': "'-s'"}; {'id': '21', 'type': 'string', 'children': [], 'value': "'--scope'"}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'nargs'}; {'id': '24', 'type': 'string', 'children': [], 'value': "'+'"}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32', '33']}; {'id': '31', 'type': 'string', 'children': [], 'value': "'-o'"}; {'id': '32', 'type': 'string', 'children': [], 'value': "'--oauth-service'"}; {'id': '33', 'type': 'keyword_argument', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'default'}; {'id': '35', 'type': 'string', 'children': [], 'value': "'google'"}; {'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': 'p'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43']}; {'id': '42', 'type': 'string', 'children': [], 'value': "'-i'"}; {'id': '43', 'type': 'string', 'children': [], 'value': "'--client-id'"}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51']}; {'id': '50', 'type': 'string', 'children': [], 'value': "'-x'"}; {'id': '51', 'type': 'string', 'children': [], 'value': "'--client-secret'"}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59']}; {'id': '58', 'type': 'string', 'children': [], 'value': "'-r'"}; {'id': '59', 'type': 'string', 'children': [], 'value': "'--redirect-uri'"}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '67']}; {'id': '66', 'type': 'string', 'children': [], 'value': "'-f'"}; {'id': '67', 'type': 'string', 'children': [], 'value': "'--client-secrets'"}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'parse_args'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'argv'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'client_args'}; {'id': '80', 'type': 'tuple', 'children': ['81', '84', '87']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'client_id'}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'client_secret'}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'client_id'}; {'id': '90', 'type': 'if_statement', 'children': ['91', '101']}; {'id': '91', 'type': 'boolean_operator', 'children': ['92', '96'], 'value': 'and'}; {'id': '92', 'type': 'call', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'any'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'client_args'}; {'id': '96', 'type': 'not_operator', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'client_args'}; {'id': '101', 'type': 'block', 'children': ['102', '109', '115']}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'call', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'concatenated_string', 'children': ['107', '108']}; {'id': '107', 'type': 'string', 'children': [], 'value': "'Must provide none of client-id, client-secret and redirect-uri;'"}; {'id': '108', 'type': 'string', 'children': [], 'value': "' or all of them.'"}; {'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': 'p'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'print_usage'}; {'id': '114', 'type': 'argument_list', 'children': []}; {'id': '115', 'type': 'return_statement', 'children': ['116']}; {'id': '116', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '117', 'type': 'print_statement', 'children': ['118']}; {'id': '118', 'type': 'attribute', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '121', 'type': 'if_statement', 'children': ['122', '126']}; {'id': '122', 'type': 'not_operator', 'children': ['123']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '126', 'type': 'block', 'children': ['127', '132', '138']}; {'id': '127', 'type': 'expression_statement', 'children': ['128']}; {'id': '128', 'type': 'call', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '130', 'type': 'argument_list', 'children': ['131']}; {'id': '131', 'type': 'string', 'children': [], 'value': "'Scope must be provided.'"}; {'id': '132', 'type': 'expression_statement', 'children': ['133']}; {'id': '133', 'type': 'call', 'children': ['134', '137']}; {'id': '134', 'type': 'attribute', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'print_usage'}; {'id': '137', 'type': 'argument_list', 'children': []}; {'id': '138', 'type': 'return_statement', 'children': ['139']}; {'id': '139', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '140', 'type': 'expression_statement', 'children': ['141']}; {'id': '141', 'type': 'assignment', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '143', 'type': 'call', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'WizardClientConfig'}; {'id': '145', 'type': 'argument_list', 'children': []}; {'id': '146', 'type': 'expression_statement', 'children': ['147']}; {'id': '147', 'type': 'assignment', 'children': ['148', '151']}; {'id': '148', 'type': 'attribute', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '151', 'type': 'call', 'children': ['152', '155']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '155', 'type': 'argument_list', 'children': ['156']}; {'id': '156', 'type': 'attribute', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '159', 'type': 'expression_statement', 'children': ['160']}; {'id': '160', 'type': 'call', 'children': ['161', '162']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '162', 'type': 'argument_list', 'children': ['163']}; {'id': '163', 'type': 'subscript', 'children': ['164', '171']}; {'id': '164', 'type': 'call', 'children': ['165', '166']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'run_local'}; {'id': '166', 'type': 'argument_list', 'children': ['167']}; {'id': '167', 'type': 'call', 'children': ['168', '169']}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'UserOAuth2'}; {'id': '169', 'type': 'argument_list', 'children': ['170']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '171', 'type': 'string', 'children': [], 'value': "'access_token'"}; {'id': '172', 'type': 'return_statement', 'children': ['173']}; {'id': '173', 'type': 'integer', 'children': [], 'value': '0'}
|
Entry point for command line script to perform OAuth 2.0.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'compute_hash'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'string'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '20']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'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': 'h'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'string'}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'hexdigest'}; {'id': '25', 'type': 'argument_list', 'children': []}
|
compute hash of string using given hash function
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_split_repo_str'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '5', 'type': 'block', 'children': ['6', '15']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sourceslist'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'SourceEntry'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'expression_list', 'children': ['17', '20', '23', '26', '29']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'architectures'}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'uri'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'dist'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'comps'}
|
Return APT source entry as a tuple.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'intersect'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'range_'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '24', '40', '56', '64', '96']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'augmented_assignment', 'children': ['9', '14'], 'value': '+='}; {'id': '9', 'type': 'attribute', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'solver'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'intersection_broad_tests_count'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '15', 'type': 'if_statement', 'children': ['16', '21']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'range_'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'is_any'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'if_statement', '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': 'solver'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'optimised'}; {'id': '30', 'type': 'block', 'children': ['31']}; {'id': '31', 'type': 'if_statement', 'children': ['32', '37']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': 'in'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'range_'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'been_intersected_with'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'pr'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '52']}; {'id': '47', 'type': 'attribute', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'pr'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'passive'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54', '55']}; {'id': '53', 'type': 'string', 'children': [], 'value': '"intersecting %s wrt range \'%s\'..."'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'range_'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'augmented_assignment', 'children': ['58', '63'], 'value': '+='}; {'id': '58', 'type': 'attribute', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'solver'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'intersection_tests_count'}; {'id': '63', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '64', 'type': 'with_statement', 'children': ['65', '79']}; {'id': '65', 'type': 'with_clause', 'children': ['66']}; {'id': '66', 'type': 'with_item', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '73']}; {'id': '68', 'type': 'attribute', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'solver'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'timed'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'attribute', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'solver'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'intersection_time'}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '83', 'type': 'list_comprehension', 'children': ['84', '85', '90']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '85', 'type': 'for_in_clause', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '90', 'type': 'if_clause', 'children': ['91']}; {'id': '91', 'type': 'comparison_operator', 'children': ['92', '95'], 'value': 'in'}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'range_'}; {'id': '96', 'type': 'if_statement', 'children': ['97', '99', '102', '135']}; {'id': '97', 'type': 'not_operator', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '99', 'type': 'block', 'children': ['100']}; {'id': '100', 'type': 'return_statement', 'children': ['101']}; {'id': '101', 'type': 'None', 'children': []}; {'id': '102', 'type': 'elif_clause', 'children': ['103', '114']}; {'id': '103', 'type': 'comparison_operator', 'children': ['104', '108'], 'value': '<'}; {'id': '104', 'type': 'call', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '108', 'type': 'call', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '114', 'type': 'block', 'children': ['115', '124', '133']}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'assignment', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'copy_'}; {'id': '118', 'type': 'call', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': '_copy'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '124', 'type': 'expression_statement', 'children': ['125']}; {'id': '125', 'type': 'call', 'children': ['126', '131']}; {'id': '126', 'type': 'attribute', 'children': ['127', '130']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'copy_'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'been_intersected_with'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'range_'}; {'id': '133', 'type': 'return_statement', 'children': ['134']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'copy_'}; {'id': '135', 'type': 'else_clause', 'children': ['136']}; {'id': '136', 'type': 'block', 'children': ['137', '146']}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'call', 'children': ['139', '144']}; {'id': '139', 'type': 'attribute', 'children': ['140', '143']}; {'id': '140', 'type': 'attribute', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'been_intersected_with'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'range_'}; {'id': '146', 'type': 'return_statement', 'children': ['147']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'self'}
|
Remove variants whose version fall outside of the given range.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'unsigned_request'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '23', '91']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '13', 'type': 'dictionary', 'children': ['14', '17', '20']}; {'id': '14', 'type': 'pair', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': '"content-type"'}; {'id': '16', 'type': 'string', 'children': [], 'value': '"application/json"'}; {'id': '17', 'type': 'pair', 'children': ['18', '19']}; {'id': '18', 'type': 'string', 'children': [], 'value': '"accept"'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"application/json"'}; {'id': '20', 'type': 'pair', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': '"X-accept-version"'}; {'id': '22', 'type': 'string', 'children': [], 'value': '"2.0.0"'}; {'id': '23', 'type': 'try_statement', 'children': ['24', '80']}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'if_statement', 'children': ['26', '27', '57']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'requests'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '41', '46', '54']}; {'id': '36', 'type': 'binary_operator', 'children': ['37', '40'], 'value': '+'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'uri'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '46', 'type': 'keyword_argument', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'payload'}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '57', 'type': 'else_clause', 'children': ['58']}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'requests'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '72', '77']}; {'id': '67', 'type': 'binary_operator', 'children': ['68', '71'], 'value': '+'}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'uri'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '72', 'type': 'keyword_argument', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '77', 'type': 'keyword_argument', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '80', 'type': 'except_clause', 'children': ['81', '85']}; {'id': '81', 'type': 'as_pattern', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '83', 'type': 'as_pattern_target', 'children': ['84']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'pro'}; {'id': '85', 'type': 'block', 'children': ['86']}; {'id': '86', 'type': 'raise_statement', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'BitPayConnectionError'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'string', 'children': [], 'value': "'Connection refused'"}; {'id': '91', 'type': 'return_statement', 'children': ['92']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'response'}
|
generic bitpay usigned wrapper
passing a payload will do a POST, otherwise a GET
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'command_line_runner'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '11', '22', '33', '57', '70', '85', '99', '104', '109']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'assignment', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'get_parser'}; {'id': '10', 'type': 'argument_list', 'children': []}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'vars'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'parse_args'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'if_statement', 'children': ['23', '26']}; {'id': '23', 'type': 'subscript', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '26', 'type': 'block', 'children': ['27', '32']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '__version__'}; {'id': '32', 'type': 'return_statement', 'children': []}; {'id': '33', 'type': 'if_statement', 'children': ['34', '37']}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'clear_cache'"}; {'id': '37', 'type': 'block', 'children': ['38', '44', '56']}; {'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': 'utils'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'clear_cache'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'string', 'children': [], 'value': "'Cleared {0}.'"}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'CACHE_DIR'}; {'id': '56', 'type': 'return_statement', 'children': []}; {'id': '57', 'type': 'if_statement', 'children': ['58', '62']}; {'id': '58', 'type': 'not_operator', 'children': ['59']}; {'id': '59', 'type': 'subscript', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '61', 'type': 'string', 'children': [], 'value': "'query'"}; {'id': '62', 'type': 'block', 'children': ['63', '69']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'print_help'}; {'id': '68', 'type': 'argument_list', 'children': []}; {'id': '69', 'type': 'return_statement', 'children': []}; {'id': '70', 'type': 'if_statement', 'children': ['71', '78']}; {'id': '71', 'type': 'not_operator', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'getenv'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'string', 'children': [], 'value': "'SCRAPE_DISABLE_CACHE'"}; {'id': '78', 'type': 'block', 'children': ['79']}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'call', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'enable_cache'}; {'id': '84', 'type': 'argument_list', 'children': []}; {'id': '85', 'type': 'if_statement', 'children': ['86', '92']}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'getenv'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'string', 'children': [], 'value': "'SCRAPE_DISABLE_IMGS'"}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'assignment', 'children': ['95', '98']}; {'id': '95', 'type': 'subscript', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '97', 'type': 'string', 'children': [], 'value': "'no_images'"}; {'id': '98', 'type': 'True', 'children': []}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'call', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'prompt_filetype'}; {'id': '102', 'type': 'argument_list', 'children': ['103']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '104', 'type': 'expression_statement', 'children': ['105']}; {'id': '105', 'type': 'call', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'prompt_save_images'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'call', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'scrape'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'args'}
|
Handle command-line interaction.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_firestore_api'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '28']}; {'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': '_firestore_api_internal'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_firestore_api_internal'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'firestore_client'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'FirestoreClient'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_credentials'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_firestore_api_internal'}
|
Lazy-loading getter GAPIC Firestore API.
Returns:
~.gapic.firestore.v1beta1.firestore_client.FirestoreClient: The
GAPIC client with the credentials of the current client.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'request_halt'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '7', 'type': 'block', 'children': ['8', '14', '46', '62']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'Future'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'decorated_definition', 'children': ['15', '19']}; {'id': '15', 'type': 'decorator', 'children': ['16']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'gen'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'coroutine'}; {'id': '19', 'type': 'function_definition', 'children': ['20', '21', '22']}; {'id': '20', 'type': 'function_name', 'children': [], 'value': '_halt'}; {'id': '21', 'type': 'parameters', 'children': []}; {'id': '22', 'type': 'block', 'children': ['23', '30', '35', '44']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'reply'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"ok"'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'yield', 'children': ['32']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'gen'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'moment'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'raise_statement', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'AsyncReply'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '53']}; {'id': '48', 'type': 'attribute', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'ioloop'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'add_callback'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'lambda', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'chain_future'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '61']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_halt'}; {'id': '60', 'type': 'argument_list', 'children': []}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '62', 'type': 'return_statement', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'f'}
|
Halt the device server.
Returns
-------
success : {'ok', 'fail'}
Whether scheduling the halt succeeded.
Examples
--------
::
?halt
!halt ok
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_devices'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '35']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'devices'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '17']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'element'}; {'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': 'get_device_elements'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18', '28']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'device'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'FritzhomeDevice'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'element'}; {'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': 'devices'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'device'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'devices'}
|
Get the list of all known devices.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'retrieve_all'}; {'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': 'subset'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '17', '23', '38']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'get_object'}; {'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': 'factory'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'get_object'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'obj_class'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'obj_class'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'full_objects'}; {'id': '26', 'type': 'list_comprehension', 'children': ['27', '35']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'get_object'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31', '34']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'obj_class'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'list_obj'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'subset'}; {'id': '35', 'type': 'for_in_clause', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'list_obj'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'JSSObjectList'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '45', '46']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'factory'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'obj_class'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'full_objects'}
|
Return a list of all JSSListData elements as full JSSObjects.
This can take a long time given a large number of objects,
and depending on the size of each object. Subsetting to only
include the data you need can improve performance.
Args:
subset: For objects which support it, a list of sub-tags to
request, or an "&" delimited string, (e.g.
"general&purchasing"). Default to None.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'save'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '34']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'options'}; {'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': 'conf'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'clang_defaultSaveOptions'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '30']}; {'id': '25', 'type': 'attribute', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'conf'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'clang_saveTranslationUnit'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32', '33']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '34', 'type': 'if_statement', 'children': ['35', '38']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': '!='}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'raise_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'TranslationUnitSaveError'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '44', 'type': 'string', 'children': [], 'value': "'Error saving TranslationUnit.'"}
|
Saves the TranslationUnit to a file.
This is equivalent to passing -emit-ast to the clang frontend. The
saved file can be loaded back into a TranslationUnit. Or, if it
corresponds to a header, it can be used as a pre-compiled header file.
If an error occurs while saving, a TranslationUnitSaveError is raised.
If the error was TranslationUnitSaveError.ERROR_INVALID_TU, this means
the constructed TranslationUnit was not valid at time of save. In this
case, the reason(s) why should be available via
TranslationUnit.diagnostics().
filename -- The path to save the translation unit to.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'mutualReceptions'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'idA'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'idB'}; {'id': '7', 'type': 'block', 'children': ['8', '18', '28']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'AB'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'receives'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'idA'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'idB'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'BA'}; {'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': 'receives'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'idB'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'idA'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'list_comprehension', 'children': ['30', '33', '36']}; {'id': '30', 'type': 'tuple', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '33', 'type': 'for_in_clause', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'AB'}; {'id': '36', 'type': 'for_in_clause', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'BA'}
|
Returns all pairs of dignities in mutual reception.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'parse_problem'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'problem_content'}; {'id': '6', 'type': 'block', 'children': ['7', '11']}; {'id': '7', 'type': 'delete_statement', 'children': ['8']}; {'id': '8', 'type': 'subscript', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'problem_content'}; {'id': '10', 'type': 'string', 'children': [], 'value': '"@order"'}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '29']}; {'id': '13', 'type': 'attribute', 'children': ['14', '28']}; {'id': '14', 'type': 'call', 'children': ['15', '24']}; {'id': '15', 'type': 'attribute', 'children': ['16', '23']}; {'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': 'task_factory'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'get_problem_types'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'problem_content'}; {'id': '27', 'type': 'string', 'children': [], 'value': '"type"'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'parse_problem'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'problem_content'}
|
Parses a problem, modifying some data
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_autodiscover'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '23']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '14']}; {'id': '7', 'type': 'not_operator', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '12', '13']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'_registerable_class'"}; {'id': '13', 'type': 'None', 'children': []}; {'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': 'ImproperlyConfigured'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'concatenated_string', 'children': ['20', '21', '22']}; {'id': '20', 'type': 'string', 'children': [], 'value': "'You must set a '"}; {'id': '21', 'type': 'string', 'children': [], 'value': '\'"_registerable_class" property \''}; {'id': '22', 'type': 'string', 'children': [], 'value': "'in order to use autodiscovery.'"}; {'id': '23', 'type': 'for_statement', 'children': ['24', '25', '28']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'mod_name'}; {'id': '25', 'type': 'tuple', 'children': ['26', '27']}; {'id': '26', 'type': 'string', 'children': [], 'value': "'dashboard'"}; {'id': '27', 'type': 'string', 'children': [], 'value': "'panel'"}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'for_statement', 'children': ['30', '31', '34']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'app'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'INSTALLED_APPS'}; {'id': '34', 'type': 'block', 'children': ['35', '42']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'mod'}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'import_module'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'app'}; {'id': '42', 'type': 'try_statement', 'children': ['43', '64']}; {'id': '43', 'type': 'block', 'children': ['44', '55']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'before_import_registry'}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '_registry'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'import_module'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '61'], 'value': '%'}; {'id': '60', 'type': 'string', 'children': [], 'value': "'%s.%s'"}; {'id': '61', 'type': 'tuple', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'app'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'mod_name'}; {'id': '64', 'type': 'except_clause', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '66', 'type': 'block', 'children': ['67', '73']}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': '_registry'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'before_import_registry'}; {'id': '73', 'type': 'if_statement', 'children': ['74', '79']}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'module_has_submodule'}; {'id': '76', 'type': 'argument_list', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'mod'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'mod_name'}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'raise_statement', 'children': []}
|
Discovers modules to register from ``settings.INSTALLED_APPS``.
This makes sure that the appropriate modules get imported to register
themselves with Horizon.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load_tag_library'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'libname'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '21']}; {'id': '6', 'type': 'import_from_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'dotted_name', 'children': ['8', '9', '10', '11']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'django'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'backends'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'django'}; {'id': '12', 'type': 'dotted_name', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'get_installed_libraries'}; {'id': '14', 'type': 'import_from_statement', 'children': ['15', '19']}; {'id': '15', 'type': 'dotted_name', 'children': ['16', '17', '18']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'django'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'template'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'library'}; {'id': '19', 'type': 'dotted_name', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'InvalidTemplateLibrary'}; {'id': '21', 'type': 'try_statement', 'children': ['22', '44']}; {'id': '22', 'type': 'block', 'children': ['23', '31', '42']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '26', 'type': 'subscript', 'children': ['27', '30']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'get_installed_libraries'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'libname'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '34', 'type': 'attribute', 'children': ['35', '41']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'importlib'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'import_module'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'register'}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '44', 'type': 'except_clause', 'children': ['45', '48']}; {'id': '45', 'type': 'tuple', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'InvalidTemplateLibrary'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'None', 'children': []}
|
Load a templatetag library on multiple Django versions.
Returns None if the library isn't loaded.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_generic_schema'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '45']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'Schema'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '20', '28']}; {'id': '12', 'type': 'keyword_argument', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'ID'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'stored'}; {'id': '19', 'type': 'True', 'children': []}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'ID'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'stored'}; {'id': '27', 'type': 'True', 'children': []}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'NGRAM'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '36', '39', '42']}; {'id': '33', 'type': 'keyword_argument', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'phrase'}; {'id': '35', 'type': 'True', 'children': []}; {'id': '36', 'type': 'keyword_argument', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'stored'}; {'id': '38', 'type': 'True', 'children': []}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'minsize'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'maxsize'}; {'id': '44', 'type': 'integer', 'children': [], 'value': '8'}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'schema'}
|
Returns whoosh's generic schema.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'spin1x_from_xi1_phi_a_phi_s'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'xi1'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'phi_a'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'phi_s'}; {'id': '7', 'type': 'block', 'children': ['8', '16']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'phi1'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'phi1_from_phi_a_phi_s'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'phi_a'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'phi_s'}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'binary_operator', 'children': ['18', '19'], 'value': '*'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'xi1'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'cos'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'phi1'}
|
Returns x-component spin for primary mass.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'serialize'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '7', 'type': 'block', 'children': ['8', '31', '42', '51']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '15']}; {'id': '9', 'type': 'boolean_operator', 'children': ['10', '12'], 'value': 'and'}; {'id': '10', 'type': 'not_operator', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'required'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'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': 'state'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'raise_error'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'MissingValue'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': '\'Missing required aggregate "{}"\''}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'element_path'}; {'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': 'start_element'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'end_element'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_element_path_create_new'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'element_path'}; {'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': '_serialize'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49', '50']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'end_element'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'start_element'}
|
Serialize the value to a new element and return the element.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'upgrade_account'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'account'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'dictionary_splat_pattern', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '10', 'type': 'block', 'children': ['11', '30', '39', '49', '81']}; {'id': '11', 'type': 'if_statement', 'children': ['12', '14']}; {'id': '12', 'type': 'not_operator', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'account'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'if_statement', 'children': ['16', '21']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '18'], 'value': 'in'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"default_account"'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'config'}; {'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': 'account'}; {'id': '25', 'type': 'subscript', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '29', 'type': 'string', 'children': [], 'value': '"default_account"'}; {'id': '30', 'type': 'if_statement', 'children': ['31', '33']}; {'id': '31', 'type': 'not_operator', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'account'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'raise_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'string', 'children': [], 'value': '"You need to provide an account"'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'account'}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'Account'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'account'}; {'id': '46', 'type': 'keyword_argument', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'blockchain_instance'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'operations'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'Account_upgrade'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'dictionary_splat', 'children': ['58']}; {'id': '58', 'type': 'dictionary', 'children': ['59', '68', '73', '76']}; {'id': '59', 'type': 'pair', 'children': ['60', '61']}; {'id': '60', 'type': 'string', 'children': [], 'value': '"fee"'}; {'id': '61', 'type': 'dictionary', 'children': ['62', '65']}; {'id': '62', 'type': 'pair', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': '"amount"'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '65', 'type': 'pair', 'children': ['66', '67']}; {'id': '66', 'type': 'string', 'children': [], 'value': '"asset_id"'}; {'id': '67', 'type': 'string', 'children': [], 'value': '"1.3.0"'}; {'id': '68', 'type': 'pair', 'children': ['69', '70']}; {'id': '69', 'type': 'string', 'children': [], 'value': '"account_to_upgrade"'}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'account'}; {'id': '72', 'type': 'string', 'children': [], 'value': '"id"'}; {'id': '73', 'type': 'pair', 'children': ['74', '75']}; {'id': '74', 'type': 'string', 'children': [], 'value': '"upgrade_to_lifetime_member"'}; {'id': '75', 'type': 'True', 'children': []}; {'id': '76', 'type': 'pair', 'children': ['77', '78']}; {'id': '77', 'type': 'string', 'children': [], 'value': '"prefix"'}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '81', 'type': 'return_statement', 'children': ['82']}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'finalizeOp'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '88', '91', '92']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '88', 'type': 'subscript', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'account'}; {'id': '90', 'type': 'string', 'children': [], 'value': '"name"'}; {'id': '91', 'type': 'string', 'children': [], 'value': '"active"'}; {'id': '92', 'type': 'dictionary_splat', 'children': ['93']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
|
Upgrade an account to Lifetime membership
:param str account: (optional) the account to allow access
to (defaults to ``default_account``)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add'}; {'id': '3', 'type': 'parameters', 'children': ['4', '8']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'workflow_definition'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '8', 'type': 'typed_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'templates_root'}; {'id': '10', 'type': 'type', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '12', 'type': 'block', 'children': ['13', '25', '50', '58', '64', '70', '76', '82', '88', '98', '116']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'schema_path'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '23', '24']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '__file__'}; {'id': '23', 'type': 'string', 'children': [], 'value': "'schema'"}; {'id': '24', 'type': 'string', 'children': [], 'value': "'workflow_definition.json'"}; {'id': '25', 'type': 'with_statement', 'children': ['26', '36']}; {'id': '26', 'type': 'with_clause', 'children': ['27']}; {'id': '27', 'type': 'with_item', 'children': ['28']}; {'id': '28', 'type': 'as_pattern', 'children': ['29', '34']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'schema_path'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '34', 'type': 'as_pattern_target', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'loads'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '49', 'type': 'argument_list', 'children': []}; {'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': 'jsonschema'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'validate'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'workflow_definition'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': '_id'}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'workflow_definition'}; {'id': '63', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_version'}; {'id': '67', 'type': 'subscript', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'workflow_definition'}; {'id': '69', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': '_load_templates'}; {'id': '73', 'type': 'argument_list', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'workflow_definition'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'templates_root'}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'workflow_id'}; {'id': '79', 'type': 'subscript', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'workflow_definition'}; {'id': '81', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '85', 'type': 'subscript', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'workflow_definition'}; {'id': '87', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'assignment', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'string', 'children': [], 'value': '"workflow_definitions:{}:{}"'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '95', 'type': 'argument_list', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'workflow_id'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '98', 'type': 'if_statement', 'children': ['99', '105']}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'DB'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'get_keys'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '105', 'type': 'block', 'children': ['106']}; {'id': '106', 'type': 'raise_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '109', 'type': 'argument_list', 'children': ['110']}; {'id': '110', 'type': 'call', 'children': ['111', '114']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'string', 'children': [], 'value': "'Workflow definition already exists: {}'"}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '114', 'type': 'argument_list', 'children': ['115']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'name'}; {'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': 'DB'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'save_dict'}; {'id': '121', 'type': 'argument_list', 'children': ['122', '123', '124']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'workflow_definition'}; {'id': '124', 'type': 'keyword_argument', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'hierarchical'}; {'id': '126', 'type': 'False', 'children': []}
|
Add a workflow definition to the Configuration Database.
Templates are expected to be found in a directory tree with the following
structure:
- workflow_id:
|- workflow_version
|- stage_id
|- stage_version
|- <templates>
Args:
workflow_definition (dict): Workflow definition.
templates_root (str): Workflow templates root path
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'to_hg_scheme_url'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'url'}; {'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': 'regexes'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_get_url_scheme_regexes'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'for_statement', 'children': ['16', '20', '21']}; {'id': '16', 'type': 'pattern_list', 'children': ['17', '18', '19']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'scheme_key'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'regex'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'regexes'}; {'id': '21', 'type': 'block', 'children': ['22', '31']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'regex'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '35']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': 'is not'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '34', 'type': 'None', 'children': []}; {'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': 'groups'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'if_statement', 'children': ['45', '51', '72']}; {'id': '45', 'type': 'comparison_operator', 'children': ['46', '50'], 'value': '=='}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'return_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'string', 'children': [], 'value': "u''"}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59', '60', '69']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'scheme_key'}; {'id': '59', 'type': 'string', 'children': [], 'value': "'://'"}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '66']}; {'id': '65', 'type': 'string', 'children': [], 'value': "'{1}'"}; {'id': '66', 'type': 'subscript', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '69', 'type': 'subscript', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '72', 'type': 'elif_clause', 'children': ['73', '79']}; {'id': '73', 'type': 'comparison_operator', 'children': ['74', '78'], 'value': '=='}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '78', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'return_statement', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'string', 'children': [], 'value': "u''"}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '85', 'type': 'argument_list', 'children': ['86', '87', '88', '89']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'scheme_key'}; {'id': '87', 'type': 'string', 'children': [], 'value': "'://'"}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '89', 'type': 'subscript', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '91', 'type': 'integer', 'children': [], 'value': '0'}
|
Convert a URL to local mercurial URL schemes
Args:
url (str): URL to map to local mercurial URL schemes
example::
# schemes.gh = git://github.com/
>> remote_url = git://github.com/westurner/dotfiles'
>> to_hg_scheme_url(remote_url)
<< gh://westurner/dotfiles
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_repo_parent'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '11', '17']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'is_repo'}; {'id': '9', 'type': 'argument_list', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'Local'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '17', 'type': 'elif_clause', 'children': ['18', '27']}; {'id': '18', 'type': 'not_operator', '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': 'isdir'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '27', 'type': 'block', 'children': ['28', '32', '82']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_rel'}; {'id': '31', 'type': 'string', 'children': [], 'value': "''"}; {'id': '32', 'type': 'while_statement', 'children': ['33', '38']}; {'id': '33', 'type': 'boolean_operator', 'children': ['34', '35'], 'value': 'and'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': '!='}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '37', 'type': 'string', 'children': [], 'value': "'/'"}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'if_statement', 'children': ['40', '44', '50']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'is_repo'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'Local'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '50', 'type': 'else_clause', 'children': ['51']}; {'id': '51', 'type': 'block', 'children': ['52', '71']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '_rel'}; {'id': '55', 'type': 'call', 'children': ['56', '61']}; {'id': '56', 'type': 'attribute', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '70']}; {'id': '62', 'type': 'call', 'children': ['63', '68']}; {'id': '63', 'type': 'attribute', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': '_rel'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'path'}; {'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': 'os'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'path'}
|
Returns parent repo or input path if none found.
:return: grit.Local or path
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortByIndex'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '6', 'type': 'block', 'children': ['7', '20', '34', '48']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '18']}; {'id': '9', 'type': 'attribute', 'children': ['10', '17']}; {'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': 'table_level'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'horizontalHeader'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'setSortIndicatorShown'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'True', 'children': []}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '23', 'type': 'call', 'children': ['24', '33']}; {'id': '24', 'type': 'attribute', 'children': ['25', '32']}; {'id': '25', 'type': 'call', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'table_level'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'horizontalHeader'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sortIndicatorOrder'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '45']}; {'id': '36', 'type': 'attribute', 'children': ['37', '44']}; {'id': '37', 'type': 'call', 'children': ['38', '43']}; {'id': '38', 'type': 'attribute', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'table_index'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '45', 'type': 'argument_list', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': '_sort_update'}; {'id': '53', 'type': 'argument_list', 'children': []}
|
Implement a Index sort.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '__log_number_of_constants'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '26', '35', '49']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'n_id'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_labels'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'n_widths'}; {'id': '18', 'type': 'binary_operator', 'children': ['19', '25'], 'value': '-'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'len'}; {'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': '_constants'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'n_id'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_io'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'writeln'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'string', 'children': [], 'value': "''"}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_io'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'text'}; {'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': "'Number of constants based on column widths: {0}'"}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'n_widths'}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '56']}; {'id': '51', 'type': 'attribute', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '_io'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'text'}; {'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': "'Number of constants based on database IDs : {0}'"}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'n_id'}
|
Logs the number of constants generated.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_geotiff_area_def'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'crs'}; {'id': '6', 'type': 'block', 'children': ['7', '12', '18', '24', '33', '41', '56', '62', '68', '74', '80', '90', '100', '108', '124']}; {'id': '7', 'type': 'import_from_statement', 'children': ['8', '10']}; {'id': '8', 'type': 'dotted_name', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'osgeo'}; {'id': '10', 'type': 'dotted_name', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'gdal'}; {'id': '12', 'type': 'import_from_statement', 'children': ['13', '16']}; {'id': '13', 'type': 'dotted_name', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'pyresample'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'geometry'}; {'id': '16', 'type': 'dotted_name', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'AreaDefinition'}; {'id': '18', 'type': 'import_from_statement', 'children': ['19', '22']}; {'id': '19', 'type': 'dotted_name', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'pyresample'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '22', 'type': 'dotted_name', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'proj4_str_to_dict'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'fid'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'gdal'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'Open'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'geo_transform'}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'fid'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'GetGeoTransform'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'pcs_id'}; {'id': '44', 'type': 'subscript', 'children': ['45', '55']}; {'id': '45', 'type': 'call', 'children': ['46', '53']}; {'id': '46', 'type': 'attribute', 'children': ['47', '52']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'fid'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'GetProjection'}; {'id': '51', 'type': 'argument_list', 'children': []}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'string', 'children': [], 'value': '\'"\''}; {'id': '55', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'min_x'}; {'id': '59', 'type': 'subscript', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'geo_transform'}; {'id': '61', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'max_y'}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'geo_transform'}; {'id': '67', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'x_size'}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'fid'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'RasterXSize'}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'assignment', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'y_size'}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'fid'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'RasterYSize'}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'max_x'}; {'id': '83', 'type': 'binary_operator', 'children': ['84', '85'], 'value': '+'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'min_x'}; {'id': '85', 'type': 'binary_operator', 'children': ['86', '89'], 'value': '*'}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'geo_transform'}; {'id': '88', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'x_size'}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'assignment', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'min_y'}; {'id': '93', 'type': 'binary_operator', 'children': ['94', '95'], 'value': '+'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'max_y'}; {'id': '95', 'type': 'binary_operator', 'children': ['96', '99'], 'value': '*'}; {'id': '96', 'type': 'subscript', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'geo_transform'}; {'id': '98', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'y_size'}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'area_extent'}; {'id': '103', 'type': 'list', 'children': ['104', '105', '106', '107'], 'value': '[min_x, min_y, max_x, max_y]'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'min_x'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'min_y'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'max_x'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'max_y'}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'assignment', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'area_def'}; {'id': '111', 'type': 'call', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'AreaDefinition'}; {'id': '113', 'type': 'argument_list', 'children': ['114', '115', '116', '117', '121', '122', '123']}; {'id': '114', 'type': 'string', 'children': [], 'value': "'geotiff_area'"}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'pcs_id'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'pcs_id'}; {'id': '117', 'type': 'call', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'proj4_str_to_dict'}; {'id': '119', 'type': 'argument_list', 'children': ['120']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'crs'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'x_size'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'y_size'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'area_extent'}; {'id': '124', 'type': 'return_statement', 'children': ['125']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'area_def'}
|
Read area definition from a geotiff.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'masked_middle_mfcc'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '16']}; {'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': 'begin'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_masked_middle_begin_end'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'subscript', 'children': ['18', '22', '24']}; {'id': '18', 'type': '()', 'children': ['19']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'masked_mfcc'}; {'id': '22', 'type': 'slice', 'children': ['23']}; {'id': '23', 'type': 'colon', 'children': []}; {'id': '24', 'type': 'slice', 'children': ['25', '26', '27']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'begin'}; {'id': '26', 'type': 'colon', 'children': []}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'end'}
|
Return the MFCC speech frames
in the MIDDLE portion of the wave.
:rtype: :class:`numpy.ndarray` (2D)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_speaker_settings'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'type', 'children': ['6']}; {'id': '6', 'type': 'generic_type', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '8', 'type': 'type_parameter', 'children': ['9']}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'Setting'}; {'id': '11', 'type': 'block', 'children': ['12', '26']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'speaker_settings'}; {'id': '15', 'type': 'await', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '24']}; {'id': '17', 'type': 'subscript', 'children': ['18', '23']}; {'id': '18', 'type': 'subscript', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'services'}; {'id': '22', 'type': 'string', 'children': [], 'value': '"audio"'}; {'id': '23', 'type': 'string', 'children': [], 'value': '"getSpeakerSettings"'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'dictionary', 'children': []}; {'id': '26', 'type': 'return_statement', 'children': ['27']}; {'id': '27', 'type': 'list_comprehension', 'children': ['28', '35']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'Setting'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'make'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'dictionary_splat', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '35', 'type': 'for_in_clause', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'speaker_settings'}
|
Return speaker settings.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'exists'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '14']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '9', 'type': 'attribute', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_instance'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_client'}; {'id': '14', 'type': 'try_statement', 'children': ['15', '31']}; {'id': '15', 'type': 'block', 'children': ['16', '29']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '23']}; {'id': '18', 'type': 'attribute', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'instance_admin_client'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'get_cluster'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'True', 'children': []}; {'id': '31', 'type': 'except_clause', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'NotFound'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'False', 'children': []}
|
Check whether the cluster already exists.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_check_cluster_exists]
:end-before: [END bigtable_check_cluster_exists]
:rtype: bool
:returns: True if the table exists, else False.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_owner_asset_ids'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'address'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '29', '33', '51']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'block_filter'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_get_event_filter'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'keyword_argument', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'owner'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'address'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'log_items'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'block_filter'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'get_all_entries'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'keyword_argument', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'max_tries'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'did_list'}; {'id': '32', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '33', 'type': 'for_statement', 'children': ['34', '35', '36']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'log_i'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'log_items'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'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': 'did_list'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'id_to_did'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'subscript', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'log_i'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '50', 'type': 'string', 'children': [], 'value': "'_did'"}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'did_list'}
|
Get the list of assets owned by an address owner.
:param address: ethereum account address, hex str
:return:
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'people'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '32', '65']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'subscript', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'cache'}; {'id': '11', 'type': 'string', 'children': [], 'value': "'people'"}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'subscript', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'cache'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'people'"}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'people_xml'}; {'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': 'bc'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'people_within_project'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '32', 'type': 'for_statement', 'children': ['33', '34', '45']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'person_node'}; {'id': '34', 'type': 'call', 'children': ['35', '43']}; {'id': '35', 'type': 'attribute', 'children': ['36', '42']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ET'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'fromstring'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'people_xml'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'findall'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'string', 'children': [], 'value': "'person'"}; {'id': '45', 'type': 'block', 'children': ['46', '53']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'Person'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'person_node'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '64']}; {'id': '55', 'type': 'subscript', 'children': ['56', '61']}; {'id': '56', 'type': 'subscript', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'cache'}; {'id': '60', 'type': 'string', 'children': [], 'value': "'people'"}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'subscript', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'cache'}; {'id': '70', 'type': 'string', 'children': [], 'value': "'people'"}
|
Dictionary of people on the project, keyed by id
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_methods'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'list_splat_pattern', 'children': ['5']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'objs'}; {'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': 'set'}; {'id': '10', 'type': 'generator_expression', 'children': ['11', '12', '15', '21']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '12', 'type': 'for_in_clause', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'objs'}; {'id': '15', 'type': 'for_in_clause', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'dir'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '21', 'type': 'if_clause', 'children': ['22']}; {'id': '22', 'type': 'boolean_operator', 'children': ['23', '30'], 'value': 'and'}; {'id': '23', 'type': 'not_operator', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'string', 'children': [], 'value': "'_'"}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'callable'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'attr'}
|
Return the names of all callable attributes of an object
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reference'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '6', 'type': 'block', 'children': ['7', '14', '21', '40', '67']}; {'id': '7', 'type': 'import_from_statement', 'children': ['8', '12']}; {'id': '8', 'type': 'dotted_name', 'children': ['9', '10', '11']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'sqlpuzzle'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_common'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '12', 'type': 'dotted_name', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'force_text'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'force_text'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '39']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'string', 'children': [], 'value': "r'{quote}([^{quote}]+){quote}|\\.'"}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'keyword_argument', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'quote'}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'reference_quote'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '43', 'type': 'generator_expression', 'children': ['44', '62', '65']}; {'id': '44', 'type': 'conditional_expression', 'children': ['45', '58', '61'], 'value': 'if'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': "'{quote}{i}{quote}'"}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '55']}; {'id': '50', 'type': 'keyword_argument', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'quote'}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'reference_quote'}; {'id': '55', 'type': 'keyword_argument', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '58', 'type': 'comparison_operator', 'children': ['59', '60'], 'value': '!='}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '60', 'type': 'string', 'children': [], 'value': "'*'"}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '62', 'type': 'for_in_clause', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '65', 'type': 'if_clause', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '67', 'type': 'return_statement', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'string', 'children': [], 'value': "'.'"}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'parts'}
|
Convert as reference on column.
table => "table"
table.column => "table"."column"
db.table.column => "db"."table"."column"
table."col.umn" => "table"."col.umn"
"table"."col.umn" => "table"."col.umn"
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'connection_factory_absent'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'both'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'server'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '28', '37', '50', '123']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '15', 'type': 'dictionary', 'children': ['16', '19', '22', '25']}; {'id': '16', 'type': 'pair', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '19', 'type': 'pair', 'children': ['20', '21']}; {'id': '20', 'type': 'string', 'children': [], 'value': "'result'"}; {'id': '21', 'type': 'None', 'children': []}; {'id': '22', 'type': 'pair', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': "'comment'"}; {'id': '24', 'type': 'None', 'children': []}; {'id': '25', 'type': 'pair', 'children': ['26', '27']}; {'id': '26', 'type': 'string', 'children': [], 'value': "'changes'"}; {'id': '27', 'type': 'dictionary', 'children': []}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'pool_name'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'string', 'children': [], 'value': "'{0}-Connection-Pool'"}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'pool_ret'}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_do_element_absent'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '44', '45', '49']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'pool_name'}; {'id': '44', 'type': 'string', 'children': [], 'value': "'connector_c_pool'"}; {'id': '45', 'type': 'dictionary', 'children': ['46']}; {'id': '46', 'type': 'pair', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': "'cascade'"}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'both'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'server'}; {'id': '50', 'type': 'if_statement', 'children': ['51', '55', '102']}; {'id': '51', 'type': 'not_operator', 'children': ['52']}; {'id': '52', 'type': 'subscript', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'pool_ret'}; {'id': '54', 'type': 'string', 'children': [], 'value': "'error'"}; {'id': '55', 'type': 'block', 'children': ['56']}; {'id': '56', 'type': 'if_statement', 'children': ['57', '64', '71', '88']}; {'id': '57', 'type': 'boolean_operator', 'children': ['58', '61'], 'value': 'and'}; {'id': '58', 'type': 'subscript', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '__opts__'}; {'id': '60', 'type': 'string', 'children': [], 'value': "'test'"}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'pool_ret'}; {'id': '63', 'type': 'string', 'children': [], 'value': "'delete'"}; {'id': '64', 'type': 'block', 'children': ['65']}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '70']}; {'id': '67', 'type': 'subscript', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '69', 'type': 'string', 'children': [], 'value': "'comment'"}; {'id': '70', 'type': 'string', 'children': [], 'value': "'Connection Factory set to be deleted'"}; {'id': '71', 'type': 'elif_clause', 'children': ['72', '75']}; {'id': '72', 'type': 'subscript', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'pool_ret'}; {'id': '74', 'type': 'string', 'children': [], 'value': "'delete'"}; {'id': '75', 'type': 'block', 'children': ['76', '82']}; {'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': 'ret'}; {'id': '80', 'type': 'string', 'children': [], 'value': "'result'"}; {'id': '81', 'type': 'True', 'children': []}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '87']}; {'id': '84', 'type': 'subscript', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '86', 'type': 'string', 'children': [], 'value': "'comment'"}; {'id': '87', 'type': 'string', 'children': [], 'value': "'Connection Factory deleted'"}; {'id': '88', 'type': 'else_clause', 'children': ['89']}; {'id': '89', 'type': 'block', 'children': ['90', '96']}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'assignment', 'children': ['92', '95']}; {'id': '92', 'type': 'subscript', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '94', 'type': 'string', 'children': [], 'value': "'result'"}; {'id': '95', 'type': 'True', 'children': []}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'assignment', 'children': ['98', '101']}; {'id': '98', 'type': 'subscript', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '100', 'type': 'string', 'children': [], 'value': "'comment'"}; {'id': '101', 'type': 'string', 'children': [], 'value': "'Connection Factory doesn\\'t exist'"}; {'id': '102', 'type': 'else_clause', 'children': ['103']}; {'id': '103', 'type': 'block', 'children': ['104', '110']}; {'id': '104', 'type': 'expression_statement', 'children': ['105']}; {'id': '105', 'type': 'assignment', 'children': ['106', '109']}; {'id': '106', 'type': 'subscript', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '108', 'type': 'string', 'children': [], 'value': "'result'"}; {'id': '109', 'type': 'False', 'children': []}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'assignment', 'children': ['112', '115']}; {'id': '112', 'type': 'subscript', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '114', 'type': 'string', 'children': [], 'value': "'comment'"}; {'id': '115', 'type': 'call', 'children': ['116', '119']}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'string', 'children': [], 'value': "'Error: {0}'"}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '119', 'type': 'argument_list', 'children': ['120']}; {'id': '120', 'type': 'subscript', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'pool_ret'}; {'id': '122', 'type': 'string', 'children': [], 'value': "'error'"}; {'id': '123', 'type': 'return_statement', 'children': ['124']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'ret'}
|
Ensures the transaction factory is absent.
name
Name of the connection factory
both
Delete both the pool and the resource, defaults to ``true``
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_mailbox_stats'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '19', '38']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'resp'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'request_single'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'string', 'children': [], 'value': "'GetMailboxStats'"}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '18', 'type': 'dictionary', 'children': []}; {'id': '19', 'type': 'for_statement', 'children': ['20', '23', '28']}; {'id': '20', 'type': 'pattern_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'resp'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '27', 'type': 'argument_list', 'children': []}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '34']}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'ret'}
|
Get global stats about mailboxes
Parses <stats numMboxes="6" totalSize="141077"/>
:returns: dict with stats
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.