sequence
stringlengths
1.16k
23.8k
docstring
stringlengths
5
7.69k
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'addValuesToField'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'numValues'}; {'id': '7', 'type': 'block', 'children': ['8', '18', '34']}; {'id': '8', 'type': 'assert_statement', 'children': ['9']}; {'id': '9', 'type': '()', 'children': ['10']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '17'], 'value': '>'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '21', 'type': 'list_comprehension', 'children': ['22', '28']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'addValueToField'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '28', 'type': 'for_in_clause', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'numValues'}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'values'}
Add values to the field i.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'clean_email_or_username'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '22', '28', '35', '47', '87']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'email_or_username'}; {'id': '9', 'type': 'call', 'children': ['10', '21']}; {'id': '10', 'type': 'attribute', 'children': ['11', '20']}; {'id': '11', 'type': 'subscript', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'cleaned_data'}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'Fields'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'EMAIL_OR_USERNAME'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'if_statement', 'children': ['23', '25']}; {'id': '23', 'type': 'not_operator', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'email_or_username'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'return_statement', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'email_or_username'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'email_or_username__to__email'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'email_or_username'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'bulk_entry'}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '46'], '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': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'split_usernames_and_emails'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'if_statement', 'children': ['48', '49', '73']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'bulk_entry'}; {'id': '49', 'type': 'block', 'children': ['50', '69']}; {'id': '50', 'type': 'for_statement', 'children': ['51', '52', '56']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'split_usernames_and_emails'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'validate_email_to_link'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62', '63', '66']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '62', 'type': 'None', 'children': []}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'ValidationMessages'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'INVALID_EMAIL_OR_USERNAME'}; {'id': '66', 'type': 'keyword_argument', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'ignore_existing'}; {'id': '68', 'type': 'True', 'children': []}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'email_or_username'}; {'id': '73', 'type': 'else_clause', 'children': ['74']}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'validate_email_to_link'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80', '81', '84']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'email_or_username'}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'ValidationMessages'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'INVALID_EMAIL_OR_USERNAME'}; {'id': '84', 'type': 'keyword_argument', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'ignore_existing'}; {'id': '86', 'type': 'True', 'children': []}; {'id': '87', 'type': 'return_statement', 'children': ['88']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'email'}
Clean email form field Returns: str: the cleaned value, converted to an email address (or an empty string)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'print_error'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'wrap'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '26', '44']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'wrap'}; {'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': 'message'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'ERROR: {0}. Exit...'"}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'rstrip'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'string', 'children': [], 'value': "'.'"}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'colorizer'}; {'id': '29', 'type': '()', 'children': ['30']}; {'id': '30', 'type': 'conditional_expression', 'children': ['31', '39', '40'], 'value': 'if'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_color_wrap'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'colorama'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'Fore'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'RED'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'colorama'}; {'id': '40', 'type': 'lambda', 'children': ['41', '43']}; {'id': '41', 'type': 'lambda_parameters', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '52']}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'colorizer'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '52', 'type': 'keyword_argument', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'stderr'}
Print error message to stderr, using ANSI-colors. :param message: Message to print :param wrap: Wrap message into ``ERROR: <message>. Exit...`` template. By default: True
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'fetch_events_for_issues_and_pr'}; {'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': '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': 'fetcher'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'fetch_events_async'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'issues'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"issues"'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '25']}; {'id': '20', 'type': 'attribute', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'fetcher'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'fetch_events_async'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'pull_requests'}; {'id': '29', 'type': 'string', 'children': [], 'value': '"pull requests"'}
Fetch event for issues and pull requests @return [Array] array of fetched issues
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_parse_doc_ref'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '23', '70', '78']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'LatexCommand'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'string', 'children': [], 'value': "'setDocRef'"}; {'id': '13', 'type': 'dictionary', 'children': ['14', '17', '20']}; {'id': '14', 'type': 'pair', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '16', 'type': 'string', 'children': [], 'value': "'handle'"}; {'id': '17', 'type': 'pair', 'children': ['18', '19']}; {'id': '18', 'type': 'string', 'children': [], 'value': "'required'"}; {'id': '19', 'type': 'True', 'children': []}; {'id': '20', 'type': 'pair', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'bracket'"}; {'id': '22', 'type': 'string', 'children': [], 'value': "'{'"}; {'id': '23', 'type': 'try_statement', 'children': ['24', '39']}; {'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': 'parsed'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'next'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'parse'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '_tex'}; {'id': '39', 'type': 'except_clause', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'StopIteration'}; {'id': '41', 'type': 'block', 'children': ['42', '51', '57', '63', '69']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '49']}; {'id': '44', 'type': 'attribute', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': '_logger'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'string', 'children': [], 'value': "'lsstdoc has no setDocRef'"}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': '_handle'}; {'id': '56', 'type': 'None', 'children': []}; {'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': '_series'}; {'id': '62', 'type': 'None', 'children': []}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': '_serial'}; {'id': '68', 'type': 'None', 'children': []}; {'id': '69', 'type': 'return_statement', 'children': []}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': '_handle'}; {'id': '75', 'type': 'subscript', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'parsed'}; {'id': '77', 'type': 'string', 'children': [], 'value': "'handle'"}; {'id': '78', 'type': 'try_statement', 'children': ['79', '98']}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '89']}; {'id': '82', 'type': 'pattern_list', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': '_series'}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': '_serial'}; {'id': '89', 'type': 'call', 'children': ['90', '95']}; {'id': '90', 'type': 'attribute', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': '_handle'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '95', 'type': 'argument_list', 'children': ['96', '97']}; {'id': '96', 'type': 'string', 'children': [], 'value': "'-'"}; {'id': '97', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '98', 'type': 'except_clause', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '100', 'type': 'block', 'children': ['101', '115', '121']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '108']}; {'id': '103', 'type': 'attribute', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': '_logger'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '108', 'type': 'argument_list', 'children': ['109', '112']}; {'id': '109', 'type': 'concatenated_string', 'children': ['110', '111']}; {'id': '110', 'type': 'string', 'children': [], 'value': "'lsstdoc handle cannot be parsed into '"}; {'id': '111', 'type': 'string', 'children': [], 'value': "'series and serial: %r'"}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': '_handle'}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'assignment', 'children': ['117', '120']}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': '_series'}; {'id': '120', 'type': 'None', 'children': []}; {'id': '121', 'type': 'expression_statement', 'children': ['122']}; {'id': '122', 'type': 'assignment', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': '_serial'}; {'id': '126', 'type': 'None', 'children': []}
Parse the document handle. Sets the ``_series``, ``_serial``, and ``_handle`` attributes.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'lo_stops'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'lo_stops'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': '_set_params'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '14', '15', '16']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'ode_obj'}; {'id': '14', 'type': 'string', 'children': [], 'value': "'LoStop'"}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'lo_stops'}; {'id': '16', 'type': 'binary_operator', 'children': ['17', '20'], 'value': '+'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'ADOF'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'LDOF'}
Set the lo stop values for this object's degrees of freedom. Parameters ---------- lo_stops : float or sequence of float A lo stop value to set on all degrees of freedom, or a list containing one such value for each degree of freedom. For rotational degrees of freedom, these values must be in radians.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_all_keyring'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '9', '17', '29']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'call', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': '_load_plugins'}; {'id': '8', 'type': 'argument_list', 'children': []}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'viable_classes'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'KeyringBackend'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'get_viable_backends'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'rings'}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'util'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'suppress_exceptions'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'viable_classes'}; {'id': '26', 'type': 'keyword_argument', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'exceptions'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'rings'}
Return a list of all implemented keyrings that can be constructed without parameters.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'label'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7', '10']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '6', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '9', 'type': 'string', 'children': [], 'value': "'any'"}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sortLabel'}; {'id': '12', 'type': 'False', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14', '20', '28', '39', '43', '55', '68', '81']}; {'id': '14', 'type': 'if_statement', 'children': ['15', '17']}; {'id': '15', 'type': 'not_operator', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'if_statement', 'children': ['21', '23']}; {'id': '21', 'type': 'not_operator', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'und'"}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '31', 'type': 'list_comprehension', 'children': ['32', '36']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'dict_to_label'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '36', 'type': 'for_in_clause', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '42', 'type': 'False', 'children': []}; {'id': '43', 'type': 'if_statement', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sortLabel'}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'find_best_label_for_type'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '53', '54']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '54', 'type': 'string', 'children': [], 'value': "'sortLabel'"}; {'id': '55', 'type': 'if_statement', 'children': ['56', '58']}; {'id': '56', 'type': 'not_operator', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'l'}; {'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': 'l'}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'find_best_label_for_type'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '66', '67']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '67', 'type': 'string', 'children': [], 'value': "'prefLabel'"}; {'id': '68', 'type': 'if_statement', 'children': ['69', '71']}; {'id': '69', 'type': 'not_operator', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'find_best_label_for_type'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '79', '80']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '80', 'type': 'string', 'children': [], 'value': "'altLabel'"}; {'id': '81', 'type': 'if_statement', 'children': ['82', '83', '86']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '86', 'type': 'else_clause', 'children': ['87']}; {'id': '87', 'type': 'block', 'children': ['88']}; {'id': '88', 'type': 'return_statement', 'children': ['89']}; {'id': '89', 'type': 'conditional_expression', 'children': ['90', '96', '99'], 'value': 'if'}; {'id': '90', 'type': 'call', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '92', 'type': 'argument_list', 'children': ['93', '94', '95']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '94', 'type': 'string', 'children': [], 'value': "'any'"}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'sortLabel'}; {'id': '96', 'type': 'comparison_operator', 'children': ['97', '98'], 'value': '!='}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '98', 'type': 'string', 'children': [], 'value': "'any'"}; {'id': '99', 'type': 'None', 'children': []}
Provide a label for a list of labels. The items in the list of labels are assumed to be either instances of :class:`Label`, or dicts with at least the key `label` in them. These will be passed to the :func:`dict_to_label` function. This method tries to find a label by looking if there's a pref label for the specified language. If there's no pref label, it looks for an alt label. It disregards hidden labels. While matching languages, preference will be given to exact matches. But, if no exact match is present, an inexact match will be attempted. This might be because a label in language `nl-BE` is being requested, but only `nl` or even `nl-NL` is present. Similarly, when requesting `nl`, a label with language `nl-NL` or even `nl-Latn-NL` will also be considered, providing no label is present that has an exact match with the requested language. If language 'any' was specified, all labels will be considered, regardless of language. To find a label without a specified language, pass `None` as language. If a language or None was specified, and no label could be found, this method will automatically try to find a label in some other language. Finally, if no label could be found, None is returned. :param string language: The preferred language to receive the label in. This should be a valid IANA language tag. :param boolean sortLabel: Should sortLabels be considered or not? If True, sortLabels will be preferred over prefLabels. Bear in mind that these are still language dependent. So, it's possible to have a different sortLabel per language. :rtype: A :class:`Label` or `None` if no label could be found.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'clone'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'git_uri'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '21', '28', '47']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'hash_digest'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sha256_hash'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'git_uri'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'local_path'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'home_directory_path'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'FOLDER'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'hash_digest'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'exists_locally'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'path_exists'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'local_path'}; {'id': '28', 'type': 'if_statement', 'children': ['29', '31', '38']}; {'id': '29', 'type': 'not_operator', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'exists_locally'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '_clone_repo'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'git_uri'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'local_path'}; {'id': '38', 'type': 'else_clause', 'children': ['39']}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'string', 'children': [], 'value': '"Git repository already exists locally."'}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'local_path'}
Clone a remote git repository to a local path. :param git_uri: the URI to the git repository to be cloned :return: the generated local path where the repository has been cloned to
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_filterRecord'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'filterList'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '6', 'type': 'block', 'children': ['7', '61']}; {'id': '7', 'type': 'for_statement', 'children': ['8', '12', '13']}; {'id': '8', 'type': 'tuple_pattern', 'children': ['9', '10', '11']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'fieldIdx'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'filterList'}; {'id': '13', 'type': 'block', 'children': ['14', '20', '28', '36', '44', '52']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '25']}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '24', 'type': 'string', 'children': [], 'value': "'value'"}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'fieldIdx'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '33']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'acceptValues'"}; {'id': '33', 'type': 'subscript', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '35', 'type': 'string', 'children': [], 'value': "'acceptValues'"}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '41']}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '40', 'type': 'string', 'children': [], 'value': "'min'"}; {'id': '41', 'type': 'subscript', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'min'"}; {'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': 'x'}; {'id': '48', 'type': 'string', 'children': [], 'value': "'max'"}; {'id': '49', 'type': 'subscript', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '51', 'type': 'string', 'children': [], 'value': "'max'"}; {'id': '52', 'type': 'if_statement', 'children': ['53', '58']}; {'id': '53', 'type': 'not_operator', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'return_statement', 'children': ['60']}; {'id': '60', 'type': 'False', 'children': []}; {'id': '61', 'type': 'return_statement', 'children': ['62']}; {'id': '62', 'type': 'True', 'children': []}
Takes a record and returns true if record meets filter criteria, false otherwise
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'recursive_find_search'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'folder_path'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'regex'}; {'id': '7', 'type': 'string', 'children': [], 'value': "''"}; {'id': '8', 'type': 'block', 'children': ['9', '13', '50']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'outlist'}; {'id': '12', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '13', 'type': 'for_statement', 'children': ['14', '18', '24']}; {'id': '14', 'type': 'pattern_list', 'children': ['15', '16', '17']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'walk'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'folder_path'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'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': 'outlist'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'list_comprehension', 'children': ['32', '39', '42']}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '39', 'type': 'for_in_clause', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '42', 'type': 'if_clause', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'search'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'regex'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'outlist'}
Returns absolute paths of files that match the regex within file_dir and all its children folders. Note: The regex matching is done using the search function of the re module. Parameters ---------- folder_path: string regex: string Returns ------- A list of strings.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_keys_to_camel_case'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'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': 'dict'}; {'id': '10', 'type': 'generator_expression', 'children': ['11', '17']}; {'id': '11', 'type': 'tuple', 'children': ['12', '16']}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'to_camel_case'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '17', 'type': 'for_in_clause', 'children': ['18', '21']}; {'id': '18', 'type': 'tuple_pattern', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '25', 'type': 'argument_list', 'children': []}
Make a copy of a dictionary with all keys converted to camel case. This is just calls to_camel_case on each of the keys in the dictionary and returns a new dictionary. :param obj: Dictionary to convert keys to camel case. :return: Dictionary with the input values and all keys in camel case
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'parse_datetime_to_epoch'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'datestamp'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'magnitude'}; {'id': '7', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '8', 'type': 'block', 'children': ['9', '16', '22']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'parsed_datetime'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'parse_lms_api_datetime'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'datestamp'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'time_since_epoch'}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '21'], 'value': '-'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'parsed_datetime'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'UNIX_EPOCH'}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'binary_operator', 'children': ['27', '32'], 'value': '*'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'time_since_epoch'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'total_seconds'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'magnitude'}
Convert an ISO-8601 datetime string to a Unix epoch timestamp in some magnitude. By default, returns seconds.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'serialize'}; {'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': 'data'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '41']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '19']}; {'id': '10', 'type': 'boolean_operator', 'children': ['11', '14'], 'value': 'and'}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '13'], 'value': 'is not'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'comparison_operator', 'children': ['15', '18'], 'value': 'is not'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'block', 'children': ['20', '32']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '27']}; {'id': '22', 'type': 'subscript', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '26', 'type': 'string', 'children': [], 'value': "'Content-Type'"}; {'id': '27', 'type': 'subscript', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'media_types'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '41', 'type': 'return_statement', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'data'}
Transforms the object into an acceptable format for transmission. @throws ValueError To indicate this serializer does not support the encoding of the specified object.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'angles'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'list_comprehension', 'children': ['8', '16']}; {'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': 'ode_obj'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'getAngle'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '16', 'type': 'for_in_clause', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'ADOF'}
List of angles for rotational degrees of freedom.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'element_to_unicode'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'element'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12', '20', '39']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '9', 'type': 'argument_list', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ElementTree'}; {'id': '11', 'type': 'string', 'children': [], 'value': "'tounicode'"}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ElementTree'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'tounicode'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'string', 'children': [], 'value': '"element"'}; {'id': '20', 'type': 'elif_clause', 'children': ['21', '28']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '27'], 'value': '<'}; {'id': '22', 'type': 'attribute', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'version_info'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'major'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'unicode'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ElementTree'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'tostring'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'element'}; {'id': '39', 'type': 'else_clause', 'children': ['40']}; {'id': '40', 'type': 'block', 'children': ['41']}; {'id': '41', 'type': 'return_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'ElementTree'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'tostring'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'element'}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'encoding'}; {'id': '50', 'type': 'string', 'children': [], 'value': '"unicode"'}
Serialize an XML element into a unicode string. This should work the same on Python2 and Python3 and with all :etree:`ElementTree` implementations. :Parameters: - `element`: the XML element to serialize :Types: - `element`: :etree:`ElementTree.Element`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'inferSingleStep'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'patternNZ'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'weightMatrix'}; {'id': '7', 'type': 'block', 'children': ['8', '21', '32', '41', '52']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'outputActivation'}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'subscript', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'weightMatrix'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'patternNZ'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'keyword_argument', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '20', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'outputActivation'}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '26'], 'value': '-'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'outputActivation'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'outputActivation'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'expOutputActivation'}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'exp'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'outputActivation'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'predictDist'}; {'id': '44', 'type': 'binary_operator', 'children': ['45', '46'], 'value': '/'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'expOutputActivation'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'expOutputActivation'}; {'id': '52', 'type': 'return_statement', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'predictDist'}
Perform inference for a single step. Given an SDR input and a weight matrix, return a predicted distribution. :param patternNZ: list of the active indices from the output below :param weightMatrix: numpy array of the weight matrix :return: numpy array of the predicted class label distribution
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'showPredictions'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5']}; {'id': '5', 'type': 'for_statement', 'children': ['6', '7', '11']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '9', 'type': 'argument_list', 'children': ['10']}; {'id': '10', 'type': 'integer', 'children': [], 'value': '6'}; {'id': '11', 'type': 'block', 'children': ['12', '18', '26', '54', '71', '88', '108', '128', '145', '162']}; {'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': 'tm'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'reset'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'print_statement', 'children': ['19']}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '25'], 'value': '+'}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '22'], 'value': '+'}; {'id': '21', 'type': 'string', 'children': [], 'value': '"--- "'}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': '"ABCDXY"'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '25', 'type': 'string', 'children': [], 'value': '" ---"'}; {'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': 'tm'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'compute'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '51']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '50']}; {'id': '36', 'type': 'attribute', 'children': ['37', '49']}; {'id': '37', 'type': 'subscript', 'children': ['38', '48']}; {'id': '38', 'type': 'call', 'children': ['39', '47']}; {'id': '39', 'type': 'attribute', 'children': ['40', '46']}; {'id': '40', 'type': 'subscript', 'children': ['41', '44']}; {'id': '41', 'type': 'subscript', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'seqT'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '44', 'type': 'slice', 'children': ['45']}; {'id': '45', 'type': 'colon', 'children': []}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'nonzero'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'tolist'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'keyword_argument', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'learn'}; {'id': '53', 'type': 'False', 'children': []}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'activeColumnsIndices'}; {'id': '57', 'type': 'list_comprehension', 'children': ['58', '64']}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'tm'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'columnForCell'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '64', 'type': 'for_in_clause', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'tm'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'getActiveCells'}; {'id': '70', 'type': 'argument_list', 'children': []}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'predictedColumnIndices'}; {'id': '74', 'type': 'list_comprehension', 'children': ['75', '81']}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'tm'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'columnForCell'}; {'id': '79', 'type': 'argument_list', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '81', 'type': 'for_in_clause', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'tm'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'getPredictiveCells'}; {'id': '87', 'type': 'argument_list', 'children': []}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'assignment', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'currentColumns'}; {'id': '91', 'type': 'list_comprehension', 'children': ['92', '98']}; {'id': '92', 'type': 'conditional_expression', 'children': ['93', '94', '97'], 'value': 'if'}; {'id': '93', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '94', 'type': 'comparison_operator', 'children': ['95', '96'], 'value': 'in'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'activeColumnsIndices'}; {'id': '97', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '98', 'type': 'for_in_clause', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '100', 'type': 'call', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '102', 'type': 'argument_list', 'children': ['103']}; {'id': '103', 'type': 'call', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'tm'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'numberOfColumns'}; {'id': '107', 'type': 'argument_list', 'children': []}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'assignment', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'predictedColumns'}; {'id': '111', 'type': 'list_comprehension', 'children': ['112', '118']}; {'id': '112', 'type': 'conditional_expression', 'children': ['113', '114', '117'], 'value': 'if'}; {'id': '113', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '114', 'type': 'comparison_operator', 'children': ['115', '116'], 'value': 'in'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'predictedColumnIndices'}; {'id': '117', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '118', 'type': 'for_in_clause', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '120', 'type': 'call', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'call', 'children': ['124', '127']}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'tm'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'numberOfColumns'}; {'id': '127', 'type': 'argument_list', 'children': []}; {'id': '128', 'type': 'expression_statement', 'children': ['129']}; {'id': '129', 'type': 'call', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'binary_operator', 'children': ['133', '134'], 'value': '+'}; {'id': '133', 'type': 'string', 'children': [], 'value': '"Active cols: "'}; {'id': '134', 'type': 'call', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '136', 'type': 'argument_list', 'children': ['137']}; {'id': '137', 'type': 'subscript', 'children': ['138', '144']}; {'id': '138', 'type': 'call', 'children': ['139', '142']}; {'id': '139', 'type': 'attribute', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'nonzero'}; {'id': '142', 'type': 'argument_list', 'children': ['143']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'currentColumns'}; {'id': '144', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '145', 'type': 'expression_statement', 'children': ['146']}; {'id': '146', 'type': 'call', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '148', 'type': 'argument_list', 'children': ['149']}; {'id': '149', 'type': 'binary_operator', 'children': ['150', '151'], 'value': '+'}; {'id': '150', 'type': 'string', 'children': [], 'value': '"Predicted cols: "'}; {'id': '151', 'type': 'call', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '153', 'type': 'argument_list', 'children': ['154']}; {'id': '154', 'type': 'subscript', 'children': ['155', '161']}; {'id': '155', 'type': 'call', 'children': ['156', '159']}; {'id': '156', 'type': 'attribute', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'nonzero'}; {'id': '159', 'type': 'argument_list', 'children': ['160']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'predictedColumns'}; {'id': '161', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '162', 'type': 'print_statement', 'children': ['163']}; {'id': '163', 'type': 'string', 'children': [], 'value': '""'}
Shows predictions of the TM when presented with the characters A, B, C, D, X, and Y without any contextual information, that is, not embedded within a sequence.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_parse_iedb_response'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '39', '48', '57', '73', '82', '109', '126']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '13']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '12'], 'value': '=='}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '12', 'type': 'integer', 'children': [], 'value': '0'}; {'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': 'ValueError'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'string', 'children': [], 'value': '"Empty response from IEDB!"'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'read_csv'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '33', '36']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'io'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'BytesIO'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '33', 'type': 'keyword_argument', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'delim_whitespace'}; {'id': '35', 'type': 'True', 'children': []}; {'id': '36', 'type': 'keyword_argument', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'header'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '39', 'type': 'assert_statement', 'children': ['40']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '45'], 'value': '=='}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '57', 'type': 'if_statement', 'children': ['58', '64']}; {'id': '58', 'type': 'comparison_operator', 'children': ['59', '63'], 'value': '=='}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '63', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '64', 'type': 'block', 'children': ['65']}; {'id': '65', 'type': 'raise_statement', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'binary_operator', 'children': ['70', '71'], 'value': '%'}; {'id': '70', 'type': 'string', 'children': [], 'value': '"No binding predictions in response from IEDB: %s"'}; {'id': '71', 'type': 'tuple', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'assignment', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'required_columns'}; {'id': '76', 'type': 'list', 'children': ['77', '78', '79', '80', '81'], 'value': '[\n "allele",\n "peptide",\n "ic50",\n "start",\n "end",\n ]'}; {'id': '77', 'type': 'string', 'children': [], 'value': '"allele"'}; {'id': '78', 'type': 'string', 'children': [], 'value': '"peptide"'}; {'id': '79', 'type': 'string', 'children': [], 'value': '"ic50"'}; {'id': '80', 'type': 'string', 'children': [], 'value': '"start"'}; {'id': '81', 'type': 'string', 'children': [], 'value': '"end"'}; {'id': '82', 'type': 'for_statement', 'children': ['83', '84', '85']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'required_columns'}; {'id': '85', 'type': 'block', 'children': ['86']}; {'id': '86', 'type': 'if_statement', 'children': ['87', '92']}; {'id': '87', 'type': 'comparison_operator', 'children': ['88', '89'], 'value': 'not in'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'raise_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'binary_operator', 'children': ['98', '101'], 'value': '%'}; {'id': '98', 'type': 'concatenated_string', 'children': ['99', '100']}; {'id': '99', 'type': 'string', 'children': [], 'value': '"Response from IEDB is missing \'%s\' column: %s. Full "'}; {'id': '100', 'type': 'string', 'children': [], 'value': '"response:\\n%s"'}; {'id': '101', 'type': 'tuple', 'children': ['102', '103', '108']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '103', 'type': 'subscript', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'ix'}; {'id': '107', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'assignment', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'rename'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'keyword_argument', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '119', 'type': 'dictionary', 'children': ['120', '123']}; {'id': '120', 'type': 'pair', 'children': ['121', '122']}; {'id': '121', 'type': 'string', 'children': [], 'value': '"percentile_rank"'}; {'id': '122', 'type': 'string', 'children': [], 'value': '"rank"'}; {'id': '123', 'type': 'pair', 'children': ['124', '125']}; {'id': '124', 'type': 'string', 'children': [], 'value': '"percentile rank"'}; {'id': '125', 'type': 'string', 'children': [], 'value': '"rank"'}; {'id': '126', 'type': 'return_statement', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'df'}
Take the binding predictions returned by IEDB's web API and parse them into a DataFrame Expect response to look like: allele seq_num start end length peptide ic50 percentile_rank HLA-A*01:01 1 2 10 9 LYNTVATLY 2145.70 3.7 HLA-A*01:01 1 5 13 9 TVATLYCVH 2216.49 3.9 HLA-A*01:01 1 7 15 9 ATLYCVHQR 2635.42 5.1 HLA-A*01:01 1 4 12 9 NTVATLYCV 6829.04 20 HLA-A*01:01 1 1 9 9 SLYNTVATL 8032.38 24 HLA-A*01:01 1 8 16 9 TLYCVHQRI 8853.90 26 HLA-A*01:01 1 3 11 9 YNTVATLYC 9865.62 29 HLA-A*01:01 1 6 14 9 VATLYCVHQ 27575.71 58 HLA-A*01:01 1 10 18 9 YCVHQRIDV 48929.64 74 HLA-A*01:01 1 9 17 9 LYCVHQRID 50000.00 75
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_child_allowed'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'child_rule'}; {'id': '6', 'type': 'block', 'children': ['7', '19', '30', '42', '60', '88']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'num_kids'}; {'id': '10', 'type': 'call', 'children': ['11', '18']}; {'id': '11', 'type': 'attribute', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'num_kids_allowed'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'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': 'rule'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '30', 'type': 'if_statement', 'children': ['31', '37']}; {'id': '31', 'type': 'not_operator', 'children': ['32']}; {'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': 'rule'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'multiple_paths'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'num_kids_allowed'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '42', 'type': 'if_statement', 'children': ['43', '46']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': '>='}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'num_kids'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'num_kids_allowed'}; {'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': 'AttributeError'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '53'], 'value': '%'}; {'id': '52', 'type': 'string', 'children': [], 'value': "'Rule %s only allows %s children'"}; {'id': '53', 'type': 'tuple', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'rule_name'}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'num_kids_allowed'}; {'id': '60', 'type': 'for_statement', 'children': ['61', '62', '71']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '62', 'type': 'call', 'children': ['63', '70']}; {'id': '63', 'type': 'attribute', 'children': ['64', '69']}; {'id': '64', 'type': 'attribute', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '70', 'type': 'argument_list', 'children': []}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'if_statement', 'children': ['73', '82']}; {'id': '73', 'type': 'comparison_operator', 'children': ['74', '79'], 'value': '=='}; {'id': '74', 'type': 'attribute', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'rule_label'}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'child_rule'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'class_label'}; {'id': '82', 'type': 'block', 'children': ['83']}; {'id': '83', 'type': 'raise_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'string', 'children': [], 'value': "'Child rule already exists'"}; {'id': '88', 'type': 'if_statement', 'children': ['89', '96']}; {'id': '89', 'type': 'comparison_operator', 'children': ['90', '91'], 'value': 'not in'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'child_rule'}; {'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': 'rule'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '96', 'type': 'block', 'children': ['97']}; {'id': '97', 'type': 'raise_statement', 'children': ['98']}; {'id': '98', 'type': 'call', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '100', 'type': 'argument_list', 'children': ['101']}; {'id': '101', 'type': 'binary_operator', 'children': ['102', '103'], 'value': '%'}; {'id': '102', 'type': 'string', 'children': [], 'value': "'Rule %s is not a valid child of Rule %s'"}; {'id': '103', 'type': 'tuple', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'child_rule'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'rule_name'}
Called to verify that the given rule can become a child of the current node. :raises AttributeError: if the child is not allowed
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_normalize_issue_dir_with_dtd'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '33', '40', '44', '72', '100', '118', '128']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '16']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'resolved_issue.xml'"}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'return_statement', 'children': []}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'issue_xml_content'}; {'id': '21', 'type': 'call', 'children': ['22', '32']}; {'id': '22', 'type': 'attribute', 'children': ['23', '31']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'issue.xml'"}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sis'}; {'id': '36', 'type': 'list', 'children': ['37', '38', '39'], 'value': "['si510.dtd', 'si520.dtd', 'si540.dtd']"}; {'id': '37', 'type': 'string', 'children': [], 'value': "'si510.dtd'"}; {'id': '38', 'type': 'string', 'children': [], 'value': "'si520.dtd'"}; {'id': '39', 'type': 'string', 'children': [], 'value': "'si540.dtd'"}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'tmp_extracted'}; {'id': '43', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '44', 'type': 'for_statement', 'children': ['45', '46', '47']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'si'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'sis'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'if_statement', 'children': ['49', '52']}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '51'], 'value': 'in'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'si'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'issue_xml_content'}; {'id': '52', 'type': 'block', 'children': ['53', '68']}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': '_extract_correct_dtd_package'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '67']}; {'id': '59', 'type': 'subscript', 'children': ['60', '66']}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'si'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'string', 'children': [], 'value': "'.'"}; {'id': '66', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'tmp_extracted'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '72', 'type': 'if_statement', 'children': ['73', '75']}; {'id': '73', 'type': 'not_operator', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'tmp_extracted'}; {'id': '75', 'type': 'block', 'children': ['76', '82', '86', '95']}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '79', 'type': 'binary_operator', 'children': ['80', '81'], 'value': '+'}; {'id': '80', 'type': 'string', 'children': [], 'value': '"It looks like the path "'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'augmented_assignment', 'children': ['84', '85'], 'value': '+='}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '85', 'type': 'string', 'children': [], 'value': '" does not contain an si510, si520 or si540 in issue.xml file"'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '93']}; {'id': '88', 'type': 'attribute', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '95', 'type': 'raise_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '103', 'type': 'list', 'children': ['104', '105', '106', '107', '112', '113'], 'value': '["xmllint", "--format", "--loaddtd",\n join(path, \'issue.xml\'),\n "--output", join(path, \'resolved_issue.xml\')]'}; {'id': '104', 'type': 'string', 'children': [], 'value': '"xmllint"'}; {'id': '105', 'type': 'string', 'children': [], 'value': '"--format"'}; {'id': '106', 'type': 'string', 'children': [], 'value': '"--loaddtd"'}; {'id': '107', 'type': 'call', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '109', 'type': 'argument_list', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '111', 'type': 'string', 'children': [], 'value': "'issue.xml'"}; {'id': '112', 'type': 'string', 'children': [], 'value': '"--output"'}; {'id': '113', 'type': 'call', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '115', 'type': 'argument_list', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '117', 'type': 'string', 'children': [], 'value': "'resolved_issue.xml'"}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'assignment', 'children': ['120', '124']}; {'id': '120', 'type': 'pattern_list', 'children': ['121', '122', '123']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'dummy'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'dummy'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'cmd_err'}; {'id': '124', 'type': 'call', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'run_shell_command'}; {'id': '126', 'type': 'argument_list', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '128', 'type': 'if_statement', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'cmd_err'}; {'id': '130', 'type': 'block', 'children': ['131', '143', '152']}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '134', 'type': 'binary_operator', 'children': ['135', '136'], 'value': '%'}; {'id': '135', 'type': 'string', 'children': [], 'value': '"Error in cleaning %s: %s"'}; {'id': '136', 'type': 'tuple', 'children': ['137', '142']}; {'id': '137', 'type': 'call', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '139', 'type': 'argument_list', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '141', 'type': 'string', 'children': [], 'value': "'issue.xml'"}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'cmd_err'}; {'id': '143', 'type': 'expression_statement', 'children': ['144']}; {'id': '144', 'type': 'call', 'children': ['145', '150']}; {'id': '145', 'type': 'attribute', 'children': ['146', '149']}; {'id': '146', 'type': 'attribute', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '150', 'type': 'argument_list', 'children': ['151']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '152', 'type': 'raise_statement', 'children': ['153']}; {'id': '153', 'type': 'call', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '155', 'type': 'argument_list', 'children': ['156']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'message'}
issue.xml from Elsevier assume the existence of a local DTD. This procedure install the DTDs next to the issue.xml file and normalize it using xmllint in order to resolve all namespaces and references.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'broadcast_event'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '6', 'type': 'list_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '8', 'type': 'block', 'children': ['9', '29']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'pkt'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '18', '21', '24']}; {'id': '15', 'type': 'keyword_argument', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"event"'}; {'id': '18', 'type': 'keyword_argument', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '21', 'type': 'keyword_argument', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'endpoint'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'ns_name'}; {'id': '29', 'type': 'for_statement', 'children': ['30', '33', '45']}; {'id': '30', 'type': 'pattern_list', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sessid'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'attribute', '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': 'socket'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'server'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sockets'}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'send_packet'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'pkt'}
This is sent to all in the sockets in this particular Namespace, including itself.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'passcode'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'callsign'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '27', '31', '56']}; {'id': '6', 'type': 'assert_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '9', 'type': 'argument_list', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'callsign'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'callsign'}; {'id': '15', 'type': 'call', 'children': ['16', '26']}; {'id': '16', 'type': 'attribute', 'children': ['17', '25']}; {'id': '17', 'type': 'subscript', 'children': ['18', '24']}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'callsign'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'string', 'children': [], 'value': "'-'"}; {'id': '24', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '0x73e2'}; {'id': '31', 'type': 'for_statement', 'children': ['32', '35', '39']}; {'id': '32', 'type': 'pattern_list', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'char'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'callsign'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'augmented_assignment', 'children': ['42', '43'], 'value': '^='}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '43', 'type': 'binary_operator', 'children': ['44', '48'], 'value': '<<'}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'ord'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'char'}; {'id': '48', 'type': '()', 'children': ['49']}; {'id': '49', 'type': 'conditional_expression', 'children': ['50', '51', '55'], 'value': 'if'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '8'}; {'id': '51', 'type': 'not_operator', 'children': ['52']}; {'id': '52', 'type': 'binary_operator', 'children': ['53', '54'], 'value': '%'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '55', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '59'], 'value': '&'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '59', 'type': 'integer', 'children': [], 'value': '0x7fff'}
Takes a CALLSIGN and returns passcode
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'PUSH'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cpu'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '21', '53']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'if_statement', 'children': ['22', '33']}; {'id': '22', 'type': 'boolean_operator', 'children': ['23', '26'], 'value': 'and'}; {'id': '23', 'type': 'comparison_operator', 'children': ['24', '25'], 'value': '!='}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '64'}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '28'], 'value': '!='}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '28', 'type': 'binary_operator', 'children': ['29', '32'], 'value': '//'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'cpu'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'address_bit_size'}; {'id': '32', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '33', 'type': 'block', 'children': ['34', '47']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'Operators'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'SEXTEND'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43', '44']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'cpu'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'address_bit_size'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'cpu'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'address_bit_size'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'cpu'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'push'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'size'}
Pushes a value onto the stack. Decrements the stack pointer and then stores the source operand on the top of the stack. :param cpu: current CPU. :param src: source operand.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'count_annotation_values'}; {'id': '3', 'type': 'parameters', 'children': ['4', '8']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'BELGraph'}; {'id': '8', 'type': 'typed_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'annotation'}; {'id': '10', 'type': 'type', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '12', 'type': 'type', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'Counter'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'Counter'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'iter_annotation_values'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'annotation'}
Count in how many edges each annotation appears in a graph :param graph: A BEL graph :param annotation: The annotation to count :return: A Counter from {annotation value: frequency}
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'send_offnetwork_invitation'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'send_offnetwork_invitation_request'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '25']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'hangouts_pb2'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'SendOffnetworkInvitationResponse'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'await', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_pb_request'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23', '24']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'devices/sendoffnetworkinvitation'"}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'send_offnetwork_invitation_request'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'response'}
Send an email to invite a non-Google contact to Hangouts.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '32']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'register_lcformat'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9', '10', '11', '14', '17', '20', '23', '26', '29']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'fileglob'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'timecols'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'magcols'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'errcols'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'readerfunc_module'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'readerfunc'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'readerfunc_kwargs'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'normfunc_module'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'normfunc'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'default_parameter', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'normfunc_kwargs'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'default_parameter', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'magsarefluxes'}; {'id': '25', 'type': 'False', 'children': []}; {'id': '26', 'type': 'default_parameter', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'overwrite_existing'}; {'id': '28', 'type': 'False', 'children': []}; {'id': '29', 'type': 'default_parameter', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'lcformat_dir'}; {'id': '31', 'type': 'string', 'children': [], 'value': "'~/.astrobase/lcformat-jsons'"}; {'id': '32', 'type': 'block', 'children': ['33', '40', '58', '76', '90', '117', '125', '142', '171', '205', '245', '282', '305']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'LOGINFO'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '39'], 'value': '%'}; {'id': '38', 'type': 'string', 'children': [], 'value': "'adding %s to LC format registry...'"}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'lcformat_dpath'}; {'id': '43', 'type': 'call', 'children': ['44', '49']}; {'id': '44', 'type': 'attribute', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'abspath'}; {'id': '49', 'type': 'argument_list', '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': 'os'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'expanduser'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'lcformat_dir'}; {'id': '58', 'type': 'if_statement', 'children': ['59', '68']}; {'id': '59', 'type': 'not_operator', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '66']}; {'id': '61', 'type': 'attribute', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'lcformat_dpath'}; {'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': 'os'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'makedirs'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'lcformat_dpath'}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'lcformat_jsonpath'}; {'id': '79', 'type': 'call', 'children': ['80', '85']}; {'id': '80', 'type': 'attribute', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '85', 'type': 'argument_list', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'lcformat_dpath'}; {'id': '87', 'type': 'binary_operator', 'children': ['88', '89'], 'value': '%'}; {'id': '88', 'type': 'string', 'children': [], 'value': "'%s.json'"}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '90', 'type': 'if_statement', 'children': ['91', '102']}; {'id': '91', 'type': 'boolean_operator', 'children': ['92', '100'], 'value': 'and'}; {'id': '92', 'type': 'call', 'children': ['93', '98']}; {'id': '93', 'type': 'attribute', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'lcformat_jsonpath'}; {'id': '100', 'type': 'not_operator', 'children': ['101']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'overwrite_existing'}; {'id': '102', 'type': 'block', 'children': ['103', '115']}; {'id': '103', 'type': 'expression_statement', 'children': ['104']}; {'id': '104', 'type': 'call', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'LOGERROR'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'binary_operator', 'children': ['108', '112'], 'value': '%'}; {'id': '108', 'type': 'concatenated_string', 'children': ['109', '110', '111']}; {'id': '109', 'type': 'string', 'children': [], 'value': "'There is an existing lcformat JSON: %s '"}; {'id': '110', 'type': 'string', 'children': [], 'value': "'for this formatkey: %s and '"}; {'id': '111', 'type': 'string', 'children': [], 'value': "'overwrite_existing = False, skipping...'"}; {'id': '112', 'type': 'tuple', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'lcformat_jsonpath'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '115', 'type': 'return_statement', 'children': ['116']}; {'id': '116', 'type': 'None', 'children': []}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'assignment', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'readermodule'}; {'id': '120', 'type': 'call', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': '_check_extmodule'}; {'id': '122', 'type': 'argument_list', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'readerfunc_module'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '125', 'type': 'if_statement', 'children': ['126', '128']}; {'id': '126', 'type': 'not_operator', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'readermodule'}; {'id': '128', 'type': 'block', 'children': ['129', '140']}; {'id': '129', 'type': 'expression_statement', 'children': ['130']}; {'id': '130', 'type': 'call', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'LOGERROR'}; {'id': '132', 'type': 'argument_list', 'children': ['133']}; {'id': '133', 'type': 'binary_operator', 'children': ['134', '137'], 'value': '%'}; {'id': '134', 'type': 'concatenated_string', 'children': ['135', '136']}; {'id': '135', 'type': 'string', 'children': [], 'value': '"could not import the required "'}; {'id': '136', 'type': 'string', 'children': [], 'value': '"module: %s to read %s light curves"'}; {'id': '137', 'type': 'tuple', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'readerfunc_module'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '140', 'type': 'return_statement', 'children': ['141']}; {'id': '141', 'type': 'None', 'children': []}; {'id': '142', 'type': 'try_statement', 'children': ['143', '154']}; {'id': '143', 'type': 'block', 'children': ['144', '150']}; {'id': '144', 'type': 'expression_statement', 'children': ['145']}; {'id': '145', 'type': 'call', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '147', 'type': 'argument_list', 'children': ['148', '149']}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'readermodule'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'readerfunc'}; {'id': '150', 'type': 'expression_statement', 'children': ['151']}; {'id': '151', 'type': 'assignment', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'readerfunc_in'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'readerfunc'}; {'id': '154', 'type': 'except_clause', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '156', 'type': 'block', 'children': ['157', '170']}; {'id': '157', 'type': 'expression_statement', 'children': ['158']}; {'id': '158', 'type': 'call', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'LOGEXCEPTION'}; {'id': '160', 'type': 'argument_list', 'children': ['161']}; {'id': '161', 'type': 'binary_operator', 'children': ['162', '166'], 'value': '%'}; {'id': '162', 'type': 'concatenated_string', 'children': ['163', '164', '165']}; {'id': '163', 'type': 'string', 'children': [], 'value': "'Could not get the specified reader '"}; {'id': '164', 'type': 'string', 'children': [], 'value': "'function: %s for lcformat: %s '"}; {'id': '165', 'type': 'string', 'children': [], 'value': "'from module: %s'"}; {'id': '166', 'type': 'tuple', 'children': ['167', '168', '169']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'readerfunc_module'}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'readerfunc'}; {'id': '170', 'type': 'raise_statement', 'children': []}; {'id': '171', 'type': 'if_statement', 'children': ['172', '173', '199']}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'normfunc_module'}; {'id': '173', 'type': 'block', 'children': ['174', '182']}; {'id': '174', 'type': 'expression_statement', 'children': ['175']}; {'id': '175', 'type': 'assignment', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'normmodule'}; {'id': '177', 'type': 'call', 'children': ['178', '179']}; {'id': '178', 'type': 'identifier', 'children': [], 'value': '_check_extmodule'}; {'id': '179', 'type': 'argument_list', 'children': ['180', '181']}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'normfunc_module'}; {'id': '181', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '182', 'type': 'if_statement', 'children': ['183', '185']}; {'id': '183', 'type': 'not_operator', 'children': ['184']}; {'id': '184', 'type': 'identifier', 'children': [], 'value': 'normmodule'}; {'id': '185', 'type': 'block', 'children': ['186', '197']}; {'id': '186', 'type': 'expression_statement', 'children': ['187']}; {'id': '187', 'type': 'call', 'children': ['188', '189']}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'LOGERROR'}; {'id': '189', 'type': 'argument_list', 'children': ['190']}; {'id': '190', 'type': 'binary_operator', 'children': ['191', '194'], 'value': '%'}; {'id': '191', 'type': 'concatenated_string', 'children': ['192', '193']}; {'id': '192', 'type': 'string', 'children': [], 'value': '"could not import the required "'}; {'id': '193', 'type': 'string', 'children': [], 'value': '"module: %s to normalize %s light curves"'}; {'id': '194', 'type': 'tuple', 'children': ['195', '196']}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'normfunc_module'}; {'id': '196', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '197', 'type': 'return_statement', 'children': ['198']}; {'id': '198', 'type': 'None', 'children': []}; {'id': '199', 'type': 'else_clause', 'children': ['200']}; {'id': '200', 'type': 'block', 'children': ['201']}; {'id': '201', 'type': 'expression_statement', 'children': ['202']}; {'id': '202', 'type': 'assignment', 'children': ['203', '204']}; {'id': '203', 'type': 'identifier', 'children': [], 'value': 'normmodule'}; {'id': '204', 'type': 'None', 'children': []}; {'id': '205', 'type': 'if_statement', 'children': ['206', '209', '239']}; {'id': '206', 'type': 'boolean_operator', 'children': ['207', '208'], 'value': 'and'}; {'id': '207', 'type': 'identifier', 'children': [], 'value': 'normfunc_module'}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'normfunc'}; {'id': '209', 'type': 'block', 'children': ['210']}; {'id': '210', 'type': 'try_statement', 'children': ['211', '222']}; {'id': '211', 'type': 'block', 'children': ['212', '218']}; {'id': '212', 'type': 'expression_statement', 'children': ['213']}; {'id': '213', 'type': 'call', 'children': ['214', '215']}; {'id': '214', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '215', 'type': 'argument_list', 'children': ['216', '217']}; {'id': '216', 'type': 'identifier', 'children': [], 'value': 'normmodule'}; {'id': '217', 'type': 'identifier', 'children': [], 'value': 'normfunc'}; {'id': '218', 'type': 'expression_statement', 'children': ['219']}; {'id': '219', 'type': 'assignment', 'children': ['220', '221']}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 'normfunc_in'}; {'id': '221', 'type': 'identifier', 'children': [], 'value': 'normfunc'}; {'id': '222', 'type': 'except_clause', 'children': ['223', '224']}; {'id': '223', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '224', 'type': 'block', 'children': ['225', '238']}; {'id': '225', 'type': 'expression_statement', 'children': ['226']}; {'id': '226', 'type': 'call', 'children': ['227', '228']}; {'id': '227', 'type': 'identifier', 'children': [], 'value': 'LOGEXCEPTION'}; {'id': '228', 'type': 'argument_list', 'children': ['229']}; {'id': '229', 'type': 'binary_operator', 'children': ['230', '234'], 'value': '%'}; {'id': '230', 'type': 'concatenated_string', 'children': ['231', '232', '233']}; {'id': '231', 'type': 'string', 'children': [], 'value': "'Could not get the specified norm '"}; {'id': '232', 'type': 'string', 'children': [], 'value': "'function: %s for lcformat: %s '"}; {'id': '233', 'type': 'string', 'children': [], 'value': "'from module: %s'"}; {'id': '234', 'type': 'tuple', 'children': ['235', '236', '237']}; {'id': '235', 'type': 'identifier', 'children': [], 'value': 'normfunc'}; {'id': '236', 'type': 'identifier', 'children': [], 'value': 'formatkey'}; {'id': '237', 'type': 'identifier', 'children': [], 'value': 'normfunc_module'}; {'id': '238', 'type': 'raise_statement', 'children': []}; {'id': '239', 'type': 'else_clause', 'children': ['240']}; {'id': '240', 'type': 'block', 'children': ['241']}; {'id': '241', 'type': 'expression_statement', 'children': ['242']}; {'id': '242', 'type': 'assignment', 'children': ['243', '244']}; {'id': '243', 'type': 'identifier', 'children': [], 'value': 'normfunc_in'}; {'id': '244', 'type': 'None', 'children': []}; {'id': '245', 'type': 'expression_statement', 'children': ['246']}; {'id': '246', 'type': 'assignment', 'children': ['247', '248']}; {'id': '247', 'type': 'identifier', 'children': [], 'value': 'formatdict'}; {'id': '248', 'type': 'dictionary', 'children': ['249', '252', '255', '258', '261', '264', '267', '270', '273', '276', '279']}; {'id': '249', 'type': 'pair', 'children': ['250', '251']}; {'id': '250', 'type': 'string', 'children': [], 'value': "'fileglob'"}; {'id': '251', 'type': 'identifier', 'children': [], 'value': 'fileglob'}; {'id': '252', 'type': 'pair', 'children': ['253', '254']}; {'id': '253', 'type': 'string', 'children': [], 'value': "'timecols'"}; {'id': '254', 'type': 'identifier', 'children': [], 'value': 'timecols'}; {'id': '255', 'type': 'pair', 'children': ['256', '257']}; {'id': '256', 'type': 'string', 'children': [], 'value': "'magcols'"}; {'id': '257', 'type': 'identifier', 'children': [], 'value': 'magcols'}; {'id': '258', 'type': 'pair', 'children': ['259', '260']}; {'id': '259', 'type': 'string', 'children': [], 'value': "'errcols'"}; {'id': '260', 'type': 'identifier', 'children': [], 'value': 'errcols'}; {'id': '261', 'type': 'pair', 'children': ['262', '263']}; {'id': '262', 'type': 'string', 'children': [], 'value': "'magsarefluxes'"}; {'id': '263', 'type': 'identifier', 'children': [], 'value': 'magsarefluxes'}; {'id': '264', 'type': 'pair', 'children': ['265', '266']}; {'id': '265', 'type': 'string', 'children': [], 'value': "'lcreader_module'"}; {'id': '266', 'type': 'identifier', 'children': [], 'value': 'readerfunc_module'}; {'id': '267', 'type': 'pair', 'children': ['268', '269']}; {'id': '268', 'type': 'string', 'children': [], 'value': "'lcreader_func'"}; {'id': '269', 'type': 'identifier', 'children': [], 'value': 'readerfunc_in'}; {'id': '270', 'type': 'pair', 'children': ['271', '272']}; {'id': '271', 'type': 'string', 'children': [], 'value': "'lcreader_kwargs'"}; {'id': '272', 'type': 'identifier', 'children': [], 'value': 'readerfunc_kwargs'}; {'id': '273', 'type': 'pair', 'children': ['274', '275']}; {'id': '274', 'type': 'string', 'children': [], 'value': "'lcnorm_module'"}; {'id': '275', 'type': 'identifier', 'children': [], 'value': 'normfunc_module'}; {'id': '276', 'type': 'pair', 'children': ['277', '278']}; {'id': '277', 'type': 'string', 'children': [], 'value': "'lcnorm_func'"}; {'id': '278', 'type': 'identifier', 'children': [], 'value': 'normfunc_in'}; {'id': '279', 'type': 'pair', 'children': ['280', '281']}; {'id': '280', 'type': 'string', 'children': [], 'value': "'lcnorm_kwargs'"}; {'id': '281', 'type': 'identifier', 'children': [], 'value': 'normfunc_kwargs'}; {'id': '282', 'type': 'with_statement', 'children': ['283', '293']}; {'id': '283', 'type': 'with_clause', 'children': ['284']}; {'id': '284', 'type': 'with_item', 'children': ['285']}; {'id': '285', 'type': 'as_pattern', 'children': ['286', '291']}; {'id': '286', 'type': 'call', 'children': ['287', '288']}; {'id': '287', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '288', 'type': 'argument_list', 'children': ['289', '290']}; {'id': '289', 'type': 'identifier', 'children': [], 'value': 'lcformat_jsonpath'}; {'id': '290', 'type': 'string', 'children': [], 'value': "'w'"}; {'id': '291', 'type': 'as_pattern_target', 'children': ['292']}; {'id': '292', 'type': 'identifier', 'children': [], 'value': 'outfd'}; {'id': '293', 'type': 'block', 'children': ['294']}; {'id': '294', 'type': 'expression_statement', 'children': ['295']}; {'id': '295', 'type': 'call', 'children': ['296', '299']}; {'id': '296', 'type': 'attribute', 'children': ['297', '298']}; {'id': '297', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '298', 'type': 'identifier', 'children': [], 'value': 'dump'}; {'id': '299', 'type': 'argument_list', 'children': ['300', '301', '302']}; {'id': '300', 'type': 'identifier', 'children': [], 'value': 'formatdict'}; {'id': '301', 'type': 'identifier', 'children': [], 'value': 'outfd'}; {'id': '302', 'type': 'keyword_argument', 'children': ['303', '304']}; {'id': '303', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '304', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '305', 'type': 'return_statement', 'children': ['306']}; {'id': '306', 'type': 'identifier', 'children': [], 'value': 'lcformat_jsonpath'}
This adds a new LC format to the astrobase LC format registry. Allows handling of custom format light curves for astrobase lcproc drivers. Once the format is successfully registered, light curves should work transparently with all of the functions in this module, by simply calling them with the `formatkey` in the `lcformat` keyword argument. LC format specifications are generated as JSON files. astrobase comes with several of these in `<astrobase install path>/data/lcformats`. LC formats you add by using this function will have their specifiers written to the `~/.astrobase/lcformat-jsons` directory in your home directory. Parameters ---------- formatkey : str A str used as the unique ID of this LC format for all lcproc functions and can be used to look it up later and import the correct functions needed to support it for lcproc operations. For example, we use 'kep-fits' as a the specifier for Kepler FITS light curves, which can be read by the `astrobase.astrokep.read_kepler_fitslc` function as specified by the `<astrobase install path>/data/lcformats/kep-fits.json` LC format specification JSON produced by `register_lcformat`. fileglob : str The default UNIX fileglob to use to search for light curve files in this LC format. This is a string like '*-whatever-???-*.*??-.lc'. timecols,magcols,errcols : list of str These are all lists of strings indicating which keys in the lcdict produced by your `lcreader_func` that will be extracted and used by lcproc functions for processing. The lists must all have the same dimensions, e.g. if timecols = ['timecol1','timecol2'], then magcols must be something like ['magcol1','magcol2'] and errcols must be something like ['errcol1', 'errcol2']. This allows you to process multiple apertures or multiple types of measurements in one go. Each element in these lists can be a simple key, e.g. 'time' (which would correspond to lcdict['time']), or a composite key, e.g. 'aperture1.times.rjd' (which would correspond to lcdict['aperture1']['times']['rjd']). See the examples in the lcformat specification JSON files in `<astrobase install path>/data/lcformats`. readerfunc_module : str This is either: - a Python module import path, e.g. 'astrobase.lcproc.catalogs' or - a path to a Python file, e.g. '/astrobase/hatsurveys/hatlc.py' that contains the Python module that contains functions used to open (and optionally normalize) a custom LC format that's not natively supported by astrobase. readerfunc : str This is the function name in `readerfunc_module` to use to read light curves in the custom format. This MUST always return a dictionary (the 'lcdict') with the following signature (the keys listed below are required, but others are allowed):: {'objectid': this object's identifier as a string, 'objectinfo':{'ra': this object's right ascension in decimal deg, 'decl': this object's declination in decimal deg, 'ndet': the number of observations in this LC, 'objectid': the object ID again for legacy reasons}, ...other time columns, mag columns go in as their own keys} normfunc_kwargs : dict or None This is a dictionary containing any kwargs to pass through to the light curve norm function. normfunc_module : str or None This is either: - a Python module import path, e.g. 'astrobase.lcproc.catalogs' or - a path to a Python file, e.g. '/astrobase/hatsurveys/hatlc.py' - None, in which case we'll use default normalization that contains the Python module that contains functions used to normalize a custom LC format that's not natively supported by astrobase. normfunc : str or None This is the function name in `normfunc_module` to use to normalize light curves in the custom format. If None, the default normalization method used by lcproc is to find gaps in the time-series, normalize measurements grouped by these gaps to zero, then normalize the entire magnitude time series to global time series median using the `astrobase.lcmath.normalize_magseries` function. If this is provided, the normalization function should take and return an lcdict of the same form as that produced by `readerfunc` above. For an example of a specific normalization function, see `normalize_lcdict_by_inst` in the `astrobase.hatsurveys.hatlc` module. normfunc_kwargs : dict or None This is a dictionary containing any kwargs to pass through to the light curve normalization function. magsarefluxes : bool If this is True, then all lcproc functions will treat the measurement columns in the lcdict produced by your `readerfunc` as flux instead of mags, so things like default normalization and sigma-clipping will be done correctly. If this is False, magnitudes will be treated as magnitudes. overwrite_existing : bool If this is True, this function will overwrite any existing LC format specification JSON with the same name as that provided in the `formatkey` arg. This can be used to update LC format specifications while keeping the `formatkey` the same. lcformat_dir : str This specifies the directory where the the LC format specification JSON produced by this function will be written. By default, this goes to the `.astrobase/lcformat-jsons` directory in your home directory. Returns ------- str Returns the file path to the generated LC format specification JSON file.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'map_transaction'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '5', 'type': 'block', 'children': ['6', '45']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '14', '31']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '9', 'type': 'argument_list', 'children': ['10', '13']}; {'id': '10', 'type': 'subscript', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'sid'"}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '14', 'type': 'block', 'children': ['15', '23']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sid'}; {'id': '18', 'type': 'subscript', 'children': ['19', '22']}; {'id': '19', 'type': 'subscript', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'sid'"}; {'id': '22', 'type': 'string', 'children': [], 'value': "'sid'"}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'symbol'}; {'id': '26', 'type': 'subscript', 'children': ['27', '30']}; {'id': '27', 'type': 'subscript', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '29', 'type': 'string', 'children': [], 'value': "'sid'"}; {'id': '30', 'type': 'string', 'children': [], 'value': "'symbol'"}; {'id': '31', 'type': 'else_clause', 'children': ['32']}; {'id': '32', 'type': 'block', 'children': ['33', '39']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sid'}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '38', 'type': 'string', 'children': [], 'value': "'sid'"}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'symbol'}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '44', 'type': 'string', 'children': [], 'value': "'sid'"}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'dictionary', 'children': ['47', '50', '53', '58', '63', '68', '73']}; {'id': '47', 'type': 'pair', 'children': ['48', '49']}; {'id': '48', 'type': 'string', 'children': [], 'value': "'sid'"}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sid'}; {'id': '50', 'type': 'pair', 'children': ['51', '52']}; {'id': '51', 'type': 'string', 'children': [], 'value': "'symbol'"}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'symbol'}; {'id': '53', 'type': 'pair', 'children': ['54', '55']}; {'id': '54', 'type': 'string', 'children': [], 'value': "'price'"}; {'id': '55', 'type': 'subscript', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '57', 'type': 'string', 'children': [], 'value': "'price'"}; {'id': '58', 'type': 'pair', 'children': ['59', '60']}; {'id': '59', 'type': 'string', 'children': [], 'value': "'order_id'"}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '62', 'type': 'string', 'children': [], 'value': "'order_id'"}; {'id': '63', 'type': 'pair', 'children': ['64', '65']}; {'id': '64', 'type': 'string', 'children': [], 'value': "'amount'"}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '67', 'type': 'string', 'children': [], 'value': "'amount'"}; {'id': '68', 'type': 'pair', 'children': ['69', '70']}; {'id': '69', 'type': 'string', 'children': [], 'value': "'commission'"}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '72', 'type': 'string', 'children': [], 'value': "'commission'"}; {'id': '73', 'type': 'pair', 'children': ['74', '75']}; {'id': '74', 'type': 'string', 'children': [], 'value': "'dt'"}; {'id': '75', 'type': 'subscript', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'txn'}; {'id': '77', 'type': 'string', 'children': [], 'value': "'dt'"}
Maps a single transaction row to a dictionary. Parameters ---------- txn : pd.DataFrame A single transaction object to convert to a dictionary. Returns ------- dict Mapped transaction.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'upload_files'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'selected_file'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'selected_host'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'only_link'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'file_name'}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'try_statement', 'children': ['10', '88']}; {'id': '10', 'type': 'block', 'children': ['11', '32', '55']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'answer'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'requests'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '26']}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '21', 'type': 'binary_operator', 'children': ['22', '25'], 'value': '+'}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'selected_host'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '25', 'type': 'string', 'children': [], 'value': '"upload.php"'}; {'id': '26', 'type': 'keyword_argument', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '28', 'type': 'dictionary', 'children': ['29']}; {'id': '29', 'type': 'pair', 'children': ['30', '31']}; {'id': '30', 'type': 'string', 'children': [], 'value': "'files[]'"}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'selected_file'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'file_name_1'}; {'id': '35', 'type': 'subscript', 'children': ['36', '54']}; {'id': '36', 'type': 'subscript', 'children': ['37', '53']}; {'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': 'findall'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43', '44']}; {'id': '42', 'type': 'string', 'children': [], 'value': 'r\'"url": *"((h.+\\/){0,1}(.+?))"[,\\}]\''}; {'id': '43', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '44', 'type': 'call', 'children': ['45', '50']}; {'id': '45', 'type': 'attribute', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'answer'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '52']}; {'id': '51', 'type': 'string', 'children': [], 'value': '"\\\\"'}; {'id': '52', 'type': 'string', 'children': [], 'value': '""'}; {'id': '53', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '55', 'type': 'if_statement', 'children': ['56', '57', '75']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'only_link'}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'return_statement', 'children': ['59']}; {'id': '59', 'type': 'list', 'children': ['60', '65'], 'value': '[selected_host[1]+file_name_1, "{}: {}{}".format(file_name, selected_host[1], file_name_1)]'}; {'id': '60', 'type': 'binary_operator', 'children': ['61', '64'], 'value': '+'}; {'id': '61', 'type': 'subscript', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'selected_host'}; {'id': '63', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'file_name_1'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'string', 'children': [], 'value': '"{}: {}{}"'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '69', 'type': 'argument_list', 'children': ['70', '71', '74']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'file_name'}; {'id': '71', 'type': 'subscript', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'selected_host'}; {'id': '73', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'file_name_1'}; {'id': '75', 'type': 'else_clause', 'children': ['76']}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'return_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'string', 'children': [], 'value': '"{}: {}{}"'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '82', 'type': 'argument_list', 'children': ['83', '84', '87']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'file_name'}; {'id': '84', 'type': 'subscript', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'selected_host'}; {'id': '86', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'file_name_1'}; {'id': '88', 'type': 'except_clause', 'children': ['89', '94']}; {'id': '89', 'type': 'attribute', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'requests'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'exceptions'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'ConnectionError'}; {'id': '94', 'type': 'block', 'children': ['95']}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'binary_operator', 'children': ['100', '103'], 'value': '+'}; {'id': '100', 'type': 'binary_operator', 'children': ['101', '102'], 'value': '+'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'file_name'}; {'id': '102', 'type': 'string', 'children': [], 'value': "' couldn\\'t be uploaded to '"}; {'id': '103', 'type': 'subscript', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'selected_host'}; {'id': '105', 'type': 'integer', 'children': [], 'value': '0'}
Uploads selected file to the host, thanks to the fact that every pomf.se based site has pretty much the same architecture.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getobjectinfo'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'window_name'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'object_name'}; {'id': '7', 'type': 'block', 'children': ['8', '49', '53', '82']}; {'id': '8', 'type': 'try_statement', 'children': ['9', '23']}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'obj_info'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_get_object_map'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19', '20']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'window_name'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'object_name'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'wait_for_object'}; {'id': '22', 'type': 'False', 'children': []}; {'id': '23', 'type': 'except_clause', 'children': ['24', '29']}; {'id': '24', 'type': 'attribute', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'atomac'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_a11y'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'ErrorInvalidUIElement'}; {'id': '29', 'type': 'block', 'children': ['30', '36']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '_windows'}; {'id': '35', 'type': 'dictionary', 'children': []}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'obj_info'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '_get_object_map'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45', '46']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'window_name'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'object_name'}; {'id': '46', 'type': 'keyword_argument', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'wait_for_object'}; {'id': '48', 'type': 'False', 'children': []}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'props'}; {'id': '52', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '53', 'type': 'if_statement', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'obj_info'}; {'id': '55', 'type': 'block', 'children': ['56']}; {'id': '56', 'type': 'for_statement', 'children': ['57', '58', '63']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'obj_prop'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'obj_info'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '62', 'type': 'argument_list', 'children': []}; {'id': '63', 'type': 'block', 'children': ['64', '75']}; {'id': '64', 'type': 'if_statement', 'children': ['65', '73']}; {'id': '65', 'type': 'boolean_operator', 'children': ['66', '70'], 'value': 'or'}; {'id': '66', 'type': 'not_operator', 'children': ['67']}; {'id': '67', 'type': 'subscript', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'obj_info'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'obj_prop'}; {'id': '70', 'type': 'comparison_operator', 'children': ['71', '72'], 'value': '=='}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'obj_prop'}; {'id': '72', 'type': 'string', 'children': [], 'value': '"obj"'}; {'id': '73', 'type': 'block', 'children': ['74']}; {'id': '74', 'type': 'continue_statement', 'children': []}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'props'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'obj_prop'}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'props'}
Get object properties. @param window_name: Window name to look for, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to look for, either full name, LDTP's name convention, or a Unix glob. @type object_name: string @return: list of properties @rtype: list
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_attached_volumes'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'datacenter_id'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'server_id'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'depth'}; {'id': '9', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '10', 'type': 'block', 'children': ['11', '28']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_perform_request'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '21'], 'value': '%'}; {'id': '20', 'type': 'string', 'children': [], 'value': "'/datacenters/%s/servers/%s/volumes?depth=%s'"}; {'id': '21', 'type': 'tuple', 'children': ['22', '23', '24']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'datacenter_id'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'server_id'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'depth'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'response'}
Retrieves a list of volumes attached to the server. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server_id: The unique ID of the server. :type server_id: ``str`` :param depth: The depth of the response data. :type depth: ``int``
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'delete'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'store_id'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'cart_id'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'line_id'}; {'id': '8', 'type': 'block', 'children': ['9', '15', '21', '27']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'store_id'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'store_id'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'cart_id'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'cart_id'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'line_id'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'line_id'}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'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': '_mc_client'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_delete'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'url'}; {'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': '_build_path'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43', '44', '45', '46']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'store_id'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'carts'"}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'cart_id'}; {'id': '45', 'type': 'string', 'children': [], 'value': "'lines'"}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'line_id'}
Delete a cart. :param store_id: The store id. :type store_id: :py:class:`str` :param cart_id: The id for the cart. :type cart_id: :py:class:`str` :param line_id: The id for the line item of a cart. :type line_id: :py:class:`str`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'query_presence'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'query_presence_request'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '25']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'hangouts_pb2'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'QueryPresenceResponse'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'await', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_pb_request'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23', '24']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'presence/querypresence'"}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'query_presence_request'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'response'}
Return presence status for a list of users.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'suggest_spelling'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'q'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'wait'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'asynchronous'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'cached'}; {'id': '13', 'type': 'False', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'YahooSpelling'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20', '21', '22']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'q'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'wait'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'asynchronous'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'cached'}
Returns list of suggested spelling corrections for the given query.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'bounds'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '14', '21']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '13'], 'value': 'is'}; {'id': '8', 'type': 'subscript', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_raw'}; {'id': '12', 'type': 'string', 'children': [], 'value': '"bounds"'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'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': 'process_pyramid'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'bounds'}; {'id': '21', 'type': 'else_clause', 'children': ['22']}; {'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': 'Bounds'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'list_splat', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_validate_bounds'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'subscript', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '_raw'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"bounds"'}
Process bounds as defined in the configuration.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_run_time_period'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'run_steps'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '18', '22', '61', '70', '79', '98']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'init_ts_start'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'get_standardized_timestamp'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'string', 'children': [], 'value': "'now'"}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'init_ts_start'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'ts_end'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'0'"}; {'id': '22', 'type': 'for_statement', 'children': ['23', '24', '25']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'run_step'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'run_steps'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'if_statement', 'children': ['27', '34']}; {'id': '27', 'type': 'boolean_operator', 'children': ['28', '31'], 'value': 'and'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'run_step'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'run_step'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'ts_end'}; {'id': '34', 'type': 'block', 'children': ['35', '48']}; {'id': '35', 'type': 'if_statement', 'children': ['36', '41']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '40'], 'value': '<'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'run_step'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'run_step'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '48', 'type': 'if_statement', 'children': ['49', '54']}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '53'], 'value': '>'}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'run_step'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'ts_end'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'ts_end'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'ts_end'}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'run_step'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'ts_end'}; {'id': '61', 'type': 'if_statement', 'children': ['62', '65']}; {'id': '62', 'type': 'comparison_operator', 'children': ['63', '64'], 'value': '=='}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'ts_end'}; {'id': '64', 'type': 'string', 'children': [], 'value': "'0'"}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'assignment', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'ts_end'}; {'id': '69', 'type': 'None', 'children': []}; {'id': '70', 'type': 'if_statement', 'children': ['71', '74']}; {'id': '71', 'type': 'comparison_operator', 'children': ['72', '73'], 'value': '=='}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'init_ts_start'}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '78', 'type': 'None', 'children': []}; {'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': 'logger'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'binary_operator', 'children': ['86', '94'], 'value': '+'}; {'id': '86', 'type': 'binary_operator', 'children': ['87', '93'], 'value': '+'}; {'id': '87', 'type': 'binary_operator', 'children': ['88', '89'], 'value': '+'}; {'id': '88', 'type': 'string', 'children': [], 'value': "'get_run_time_period range returned '"}; {'id': '89', 'type': 'call', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '93', 'type': 'string', 'children': [], 'value': "' to '"}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'ts_end'}; {'id': '98', 'type': 'return_statement', 'children': ['99']}; {'id': '99', 'type': 'expression_list', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'ts_start'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'ts_end'}
This method finds the time range which covers all the Run_Steps :param run_steps: list of Run_Step objects :return: tuple of start and end timestamps
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_getInputNeighborhood'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'centerInput'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11', '25']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_wrapAround'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'topology'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'wrappingNeighborhood'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19', '22']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'centerInput'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_potentialRadius'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_inputDimensions'}; {'id': '25', 'type': 'else_clause', 'children': ['26']}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'topology'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'neighborhood'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34', '37']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'centerInput'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_potentialRadius'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '_inputDimensions'}
Gets a neighborhood of inputs. Simply calls topology.wrappingNeighborhood or topology.neighborhood. A subclass can insert different topology behavior by overriding this method. :param centerInput (int) The center of the neighborhood. @returns (1D numpy array of integers) The inputs in the neighborhood.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dipole_moment'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'AvailableMethods'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'Method'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '14', '112', '119', '131', '198']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '14', 'type': 'function_definition', 'children': ['15', '16', '17']}; {'id': '15', 'type': 'function_name', 'children': [], 'value': 'list_methods'}; {'id': '16', 'type': 'parameters', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18', '22', '49', '76', '103', '110']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'methods'}; {'id': '21', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '22', 'type': 'if_statement', 'children': ['23', '41']}; {'id': '23', 'type': 'boolean_operator', 'children': ['24', '29'], 'value': 'and'}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '26'], 'value': 'in'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_dipole_CCDB'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '29', 'type': 'not_operator', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'isnan'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'subscript', 'children': ['36', '39', '40']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_dipole_CCDB'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'at'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '40', 'type': 'string', 'children': [], 'value': "'Dipole'"}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'methods'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'CCCBDB'}; {'id': '49', 'type': 'if_statement', 'children': ['50', '68']}; {'id': '50', 'type': 'boolean_operator', 'children': ['51', '56'], 'value': 'and'}; {'id': '51', 'type': 'comparison_operator', 'children': ['52', '53'], 'value': 'in'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '_dipole_Muller'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '56', 'type': 'not_operator', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'isnan'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'subscript', 'children': ['63', '66', '67']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': '_dipole_Muller'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'at'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '67', 'type': 'string', 'children': [], 'value': "'Dipole'"}; {'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': 'methods'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'MULLER'}; {'id': '76', 'type': 'if_statement', 'children': ['77', '95']}; {'id': '77', 'type': 'boolean_operator', 'children': ['78', '83'], 'value': 'and'}; {'id': '78', 'type': 'comparison_operator', 'children': ['79', '80'], 'value': 'in'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': '_dipole_Poling'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '83', 'type': 'not_operator', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'isnan'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'subscript', 'children': ['90', '93', '94']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': '_dipole_Poling'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'at'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '94', 'type': 'string', 'children': [], 'value': "'Dipole'"}; {'id': '95', 'type': 'block', 'children': ['96']}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'methods'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '101', 'type': 'argument_list', 'children': ['102']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'POLING'}; {'id': '103', 'type': 'expression_statement', 'children': ['104']}; {'id': '104', 'type': 'call', 'children': ['105', '108']}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'methods'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '108', 'type': 'argument_list', 'children': ['109']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'NONE'}; {'id': '110', 'type': 'return_statement', 'children': ['111']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'methods'}; {'id': '112', 'type': 'if_statement', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'AvailableMethods'}; {'id': '114', 'type': 'block', 'children': ['115']}; {'id': '115', 'type': 'return_statement', 'children': ['116']}; {'id': '116', 'type': 'call', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'list_methods'}; {'id': '118', 'type': 'argument_list', 'children': []}; {'id': '119', 'type': 'if_statement', 'children': ['120', '122']}; {'id': '120', 'type': 'not_operator', 'children': ['121']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'Method'}; {'id': '122', 'type': 'block', 'children': ['123']}; {'id': '123', 'type': 'expression_statement', 'children': ['124']}; {'id': '124', 'type': 'assignment', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'Method'}; {'id': '126', 'type': 'subscript', 'children': ['127', '130']}; {'id': '127', 'type': 'call', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'list_methods'}; {'id': '129', 'type': 'argument_list', 'children': []}; {'id': '130', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '131', 'type': 'if_statement', 'children': ['132', '135', '148', '165', '182', '191']}; {'id': '132', 'type': 'comparison_operator', 'children': ['133', '134'], 'value': '=='}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'Method'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'CCCBDB'}; {'id': '135', 'type': 'block', 'children': ['136']}; {'id': '136', 'type': 'expression_statement', 'children': ['137']}; {'id': '137', 'type': 'assignment', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': '_dipole'}; {'id': '139', 'type': 'call', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '141', 'type': 'argument_list', 'children': ['142']}; {'id': '142', 'type': 'subscript', 'children': ['143', '146', '147']}; {'id': '143', 'type': 'attribute', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': '_dipole_CCDB'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'at'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '147', 'type': 'string', 'children': [], 'value': "'Dipole'"}; {'id': '148', 'type': 'elif_clause', 'children': ['149', '152']}; {'id': '149', 'type': 'comparison_operator', 'children': ['150', '151'], 'value': '=='}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'Method'}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'MULLER'}; {'id': '152', 'type': 'block', 'children': ['153']}; {'id': '153', 'type': 'expression_statement', 'children': ['154']}; {'id': '154', 'type': 'assignment', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': '_dipole'}; {'id': '156', 'type': 'call', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '158', 'type': 'argument_list', 'children': ['159']}; {'id': '159', 'type': 'subscript', 'children': ['160', '163', '164']}; {'id': '160', 'type': 'attribute', 'children': ['161', '162']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': '_dipole_Muller'}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'at'}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '164', 'type': 'string', 'children': [], 'value': "'Dipole'"}; {'id': '165', 'type': 'elif_clause', 'children': ['166', '169']}; {'id': '166', 'type': 'comparison_operator', 'children': ['167', '168'], 'value': '=='}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'Method'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'POLING'}; {'id': '169', 'type': 'block', 'children': ['170']}; {'id': '170', 'type': 'expression_statement', 'children': ['171']}; {'id': '171', 'type': 'assignment', 'children': ['172', '173']}; {'id': '172', 'type': 'identifier', 'children': [], 'value': '_dipole'}; {'id': '173', 'type': 'call', 'children': ['174', '175']}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '175', 'type': 'argument_list', 'children': ['176']}; {'id': '176', 'type': 'subscript', 'children': ['177', '180', '181']}; {'id': '177', 'type': 'attribute', 'children': ['178', '179']}; {'id': '178', 'type': 'identifier', 'children': [], 'value': '_dipole_Poling'}; {'id': '179', 'type': 'identifier', 'children': [], 'value': 'at'}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'CASRN'}; {'id': '181', 'type': 'string', 'children': [], 'value': "'Dipole'"}; {'id': '182', 'type': 'elif_clause', 'children': ['183', '186']}; {'id': '183', 'type': 'comparison_operator', 'children': ['184', '185'], 'value': '=='}; {'id': '184', 'type': 'identifier', 'children': [], 'value': 'Method'}; {'id': '185', 'type': 'identifier', 'children': [], 'value': 'NONE'}; {'id': '186', 'type': 'block', 'children': ['187']}; {'id': '187', 'type': 'expression_statement', 'children': ['188']}; {'id': '188', 'type': 'assignment', 'children': ['189', '190']}; {'id': '189', 'type': 'identifier', 'children': [], 'value': '_dipole'}; {'id': '190', 'type': 'None', 'children': []}; {'id': '191', 'type': 'else_clause', 'children': ['192']}; {'id': '192', 'type': 'block', 'children': ['193']}; {'id': '193', 'type': 'raise_statement', 'children': ['194']}; {'id': '194', 'type': 'call', 'children': ['195', '196']}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '196', 'type': 'argument_list', 'children': ['197']}; {'id': '197', 'type': 'string', 'children': [], 'value': "'Failure in in function'"}; {'id': '198', 'type': 'return_statement', 'children': ['199']}; {'id': '199', 'type': 'identifier', 'children': [], 'value': '_dipole'}
r'''This function handles the retrieval of a chemical's dipole moment. Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided; returns None if the data is not available. Prefered source is 'CCCBDB'. Considerable variation in reported data has found. Parameters ---------- CASRN : string CASRN [-] Returns ------- dipole : float Dipole moment, [debye] methods : list, only returned if AvailableMethods == True List of methods which can be used to obtain dipole moment with the given inputs Other Parameters ---------------- Method : string, optional The method name to use. Accepted methods are 'CCCBDB', 'MULLER', or 'POLING'. All valid values are also held in the list `dipole_methods`. AvailableMethods : bool, optional If True, function will determine which methods can be used to obtain the dipole moment for the desired chemical, and will return methods instead of the dipole moment Notes ----- A total of three sources are available for this function. They are: * 'CCCBDB', a series of critically evaluated data for compounds in [1]_, intended for use in predictive modeling. * 'MULLER', a collection of data in a group-contribution scheme in [2]_. * 'POLING', in the appendix in [3]. This function returns dipole moment in units of Debye. This is actually a non-SI unit; to convert to SI, multiply by 3.33564095198e-30 and its units will be in ampere*second^2 or equivalently and more commonly given, coulomb*second. The constant is the result of 1E-21/c, where c is the speed of light. Examples -------- >>> dipole_moment(CASRN='64-17-5') 1.44 References ---------- .. [1] NIST Computational Chemistry Comparison and Benchmark Database NIST Standard Reference Database Number 101 Release 17b, September 2015, Editor: Russell D. Johnson III http://cccbdb.nist.gov/ .. [2] Muller, Karsten, Liudmila Mokrushina, and Wolfgang Arlt. "Second- Order Group Contribution Method for the Determination of the Dipole Moment." Journal of Chemical & Engineering Data 57, no. 4 (April 12, 2012): 1231-36. doi:10.1021/je2013395. .. [3] Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_dcm_reader'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'store_metadata'}; {'id': '6', 'type': 'True', 'children': []}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'header_fields'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'block', 'children': ['11', '20', '65']}; {'id': '11', 'type': 'if_statement', 'children': ['12', '14']}; {'id': '12', 'type': 'not_operator', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'store_metadata'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'lambda', 'children': ['17', '19']}; {'id': '17', 'type': 'lambda_parameters', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'fpath'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'fpath'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '24', '35']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '23'], 'value': 'is'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'header_fields'}; {'id': '23', 'type': 'None', 'children': []}; {'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': 'build_dcm'}; {'id': '28', 'type': 'lambda', 'children': ['29', '31']}; {'id': '29', 'type': 'lambda_parameters', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'fpath'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'DicomFile'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'fpath'}; {'id': '35', 'type': 'else_clause', 'children': ['36']}; {'id': '36', 'type': 'block', 'children': ['37', '45']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'dicom_header'}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'namedtuple'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '44']}; {'id': '43', 'type': 'string', 'children': [], 'value': "'DicomHeader'"}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'header_fields'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'build_dcm'}; {'id': '48', 'type': 'lambda', 'children': ['49', '51']}; {'id': '49', 'type': 'lambda_parameters', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'fpath'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'dicom_header'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '_make'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '63']}; {'id': '57', 'type': 'attribute', 'children': ['58', '62']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'DicomFile'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'fpath'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'get_attributes'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'header_fields'}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'build_dcm'}
Creates a lambda function to read DICOM files. If store_store_metadata is False, will only return the file path. Else if you give header_fields, will return only the set of of header_fields within a DicomFile object or the whole DICOM file if None. :return: function This function has only one parameter: file_path
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'readFromCheckpoint'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'checkpointDir'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '44', '53']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'checkpointPath'}; {'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': '_getModelCheckpointFilePath'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'checkpointDir'}; {'id': '16', 'type': 'with_statement', 'children': ['17', '27']}; {'id': '17', 'type': 'with_clause', 'children': ['18']}; {'id': '18', 'type': 'with_item', 'children': ['19']}; {'id': '19', 'type': 'as_pattern', 'children': ['20', '25']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'checkpointPath'}; {'id': '24', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '25', 'type': 'as_pattern_target', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'f'}; {'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': 'proto'}; {'id': '31', 'type': 'call', 'children': ['32', '39']}; {'id': '32', 'type': 'attribute', 'children': ['33', '38']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'getSchema'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'traversal_limit_in_words'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': '_TRAVERSAL_LIMIT_IN_WORDS'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'proto'}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'model'}
Deserializes model from checkpointDir using capnproto
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_scheduler_location'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'topologyName'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'callback'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '14', '21', '41', '50']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'isWatching'}; {'id': '13', 'type': 'False', 'children': []}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '17', 'type': 'dictionary', 'children': ['18']}; {'id': '18', 'type': 'pair', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': '"result"'}; {'id': '20', 'type': 'None', 'children': []}; {'id': '21', 'type': 'if_statement', 'children': ['22', '23', '28']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'callback'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'isWatching'}; {'id': '27', 'type': 'True', 'children': []}; {'id': '28', 'type': 'else_clause', 'children': ['29']}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'function_definition', 'children': ['31', '32', '34']}; {'id': '31', 'type': 'function_name', 'children': [], 'value': 'callback'}; {'id': '32', 'type': 'parameters', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '40']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '39', 'type': 'string', 'children': [], 'value': '"result"'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_get_scheduler_location_with_watch'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48', '49']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'topologyName'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'callback'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'isWatching'}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '53', 'type': 'string', 'children': [], 'value': '"result"'}
get scheduler location
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'last_job_data'}; {'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': 'pk'}; {'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', '25']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'ujt'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20', '23']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'pk'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'include_debug_header'}; {'id': '22', 'type': 'True', 'children': []}; {'id': '23', 'type': 'dictionary_splat', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '25', 'type': 'if_statement', 'children': ['26', '31', '61', '101']}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '28'], 'value': 'in'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'current_update'"}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'ujt'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'related'"}; {'id': '31', 'type': 'block', 'children': ['32', '42']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'string', 'children': [], 'value': "'A current job; retrieving it.'"}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'header'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'details'"}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '60']}; {'id': '44', 'type': 'attribute', 'children': ['45', '59']}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'subscript', 'children': ['51', '56']}; {'id': '51', 'type': 'subscript', 'children': ['52', '55']}; {'id': '52', 'type': 'subscript', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'ujt'}; {'id': '54', 'type': 'string', 'children': [], 'value': "'related'"}; {'id': '55', 'type': 'string', 'children': [], 'value': "'current_update'"}; {'id': '56', 'type': 'slice', 'children': ['57', '58']}; {'id': '57', 'type': 'integer', 'children': [], 'value': '7'}; {'id': '58', 'type': 'colon', 'children': []}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '60', 'type': 'argument_list', 'children': []}; {'id': '61', 'type': 'elif_clause', 'children': ['62', '71']}; {'id': '62', 'type': 'call', 'children': ['63', '68']}; {'id': '63', 'type': 'attribute', 'children': ['64', '67']}; {'id': '64', 'type': 'subscript', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'ujt'}; {'id': '66', 'type': 'string', 'children': [], 'value': "'related'"}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '70']}; {'id': '69', 'type': 'string', 'children': [], 'value': "'last_update'"}; {'id': '70', 'type': 'None', 'children': []}; {'id': '71', 'type': 'block', 'children': ['72', '82']}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '79']}; {'id': '78', 'type': 'string', 'children': [], 'value': "'No current job or update exists; retrieving the most recent.'"}; {'id': '79', 'type': 'keyword_argument', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'header'}; {'id': '81', 'type': 'string', 'children': [], 'value': "'details'"}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '100']}; {'id': '84', 'type': 'attribute', 'children': ['85', '99']}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'subscript', 'children': ['91', '96']}; {'id': '91', 'type': 'subscript', 'children': ['92', '95']}; {'id': '92', 'type': 'subscript', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'ujt'}; {'id': '94', 'type': 'string', 'children': [], 'value': "'related'"}; {'id': '95', 'type': 'string', 'children': [], 'value': "'last_update'"}; {'id': '96', 'type': 'slice', 'children': ['97', '98']}; {'id': '97', 'type': 'integer', 'children': [], 'value': '7'}; {'id': '98', 'type': 'colon', 'children': []}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '100', 'type': 'argument_list', 'children': []}; {'id': '101', 'type': 'else_clause', 'children': ['102']}; {'id': '102', 'type': 'block', 'children': ['103']}; {'id': '103', 'type': 'raise_statement', 'children': ['104']}; {'id': '104', 'type': 'call', 'children': ['105', '108']}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'NotFound'}; {'id': '108', 'type': 'argument_list', 'children': ['109']}; {'id': '109', 'type': 'string', 'children': [], 'value': "'No related jobs or updates exist.'"}
Internal utility function for Unified Job Templates. Returns data about the last job run off of that UJT
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'to_representation'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '24', '37', '75']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'updated_program'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'deepcopy'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'enterprise_customer_catalog'}; {'id': '19', 'type': 'subscript', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '23', 'type': 'string', 'children': [], 'value': "'enterprise_customer_catalog'"}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '29']}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'updated_program'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'enrollment_url'"}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'enterprise_customer_catalog'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'get_program_enrollment_url'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'updated_program'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'uuid'"}; {'id': '37', 'type': 'for_statement', 'children': ['38', '39', '42']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'course'}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'updated_program'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'courses'"}; {'id': '42', 'type': 'block', 'children': ['43', '56']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '48']}; {'id': '45', 'type': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'course'}; {'id': '47', 'type': 'string', 'children': [], 'value': "'enrollment_url'"}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'enterprise_customer_catalog'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'get_course_enrollment_url'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'subscript', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'course'}; {'id': '55', 'type': 'string', 'children': [], 'value': "'key'"}; {'id': '56', 'type': 'for_statement', 'children': ['57', '58', '61']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'course_run'}; {'id': '58', 'type': 'subscript', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'course'}; {'id': '60', 'type': 'string', 'children': [], 'value': "'course_runs'"}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '67']}; {'id': '64', 'type': 'subscript', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'course_run'}; {'id': '66', 'type': 'string', 'children': [], 'value': "'enrollment_url'"}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'enterprise_customer_catalog'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'get_course_run_enrollment_url'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'subscript', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'course_run'}; {'id': '74', 'type': 'string', 'children': [], 'value': "'key'"}; {'id': '75', 'type': 'return_statement', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'updated_program'}
Return the updated program data dictionary. Arguments: instance (dict): The program data. Returns: dict: The updated program data.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_characteristics_discovered'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '6', 'type': 'block', 'children': ['7', '16']}; {'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': '_discovered_services'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '16', 'type': 'if_statement', 'children': ['17', '31']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '21'], 'value': '>='}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_discovered_services'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'set'}; {'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': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_peripheral'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'services'}; {'id': '30', 'type': 'argument_list', 'children': []}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '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': '_discovered'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '39', 'type': 'argument_list', 'children': []}
Called when GATT characteristics have been discovered.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'truncate'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'max_len'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '350'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '10', 'type': 'string', 'children': [], 'value': "'...'"}; {'id': '11', 'type': 'block', 'children': ['12', '22']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '19']}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '18'], 'value': '<='}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'max_len'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '39'], 'value': '+'}; {'id': '24', 'type': 'subscript', 'children': ['25', '38']}; {'id': '25', 'type': 'call', 'children': ['26', '33']}; {'id': '26', 'type': 'attribute', 'children': ['27', '32']}; {'id': '27', 'type': 'subscript', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '29', 'type': 'slice', 'children': ['30', '31']}; {'id': '30', 'type': 'colon', 'children': []}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'max_len'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'rsplit'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35']}; {'id': '34', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'maxsplit'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'end'}
Truncate the supplied text for display. Arguments: text (:py:class:`str`): The text to truncate. max_len (:py:class:`int`, optional): The maximum length of the text before truncation (defaults to 350 characters). end (:py:class:`str`, optional): The ending to use to show that the text was truncated (defaults to ``'...'``). Returns: :py:class:`str`: The truncated text.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'effective_bounds'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'snap_bounds'}; {'id': '9', 'type': 'argument_list', 'children': ['10', '27', '32']}; {'id': '10', 'type': 'keyword_argument', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'bounds'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'clip_bounds'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '20']}; {'id': '15', 'type': 'keyword_argument', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'bounds'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'init_bounds'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'clip'}; {'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': 'process_pyramid'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'bounds'}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'pyramid'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'process_pyramid'}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'zoom'}; {'id': '34', 'type': 'conditional_expression', 'children': ['35', '43', '46'], 'value': 'if'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'min'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'subscript', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'baselevels'}; {'id': '42', 'type': 'string', 'children': [], 'value': '"zooms"'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'baselevels'}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'min'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'init_zoom_levels'}
Effective process bounds required to initialize inputs. Process bounds sometimes have to be larger, because all intersecting process tiles have to be covered as well.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'connect'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'addr'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'with_statement', 'children': ['14', '19']}; {'id': '14', 'type': 'with_clause', 'children': ['15']}; {'id': '15', 'type': 'with_item', 'children': ['16']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'lock'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_connect'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27', '28']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'addr'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'service'}
Start establishing TCP connection with given address. One of: `port` or `service` must be provided and `addr` must be a domain name and not an IP address if `port` is not given. When `service` is given try an SRV lookup for that service at domain `addr`. If `service` is not given or `addr` is an IP address, or the SRV lookup fails, connect to `port` at host `addr` directly. [initiating entity only] :Parameters: - `addr`: peer name or IP address - `port`: port number to connect to - `service`: service name (to be resolved using SRV DNS records)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'validate_extra_link'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'extra_link'}; {'id': '6', 'type': 'block', 'children': ['7', '23', '32']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '15']}; {'id': '8', 'type': 'boolean_operator', 'children': ['9', '12'], 'value': 'or'}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': 'not in'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'EXTRA_LINK_NAME_KEY'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'extra_link'}; {'id': '12', 'type': 'comparison_operator', 'children': ['13', '14'], 'value': 'not in'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'EXTRA_LINK_FORMATTER_KEY'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'extra_link'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'raise_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '22'], 'value': '+'}; {'id': '21', 'type': 'string', 'children': [], 'value': '"Invalid extra.links format. "'}; {'id': '22', 'type': 'string', 'children': [], 'value': '"Extra link must include a \'name\' and \'formatter\' field"'}; {'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': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'validated_formatter'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'extra_link'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'EXTRA_LINK_FORMATTER_KEY'}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'extra_link'}
validate extra link
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'soft_equals'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '6', 'type': 'block', 'children': ['7', '30', '53']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '19']}; {'id': '8', 'type': 'boolean_operator', 'children': ['9', '14'], 'value': 'or'}; {'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': 'a'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'str'}; {'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': 'b'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '26'], 'value': '=='}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '30', 'type': 'if_statement', 'children': ['31', '42']}; {'id': '31', 'type': 'boolean_operator', 'children': ['32', '37'], 'value': 'or'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'return_statement', 'children': ['44']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '49'], 'value': 'is'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'comparison_operator', 'children': ['55', '56'], 'value': '=='}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'b'}
Implements the '==' operator, which does type JS-style coertion.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'swap'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '11', '20', '29']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'effect_args'}; {'id': '9', 'type': 'list', 'children': ['10'], 'value': "['swap']"}; {'id': '10', 'type': 'string', 'children': [], 'value': "'swap'"}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'effects'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'effect_args'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '27']}; {'id': '22', 'type': 'attribute', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'effects_log'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'swap'"}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}
Swap stereo channels. If the input is not stereo, pairs of channels are swapped, and a possible odd last channel passed through. E.g., for seven channels, the output order will be 2, 1, 4, 3, 6, 5, 7. See Also ---------- remix
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_to'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '14', '98', '137']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '13'], 'value': 'is'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'MaterialPackage'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'if_statement', 'children': ['16', '23', '32']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '20'], 'value': '=='}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'material'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'material'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'augmented_assignment', 'children': ['26', '29'], 'value': '+='}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'compound_masses'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'compound_masses'}; {'id': '32', 'type': 'else_clause', 'children': ['33']}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'for_statement', 'children': ['35', '36', '41']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'compound'}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'material'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'compounds'}; {'id': '41', 'type': 'block', 'children': ['42', '84']}; {'id': '42', 'type': 'if_statement', 'children': ['43', '50']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': 'not in'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'compound'}; {'id': '45', 'type': 'attribute', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'material'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'compounds'}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'raise_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'binary_operator', 'children': ['56', '83'], 'value': '+'}; {'id': '56', 'type': 'binary_operator', 'children': ['57', '78'], 'value': '+'}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '77'], 'value': '+'}; {'id': '58', 'type': 'binary_operator', 'children': ['59', '76'], 'value': '+'}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '75'], 'value': '+'}; {'id': '60', 'type': 'binary_operator', 'children': ['61', '70'], 'value': '+'}; {'id': '61', 'type': 'binary_operator', 'children': ['62', '69'], 'value': '+'}; {'id': '62', 'type': 'binary_operator', 'children': ['63', '64'], 'value': '+'}; {'id': '63', 'type': 'string', 'children': [], 'value': '"Packages of \'"'}; {'id': '64', 'type': 'attribute', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'material'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '69', 'type': 'string', 'children': [], 'value': '"\' cannot be added to packages of \'"'}; {'id': '70', 'type': 'attribute', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'material'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '75', 'type': 'string', 'children': [], 'value': '"\'. The compound \'"'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'compound'}; {'id': '77', 'type': 'string', 'children': [], 'value': '"\' was not found in \'"'}; {'id': '78', 'type': 'attribute', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'material'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '83', 'type': 'string', 'children': [], 'value': '"\'."'}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'add_to'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'tuple', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'compound'}; {'id': '92', 'type': 'call', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'get_compound_mass'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'compound'}; {'id': '98', 'type': 'elif_clause', 'children': ['99', '105']}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': '_is_compound_mass_tuple'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '105', 'type': 'block', 'children': ['106', '112', '123', '129']}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'assignment', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'compound'}; {'id': '109', 'type': 'subscript', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '111', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '112', 'type': 'expression_statement', 'children': ['113']}; {'id': '113', 'type': 'assignment', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'compound_index'}; {'id': '115', 'type': 'call', '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': 'material'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'get_compound_index'}; {'id': '121', 'type': 'argument_list', 'children': ['122']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'compound'}; {'id': '123', 'type': 'expression_statement', 'children': ['124']}; {'id': '124', 'type': 'assignment', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'mass'}; {'id': '126', 'type': 'subscript', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '128', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '129', 'type': 'expression_statement', 'children': ['130']}; {'id': '130', 'type': 'augmented_assignment', 'children': ['131', '136'], 'value': '+='}; {'id': '131', 'type': 'subscript', 'children': ['132', '135']}; {'id': '132', 'type': 'attribute', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'compound_masses'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'compound_index'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'mass'}; {'id': '137', 'type': 'else_clause', 'children': ['138']}; {'id': '138', 'type': 'block', 'children': ['139']}; {'id': '139', 'type': 'raise_statement', 'children': ['140']}; {'id': '140', 'type': 'call', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '142', 'type': 'argument_list', 'children': ['143']}; {'id': '143', 'type': 'string', 'children': [], 'value': "'Invalid addition argument.'"}
Add another chem material package to this material package. :param other: The other material package.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'gamepad'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '27', '35']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_xinput_state'}; {'id': '11', 'type': 'argument_list', 'children': []}; {'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': '_xinput'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'XInputGetState'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '23']}; {'id': '18', 'type': 'binary_operator', 'children': ['19', '22'], 'value': '-'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'ControllerID'}; {'id': '22', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'pointer'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'state'}; {'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': 'dwPacketNumber'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'dwPacketNumber'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'XINPUT_GAMEPAD'}
Returns the current gamepad state. Buttons pressed is shown as a raw integer value. Use rController.buttons for a list of buttons pressed.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_api_call'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'method_name'}; {'id': '6', 'type': 'list_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '8', 'type': 'dictionary_splat_pattern', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '10', 'type': 'block', 'children': ['11', '21', '33', '52', '60']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': "'params'"}; {'id': '20', 'type': 'dictionary', 'children': []}; {'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': 'params'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'dictionary', 'children': ['28']}; {'id': '28', 'type': 'pair', 'children': ['29', '30']}; {'id': '29', 'type': 'string', 'children': [], 'value': "'key'"}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_apikey'}; {'id': '33', 'type': 'if_statement', 'children': ['34', '39']}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '38'], 'value': 'is not'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_token'}; {'id': '38', 'type': 'None', 'children': []}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'dictionary', 'children': ['47']}; {'id': '47', 'type': 'pair', 'children': ['48', '49']}; {'id': '48', 'type': 'string', 'children': [], 'value': "'token'"}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': '_token'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'http_method'}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'requests'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'method_name'}; {'id': '60', 'type': 'return_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'http_method'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '69', '71']}; {'id': '64', 'type': 'binary_operator', 'children': ['65', '66'], 'value': '+'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'TRELLO_URL'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': '_url'}; {'id': '69', 'type': 'list_splat', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '71', 'type': 'dictionary_splat', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
Makes the HTTP request.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'p_file_contributor'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'f_term'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'predicate'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'for_statement', 'children': ['9', '13', '24']}; {'id': '9', 'type': 'pattern_list', 'children': ['10', '11', '12']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'contributor'}; {'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': 'graph'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'triples'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'tuple', 'children': ['21', '22', '23']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'f_term'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'predicate'}; {'id': '23', 'type': 'None', 'children': []}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '32']}; {'id': '27', 'type': 'attribute', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'builder'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'add_file_contribution'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'doc'}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'text_type'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'contributor'}
Parse all file contributors and adds them to the model.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'strftime'}; {'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': 'fmt'}; {'id': '7', 'type': 'string', 'children': [], 'value': '"%d:%H:%M:%S"'}; {'id': '8', 'type': 'block', 'children': ['9', '65', '69', '89']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'substitutions'}; {'id': '12', 'type': 'dictionary', 'children': ['13', '21', '31', '45', '55']}; {'id': '13', 'type': 'pair', 'children': ['14', '15']}; {'id': '14', 'type': 'string', 'children': [], 'value': '"%d"'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'str'}; {'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': 'days'}; {'id': '21', 'type': 'pair', 'children': ['22', '23']}; {'id': '22', 'type': 'string', 'children': [], 'value': '"%H"'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': '"{0:02d}"'}; {'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': 'dhours'}; {'id': '31', 'type': 'pair', 'children': ['32', '33']}; {'id': '32', 'type': 'string', 'children': [], 'value': '"%h"'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'binary_operator', 'children': ['37', '42'], 'value': '+'}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '39'], 'value': '*'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '24'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'days'}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'dhours'}; {'id': '45', 'type': 'pair', 'children': ['46', '47']}; {'id': '46', 'type': 'string', 'children': [], 'value': '"%M"'}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'string', 'children': [], 'value': '"{0:02d}"'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'format'}; {'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': 'dminutes'}; {'id': '55', 'type': 'pair', 'children': ['56', '57']}; {'id': '56', 'type': 'string', 'children': [], 'value': '"%S"'}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'string', 'children': [], 'value': '"{0:02d}"'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'dseconds'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'fmt'}; {'id': '69', 'type': 'for_statement', 'children': ['70', '73', '78']}; {'id': '70', 'type': 'pattern_list', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'search'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'replacement'}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'substitutions'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '77', 'type': 'argument_list', 'children': []}; {'id': '78', 'type': 'block', 'children': ['79']}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'search'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'replacement'}; {'id': '89', 'type': 'return_statement', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 's'}
Primitive string formatter. The only directives understood are the following: ============ ========================== Directive meaning ============ ========================== %d day as integer %H hour [00-23] %h hours including days %M minute as integer [00-59] %S second as integer [00-59] ============ ==========================
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_trip_counts_per_day'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '25', '35', '45', '57', '69', '78', '100', '104', '108', '153', '163', '176']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '9', 'type': 'string', 'children': [], 'value': '"SELECT date, count(*) AS number_of_trips FROM day_trips GROUP BY date"'}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'trip_counts_per_day'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'read_sql_query'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19', '22']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'conn'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'index_col'}; {'id': '24', 'type': 'string', 'children': [], 'value': '"date"'}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'max_day'}; {'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': 'trip_counts_per_day'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'min_day'}; {'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': 'trip_counts_per_day'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'min'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'min_date'}; {'id': '48', 'type': 'call', 'children': ['49', '54']}; {'id': '49', 'type': 'attribute', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'strptime'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'min_day'}; {'id': '56', 'type': 'string', 'children': [], 'value': "'%Y-%m-%d'"}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'max_date'}; {'id': '60', 'type': 'call', 'children': ['61', '66']}; {'id': '61', 'type': 'attribute', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'strptime'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'max_day'}; {'id': '68', 'type': 'string', 'children': [], 'value': "'%Y-%m-%d'"}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'num_days'}; {'id': '72', 'type': 'attribute', 'children': ['73', '77']}; {'id': '73', 'type': '()', 'children': ['74']}; {'id': '74', 'type': 'binary_operator', 'children': ['75', '76'], 'value': '-'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'max_date'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'min_date'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'days'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'dates'}; {'id': '81', 'type': 'list_comprehension', 'children': ['82', '92']}; {'id': '82', 'type': 'binary_operator', 'children': ['83', '84'], 'value': '+'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'min_date'}; {'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': 'timedelta'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'keyword_argument', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'days'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '92', 'type': 'for_in_clause', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'binary_operator', 'children': ['98', '99'], 'value': '+'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'num_days'}; {'id': '99', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'trip_counts'}; {'id': '103', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '104', 'type': 'expression_statement', 'children': ['105']}; {'id': '105', 'type': 'assignment', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'date_strings'}; {'id': '107', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '108', 'type': 'for_statement', 'children': ['109', '110', '111']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'date'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'dates'}; {'id': '111', 'type': 'block', 'children': ['112', '121', '128', '146']}; {'id': '112', 'type': 'expression_statement', 'children': ['113']}; {'id': '113', 'type': 'assignment', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'date_string'}; {'id': '115', 'type': 'call', 'children': ['116', '119']}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'date'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'strftime'}; {'id': '119', 'type': 'argument_list', 'children': ['120']}; {'id': '120', 'type': 'string', 'children': [], 'value': '"%Y-%m-%d"'}; {'id': '121', 'type': 'expression_statement', 'children': ['122']}; {'id': '122', 'type': 'call', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'date_strings'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '126', 'type': 'argument_list', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'date_string'}; {'id': '128', 'type': 'try_statement', 'children': ['129', '139']}; {'id': '129', 'type': 'block', 'children': ['130']}; {'id': '130', 'type': 'expression_statement', 'children': ['131']}; {'id': '131', 'type': 'assignment', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '133', 'type': 'subscript', 'children': ['134', '137', '138']}; {'id': '134', 'type': 'attribute', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'trip_counts_per_day'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'loc'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'date_string'}; {'id': '138', 'type': 'string', 'children': [], 'value': "'number_of_trips'"}; {'id': '139', 'type': 'except_clause', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '141', 'type': 'block', 'children': ['142']}; {'id': '142', 'type': 'expression_statement', 'children': ['143']}; {'id': '143', 'type': 'assignment', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '145', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '146', 'type': 'expression_statement', 'children': ['147']}; {'id': '147', 'type': 'call', 'children': ['148', '151']}; {'id': '148', 'type': 'attribute', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'trip_counts'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '151', 'type': 'argument_list', 'children': ['152']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '153', 'type': 'for_statement', 'children': ['154', '155', '158']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'date_string'}; {'id': '155', 'type': 'attribute', 'children': ['156', '157']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'trip_counts_per_day'}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '158', 'type': 'block', 'children': ['159']}; {'id': '159', 'type': 'assert_statement', 'children': ['160']}; {'id': '160', 'type': 'comparison_operator', 'children': ['161', '162'], 'value': 'in'}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'date_string'}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'date_strings'}; {'id': '163', 'type': 'expression_statement', 'children': ['164']}; {'id': '164', 'type': 'assignment', 'children': ['165', '166']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '166', 'type': 'dictionary', 'children': ['167', '170', '173']}; {'id': '167', 'type': 'pair', 'children': ['168', '169']}; {'id': '168', 'type': 'string', 'children': [], 'value': '"date"'}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'dates'}; {'id': '170', 'type': 'pair', 'children': ['171', '172']}; {'id': '171', 'type': 'string', 'children': [], 'value': '"date_str"'}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'date_strings'}; {'id': '173', 'type': 'pair', 'children': ['174', '175']}; {'id': '174', 'type': 'string', 'children': [], 'value': '"trip_counts"'}; {'id': '175', 'type': 'identifier', 'children': [], 'value': 'trip_counts'}; {'id': '176', 'type': 'return_statement', 'children': ['177']}; {'id': '177', 'type': 'call', 'children': ['178', '181']}; {'id': '178', 'type': 'attribute', 'children': ['179', '180']}; {'id': '179', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '181', 'type': 'argument_list', 'children': ['182']}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'data'}
Get trip counts per day between the start and end day of the feed. Returns ------- trip_counts : pandas.DataFrame Has columns "date_str" (dtype str) "trip_counts" (dtype int)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'package_verif_node'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'package'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '26', '35', '51', '60', '76', '84', '95', '108']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'verif_node'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'BNode'}; {'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': 'type_triple'}; {'id': '16', 'type': 'tuple', 'children': ['17', '18', '21']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'verif_node'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'RDF'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'spdx_namespace'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'PackageVerificationCode'}; {'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': 'graph'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'type_triple'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'value_triple'}; {'id': '38', 'type': 'tuple', 'children': ['39', '40', '45']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'verif_node'}; {'id': '40', 'type': 'attribute', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'spdx_namespace'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'packageVerificationCodeValue'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'Literal'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'package'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'verif_code'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '58']}; {'id': '53', 'type': 'attribute', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'value_triple'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'excl_file_nodes'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'map'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '73']}; {'id': '66', 'type': 'lambda', 'children': ['67', '69']}; {'id': '67', 'type': 'lambda_parameters', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'excl'}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'Literal'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'excl'}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'package'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'verif_exc_files'}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'excl_predicate'}; {'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': 'spdx_namespace'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'packageVerificationCodeExcludedFile'}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'excl_file_triples'}; {'id': '87', 'type': 'list_comprehension', 'children': ['88', '92']}; {'id': '88', 'type': 'tuple', 'children': ['89', '90', '91']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'verif_node'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'excl_predicate'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'xcl_file'}; {'id': '92', 'type': 'for_in_clause', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'xcl_file'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'excl_file_nodes'}; {'id': '95', 'type': 'for_statement', 'children': ['96', '97', '98']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'trp'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'excl_file_triples'}; {'id': '98', 'type': 'block', 'children': ['99']}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'call', 'children': ['101', '106']}; {'id': '101', 'type': 'attribute', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'trp'}; {'id': '108', 'type': 'return_statement', 'children': ['109']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'verif_node'}
Return a node representing package verification code.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'outer_left_join'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'join_streamlet'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'window_config'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'join_function'}; {'id': '8', 'type': 'block', 'children': ['9', '19', '32', '39', '46']}; {'id': '9', 'type': 'import_from_statement', 'children': ['10', '15', '17']}; {'id': '10', 'type': 'dotted_name', 'children': ['11', '12', '13', '14']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'heronpy'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'streamlet'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'impl'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'joinbolt'}; {'id': '15', 'type': 'dotted_name', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'JoinStreamlet'}; {'id': '17', 'type': 'dotted_name', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'JoinBolt'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'join_streamlet_result'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'JoinStreamlet'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '28', '29', '30', '31']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'JoinBolt'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'OUTER_LEFT'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'window_config'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'join_function'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'join_streamlet'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_add_child'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'join_streamlet_result'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'join_streamlet'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': '_add_child'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'join_streamlet_result'}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'join_streamlet_result'}
Return a new Streamlet by left join_streamlet with this streamlet
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'pre_deploy'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '8', '13']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'service'}; {'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': 'genv'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'services'}; {'id': '13', 'type': 'block', 'children': ['14', '26', '37']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '17', 'type': 'call', 'children': ['18', '25']}; {'id': '18', 'type': 'attribute', 'children': ['19', '24']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '25', 'type': 'argument_list', 'children': []}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'funcs'}; {'id': '29', 'type': 'call', 'children': ['30', '35']}; {'id': '30', 'type': 'attribute', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'common'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'service_pre_deployers'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '37', 'type': 'if_statement', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'funcs'}; {'id': '39', 'type': 'block', 'children': ['40', '48']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'binary_operator', 'children': ['45', '46'], 'value': '%'}; {'id': '45', 'type': 'string', 'children': [], 'value': "'Running pre-deployments for service %s...'"}; {'id': '46', 'type': 'tuple', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '48', 'type': 'for_statement', 'children': ['49', '50', '51']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'funcs'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '55', 'type': 'argument_list', 'children': []}
Runs methods services have requested be run before each deployment.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'tf_retrieve_indices'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '42', '48', '77', '83', '112', '128', '144']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'for_statement', 'children': ['14', '15', '21']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'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': 'states_memory'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '27']}; {'id': '24', 'type': 'subscript', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'gather'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '39']}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '34', 'type': 'subscript', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'states_memory'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'internals'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'for_statement', 'children': ['49', '50', '56']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'internals_memory'}; {'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': 'internals'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'gather'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '74']}; {'id': '67', 'type': 'keyword_argument', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '69', 'type': 'subscript', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'internals_memory'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '74', 'type': 'keyword_argument', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '80', 'type': 'call', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '82', 'type': 'argument_list', 'children': []}; {'id': '83', 'type': 'for_statement', 'children': ['84', '85', '91']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '85', 'type': 'call', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'actions_memory'}; {'id': '91', 'type': 'block', 'children': ['92']}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'assignment', 'children': ['94', '97']}; {'id': '94', 'type': 'subscript', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '97', 'type': 'call', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'gather'}; {'id': '101', 'type': 'argument_list', 'children': ['102', '109']}; {'id': '102', 'type': 'keyword_argument', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '104', 'type': 'subscript', 'children': ['105', '108']}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'actions_memory'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '109', 'type': 'keyword_argument', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '112', 'type': 'expression_statement', 'children': ['113']}; {'id': '113', 'type': 'assignment', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'terminal'}; {'id': '115', 'type': 'call', 'children': ['116', '119']}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'gather'}; {'id': '119', 'type': 'argument_list', 'children': ['120', '125']}; {'id': '120', 'type': 'keyword_argument', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'terminal_memory'}; {'id': '125', 'type': 'keyword_argument', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '128', 'type': 'expression_statement', 'children': ['129']}; {'id': '129', 'type': 'assignment', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'reward'}; {'id': '131', 'type': 'call', 'children': ['132', '135']}; {'id': '132', 'type': 'attribute', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'gather'}; {'id': '135', 'type': 'argument_list', 'children': ['136', '141']}; {'id': '136', 'type': 'keyword_argument', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '138', 'type': 'attribute', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'reward_memory'}; {'id': '141', 'type': 'keyword_argument', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '144', 'type': 'if_statement', 'children': ['145', '148', '264']}; {'id': '145', 'type': 'attribute', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'include_next_states'}; {'id': '148', 'type': 'block', 'children': ['149', '158', '169', '175', '204', '210', '239']}; {'id': '149', 'type': 'assert_statement', 'children': ['150']}; {'id': '150', 'type': 'comparison_operator', 'children': ['151', '157'], 'value': '=='}; {'id': '151', 'type': 'call', 'children': ['152', '155']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'util'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'rank'}; {'id': '155', 'type': 'argument_list', 'children': ['156']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '157', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '158', 'type': 'expression_statement', 'children': ['159']}; {'id': '159', 'type': 'assignment', 'children': ['160', '161']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'next_indices'}; {'id': '161', 'type': 'binary_operator', 'children': ['162', '166'], 'value': '%'}; {'id': '162', 'type': '()', 'children': ['163']}; {'id': '163', 'type': 'binary_operator', 'children': ['164', '165'], 'value': '+'}; {'id': '164', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '165', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '166', 'type': 'attribute', 'children': ['167', '168']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'capacity'}; {'id': '169', 'type': 'expression_statement', 'children': ['170']}; {'id': '170', 'type': 'assignment', 'children': ['171', '172']}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'next_states'}; {'id': '172', 'type': 'call', 'children': ['173', '174']}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '174', 'type': 'argument_list', 'children': []}; {'id': '175', 'type': 'for_statement', 'children': ['176', '177', '183']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '177', 'type': 'call', 'children': ['178', '179']}; {'id': '178', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '179', 'type': 'argument_list', 'children': ['180']}; {'id': '180', 'type': 'attribute', 'children': ['181', '182']}; {'id': '181', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'states_memory'}; {'id': '183', 'type': 'block', 'children': ['184']}; {'id': '184', 'type': 'expression_statement', 'children': ['185']}; {'id': '185', 'type': 'assignment', 'children': ['186', '189']}; {'id': '186', 'type': 'subscript', 'children': ['187', '188']}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'next_states'}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '189', 'type': 'call', 'children': ['190', '193']}; {'id': '190', 'type': 'attribute', 'children': ['191', '192']}; {'id': '191', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '192', 'type': 'identifier', 'children': [], 'value': 'gather'}; {'id': '193', 'type': 'argument_list', 'children': ['194', '201']}; {'id': '194', 'type': 'keyword_argument', 'children': ['195', '196']}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '196', 'type': 'subscript', 'children': ['197', '200']}; {'id': '197', 'type': 'attribute', 'children': ['198', '199']}; {'id': '198', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'states_memory'}; {'id': '200', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '201', 'type': 'keyword_argument', 'children': ['202', '203']}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '203', 'type': 'identifier', 'children': [], 'value': 'next_indices'}; {'id': '204', 'type': 'expression_statement', 'children': ['205']}; {'id': '205', 'type': 'assignment', 'children': ['206', '207']}; {'id': '206', 'type': 'identifier', 'children': [], 'value': 'next_internals'}; {'id': '207', 'type': 'call', 'children': ['208', '209']}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '209', 'type': 'argument_list', 'children': []}; {'id': '210', 'type': 'for_statement', 'children': ['211', '212', '218']}; {'id': '211', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '212', 'type': 'call', 'children': ['213', '214']}; {'id': '213', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '214', 'type': 'argument_list', 'children': ['215']}; {'id': '215', 'type': 'attribute', 'children': ['216', '217']}; {'id': '216', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '217', 'type': 'identifier', 'children': [], 'value': 'internals_memory'}; {'id': '218', 'type': 'block', 'children': ['219']}; {'id': '219', 'type': 'expression_statement', 'children': ['220']}; {'id': '220', 'type': 'assignment', 'children': ['221', '224']}; {'id': '221', 'type': 'subscript', 'children': ['222', '223']}; {'id': '222', 'type': 'identifier', 'children': [], 'value': 'next_internals'}; {'id': '223', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '224', 'type': 'call', 'children': ['225', '228']}; {'id': '225', 'type': 'attribute', 'children': ['226', '227']}; {'id': '226', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '227', 'type': 'identifier', 'children': [], 'value': 'gather'}; {'id': '228', 'type': 'argument_list', 'children': ['229', '236']}; {'id': '229', 'type': 'keyword_argument', 'children': ['230', '231']}; {'id': '230', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '231', 'type': 'subscript', 'children': ['232', '235']}; {'id': '232', 'type': 'attribute', 'children': ['233', '234']}; {'id': '233', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '234', 'type': 'identifier', 'children': [], 'value': 'internals_memory'}; {'id': '235', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '236', 'type': 'keyword_argument', 'children': ['237', '238']}; {'id': '237', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '238', 'type': 'identifier', 'children': [], 'value': 'next_indices'}; {'id': '239', 'type': 'return_statement', 'children': ['240']}; {'id': '240', 'type': 'call', 'children': ['241', '242']}; {'id': '241', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '242', 'type': 'argument_list', 'children': ['243', '246', '249', '252', '255', '258', '261']}; {'id': '243', 'type': 'keyword_argument', 'children': ['244', '245']}; {'id': '244', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '245', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '246', 'type': 'keyword_argument', 'children': ['247', '248']}; {'id': '247', 'type': 'identifier', 'children': [], 'value': 'internals'}; {'id': '248', 'type': 'identifier', 'children': [], 'value': 'internals'}; {'id': '249', 'type': 'keyword_argument', 'children': ['250', '251']}; {'id': '250', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '251', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '252', 'type': 'keyword_argument', 'children': ['253', '254']}; {'id': '253', 'type': 'identifier', 'children': [], 'value': 'terminal'}; {'id': '254', 'type': 'identifier', 'children': [], 'value': 'terminal'}; {'id': '255', 'type': 'keyword_argument', 'children': ['256', '257']}; {'id': '256', 'type': 'identifier', 'children': [], 'value': 'reward'}; {'id': '257', 'type': 'identifier', 'children': [], 'value': 'reward'}; {'id': '258', 'type': 'keyword_argument', 'children': ['259', '260']}; {'id': '259', 'type': 'identifier', 'children': [], 'value': 'next_states'}; {'id': '260', 'type': 'identifier', 'children': [], 'value': 'next_states'}; {'id': '261', 'type': 'keyword_argument', 'children': ['262', '263']}; {'id': '262', 'type': 'identifier', 'children': [], 'value': 'next_internals'}; {'id': '263', 'type': 'identifier', 'children': [], 'value': 'next_internals'}; {'id': '264', 'type': 'else_clause', 'children': ['265']}; {'id': '265', 'type': 'block', 'children': ['266']}; {'id': '266', 'type': 'return_statement', 'children': ['267']}; {'id': '267', 'type': 'call', 'children': ['268', '269']}; {'id': '268', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '269', 'type': 'argument_list', 'children': ['270', '273', '276', '279', '282']}; {'id': '270', 'type': 'keyword_argument', 'children': ['271', '272']}; {'id': '271', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '272', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '273', 'type': 'keyword_argument', 'children': ['274', '275']}; {'id': '274', 'type': 'identifier', 'children': [], 'value': 'internals'}; {'id': '275', 'type': 'identifier', 'children': [], 'value': 'internals'}; {'id': '276', 'type': 'keyword_argument', 'children': ['277', '278']}; {'id': '277', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '278', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '279', 'type': 'keyword_argument', 'children': ['280', '281']}; {'id': '280', 'type': 'identifier', 'children': [], 'value': 'terminal'}; {'id': '281', 'type': 'identifier', 'children': [], 'value': 'terminal'}; {'id': '282', 'type': 'keyword_argument', 'children': ['283', '284']}; {'id': '283', 'type': 'identifier', 'children': [], 'value': 'reward'}; {'id': '284', 'type': 'identifier', 'children': [], 'value': 'reward'}
Fetches experiences for given indices. Args: indices: Index tensor Returns: Batch of experiences
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'localize_datetime'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'tz_name'}; {'id': '7', 'type': 'string', 'children': [], 'value': "'UTC'"}; {'id': '8', 'type': 'block', 'children': ['9', '13', '65']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'tz_aware_dt'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '13', 'type': 'if_statement', 'children': ['14', '19', '56']}; {'id': '14', 'type': 'comparison_operator', 'children': ['15', '18'], 'value': 'is'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'tzinfo'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'block', 'children': ['20', '29', '38', '47']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'utc'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'pytz'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'UTC'"}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'aware'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'utc'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'localize'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'pytz'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'tz_name'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'tz_aware_dt'}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'aware'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'astimezone'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '56', 'type': 'else_clause', 'children': ['57']}; {'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': 'logger'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'warn'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'string', 'children': [], 'value': "'tzinfo already set'"}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'tz_aware_dt'}
Provide a timzeone-aware object for a given datetime and timezone name
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_data'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '5', 'type': 'block', 'children': ['6', '28', '34']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '18']}; {'id': '7', 'type': 'boolean_operator', 'children': ['8', '13'], 'value': 'and'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'_data_cache'"}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '17'], 'value': 'is'}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_data_cache'}; {'id': '17', 'type': 'None', 'children': []}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'deepcopy'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'img'}; {'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': 'gc'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'collect'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'img'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'get_data'}; {'id': '39', 'type': 'argument_list', 'children': []}
Get the data in the image without having a side effect on the Nifti1Image object Parameters ---------- img: Nifti1Image Returns ------- np.ndarray
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_bib_processor'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'retrieved'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '30', '36']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '10', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '11', 'type': 'for_statement', 'children': ['12', '13', '16']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'bib'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'retrieved'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'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': 'items'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'subscript', 'children': ['24', '29']}; {'id': '24', 'type': 'subscript', 'children': ['25', '28']}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'bib'}; {'id': '27', 'type': 'string', 'children': [], 'value': '"content"'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '29', 'type': 'string', 'children': [], 'value': '"value"'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'url_params'}; {'id': '35', 'type': 'None', 'children': []}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'items'}
Return a list of strings formatted as HTML bibliography entries
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ensure_dir_exists'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '46']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': '"wrap a function that returns a dir, making sure it exists"'}; {'id': '8', 'type': 'decorated_definition', 'children': ['9', '16']}; {'id': '9', 'type': 'decorator', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'functools'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'wraps'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '16', 'type': 'function_definition', 'children': ['17', '18', '19']}; {'id': '17', 'type': 'function_name', 'children': [], 'value': 'make_if_not_present'}; {'id': '18', 'type': 'parameters', 'children': []}; {'id': '19', 'type': 'block', 'children': ['20', '26', '44']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'dir'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '25', 'type': 'argument_list', 'children': []}; {'id': '26', 'type': 'if_statement', 'children': ['27', '36']}; {'id': '27', 'type': 'not_operator', 'children': ['28']}; {'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': 'os'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'isdir'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'dir'}; {'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': 'os'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'makedirs'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'dir'}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'dir'}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'make_if_not_present'}
wrap a function that returns a dir, making sure it exists
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_generateMetricSpecString'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'inferenceElement'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'metric'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'returnLabel'}; {'id': '14', 'type': 'False', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '34', '61', '67', '75', '83']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'metricSpecArgs'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '25', '28', '31']}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'metric'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'metric'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'inferenceElement'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'inferenceElement'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'metricSpecAsString'}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '39'], 'value': '%'}; {'id': '38', 'type': 'string', 'children': [], 'value': '"MetricSpec(%s)"'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'string', 'children': [], 'value': "', '"}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'list_comprehension', 'children': ['45', '54']}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '47'], 'value': '%'}; {'id': '46', 'type': 'string', 'children': [], 'value': "'%s=%r'"}; {'id': '47', 'type': 'tuple', 'children': ['48', '51']}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '53', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '54', 'type': 'for_in_clause', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'metricSpecArgs'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '60', 'type': 'argument_list', 'children': []}; {'id': '61', 'type': 'if_statement', 'children': ['62', '64']}; {'id': '62', 'type': 'not_operator', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'returnLabel'}; {'id': '64', 'type': 'block', 'children': ['65']}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'metricSpecAsString'}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'spec'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'MetricSpec'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'dictionary_splat', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'metricSpecArgs'}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'metricLabel'}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'spec'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'getLabel'}; {'id': '82', 'type': 'argument_list', 'children': []}; {'id': '83', 'type': 'return_statement', 'children': ['84']}; {'id': '84', 'type': 'expression_list', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'metricSpecAsString'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'metricLabel'}
Generates the string representation of a MetricSpec object, and returns the metric key associated with the metric. Parameters: ----------------------------------------------------------------------- inferenceElement: An InferenceElement value that indicates which part of the inference this metric is computed on metric: The type of the metric being computed (e.g. aae, avg_error) params: A dictionary of parameters for the metric. The keys are the parameter names and the values should be the parameter values (e.g. window=200) field: The name of the field for which this metric is being computed returnLabel: If True, returns the label of the MetricSpec that was generated
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'ERROR', 'children': ['2', '159', '166', '173']}; {'id': '2', 'type': 'function_definition', 'children': ['3', '4', '7', '73']}; {'id': '3', 'type': 'function_name', 'children': [], 'value': 'FIR_header'}; {'id': '4', 'type': 'parameters', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'fname_out'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '7', 'type': 'ERROR', 'children': ['8', '15', '19', '27', '34', '37', '42', '64', '67']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'M'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'N'}; {'id': '18', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'fname_out'}; {'id': '26', 'type': 'string', 'children': [], 'value': "'wt'"}; {'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': 'f'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'string', 'children': [], 'value': "'//define a FIR coefficient Array\\n\\n'"}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39', '41']}; {'id': '38', 'type': 'string', 'children': [], 'value': "'\n f.write('"}; {'id': '39', 'type': 'ERROR', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '42', 'type': 'call', 'children': ['43', '62']}; {'id': '43', 'type': 'attribute', 'children': ['44', '59', '61']}; {'id': '44', 'type': 'call', 'children': ['45', '57']}; {'id': '45', 'type': 'attribute', 'children': ['46', '54', '56']}; {'id': '46', 'type': 'call', 'children': ['47', '52']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49', '51']}; {'id': '48', 'type': 'string', 'children': [], 'value': "'\n f.write('"}; {'id': '49', 'type': 'ERROR', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'string', 'children': [], 'value': "'/************************************************************************/\\n'"}; {'id': '54', 'type': 'ERROR', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'string', 'children': [], 'value': "'/* FIR Filter Coefficients */\\n'"}; {'id': '59', 'type': 'ERROR', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'float32_t h_FIR[M_FIR] = {'"}; {'id': '64', 'type': 'ERROR', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'kk'}; {'id': '66', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '67', 'type': 'for_in_clause', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'M'}; {'id': '73', 'type': 'block', 'children': ['74']}; {'id': '74', 'type': 'if_statement', 'children': ['75', '88', '104', '146']}; {'id': '75', 'type': 'boolean_operator', 'children': ['76', '82'], 'value': 'and'}; {'id': '76', 'type': '()', 'children': ['77']}; {'id': '77', 'type': 'comparison_operator', 'children': ['78', '79'], 'value': '<'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'kk'}; {'id': '79', 'type': 'binary_operator', 'children': ['80', '81'], 'value': '-'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'N'}; {'id': '81', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '82', 'type': '()', 'children': ['83']}; {'id': '83', 'type': 'comparison_operator', 'children': ['84', '85'], 'value': '<'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '85', 'type': 'binary_operator', 'children': ['86', '87'], 'value': '-'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'M'}; {'id': '87', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '88', 'type': 'block', 'children': ['89', '100']}; {'id': '89', 'type': 'expression_statement', 'children': ['90']}; {'id': '90', 'type': 'call', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'binary_operator', 'children': ['96', '97'], 'value': '%'}; {'id': '96', 'type': 'string', 'children': [], 'value': "'%15.12f,'"}; {'id': '97', 'type': 'subscript', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'augmented_assignment', 'children': ['102', '103'], 'value': '+='}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'kk'}; {'id': '103', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '104', 'type': 'elif_clause', 'children': ['105', '118']}; {'id': '105', 'type': 'binary_operator', 'children': ['106', '112'], 'value': '&'}; {'id': '106', 'type': '()', 'children': ['107']}; {'id': '107', 'type': 'comparison_operator', 'children': ['108', '109'], 'value': '=='}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'kk'}; {'id': '109', 'type': 'binary_operator', 'children': ['110', '111'], 'value': '-'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'N'}; {'id': '111', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '112', 'type': '()', 'children': ['113']}; {'id': '113', 'type': 'comparison_operator', 'children': ['114', '115'], 'value': '<'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '115', 'type': 'binary_operator', 'children': ['116', '117'], 'value': '-'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'M'}; {'id': '117', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '118', 'type': 'block', 'children': ['119', '130']}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'call', 'children': ['121', '124']}; {'id': '121', 'type': 'attribute', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '124', 'type': 'argument_list', 'children': ['125']}; {'id': '125', 'type': 'binary_operator', 'children': ['126', '127'], 'value': '%'}; {'id': '126', 'type': 'string', 'children': [], 'value': "'%15.12f,\\n'"}; {'id': '127', 'type': 'subscript', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '130', 'type': 'if_statement', 'children': ['131', '134']}; {'id': '131', 'type': 'comparison_operator', 'children': ['132', '133'], 'value': '<'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'M'}; {'id': '134', 'type': 'block', 'children': ['135', '142']}; {'id': '135', 'type': 'expression_statement', 'children': ['136']}; {'id': '136', 'type': 'call', 'children': ['137', '140']}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '140', 'type': 'argument_list', 'children': ['141']}; {'id': '141', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '142', 'type': 'expression_statement', 'children': ['143']}; {'id': '143', 'type': 'assignment', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'kk'}; {'id': '145', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '146', 'type': 'else_clause', 'children': ['147']}; {'id': '147', 'type': 'block', 'children': ['148']}; {'id': '148', 'type': 'expression_statement', 'children': ['149']}; {'id': '149', 'type': 'call', 'children': ['150', '153']}; {'id': '150', 'type': 'attribute', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '153', 'type': 'argument_list', 'children': ['154']}; {'id': '154', 'type': 'binary_operator', 'children': ['155', '156'], 'value': '%'}; {'id': '155', 'type': 'string', 'children': [], 'value': "'%15.12f'"}; {'id': '156', 'type': 'subscript', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '159', 'type': 'expression_statement', 'children': ['160']}; {'id': '160', 'type': 'call', 'children': ['161', '164']}; {'id': '161', 'type': 'attribute', 'children': ['162', '163']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '164', 'type': 'argument_list', 'children': ['165']}; {'id': '165', 'type': 'string', 'children': [], 'value': "'};\\n'"}; {'id': '166', 'type': 'expression_statement', 'children': ['167']}; {'id': '167', 'type': 'call', 'children': ['168', '171']}; {'id': '168', 'type': 'attribute', 'children': ['169', '170']}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '171', 'type': 'argument_list', 'children': ['172']}; {'id': '172', 'type': 'string', 'children': [], 'value': "'/************************************************************************/\\n'"}; {'id': '173', 'type': 'expression_statement', 'children': ['174']}; {'id': '174', 'type': 'call', 'children': ['175', '178']}; {'id': '175', 'type': 'attribute', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '178', 'type': 'argument_list', 'children': []}
Write FIR Filter Header Files Mark Wickert February 2015
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '20']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'draw'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14', '17']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'background_threshold'}; {'id': '10', 'type': 'float', 'children': [], 'value': '0.01'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'background_class_id'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'return_foreground_mask'}; {'id': '19', 'type': 'False', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21', '35', '46', '71', '82', '102', '111', '144', '169', '214', '223']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'get_arr_int'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '32']}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'background_threshold'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'background_threshold'}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'background_class_id'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'background_class_id'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'nb_classes'}; {'id': '38', 'type': 'binary_operator', 'children': ['39', '40'], 'value': '+'}; {'id': '39', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'segmap_drawn'}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'zeros'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '66']}; {'id': '54', 'type': 'tuple', 'children': ['55', '60', '65']}; {'id': '55', 'type': 'subscript', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '59', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '60', 'type': 'subscript', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '65', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '66', 'type': 'keyword_argument', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'uint8'}; {'id': '71', 'type': 'if_statement', 'children': ['72', '75']}; {'id': '72', 'type': 'comparison_operator', 'children': ['73', '74'], 'value': 'is'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '74', 'type': 'None', 'children': []}; {'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': 'colors'}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'SegmentationMapOnImage'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'DEFAULT_SEGMENT_COLORS'}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'ia'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'do_assert'}; {'id': '87', 'type': 'argument_list', 'children': ['88', '94']}; {'id': '88', 'type': 'comparison_operator', 'children': ['89', '90'], 'value': '<='}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'nb_classes'}; {'id': '90', 'type': 'call', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '92', 'type': 'argument_list', 'children': ['93']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '94', 'type': 'binary_operator', 'children': ['95', '96'], 'value': '%'}; {'id': '95', 'type': 'string', 'children': [], 'value': '"Can\'t draw all %d classes as it would exceed the maximum number of %d available colors."'}; {'id': '96', 'type': 'tuple', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'nb_classes'}; {'id': '98', 'type': 'call', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '100', 'type': 'argument_list', 'children': ['101']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'assignment', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'ids_in_map'}; {'id': '105', 'type': 'call', 'children': ['106', '109']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'unique'}; {'id': '109', 'type': 'argument_list', 'children': ['110']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '111', 'type': 'for_statement', 'children': ['112', '115', '125']}; {'id': '112', 'type': 'pattern_list', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '115', 'type': 'call', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '117', 'type': 'argument_list', 'children': ['118', '124']}; {'id': '118', 'type': 'call', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'sm'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'nb_classes'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '125', 'type': 'block', 'children': ['126']}; {'id': '126', 'type': 'if_statement', 'children': ['127', '130']}; {'id': '127', 'type': 'comparison_operator', 'children': ['128', '129'], 'value': 'in'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'ids_in_map'}; {'id': '130', 'type': 'block', 'children': ['131', '138']}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'class_mask'}; {'id': '134', 'type': '()', 'children': ['135']}; {'id': '135', 'type': 'comparison_operator', 'children': ['136', '137'], 'value': '=='}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '138', 'type': 'expression_statement', 'children': ['139']}; {'id': '139', 'type': 'assignment', 'children': ['140', '143']}; {'id': '140', 'type': 'subscript', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'segmap_drawn'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'class_mask'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '144', 'type': 'if_statement', 'children': ['145', '146', '163']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'return_foreground_mask'}; {'id': '146', 'type': 'block', 'children': ['147', '156']}; {'id': '147', 'type': 'expression_statement', 'children': ['148']}; {'id': '148', 'type': 'assignment', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'background_class_id'}; {'id': '150', 'type': 'conditional_expression', 'children': ['151', '152', '155'], 'value': 'if'}; {'id': '151', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '152', 'type': 'comparison_operator', 'children': ['153', '154'], 'value': 'is'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'background_class_id'}; {'id': '154', 'type': 'None', 'children': []}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'background_class_id'}; {'id': '156', 'type': 'expression_statement', 'children': ['157']}; {'id': '157', 'type': 'assignment', 'children': ['158', '159']}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'foreground_mask'}; {'id': '159', 'type': '()', 'children': ['160']}; {'id': '160', 'type': 'comparison_operator', 'children': ['161', '162'], 'value': '!='}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'background_class_id'}; {'id': '163', 'type': 'else_clause', 'children': ['164']}; {'id': '164', 'type': 'block', 'children': ['165']}; {'id': '165', 'type': 'expression_statement', 'children': ['166']}; {'id': '166', 'type': 'assignment', 'children': ['167', '168']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'foreground_mask'}; {'id': '168', 'type': 'None', 'children': []}; {'id': '169', 'type': 'if_statement', 'children': ['170', '173']}; {'id': '170', 'type': 'comparison_operator', 'children': ['171', '172'], 'value': 'is not'}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '172', 'type': 'None', 'children': []}; {'id': '173', 'type': 'block', 'children': ['174', '187']}; {'id': '174', 'type': 'expression_statement', 'children': ['175']}; {'id': '175', 'type': 'assignment', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'segmap_drawn'}; {'id': '177', 'type': 'call', 'children': ['178', '181']}; {'id': '178', 'type': 'attribute', 'children': ['179', '180']}; {'id': '179', 'type': 'identifier', 'children': [], 'value': 'ia'}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'imresize_single_image'}; {'id': '181', 'type': 'argument_list', 'children': ['182', '183', '184']}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'segmap_drawn'}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '184', 'type': 'keyword_argument', 'children': ['185', '186']}; {'id': '185', 'type': 'identifier', 'children': [], 'value': 'interpolation'}; {'id': '186', 'type': 'string', 'children': [], 'value': '"nearest"'}; {'id': '187', 'type': 'if_statement', 'children': ['188', '191']}; {'id': '188', 'type': 'comparison_operator', 'children': ['189', '190'], 'value': 'is not'}; {'id': '189', 'type': 'identifier', 'children': [], 'value': 'foreground_mask'}; {'id': '190', 'type': 'None', 'children': []}; {'id': '191', 'type': 'block', 'children': ['192']}; {'id': '192', 'type': 'expression_statement', 'children': ['193']}; {'id': '193', 'type': 'assignment', 'children': ['194', '195']}; {'id': '194', 'type': 'identifier', 'children': [], 'value': 'foreground_mask'}; {'id': '195', 'type': 'comparison_operator', 'children': ['196', '213'], 'value': '>'}; {'id': '196', 'type': 'call', 'children': ['197', '200']}; {'id': '197', 'type': 'attribute', 'children': ['198', '199']}; {'id': '198', 'type': 'identifier', 'children': [], 'value': 'ia'}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'imresize_single_image'}; {'id': '200', 'type': 'argument_list', 'children': ['201', '209', '210']}; {'id': '201', 'type': 'call', 'children': ['202', '205']}; {'id': '202', 'type': 'attribute', 'children': ['203', '204']}; {'id': '203', 'type': 'identifier', 'children': [], 'value': 'foreground_mask'}; {'id': '204', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '205', 'type': 'argument_list', 'children': ['206']}; {'id': '206', 'type': 'attribute', 'children': ['207', '208']}; {'id': '207', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'uint8'}; {'id': '209', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '210', 'type': 'keyword_argument', 'children': ['211', '212']}; {'id': '211', 'type': 'identifier', 'children': [], 'value': 'interpolation'}; {'id': '212', 'type': 'string', 'children': [], 'value': '"nearest"'}; {'id': '213', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '214', 'type': 'if_statement', 'children': ['215', '218']}; {'id': '215', 'type': 'comparison_operator', 'children': ['216', '217'], 'value': 'is not'}; {'id': '216', 'type': 'identifier', 'children': [], 'value': 'foreground_mask'}; {'id': '217', 'type': 'None', 'children': []}; {'id': '218', 'type': 'block', 'children': ['219']}; {'id': '219', 'type': 'return_statement', 'children': ['220']}; {'id': '220', 'type': 'expression_list', 'children': ['221', '222']}; {'id': '221', 'type': 'identifier', 'children': [], 'value': 'segmap_drawn'}; {'id': '222', 'type': 'identifier', 'children': [], 'value': 'foreground_mask'}; {'id': '223', 'type': 'return_statement', 'children': ['224']}; {'id': '224', 'type': 'identifier', 'children': [], 'value': 'segmap_drawn'}
Render the segmentation map as an RGB image. Parameters ---------- size : None or float or iterable of int or iterable of float, optional Size of the rendered RGB image as ``(height, width)``. See :func:`imgaug.imgaug.imresize_single_image` for details. If set to None, no resizing is performed and the size of the segmentation map array is used. background_threshold : float, optional See :func:`imgaug.SegmentationMapOnImage.get_arr_int`. background_class_id : None or int, optional See :func:`imgaug.SegmentationMapOnImage.get_arr_int`. colors : None or list of tuple of int, optional Colors to use. One for each class to draw. If None, then default colors will be used. return_foreground_mask : bool, optional Whether to return a mask of the same size as the drawn segmentation map, containing True at any spatial location that is not the background class and False everywhere else. Returns ------- segmap_drawn : (H,W,3) ndarray Rendered segmentation map (dtype is uint8). foreground_mask : (H,W) ndarray Mask indicating the locations of foreground classes (dtype is bool). This value is only returned if `return_foreground_mask` is True.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'prepare_path'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '5', 'type': 'block', 'children': ['6', '24']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '13']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '12'], 'value': '=='}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '21']}; {'id': '16', 'type': 'attribute', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'list_splat', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'path'}
Path join helper method Join paths if list passed :type path: str|unicode|list :rtype: str|unicode
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'revoke_token'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'callback'}; {'id': '7', 'type': 'block', 'children': ['8', '22']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'yield', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'Task'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '18', '19']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'data_store'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'tokens'"}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'callback'}; {'id': '25', 'type': 'argument_list', 'children': []}
revoke_token removes the access token from the data_store
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'separate_particles_into_groups'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'region_size'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '40'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'bounds'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'doshift'}; {'id': '13', 'type': 'False', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15', '29', '47', '79', '102', '106', '124', '142', '161', '180', '188', '212', '254', '286', '292']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'imtile'}; {'id': '18', 'type': 'call', 'children': ['19', '24']}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'oshape'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'translate'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'unary_operator', 'children': ['26'], 'value': '-'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'pad'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'bounding_tile'}; {'id': '32', 'type': '()', 'children': ['33']}; {'id': '33', 'type': 'conditional_expression', 'children': ['34', '35', '38'], 'value': 'if'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'imtile'}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': 'is'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'bounds'}; {'id': '37', 'type': 'None', 'children': []}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'Tile'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '44']}; {'id': '41', 'type': 'subscript', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'bounds'}; {'id': '43', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'bounds'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'rs'}; {'id': '50', 'type': '()', 'children': ['51']}; {'id': '51', 'type': 'conditional_expression', 'children': ['52', '65', '73'], 'value': 'if'}; {'id': '52', 'type': 'binary_operator', 'children': ['53', '64'], 'value': '*'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'ones'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'bounding_tile'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'dim'}; {'id': '61', 'type': 'keyword_argument', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '63', 'type': 'string', 'children': [], 'value': "'int'"}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'region_size'}; {'id': '65', 'type': 'comparison_operator', 'children': ['66', '72'], 'value': '=='}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'region_size'}; {'id': '72', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'region_size'}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'n_translate'}; {'id': '82', 'type': 'call', 'children': ['83', '100']}; {'id': '83', 'type': 'attribute', 'children': ['84', '99']}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'ceil'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'binary_operator', 'children': ['90', '98'], 'value': '/'}; {'id': '90', 'type': 'call', 'children': ['91', '96']}; {'id': '91', 'type': 'attribute', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'bounding_tile'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'string', 'children': [], 'value': "'float'"}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'rs'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '100', 'type': 'argument_list', 'children': ['101']}; {'id': '101', 'type': 'string', 'children': [], 'value': "'int'"}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'assignment', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'particle_groups'}; {'id': '105', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'assignment', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'tile'}; {'id': '109', 'type': 'call', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'Tile'}; {'id': '111', 'type': 'argument_list', 'children': ['112', '117']}; {'id': '112', 'type': 'keyword_argument', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'left'}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'bounding_tile'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '117', 'type': 'keyword_argument', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'right'}; {'id': '119', 'type': 'binary_operator', 'children': ['120', '123'], 'value': '+'}; {'id': '120', 'type': 'attribute', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'bounding_tile'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'rs'}; {'id': '124', 'type': 'if_statement', 'children': ['125', '128']}; {'id': '125', 'type': 'comparison_operator', 'children': ['126', '127'], 'value': '=='}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'doshift'}; {'id': '127', 'type': 'string', 'children': [], 'value': "'rand'"}; {'id': '128', 'type': 'block', 'children': ['129']}; {'id': '129', 'type': 'expression_statement', 'children': ['130']}; {'id': '130', 'type': 'assignment', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'doshift'}; {'id': '132', 'type': 'call', 'children': ['133', '138']}; {'id': '133', 'type': 'attribute', 'children': ['134', '137']}; {'id': '134', 'type': 'attribute', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'random'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'choice'}; {'id': '138', 'type': 'argument_list', 'children': ['139']}; {'id': '139', 'type': 'list', 'children': ['140', '141'], 'value': '[True, False]'}; {'id': '140', 'type': 'True', 'children': []}; {'id': '141', 'type': 'False', 'children': []}; {'id': '142', 'type': 'if_statement', 'children': ['143', '144', '155']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'doshift'}; {'id': '144', 'type': 'block', 'children': ['145', '151']}; {'id': '145', 'type': 'expression_statement', 'children': ['146']}; {'id': '146', 'type': 'assignment', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'shift'}; {'id': '148', 'type': 'binary_operator', 'children': ['149', '150'], 'value': '//'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'rs'}; {'id': '150', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '151', 'type': 'expression_statement', 'children': ['152']}; {'id': '152', 'type': 'augmented_assignment', 'children': ['153', '154'], 'value': '+='}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'n_translate'}; {'id': '154', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '155', 'type': 'else_clause', 'children': ['156']}; {'id': '156', 'type': 'block', 'children': ['157']}; {'id': '157', 'type': 'expression_statement', 'children': ['158']}; {'id': '158', 'type': 'assignment', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'shift'}; {'id': '160', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '161', 'type': 'expression_statement', 'children': ['162']}; {'id': '162', 'type': 'assignment', 'children': ['163', '164']}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'deltas'}; {'id': '164', 'type': 'call', 'children': ['165', '168']}; {'id': '165', 'type': 'attribute', 'children': ['166', '167']}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'meshgrid'}; {'id': '168', 'type': 'argument_list', 'children': ['169']}; {'id': '169', 'type': 'list_splat', 'children': ['170']}; {'id': '170', 'type': 'list_comprehension', 'children': ['171', '177']}; {'id': '171', 'type': 'call', 'children': ['172', '175']}; {'id': '172', 'type': 'attribute', 'children': ['173', '174']}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'arange'}; {'id': '175', 'type': 'argument_list', 'children': ['176']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '177', 'type': 'for_in_clause', 'children': ['178', '179']}; {'id': '178', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '179', 'type': 'identifier', 'children': [], 'value': 'n_translate'}; {'id': '180', 'type': 'expression_statement', 'children': ['181']}; {'id': '181', 'type': 'assignment', 'children': ['182', '183']}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'positions'}; {'id': '183', 'type': 'call', 'children': ['184', '187']}; {'id': '184', 'type': 'attribute', 'children': ['185', '186']}; {'id': '185', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'obj_get_positions'}; {'id': '187', 'type': 'argument_list', 'children': []}; {'id': '188', 'type': 'if_statement', 'children': ['189', '192']}; {'id': '189', 'type': 'comparison_operator', 'children': ['190', '191'], 'value': 'is'}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'bounds'}; {'id': '191', 'type': 'None', 'children': []}; {'id': '192', 'type': 'block', 'children': ['193']}; {'id': '193', 'type': 'expression_statement', 'children': ['194']}; {'id': '194', 'type': 'assignment', 'children': ['195', '196']}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'positions'}; {'id': '196', 'type': 'call', 'children': ['197', '200']}; {'id': '197', 'type': 'attribute', 'children': ['198', '199']}; {'id': '198', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'clip'}; {'id': '200', 'type': 'argument_list', 'children': ['201', '202', '207']}; {'id': '201', 'type': 'identifier', 'children': [], 'value': 'positions'}; {'id': '202', 'type': 'binary_operator', 'children': ['203', '206'], 'value': '+'}; {'id': '203', 'type': 'attribute', 'children': ['204', '205']}; {'id': '204', 'type': 'identifier', 'children': [], 'value': 'imtile'}; {'id': '205', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '206', 'type': 'float', 'children': [], 'value': '1e-3'}; {'id': '207', 'type': 'binary_operator', 'children': ['208', '211'], 'value': '-'}; {'id': '208', 'type': 'attribute', 'children': ['209', '210']}; {'id': '209', 'type': 'identifier', 'children': [], 'value': 'imtile'}; {'id': '210', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '211', 'type': 'float', 'children': [], 'value': '1e-3'}; {'id': '212', 'type': 'expression_statement', 'children': ['213']}; {'id': '213', 'type': 'assignment', 'children': ['214', '215']}; {'id': '214', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '215', 'type': 'call', 'children': ['216', '217']}; {'id': '216', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '217', 'type': 'argument_list', 'children': ['218']}; {'id': '218', 'type': 'call', 'children': ['219', '220']}; {'id': '219', 'type': 'identifier', 'children': [], 'value': 'map'}; {'id': '220', 'type': 'argument_list', 'children': ['221', '244']}; {'id': '221', 'type': 'lambda', 'children': ['222', '225']}; {'id': '222', 'type': 'lambda_parameters', 'children': ['223']}; {'id': '223', 'type': 'list_splat_pattern', 'children': ['224']}; {'id': '224', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '225', 'type': 'call', 'children': ['226', '227']}; {'id': '226', 'type': 'identifier', 'children': [], 'value': 'find_particles_in_tile'}; {'id': '227', 'type': 'argument_list', 'children': ['228', '229']}; {'id': '228', 'type': 'identifier', 'children': [], 'value': 'positions'}; {'id': '229', 'type': 'call', 'children': ['230', '233']}; {'id': '230', 'type': 'attribute', 'children': ['231', '232']}; {'id': '231', 'type': 'identifier', 'children': [], 'value': 'tile'}; {'id': '232', 'type': 'identifier', 'children': [], 'value': 'translate'}; {'id': '233', 'type': 'argument_list', 'children': ['234']}; {'id': '234', 'type': 'binary_operator', 'children': ['235', '243'], 'value': '-'}; {'id': '235', 'type': 'binary_operator', 'children': ['236', '242'], 'value': '*'}; {'id': '236', 'type': 'call', 'children': ['237', '240']}; {'id': '237', 'type': 'attribute', 'children': ['238', '239']}; {'id': '238', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '239', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '240', 'type': 'argument_list', 'children': ['241']}; {'id': '241', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '242', 'type': 'identifier', 'children': [], 'value': 'rs'}; {'id': '243', 'type': 'identifier', 'children': [], 'value': 'shift'}; {'id': '244', 'type': 'list_splat', 'children': ['245']}; {'id': '245', 'type': 'list_comprehension', 'children': ['246', '251']}; {'id': '246', 'type': 'call', 'children': ['247', '250']}; {'id': '247', 'type': 'attribute', 'children': ['248', '249']}; {'id': '248', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '249', 'type': 'identifier', 'children': [], 'value': 'ravel'}; {'id': '250', 'type': 'argument_list', 'children': []}; {'id': '251', 'type': 'for_in_clause', 'children': ['252', '253']}; {'id': '252', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '253', 'type': 'identifier', 'children': [], 'value': 'deltas'}; {'id': '254', 'type': 'for_statement', 'children': ['255', '256', '269']}; {'id': '255', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '256', 'type': 'call', 'children': ['257', '258']}; {'id': '257', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '258', 'type': 'argument_list', 'children': ['259', '265', '267']}; {'id': '259', 'type': 'binary_operator', 'children': ['260', '264'], 'value': '-'}; {'id': '260', 'type': 'call', 'children': ['261', '262']}; {'id': '261', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '262', 'type': 'argument_list', 'children': ['263']}; {'id': '263', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '264', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '265', 'type': 'unary_operator', 'children': ['266'], 'value': '-'}; {'id': '266', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '267', 'type': 'unary_operator', 'children': ['268'], 'value': '-'}; {'id': '268', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '269', 'type': 'block', 'children': ['270']}; {'id': '270', 'type': 'if_statement', 'children': ['271', '278']}; {'id': '271', 'type': 'comparison_operator', 'children': ['272', '277'], 'value': '=='}; {'id': '272', 'type': 'attribute', 'children': ['273', '276']}; {'id': '273', 'type': 'subscript', 'children': ['274', '275']}; {'id': '274', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '275', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '276', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '277', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '278', 'type': 'block', 'children': ['279']}; {'id': '279', 'type': 'expression_statement', 'children': ['280']}; {'id': '280', 'type': 'call', 'children': ['281', '284']}; {'id': '281', 'type': 'attribute', 'children': ['282', '283']}; {'id': '282', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '283', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '284', 'type': 'argument_list', 'children': ['285']}; {'id': '285', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '286', 'type': 'assert_statement', 'children': ['287']}; {'id': '287', 'type': 'call', 'children': ['288', '289']}; {'id': '288', 'type': 'identifier', 'children': [], 'value': '_check_groups'}; {'id': '289', 'type': 'argument_list', 'children': ['290', '291']}; {'id': '290', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '291', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '292', 'type': 'return_statement', 'children': ['293']}; {'id': '293', 'type': 'identifier', 'children': [], 'value': 'groups'}
Separates particles into convenient groups for optimization. Given a state, returns a list of groups of particles. Each group of particles are located near each other in the image. Every particle located in the desired region is contained in exactly 1 group. Parameters ---------- s : :class:`peri.states.ImageState` The peri state to find particles in. region_size : Int or 3-element list-like of ints, optional The size of the box. Groups particles into boxes of shape (region_size[0], region_size[1], region_size[2]). If region_size is a scalar, the box is a cube of length region_size. Default is 40. bounds : 2-element list-like of 3-element lists, optional The sub-region of the image over which to look for particles. bounds[0]: The lower-left corner of the image region. bounds[1]: The upper-right corner of the image region. Default (None -> ([0,0,0], s.oshape.shape)) is a box of the entire image size, i.e. the default places every particle in the image somewhere in the groups. doshift : {True, False, `'rand'`}, optional Whether or not to shift the tile boxes by half a region size, to prevent the same particles to be chosen every time. If `'rand'`, randomly chooses either True or False. Default is False Returns ------- particle_groups : List Each element of particle_groups is an int numpy.ndarray of the group of nearby particles. Only contains groups with a nonzero number of particles, so the elements don't necessarily correspond to a given image region.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ping'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '18', '24', '37', '43', '51', '72']}; {'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': '_idle'}; {'id': '11', 'type': 'argument_list', 'children': []}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_transaction_start'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_i2c_start'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_i2c_write_bytes'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'list', 'children': ['31'], 'value': '[self._address_byte(False)]'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '_address_byte'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'False', 'children': []}; {'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': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_i2c_stop'}; {'id': '42', 'type': 'argument_list', 'children': []}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'response'}; {'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': '_transaction_end'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'if_statement', 'children': ['52', '58']}; {'id': '52', 'type': 'comparison_operator', 'children': ['53', '57'], 'value': '!='}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '57', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'raise_statement', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'RuntimeError'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'string', 'children': [], 'value': "'Expected 1 response byte but received {0} byte(s).'"}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '72', 'type': 'return_statement', 'children': ['73']}; {'id': '73', 'type': '()', 'children': ['74']}; {'id': '74', 'type': 'comparison_operator', 'children': ['75', '81'], 'value': '=='}; {'id': '75', 'type': '()', 'children': ['76']}; {'id': '76', 'type': 'binary_operator', 'children': ['77', '80'], 'value': '&'}; {'id': '77', 'type': 'subscript', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '79', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '80', 'type': 'integer', 'children': [], 'value': '0x01'}; {'id': '81', 'type': 'integer', 'children': [], 'value': '0x00'}
Attempt to detect if a device at this address is present on the I2C bus. Will send out the device's address for writing and verify an ACK is received. Returns true if the ACK is received, and false if not.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'append_arguments'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'klass'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sub_parsers'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'default_epilog'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'general_arguments'}; {'id': '8', 'type': 'block', 'children': ['9', '24', '34', '51', '61', '107', '117', '135', '159']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'entry_name'}; {'id': '12', 'type': 'call', 'children': ['13', '21']}; {'id': '13', 'type': 'attribute', 'children': ['14', '20']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'hump_to_underscore'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'klass'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'_component'"}; {'id': '23', 'type': 'string', 'children': [], 'value': "''"}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'epilog'}; {'id': '27', 'type': 'conditional_expression', 'children': ['28', '29', '30', '31'], 'value': 'if'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'default_epilog'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'default_epilog'}; {'id': '30', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '31', 'type': 'concatenated_string', 'children': ['32', '33']}; {'id': '32', 'type': 'string', 'children': [], 'value': "'This tool generate by `cliez` '"}; {'id': '33', 'type': 'string', 'children': [], 'value': "'https://www.github.com/wangwenpei/cliez'"}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'sub_parser'}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sub_parsers'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'add_parser'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43', '48']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'entry_name'}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'help'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'klass'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': '__doc__'}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'epilog'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'epilog'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'sub_parser'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '56', 'type': 'attribute', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'klass'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'add_arguments'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': '__doc__'}; {'id': '61', 'type': 'if_statement', 'children': ['62', '67']}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'klass'}; {'id': '66', 'type': 'string', 'children': [], 'value': "'add_slot_args'"}; {'id': '67', 'type': 'block', 'children': ['68', '78', '96', '106']}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'slot_args'}; {'id': '71', 'type': 'boolean_operator', 'children': ['72', '77'], 'value': 'or'}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'klass'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'add_slot_args'}; {'id': '76', 'type': 'argument_list', 'children': []}; {'id': '77', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '78', 'type': 'for_statement', 'children': ['79', '80', '81']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'slot_args'}; {'id': '81', 'type': 'block', 'children': ['82']}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'sub_parser'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '87', 'type': 'argument_list', 'children': ['88', '92']}; {'id': '88', 'type': 'list_splat', 'children': ['89']}; {'id': '89', 'type': 'subscript', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '91', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '92', 'type': 'dictionary_splat', 'children': ['93']}; {'id': '93', 'type': 'subscript', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '95', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'assignment', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'sub_parser'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '101', 'type': 'attribute', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'klass'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'add_slot_args'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': '__doc__'}; {'id': '106', 'type': 'pass_statement', 'children': []}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'assignment', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'user_arguments'}; {'id': '110', 'type': 'boolean_operator', 'children': ['111', '116'], 'value': 'or'}; {'id': '111', 'type': 'call', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'klass'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'add_arguments'}; {'id': '115', 'type': 'argument_list', 'children': []}; {'id': '116', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '117', 'type': 'for_statement', 'children': ['118', '119', '120']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'user_arguments'}; {'id': '120', 'type': 'block', 'children': ['121']}; {'id': '121', 'type': 'expression_statement', 'children': ['122']}; {'id': '122', 'type': 'call', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'sub_parser'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '126', 'type': 'argument_list', 'children': ['127', '131']}; {'id': '127', 'type': 'list_splat', 'children': ['128']}; {'id': '128', 'type': 'subscript', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '130', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '131', 'type': 'dictionary_splat', 'children': ['132']}; {'id': '132', 'type': 'subscript', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '134', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '135', 'type': 'if_statement', 'children': ['136', '140']}; {'id': '136', 'type': 'not_operator', 'children': ['137']}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'klass'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'exclude_global_option'}; {'id': '140', 'type': 'block', 'children': ['141']}; {'id': '141', 'type': 'for_statement', 'children': ['142', '143', '144']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'general_arguments'}; {'id': '144', 'type': 'block', 'children': ['145']}; {'id': '145', 'type': 'expression_statement', 'children': ['146']}; {'id': '146', 'type': 'call', 'children': ['147', '150']}; {'id': '147', 'type': 'attribute', 'children': ['148', '149']}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'sub_parser'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'add_argument'}; {'id': '150', 'type': 'argument_list', 'children': ['151', '155']}; {'id': '151', 'type': 'list_splat', 'children': ['152']}; {'id': '152', 'type': 'subscript', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '154', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '155', 'type': 'dictionary_splat', 'children': ['156']}; {'id': '156', 'type': 'subscript', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '158', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '159', 'type': 'return_statement', 'children': ['160']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'sub_parser'}
Add class options to argparser options. :param cliez.component.Component klass: subclass of Component :param Namespace sub_parsers: :param str default_epilog: default_epilog :param list general_arguments: global options, defined by user :return: Namespace subparser
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14', '18']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'format_output'}; {'id': '3', 'type': 'parameters', 'children': ['4', '10', '11']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'attribute', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'col_maps'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'type', 'children': ['15']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '18', 'type': 'block', 'children': ['19', '30', '53', '70', '89', '242', '253']}; {'id': '19', 'type': 'if_statement', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'empty'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'if_statement', 'children': ['31', '34', '42']}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '33'], 'value': '=='}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'bdp'"}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'req_cols'}; {'id': '38', 'type': 'list', 'children': ['39', '40', '41'], 'value': "['ticker', 'field', 'value']"}; {'id': '39', 'type': 'string', 'children': [], 'value': "'ticker'"}; {'id': '40', 'type': 'string', 'children': [], 'value': "'field'"}; {'id': '41', 'type': 'string', 'children': [], 'value': "'value'"}; {'id': '42', 'type': 'else_clause', 'children': ['43']}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'req_cols'}; {'id': '47', 'type': 'list', 'children': ['48', '49', '50', '51', '52'], 'value': "['ticker', 'field', 'name', 'value', 'position']"}; {'id': '48', 'type': 'string', 'children': [], 'value': "'ticker'"}; {'id': '49', 'type': 'string', 'children': [], 'value': "'field'"}; {'id': '50', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '51', 'type': 'string', 'children': [], 'value': "'value'"}; {'id': '52', 'type': 'string', 'children': [], 'value': "'position'"}; {'id': '53', 'type': 'if_statement', 'children': ['54', '63']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'any'}; {'id': '56', 'type': 'generator_expression', 'children': ['57', '60']}; {'id': '57', 'type': 'comparison_operator', 'children': ['58', '59'], 'value': 'not in'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '60', 'type': 'for_in_clause', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'req_cols'}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'return_statement', 'children': ['65']}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '69', 'type': 'argument_list', 'children': []}; {'id': '70', 'type': 'if_statement', 'children': ['71', '82']}; {'id': '71', 'type': 'attribute', 'children': ['72', '81']}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'dropna'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'keyword_argument', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'subset'}; {'id': '79', 'type': 'list', 'children': ['80'], 'value': "['value']"}; {'id': '80', 'type': 'string', 'children': [], 'value': "'value'"}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'empty'}; {'id': '82', 'type': 'block', 'children': ['83']}; {'id': '83', 'type': 'return_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '88', 'type': 'argument_list', 'children': []}; {'id': '89', 'type': 'if_statement', 'children': ['90', '93', '157']}; {'id': '90', 'type': 'comparison_operator', 'children': ['91', '92'], 'value': '=='}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '92', 'type': 'string', 'children': [], 'value': "'bdp'"}; {'id': '93', 'type': 'block', 'children': ['94']}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '97', 'type': 'call', 'children': ['98', '155']}; {'id': '98', 'type': 'attribute', 'children': ['99', '154']}; {'id': '99', 'type': 'call', 'children': ['100', '153']}; {'id': '100', 'type': 'attribute', 'children': ['101', '152']}; {'id': '101', 'type': 'call', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'concat'}; {'id': '110', 'type': 'argument_list', 'children': ['111', '146', '149']}; {'id': '111', 'type': 'list_comprehension', 'children': ['112', '136']}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'Series'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'dictionary', 'children': ['118', '123']}; {'id': '118', 'type': 'dictionary_splat', 'children': ['119']}; {'id': '119', 'type': 'dictionary', 'children': ['120']}; {'id': '120', 'type': 'pair', 'children': ['121', '122']}; {'id': '121', 'type': 'string', 'children': [], 'value': "'ticker'"}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '123', 'type': 'dictionary_splat', 'children': ['124']}; {'id': '124', 'type': 'call', 'children': ['125', '135']}; {'id': '125', 'type': 'attribute', 'children': ['126', '134']}; {'id': '126', 'type': 'attribute', 'children': ['127', '133']}; {'id': '127', 'type': 'call', 'children': ['128', '131']}; {'id': '128', 'type': 'attribute', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'grp'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'set_index'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'string', 'children': [], 'value': "'field'"}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'to_dict'}; {'id': '135', 'type': 'argument_list', 'children': []}; {'id': '136', 'type': 'for_in_clause', 'children': ['137', '140']}; {'id': '137', 'type': 'pattern_list', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'grp'}; {'id': '140', 'type': 'call', 'children': ['141', '144']}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'groupby'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'string', 'children': [], 'value': "'ticker'"}; {'id': '146', 'type': 'keyword_argument', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '148', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '149', 'type': 'keyword_argument', 'children': ['150', '151']}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '151', 'type': 'False', 'children': []}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'transpose'}; {'id': '153', 'type': 'argument_list', 'children': []}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'set_index'}; {'id': '155', 'type': 'argument_list', 'children': ['156']}; {'id': '156', 'type': 'string', 'children': [], 'value': "'ticker'"}; {'id': '157', 'type': 'else_clause', 'children': ['158']}; {'id': '158', 'type': 'block', 'children': ['159', '234']}; {'id': '159', 'type': 'expression_statement', 'children': ['160']}; {'id': '160', 'type': 'assignment', 'children': ['161', '162']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '162', 'type': 'call', 'children': ['163', '232']}; {'id': '163', 'type': 'attribute', 'children': ['164', '231']}; {'id': '164', 'type': 'call', 'children': ['165', '227']}; {'id': '165', 'type': 'attribute', 'children': ['166', '226']}; {'id': '166', 'type': 'call', 'children': ['167', '170']}; {'id': '167', 'type': 'attribute', 'children': ['168', '169']}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '170', 'type': 'argument_list', 'children': ['171']}; {'id': '171', 'type': 'call', 'children': ['172', '175']}; {'id': '172', 'type': 'attribute', 'children': ['173', '174']}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'concat'}; {'id': '175', 'type': 'argument_list', 'children': ['176', '223']}; {'id': '176', 'type': 'list_comprehension', 'children': ['177', '209']}; {'id': '177', 'type': 'call', 'children': ['178', '205']}; {'id': '178', 'type': 'attribute', 'children': ['179', '204']}; {'id': '179', 'type': 'call', 'children': ['180', '200']}; {'id': '180', 'type': 'attribute', 'children': ['181', '199']}; {'id': '181', 'type': 'call', 'children': ['182', '198']}; {'id': '182', 'type': 'attribute', 'children': ['183', '197']}; {'id': '183', 'type': 'call', 'children': ['184', '195']}; {'id': '184', 'type': 'attribute', 'children': ['185', '194']}; {'id': '185', 'type': 'subscript', 'children': ['186', '189', '191']}; {'id': '186', 'type': 'attribute', 'children': ['187', '188']}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'grp'}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'loc'}; {'id': '189', 'type': 'slice', 'children': ['190']}; {'id': '190', 'type': 'colon', 'children': []}; {'id': '191', 'type': 'list', 'children': ['192', '193'], 'value': "['name', 'value']"}; {'id': '192', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '193', 'type': 'string', 'children': [], 'value': "'value'"}; {'id': '194', 'type': 'identifier', 'children': [], 'value': 'set_index'}; {'id': '195', 'type': 'argument_list', 'children': ['196']}; {'id': '196', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '197', 'type': 'identifier', 'children': [], 'value': 'transpose'}; {'id': '198', 'type': 'argument_list', 'children': []}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'reset_index'}; {'id': '200', 'type': 'argument_list', 'children': ['201']}; {'id': '201', 'type': 'keyword_argument', 'children': ['202', '203']}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'drop'}; {'id': '203', 'type': 'True', 'children': []}; {'id': '204', 'type': 'identifier', 'children': [], 'value': 'assign'}; {'id': '205', 'type': 'argument_list', 'children': ['206']}; {'id': '206', 'type': 'keyword_argument', 'children': ['207', '208']}; {'id': '207', 'type': 'identifier', 'children': [], 'value': 'ticker'}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '209', 'type': 'for_in_clause', 'children': ['210', '215']}; {'id': '210', 'type': 'pattern_list', 'children': ['211', '214']}; {'id': '211', 'type': 'tuple_pattern', 'children': ['212', '213']}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '213', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '214', 'type': 'identifier', 'children': [], 'value': 'grp'}; {'id': '215', 'type': 'call', 'children': ['216', '219']}; {'id': '216', 'type': 'attribute', 'children': ['217', '218']}; {'id': '217', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '218', 'type': 'identifier', 'children': [], 'value': 'groupby'}; {'id': '219', 'type': 'argument_list', 'children': ['220']}; {'id': '220', 'type': 'list', 'children': ['221', '222'], 'value': "['ticker', 'position']"}; {'id': '221', 'type': 'string', 'children': [], 'value': "'ticker'"}; {'id': '222', 'type': 'string', 'children': [], 'value': "'position'"}; {'id': '223', 'type': 'keyword_argument', 'children': ['224', '225']}; {'id': '224', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '225', 'type': 'False', 'children': []}; {'id': '226', 'type': 'identifier', 'children': [], 'value': 'reset_index'}; {'id': '227', 'type': 'argument_list', 'children': ['228']}; {'id': '228', 'type': 'keyword_argument', 'children': ['229', '230']}; {'id': '229', 'type': 'identifier', 'children': [], 'value': 'drop'}; {'id': '230', 'type': 'True', 'children': []}; {'id': '231', 'type': 'identifier', 'children': [], 'value': 'set_index'}; {'id': '232', 'type': 'argument_list', 'children': ['233']}; {'id': '233', 'type': 'string', 'children': [], 'value': "'ticker'"}; {'id': '234', 'type': 'expression_statement', 'children': ['235']}; {'id': '235', 'type': 'assignment', 'children': ['236', '241']}; {'id': '236', 'type': 'attribute', 'children': ['237', '240']}; {'id': '237', 'type': 'attribute', 'children': ['238', '239']}; {'id': '238', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '239', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '240', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '241', 'type': 'None', 'children': []}; {'id': '242', 'type': 'if_statement', 'children': ['243', '246']}; {'id': '243', 'type': 'comparison_operator', 'children': ['244', '245'], 'value': 'is'}; {'id': '244', 'type': 'identifier', 'children': [], 'value': 'col_maps'}; {'id': '245', 'type': 'None', 'children': []}; {'id': '246', 'type': 'block', 'children': ['247']}; {'id': '247', 'type': 'expression_statement', 'children': ['248']}; {'id': '248', 'type': 'assignment', 'children': ['249', '250']}; {'id': '249', 'type': 'identifier', 'children': [], 'value': 'col_maps'}; {'id': '250', 'type': 'call', 'children': ['251', '252']}; {'id': '251', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '252', 'type': 'argument_list', 'children': []}; {'id': '253', 'type': 'return_statement', 'children': ['254']}; {'id': '254', 'type': 'call', 'children': ['255', '290']}; {'id': '255', 'type': 'attribute', 'children': ['256', '289']}; {'id': '256', 'type': 'call', 'children': ['257', '260']}; {'id': '257', 'type': 'attribute', 'children': ['258', '259']}; {'id': '258', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '259', 'type': 'identifier', 'children': [], 'value': 'rename'}; {'id': '260', 'type': 'argument_list', 'children': ['261']}; {'id': '261', 'type': 'keyword_argument', 'children': ['262', '263']}; {'id': '262', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '263', 'type': 'lambda', 'children': ['264', '266']}; {'id': '264', 'type': 'lambda_parameters', 'children': ['265']}; {'id': '265', 'type': 'identifier', 'children': [], 'value': 'vv'}; {'id': '266', 'type': 'call', 'children': ['267', '270']}; {'id': '267', 'type': 'attribute', 'children': ['268', '269']}; {'id': '268', 'type': 'identifier', 'children': [], 'value': 'col_maps'}; {'id': '269', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '270', 'type': 'argument_list', 'children': ['271', '272']}; {'id': '271', 'type': 'identifier', 'children': [], 'value': 'vv'}; {'id': '272', 'type': 'call', 'children': ['273', '286']}; {'id': '273', 'type': 'attribute', 'children': ['274', '285']}; {'id': '274', 'type': 'call', 'children': ['275', '282']}; {'id': '275', 'type': 'attribute', 'children': ['276', '281']}; {'id': '276', 'type': 'call', 'children': ['277', '280']}; {'id': '277', 'type': 'attribute', 'children': ['278', '279']}; {'id': '278', 'type': 'identifier', 'children': [], 'value': 'vv'}; {'id': '279', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '280', 'type': 'argument_list', 'children': []}; {'id': '281', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '282', 'type': 'argument_list', 'children': ['283', '284']}; {'id': '283', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '284', 'type': 'string', 'children': [], 'value': "'_'"}; {'id': '285', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '286', 'type': 'argument_list', 'children': ['287', '288']}; {'id': '287', 'type': 'string', 'children': [], 'value': "'-'"}; {'id': '288', 'type': 'string', 'children': [], 'value': "'_'"}; {'id': '289', 'type': 'identifier', 'children': [], 'value': 'apply'}; {'id': '290', 'type': 'argument_list', 'children': ['291', '294', '297']}; {'id': '291', 'type': 'attribute', 'children': ['292', '293']}; {'id': '292', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '293', 'type': 'identifier', 'children': [], 'value': 'to_numeric'}; {'id': '294', 'type': 'keyword_argument', 'children': ['295', '296']}; {'id': '295', 'type': 'identifier', 'children': [], 'value': 'errors'}; {'id': '296', 'type': 'string', 'children': [], 'value': "'ignore'"}; {'id': '297', 'type': 'keyword_argument', 'children': ['298', '299']}; {'id': '298', 'type': 'identifier', 'children': [], 'value': 'downcast'}; {'id': '299', 'type': 'string', 'children': [], 'value': "'float'"}
Format `pdblp` outputs to column-based results Args: data: `pdblp` result source: `bdp` or `bds` col_maps: rename columns with these mappings Returns: pd.DataFrame Examples: >>> format_output( ... data=pd.read_pickle('xbbg/tests/data/sample_bdp.pkl'), ... source='bdp' ... ).reset_index() ticker name 0 QQQ US Equity INVESCO QQQ TRUST SERIES 1 1 SPY US Equity SPDR S&P 500 ETF TRUST >>> format_output( ... data=pd.read_pickle('xbbg/tests/data/sample_dvd.pkl'), ... source='bds', col_maps={'Dividend Frequency': 'dvd_freq'} ... ).loc[:, ['ex_date', 'dividend_amount', 'dvd_freq']].reset_index() ticker ex_date dividend_amount dvd_freq 0 C US Equity 2018-02-02 0.32 Quarter
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'activateDendrites'}; {'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': 'learn'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '27', '56', '85', '101', '117', '123', '129']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '14']}; {'id': '11', 'type': 'tuple_pattern', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'numActiveConnected'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'numActivePotential'}; {'id': '14', 'type': 'call', 'children': ['15', '20']}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'connections'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'computeActivity'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'activeCells'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'connectedPermanence'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'activeSegments'}; {'id': '30', 'type': 'generator_expression', 'children': ['31', '39', '48']}; {'id': '31', 'type': 'call', 'children': ['32', '37']}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'connections'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'segmentForFlatIdx'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '39', 'type': 'for_in_clause', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'numActiveConnected'}; {'id': '48', 'type': 'if_clause', 'children': ['49']}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '53'], 'value': '>='}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'numActiveConnected'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'activationThreshold'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'matchingSegments'}; {'id': '59', 'type': 'generator_expression', 'children': ['60', '68', '77']}; {'id': '60', 'type': 'call', 'children': ['61', '66']}; {'id': '61', 'type': 'attribute', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'connections'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'segmentForFlatIdx'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '68', 'type': 'for_in_clause', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'numActivePotential'}; {'id': '77', 'type': 'if_clause', 'children': ['78']}; {'id': '78', 'type': 'comparison_operator', 'children': ['79', '82'], 'value': '>='}; {'id': '79', 'type': 'subscript', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'numActivePotential'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'minThreshold'}; {'id': '85', 'type': 'expression_statement', 'children': ['86']}; {'id': '86', 'type': 'assignment', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'activeSegments'}; {'id': '90', 'type': 'call', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '92', 'type': 'argument_list', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'activeSegments'}; {'id': '94', 'type': 'keyword_argument', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '96', 'type': 'attribute', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'connections'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'segmentPositionSortKey'}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'assignment', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'matchingSegments'}; {'id': '106', 'type': 'call', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '108', 'type': 'argument_list', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'matchingSegments'}; {'id': '110', 'type': 'keyword_argument', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '112', 'type': 'attribute', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'connections'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'segmentPositionSortKey'}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'assignment', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'numActiveConnectedSynapsesForSegment'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'numActiveConnected'}; {'id': '123', 'type': 'expression_statement', 'children': ['124']}; {'id': '124', 'type': 'assignment', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'numActivePotentialSynapsesForSegment'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'numActivePotential'}; {'id': '129', 'type': 'if_statement', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'learn'}; {'id': '131', 'type': 'block', 'children': ['132', '150']}; {'id': '132', 'type': 'for_statement', 'children': ['133', '134', '137']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'segment'}; {'id': '134', 'type': 'attribute', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'activeSegments'}; {'id': '137', 'type': 'block', 'children': ['138']}; {'id': '138', 'type': 'expression_statement', 'children': ['139']}; {'id': '139', 'type': 'assignment', 'children': ['140', '147']}; {'id': '140', 'type': 'subscript', 'children': ['141', '144']}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'lastUsedIterationForSegment'}; {'id': '144', 'type': 'attribute', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'segment'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'flatIdx'}; {'id': '147', 'type': 'attribute', 'children': ['148', '149']}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '150', 'type': 'expression_statement', 'children': ['151']}; {'id': '151', 'type': 'augmented_assignment', 'children': ['152', '155'], 'value': '+='}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '155', 'type': 'integer', 'children': [], 'value': '1'}
Calculate dendrite segment activity, using the current active cells. :param learn: (bool) If true, segment activations will be recorded. This information is used during segment cleanup. **Pseudocode:** :: for each distal dendrite segment with activity >= activationThreshold mark the segment as active for each distal dendrite segment with unconnected activity >= minThreshold mark the segment as matching
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'instruction_to_svg_dict'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'instruction_or_id'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'copy_result'}; {'id': '8', 'type': 'True', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '19', '53', '63']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'instruction_id'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'get_instruction_id'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'instruction_or_id'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '25', '34']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '22'], 'value': 'in'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'instruction_id'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_cache'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '29', 'type': 'subscript', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_cache'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'instruction_id'}; {'id': '34', 'type': 'else_clause', 'children': ['35']}; {'id': '35', 'type': 'block', 'children': ['36', '45']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '_instruction_to_svg_dict'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'instruction_id'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '52']}; {'id': '47', 'type': 'subscript', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': '_cache'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'instruction_id'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '53', 'type': 'if_statement', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'copy_result'}; {'id': '55', 'type': 'block', 'children': ['56']}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'deepcopy'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'result'}
Return the SVG dict for the SVGBuilder. :param instruction_or_id: the instruction or id, see :meth:`get_instruction_id` :param bool copy_result: whether to copy the result :rtype: dict The result is cached.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'filter_list'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'lst'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '6', 'type': 'block', 'children': ['7', '63', '72']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '18', '41']}; {'id': '8', 'type': 'boolean_operator', 'children': ['9', '13'], 'value': 'and'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'is_fnmatch_regex'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '13', 'type': 'not_operator', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'is_regex'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '18', 'type': 'block', 'children': ['19', '31']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': "'Using fnmatch for {0}'"}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'filst'}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'fnmatch'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'lst'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '41', 'type': 'else_clause', 'children': ['42']}; {'id': '42', 'type': 'block', 'children': ['43', '55']}; {'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': 'log'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'string', 'children': [], 'value': "'Using regex match for {0}'"}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'filst'}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'match_list'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'lst'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '63', 'type': 'if_statement', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'filst'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'filst'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '71', 'type': 'argument_list', 'children': []}; {'id': '72', 'type': 'return_statement', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'filst'}
Filters the lst using pattern. If pattern starts with '(' it will be considered a re regular expression, otherwise it will use fnmatch filter. :param lst: list of strings :param pattern: string :return: list of strings Filtered list of strings
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'send_command'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'with_statement', 'children': ['8', '13']}; {'id': '8', 'type': 'with_clause', 'children': ['9']}; {'id': '9', 'type': 'with_item', 'children': ['10']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_lock'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'try_statement', 'children': ['15', '79']}; {'id': '15', 'type': 'block', 'children': ['16', '30', '38', '69', '77']}; {'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': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_socket'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'send'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'encode'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"utf8"'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'receive'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'while_statement', 'children': ['39', '52']}; {'id': '39', 'type': 'boolean_operator', 'children': ['40', '46'], 'value': 'or'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"S"'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'string', 'children': [], 'value': '"NEW"'}; {'id': '52', 'type': 'block', 'children': ['53', '61']}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_LOGGER'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '60']}; {'id': '59', 'type': 'string', 'children': [], 'value': '"!Got response: %s"'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'receive'}; {'id': '68', 'type': 'argument_list', 'children': []}; {'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': '_LOGGER'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '76']}; {'id': '75', 'type': 'string', 'children': [], 'value': '"Received: %s"'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '77', 'type': 'return_statement', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '79', 'type': 'except_clause', 'children': ['80', '86']}; {'id': '80', 'type': 'as_pattern', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'socket'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '84', 'type': 'as_pattern_target', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '86', 'type': 'block', 'children': ['87', '95', '101']}; {'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': '"Error sending command: %s"'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'connect'}; {'id': '100', 'type': 'argument_list', 'children': []}; {'id': '101', 'type': 'return_statement', 'children': ['102']}; {'id': '102', 'type': 'string', 'children': [], 'value': '""'}
Send TCP command to hub and return response.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'restart'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '25', '67', '73', '108']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '9', 'type': 'integer', 'children': [], 'value': '60'}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sleep_n'}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'binary_operator', 'children': ['17', '24'], 'value': '*'}; {'id': '17', 'type': 'binary_operator', 'children': ['18', '23'], 'value': '/'}; {'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': 'env'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'max_restart_wait_minutes'}; {'id': '23', 'type': 'float', 'children': [], 'value': '10.'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '60'}; {'id': '25', 'type': 'for_statement', 'children': ['26', '27', '31']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '31', 'type': 'block', 'children': ['32', '38', '51', '60']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'if_statement', 'children': ['39', '49']}; {'id': '39', 'type': 'boolean_operator', 'children': ['40', '43'], 'value': 'or'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'dryrun'}; {'id': '43', 'type': 'not_operator', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'is_running'}; {'id': '48', 'type': 'argument_list', 'children': []}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'break_statement', 'children': []}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'binary_operator', 'children': ['56', '57'], 'value': '%'}; {'id': '56', 'type': 'string', 'children': [], 'value': "'Waiting for supervisor to stop (%i of %i)...'"}; {'id': '57', 'type': 'tuple', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'n'}; {'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': 'time'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'sleep'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sleep_n'}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '72', 'type': 'argument_list', 'children': []}; {'id': '73', 'type': 'for_statement', 'children': ['74', '75', '79']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '79', 'type': 'block', 'children': ['80', '92', '101']}; {'id': '80', 'type': 'if_statement', 'children': ['81', '90']}; {'id': '81', 'type': 'boolean_operator', 'children': ['82', '85'], 'value': 'or'}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'dryrun'}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'is_running'}; {'id': '89', 'type': 'argument_list', 'children': []}; {'id': '90', 'type': 'block', 'children': ['91']}; {'id': '91', 'type': 'return_statement', 'children': []}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'call', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'binary_operator', 'children': ['97', '98'], 'value': '%'}; {'id': '97', 'type': 'string', 'children': [], 'value': "'Waiting for supervisor to start (%i of %i)...'"}; {'id': '98', 'type': 'tuple', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'sleep'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'sleep_n'}; {'id': '108', 'type': 'raise_statement', 'children': ['109']}; {'id': '109', 'type': 'call', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'binary_operator', 'children': ['113', '114'], 'value': '%'}; {'id': '113', 'type': 'string', 'children': [], 'value': "'Failed to restart service %s!'"}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'name'}
Supervisor can take a very long time to start and stop, so wait for it.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'list'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'ignore_patterns'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'for_statement', 'children': ['8', '9', '17']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'storage'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'itervalues'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'storages'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'if_statement', 'children': ['19', '25']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'storage'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'string', 'children': [], 'value': "''"}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'for_statement', 'children': ['27', '28', '35']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'get_files'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'storage'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'ignore_patterns'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'yield', 'children': ['38']}; {'id': '38', 'type': 'expression_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'storage'}
List all files in all app storages.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '__getOptimizedMetricLabel'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '21', '68']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'matchingKeys'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'matchPatterns'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '16']}; {'id': '12', 'type': 'list', 'children': ['13'], 'value': '[self._optimizeKeyPattern]'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_optimizeKeyPattern'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_getMetricLabels'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'if_statement', 'children': ['22', '28', '47']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '27'], 'value': '=='}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'matchingKeys'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'raise_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'binary_operator', 'children': ['34', '37', '38'], 'value': '%'}; {'id': '34', 'type': 'concatenated_string', 'children': ['35', '36']}; {'id': '35', 'type': 'string', 'children': [], 'value': '"None of the generated metrics match the specified "'}; {'id': '36', 'type': 'string', 'children': [], 'value': '"optimization pattern: %s. Available metrics are %s"'}; {'id': '37', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '38', 'type': 'tuple', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_optimizeKeyPattern'}; {'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': '_getMetricLabels'}; {'id': '46', 'type': 'argument_list', 'children': []}; {'id': '47', 'type': 'elif_clause', 'children': ['48', '54']}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '53'], 'value': '>'}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'matchingKeys'}; {'id': '53', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'raise_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '63'], 'value': '%'}; {'id': '60', 'type': 'concatenated_string', 'children': ['61', '62']}; {'id': '61', 'type': 'string', 'children': [], 'value': '"The specified optimization pattern \'%s\' matches more "'}; {'id': '62', 'type': 'string', 'children': [], 'value': '"than one metric: %s"'}; {'id': '63', 'type': 'tuple', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_optimizeKeyPattern'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'matchingKeys'}; {'id': '68', 'type': 'return_statement', 'children': ['69']}; {'id': '69', 'type': 'subscript', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'matchingKeys'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '0'}
Get the label for the metric being optimized. This function also caches the label in the instance variable self._optimizedMetricLabel Parameters: ----------------------------------------------------------------------- metricLabels: A sequence of all the labels being computed for this model Returns: The label for the metric being optmized over
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'to_shapely_polygon'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10']}; {'id': '6', 'type': 'import_statement', 'children': ['7']}; {'id': '7', 'type': 'dotted_name', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'shapely'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'geometry'}; {'id': '10', 'type': 'return_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'shapely'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'geometry'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'Polygon'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'list_comprehension', 'children': ['19', '26']}; {'id': '19', 'type': 'tuple', 'children': ['20', '23']}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'point'}; {'id': '22', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '23', 'type': 'subscript', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'point'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '26', 'type': 'for_in_clause', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'point'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'exterior'}
Convert this polygon to a Shapely polygon. Returns ------- shapely.geometry.Polygon The Shapely polygon matching this polygon's exterior.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'valid'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_default_parameter', 'children': ['6', '7', '9']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'type', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '12', 'type': 'block', 'children': ['13', '52', '69', '86']}; {'id': '13', 'type': 'if_statement', 'children': ['14', '17']}; {'id': '14', 'type': 'comparison_operator', 'children': ['15', '16'], 'value': 'is'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18', '30', '38']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'epoch'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25', '26', '27', '28', '29']}; {'id': '24', 'type': 'integer', 'children': [], 'value': '1970'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '29', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'now'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'utcnow'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '51']}; {'id': '45', 'type': 'attribute', 'children': ['46', '50']}; {'id': '46', 'type': '()', 'children': ['47']}; {'id': '47', 'type': 'binary_operator', 'children': ['48', '49'], 'value': '-'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'now'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'epoch'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'total_seconds'}; {'id': '51', 'type': 'argument_list', 'children': []}; {'id': '52', 'type': 'if_statement', 'children': ['53', '66']}; {'id': '53', 'type': 'boolean_operator', 'children': ['54', '61'], 'value': 'and'}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '56', 'type': 'argument_list', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'valid_from'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '61', 'type': 'comparison_operator', 'children': ['62', '63'], 'value': '<'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'valid_from'}; {'id': '66', 'type': 'block', 'children': ['67']}; {'id': '67', 'type': 'return_statement', 'children': ['68']}; {'id': '68', 'type': 'False', 'children': []}; {'id': '69', 'type': 'if_statement', 'children': ['70', '83']}; {'id': '70', 'type': 'boolean_operator', 'children': ['71', '78'], 'value': 'and'}; {'id': '71', 'type': 'call', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '73', 'type': 'argument_list', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'valid_to'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '78', 'type': 'comparison_operator', 'children': ['79', '80'], 'value': '>'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'valid_to'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'False', 'children': []}; {'id': '86', 'type': 'return_statement', 'children': ['87']}; {'id': '87', 'type': 'True', 'children': []}
Is the token valid? This method only checks the timestamps within the token and compares them against the current time if none is provided. :param time: The timestamp to validate against :type time: Union[int, None] :return: The validity of the token. :rtype: bool
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_all_checkpoints'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'rundir'}; {'id': '6', 'type': 'string', 'children': [], 'value': '"runinfo"'}; {'id': '7', 'type': 'block', 'children': ['8', '22', '34', '38', '76']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '19']}; {'id': '9', 'type': '()', 'children': ['10']}; {'id': '10', 'type': 'not_operator', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'isdir'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'rundir'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'listdir'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'rundir'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'checkpoints'}; {'id': '37', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '38', 'type': 'for_statement', 'children': ['39', '40', '41']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'runid'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '41', 'type': 'block', 'children': ['42', '59']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'checkpoint'}; {'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': 'os'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'abspath'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'string', 'children': [], 'value': "'{}/{}/checkpoint'"}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '56', 'type': 'argument_list', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'rundir'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'runid'}; {'id': '59', 'type': 'if_statement', 'children': ['60', '68']}; {'id': '60', 'type': 'call', 'children': ['61', '66']}; {'id': '61', 'type': 'attribute', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'isdir'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'checkpoint'}; {'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': 'checkpoints'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'checkpoint'}; {'id': '76', 'type': 'return_statement', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'checkpoints'}
Finds the checkpoints from all last runs. Note that checkpoints are incremental, and this helper will not find previous checkpoints from earlier than the most recent run. It probably should be made to do so. Kwargs: - rundir(str) : Path to the runinfo directory Returns: - a list suitable for the checkpointFiles parameter of DataFlowKernel constructor
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create_body_index'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'xml_string'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '19', '45']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'xml'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ET'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'fromstring'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'xml_string'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'body_to_index'}; {'id': '18', 'type': 'dictionary', 'children': []}; {'id': '19', 'type': 'for_statement', 'children': ['20', '23', '32']}; {'id': '20', 'type': 'pattern_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'xml'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'findall'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'string', 'children': [], 'value': '"*/Body/Name"'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '44']}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'body_to_index'}; {'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': 'body'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'body_to_index'}
Extract a name to index dictionary from 6dof settings xml
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dragMouseButtonLeft'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'coord'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'dest_coord'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'interval'}; {'id': '9', 'type': 'float', 'children': [], 'value': '0.5'}; {'id': '10', 'type': 'block', 'children': ['11', '15', '29']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'modFlags'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_queueMouseButton'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22', '25', '26']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'coord'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'Quartz'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'kCGMouseButtonLeft'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'modFlags'}; {'id': '26', 'type': 'keyword_argument', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'dest_coord'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'dest_coord'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_postQueuedEvents'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'interval'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'interval'}
Drag the left mouse button without modifiers pressed. Parameters: coordinates to click on screen (tuple (x, y)) dest coordinates to drag to (tuple (x, y)) interval to send event of btn down, drag and up Returns: None
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'copy_web_file_to_local'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'file_path'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'target_path'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '26', '37']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'response'}; {'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': 'urllib'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'urlopen'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'file_path'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'target_path'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'w'"}; {'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': 'f'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '36', 'type': 'argument_list', 'children': []}; {'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': 'f'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '42', 'type': 'argument_list', 'children': []}
Copies a file from its location on the web to a designated place on the local machine. Args: file_path: Complete url of the file to copy, string (e.g. http://fool.com/input.css). target_path: Path and name of file on the local machine, string. (e.g. /directory/output.css) Returns: None.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'task_or_dryrun'}; {'id': '3', 'type': 'parameters', 'children': ['4', '6']}; {'id': '4', 'type': 'list_splat_pattern', 'children': ['5']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '6', 'type': 'dictionary_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '8', 'type': 'block', 'children': ['9', '19', '29', '39', '53', '59', '65']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'invoked'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'boolean_operator', 'children': ['16', '18'], 'value': 'or'}; {'id': '16', 'type': 'not_operator', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'task_class'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': '"task_class"'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'WrappedCallableTask'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '34']}; {'id': '31', 'type': 'pattern_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '34', 'type': 'expression_list', 'children': ['35', '38']}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '38', 'type': 'tuple', 'children': []}; {'id': '39', 'type': 'function_definition', 'children': ['40', '41', '43']}; {'id': '40', 'type': 'function_name', 'children': [], 'value': 'wrapper'}; {'id': '41', 'type': 'parameters', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'task_class'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49', '51']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '49', 'type': 'list_splat', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '51', 'type': 'dictionary_splat', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'wrapper'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'is_task_or_dryrun'}; {'id': '58', 'type': 'True', 'children': []}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'wrapper'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'wrapped'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'conditional_expression', 'children': ['67', '68', '69'], 'value': 'if'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'wrapper'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'invoked'}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'wrapper'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'func'}
Decorator declaring the wrapped function to be a new-style task. May be invoked as a simple, argument-less decorator (i.e. ``@task``) or with arguments customizing its behavior (e.g. ``@task(alias='myalias')``). Please see the :ref:`new-style task <task-decorator>` documentation for details on how to use this decorator. .. versionchanged:: 1.2 Added the ``alias``, ``aliases``, ``task_class`` and ``default`` keyword arguments. See :ref:`task-decorator-arguments` for details. .. versionchanged:: 1.5 Added the ``name`` keyword argument. .. seealso:: `~fabric.docs.unwrap_tasks`, `~fabric.tasks.WrappedCallableTask`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'save_training_log'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'dictionary_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '7', 'type': 'block', 'children': ['8', '15', '29', '42', '51']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_fill_project_info'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'dictionary', 'children': ['22']}; {'id': '22', 'type': 'pair', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': "'time'"}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'utcnow'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_result'}; {'id': '32', 'type': 'call', 'children': ['33', '40']}; {'id': '33', 'type': 'attribute', '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': 'db'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'TrainLog'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'insert_one'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': '_log'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': '_print_dict'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '59'], 'value': '+'}; {'id': '58', 'type': 'string', 'children': [], 'value': '"[Database] train log: "'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_log'}
Saves the training log, timestamp will be added automatically. Parameters ----------- kwargs : logging information Events, such as accuracy, loss, step number and etc. Examples --------- >>> db.save_training_log(accuracy=0.33, loss=0.98)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'is_fully_within_image'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'image'}; {'id': '6', 'type': 'block', 'children': ['7', '14', '25']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'normalize_shape'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'image'}; {'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': 'height'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'width'}; {'id': '19', 'type': 'subscript', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '21', 'type': 'slice', 'children': ['22', '23', '24']}; {'id': '22', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '23', 'type': 'colon', 'children': []}; {'id': '24', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'boolean_operator', 'children': ['27', '44'], 'value': 'and'}; {'id': '27', 'type': 'boolean_operator', 'children': ['28', '39'], 'value': 'and'}; {'id': '28', 'type': 'boolean_operator', 'children': ['29', '34'], 'value': 'and'}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '33'], 'value': '>='}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'x1'}; {'id': '33', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '38'], 'value': '<'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'x2'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'width'}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '43'], 'value': '>='}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'y1'}; {'id': '43', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '48'], 'value': '<'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'y2'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'height'}
Estimate whether the bounding box is fully inside the image area. Parameters ---------- image : (H,W,...) ndarray or tuple of int Image dimensions to use. If an ndarray, its shape will be used. If a tuple, it is assumed to represent the image shape and must contain at least two integers. Returns ------- bool True if the bounding box is fully inside the image area. False otherwise.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_object'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '25']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'string', 'children': [], 'value': '"."'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'model_name'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '34']}; {'id': '27', 'type': 'attribute', 'children': ['28', '33']}; {'id': '28', 'type': 'subscript', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'models'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'model_name'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'get_object'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'string', 'children': [], 'value': '"."'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'parts'}
Retrieve an object by its absolute name.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'bootstrap'}; {'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': 'force'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'block', 'children': ['9', '16', '27', '33', '120', '127']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'force'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'force'}; {'id': '16', 'type': 'if_statement', 'children': ['17', '25']}; {'id': '17', 'type': 'boolean_operator', 'children': ['18', '23'], 'value': 'and'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'has_pip'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'not_operator', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'force'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'return_statement', 'children': []}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'local_renderer'}; {'id': '33', 'type': 'if_statement', 'children': ['34', '41', '49', '91', '107']}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '40'], 'value': '=='}; {'id': '35', 'type': 'attribute', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'bootstrap_method'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'GET_PIP'}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'sudo'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'string', 'children': [], 'value': "'curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | python'"}; {'id': '49', 'type': 'elif_clause', 'children': ['50', '57']}; {'id': '50', 'type': 'comparison_operator', 'children': ['51', '56'], 'value': '=='}; {'id': '51', 'type': 'attribute', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'bootstrap_method'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'EZ_SETUP'}; {'id': '57', 'type': 'block', 'children': ['58', '65', '84']}; {'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': 'r'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'string', 'children': [], 'value': "'wget http://peak.telecommunity.com/dist/ez_setup.py -O /tmp/ez_setup.py'"}; {'id': '65', 'type': 'with_statement', 'children': ['66', '76']}; {'id': '66', 'type': 'with_clause', 'children': ['67']}; {'id': '67', 'type': 'with_item', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'keyword_argument', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'warn_only'}; {'id': '75', 'type': 'True', 'children': []}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'sudo'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'string', 'children': [], 'value': "'python /tmp/ez_setup.py -U setuptools'"}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'sudo'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'string', 'children': [], 'value': "'easy_install -U pip'"}; {'id': '91', 'type': 'elif_clause', 'children': ['92', '99']}; {'id': '92', 'type': 'comparison_operator', 'children': ['93', '98'], 'value': '=='}; {'id': '93', 'type': 'attribute', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'bootstrap_method'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'PYTHON_PIP'}; {'id': '99', 'type': 'block', 'children': ['100']}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'call', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'sudo'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'string', 'children': [], 'value': "'apt-get install -y python-pip'"}; {'id': '107', 'type': 'else_clause', 'children': ['108']}; {'id': '108', 'type': 'block', 'children': ['109']}; {'id': '109', 'type': 'raise_statement', 'children': ['110']}; {'id': '110', 'type': 'call', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'NotImplementedError'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'binary_operator', 'children': ['114', '115'], 'value': '%'}; {'id': '114', 'type': 'string', 'children': [], 'value': "'Unknown pip bootstrap method: %s'"}; {'id': '115', 'type': 'attribute', 'children': ['116', '119']}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'bootstrap_method'}; {'id': '120', 'type': 'expression_statement', 'children': ['121']}; {'id': '121', 'type': 'call', 'children': ['122', '125']}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'sudo'}; {'id': '125', 'type': 'argument_list', 'children': ['126']}; {'id': '126', 'type': 'string', 'children': [], 'value': "'pip {quiet_flag} install --upgrade pip'"}; {'id': '127', 'type': 'expression_statement', 'children': ['128']}; {'id': '128', 'type': 'call', 'children': ['129', '132']}; {'id': '129', 'type': 'attribute', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'sudo'}; {'id': '132', 'type': 'argument_list', 'children': ['133']}; {'id': '133', 'type': 'string', 'children': [], 'value': "'pip {quiet_flag} install --upgrade virtualenv'"}
Installs all the necessary packages necessary for managing virtual environments with pip.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'tf_import_demo_experience'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'internals'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'terminal'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'reward'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'demo_memory'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '22', '25', '28', '31']}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'internals'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'internals'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'terminal'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'terminal'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'reward'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'reward'}
Imports a single experience to memory.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'aov_theta'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'times'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'mags'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'errs'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'frequency'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'binsize'}; {'id': '10', 'type': 'float', 'children': [], 'value': '0.05'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'minbin'}; {'id': '13', 'type': 'integer', 'children': [], 'value': '9'}; {'id': '14', 'type': 'block', 'children': ['15', '21', '27', '43', '49', '55', '64', '70', '78', '82', '86', '90', '94', '101', '197', '204', '211', '218', '230', '242', '248']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'period'}; {'id': '18', 'type': 'binary_operator', 'children': ['19', '20'], 'value': '/'}; {'id': '19', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'frequency'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'fold_time'}; {'id': '24', 'type': 'subscript', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'times'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'phased'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'phase_magseries'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34', '35', '36', '37', '40']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'times'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'mags'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'period'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'fold_time'}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'wrap'}; {'id': '39', 'type': 'False', 'children': []}; {'id': '40', 'type': 'keyword_argument', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '42', 'type': 'True', 'children': []}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'phases'}; {'id': '46', 'type': 'subscript', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'phased'}; {'id': '48', 'type': 'string', 'children': [], 'value': "'phase'"}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'pmags'}; {'id': '52', 'type': 'subscript', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'phased'}; {'id': '54', 'type': 'string', 'children': [], 'value': "'mags'"}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'bins'}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'nparange'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62', '63']}; {'id': '61', 'type': 'float', 'children': [], 'value': '0.0'}; {'id': '62', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'binsize'}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'ndets'}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'phases'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'binnedphaseinds'}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'npdigitize'}; {'id': '75', 'type': 'argument_list', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'phases'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'bins'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'bin_s1_tops'}; {'id': '81', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'bin_s2_tops'}; {'id': '85', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'binndets'}; {'id': '89', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'assignment', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'goodbins'}; {'id': '93', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'all_xbar'}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'npmedian'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'pmags'}; {'id': '101', 'type': 'for_statement', 'children': ['102', '103', '107']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '103', 'type': 'call', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'npunique'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'binnedphaseinds'}; {'id': '107', 'type': 'block', 'children': ['108', '114', '120']}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'assignment', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'thisbin_inds'}; {'id': '111', 'type': 'comparison_operator', 'children': ['112', '113'], 'value': '=='}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'binnedphaseinds'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '114', 'type': 'expression_statement', 'children': ['115']}; {'id': '115', 'type': 'assignment', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'thisbin_mags'}; {'id': '117', 'type': 'subscript', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'pmags'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'thisbin_inds'}; {'id': '120', 'type': 'if_statement', 'children': ['121', '126']}; {'id': '121', 'type': 'comparison_operator', 'children': ['122', '125'], 'value': '>'}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'thisbin_mags'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'minbin'}; {'id': '126', 'type': 'block', 'children': ['127', '133', '140', '155', '170', '177', '184', '191']}; {'id': '127', 'type': 'expression_statement', 'children': ['128']}; {'id': '128', 'type': 'assignment', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'thisbin_ndet'}; {'id': '130', 'type': 'attribute', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'thisbin_mags'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '133', 'type': 'expression_statement', 'children': ['134']}; {'id': '134', 'type': 'assignment', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'thisbin_xbar'}; {'id': '136', 'type': 'call', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'npmedian'}; {'id': '138', 'type': 'argument_list', 'children': ['139']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'thisbin_mags'}; {'id': '140', 'type': 'expression_statement', 'children': ['141']}; {'id': '141', 'type': 'assignment', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'thisbin_s1_top'}; {'id': '143', 'type': '()', 'children': ['144']}; {'id': '144', 'type': 'binary_operator', 'children': ['145', '151'], 'value': '*'}; {'id': '145', 'type': 'binary_operator', 'children': ['146', '147'], 'value': '*'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'thisbin_ndet'}; {'id': '147', 'type': '()', 'children': ['148']}; {'id': '148', 'type': 'binary_operator', 'children': ['149', '150'], 'value': '-'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'thisbin_xbar'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'all_xbar'}; {'id': '151', 'type': '()', 'children': ['152']}; {'id': '152', 'type': 'binary_operator', 'children': ['153', '154'], 'value': '-'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'thisbin_xbar'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'all_xbar'}; {'id': '155', 'type': 'expression_statement', 'children': ['156']}; {'id': '156', 'type': 'assignment', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'thisbin_s2_top'}; {'id': '158', 'type': 'call', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'npsum'}; {'id': '160', 'type': 'argument_list', 'children': ['161']}; {'id': '161', 'type': 'binary_operator', 'children': ['162', '166'], 'value': '*'}; {'id': '162', 'type': '()', 'children': ['163']}; {'id': '163', 'type': 'binary_operator', 'children': ['164', '165'], 'value': '-'}; {'id': '164', 'type': 'identifier', 'children': [], 'value': 'thisbin_mags'}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'all_xbar'}; {'id': '166', 'type': '()', 'children': ['167']}; {'id': '167', 'type': 'binary_operator', 'children': ['168', '169'], 'value': '-'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'thisbin_mags'}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'all_xbar'}; {'id': '170', 'type': 'expression_statement', 'children': ['171']}; {'id': '171', 'type': 'call', 'children': ['172', '175']}; {'id': '172', 'type': 'attribute', 'children': ['173', '174']}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'bin_s1_tops'}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '175', 'type': 'argument_list', 'children': ['176']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'thisbin_s1_top'}; {'id': '177', 'type': 'expression_statement', 'children': ['178']}; {'id': '178', 'type': 'call', 'children': ['179', '182']}; {'id': '179', 'type': 'attribute', 'children': ['180', '181']}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'bin_s2_tops'}; {'id': '181', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '182', 'type': 'argument_list', 'children': ['183']}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'thisbin_s2_top'}; {'id': '184', 'type': 'expression_statement', 'children': ['185']}; {'id': '185', 'type': 'call', 'children': ['186', '189']}; {'id': '186', 'type': 'attribute', 'children': ['187', '188']}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'binndets'}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '189', 'type': 'argument_list', 'children': ['190']}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'thisbin_ndet'}; {'id': '191', 'type': 'expression_statement', 'children': ['192']}; {'id': '192', 'type': 'assignment', 'children': ['193', '194']}; {'id': '193', 'type': 'identifier', 'children': [], 'value': 'goodbins'}; {'id': '194', 'type': 'binary_operator', 'children': ['195', '196'], 'value': '+'}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'goodbins'}; {'id': '196', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '197', 'type': 'expression_statement', 'children': ['198']}; {'id': '198', 'type': 'assignment', 'children': ['199', '200']}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'bin_s1_tops'}; {'id': '200', 'type': 'call', 'children': ['201', '202']}; {'id': '201', 'type': 'identifier', 'children': [], 'value': 'nparray'}; {'id': '202', 'type': 'argument_list', 'children': ['203']}; {'id': '203', 'type': 'identifier', 'children': [], 'value': 'bin_s1_tops'}; {'id': '204', 'type': 'expression_statement', 'children': ['205']}; {'id': '205', 'type': 'assignment', 'children': ['206', '207']}; {'id': '206', 'type': 'identifier', 'children': [], 'value': 'bin_s2_tops'}; {'id': '207', 'type': 'call', 'children': ['208', '209']}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'nparray'}; {'id': '209', 'type': 'argument_list', 'children': ['210']}; {'id': '210', 'type': 'identifier', 'children': [], 'value': 'bin_s2_tops'}; {'id': '211', 'type': 'expression_statement', 'children': ['212']}; {'id': '212', 'type': 'assignment', 'children': ['213', '214']}; {'id': '213', 'type': 'identifier', 'children': [], 'value': 'binndets'}; {'id': '214', 'type': 'call', 'children': ['215', '216']}; {'id': '215', 'type': 'identifier', 'children': [], 'value': 'nparray'}; {'id': '216', 'type': 'argument_list', 'children': ['217']}; {'id': '217', 'type': 'identifier', 'children': [], 'value': 'binndets'}; {'id': '218', 'type': 'expression_statement', 'children': ['219']}; {'id': '219', 'type': 'assignment', 'children': ['220', '221']}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 's1'}; {'id': '221', 'type': 'binary_operator', 'children': ['222', '226'], 'value': '/'}; {'id': '222', 'type': 'call', 'children': ['223', '224']}; {'id': '223', 'type': 'identifier', 'children': [], 'value': 'npsum'}; {'id': '224', 'type': 'argument_list', 'children': ['225']}; {'id': '225', 'type': 'identifier', 'children': [], 'value': 'bin_s1_tops'}; {'id': '226', 'type': '()', 'children': ['227']}; {'id': '227', 'type': 'binary_operator', 'children': ['228', '229'], 'value': '-'}; {'id': '228', 'type': 'identifier', 'children': [], 'value': 'goodbins'}; {'id': '229', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '230', 'type': 'expression_statement', 'children': ['231']}; {'id': '231', 'type': 'assignment', 'children': ['232', '233']}; {'id': '232', 'type': 'identifier', 'children': [], 'value': 's2'}; {'id': '233', 'type': 'binary_operator', 'children': ['234', '238'], 'value': '/'}; {'id': '234', 'type': 'call', 'children': ['235', '236']}; {'id': '235', 'type': 'identifier', 'children': [], 'value': 'npsum'}; {'id': '236', 'type': 'argument_list', 'children': ['237']}; {'id': '237', 'type': 'identifier', 'children': [], 'value': 'bin_s2_tops'}; {'id': '238', 'type': '()', 'children': ['239']}; {'id': '239', 'type': 'binary_operator', 'children': ['240', '241'], 'value': '-'}; {'id': '240', 'type': 'identifier', 'children': [], 'value': 'ndets'}; {'id': '241', 'type': 'identifier', 'children': [], 'value': 'goodbins'}; {'id': '242', 'type': 'expression_statement', 'children': ['243']}; {'id': '243', 'type': 'assignment', 'children': ['244', '245']}; {'id': '244', 'type': 'identifier', 'children': [], 'value': 'theta_aov'}; {'id': '245', 'type': 'binary_operator', 'children': ['246', '247'], 'value': '/'}; {'id': '246', 'type': 'identifier', 'children': [], 'value': 's1'}; {'id': '247', 'type': 'identifier', 'children': [], 'value': 's2'}; {'id': '248', 'type': 'return_statement', 'children': ['249']}; {'id': '249', 'type': 'identifier', 'children': [], 'value': 'theta_aov'}
Calculates the Schwarzenberg-Czerny AoV statistic at a test frequency. Parameters ---------- times,mags,errs : np.array The input time-series and associated errors. frequency : float The test frequency to calculate the theta statistic at. binsize : float The phase bin size to use. minbin : int The minimum number of items in a phase bin to consider in the calculation of the statistic. Returns ------- theta_aov : float The value of the AoV statistic at the specified `frequency`.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'to_json'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12', '34']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is not'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'subreference'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'dictionary', 'children': ['15', '20']}; {'id': '15', 'type': 'pair', 'children': ['16', '17']}; {'id': '16', 'type': 'string', 'children': [], 'value': '"source"'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'objectId'}; {'id': '20', 'type': 'pair', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': '"selector"'}; {'id': '22', 'type': 'dictionary', 'children': ['23', '26', '29']}; {'id': '23', 'type': 'pair', 'children': ['24', '25']}; {'id': '24', 'type': 'string', 'children': [], 'value': '"type"'}; {'id': '25', 'type': 'string', 'children': [], 'value': '"FragmentSelector"'}; {'id': '26', 'type': 'pair', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': '"conformsTo"'}; {'id': '28', 'type': 'string', 'children': [], 'value': '"http://ontology-dts.org/terms/subreference"'}; {'id': '29', 'type': 'pair', 'children': ['30', '31']}; {'id': '30', 'type': 'string', 'children': [], 'value': '"value"'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'subreference'}; {'id': '34', 'type': 'else_clause', 'children': ['35']}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'dictionary', 'children': ['38']}; {'id': '38', 'type': 'pair', 'children': ['39', '40']}; {'id': '39', 'type': 'string', 'children': [], 'value': '"source"'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'objectId'}
Method to call to get a serializable object for json.dump or jsonify based on the target :return: dict
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'mark_all_read'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '18']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'BackendClass'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'stored_messages_settings'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'STORAGE_BACKEND'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'backend'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'BackendClass'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'backend'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'inbox_purge'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'user'}
Mark all message instances for a user as read. :param user: user instance for the recipient
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_track_by_id'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'track_id'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'track_point_limit'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'track_point_offset'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13', '17', '26', '35', '51', '59']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'tracking_data'}; {'id': '16', 'type': 'dictionary', 'children': []}; {'id': '17', 'type': 'if_statement', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'track_point_limit'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '25']}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'tracking_data'}; {'id': '24', 'type': 'string', 'children': [], 'value': "'track_point_limit'"}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'track_point_limit'}; {'id': '26', 'type': 'if_statement', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'track_point_offset'}; {'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': 'tracking_data'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'track_point_offset'"}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'track_point_offset'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'make_get_request'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '42', '48']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'string', 'children': [], 'value': "'tracks/{}'"}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'track_id'}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'params_data'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'tracking_data'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'json_data'}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '58', 'type': 'argument_list', 'children': []}; {'id': '59', 'type': 'if_statement', 'children': ['60', '65', '70']}; {'id': '60', 'type': 'comparison_operator', 'children': ['61', '64'], 'value': '=='}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'status_code'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '200'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'return_statement', 'children': ['67']}; {'id': '67', 'type': 'subscript', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'json_data'}; {'id': '69', 'type': 'string', 'children': [], 'value': "'result'"}; {'id': '70', 'type': 'else_clause', 'children': ['71']}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'raise_statement', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'TrackNotFoundException'}; {'id': '75', 'type': 'argument_list', 'children': ['76', '81', '86']}; {'id': '76', 'type': 'keyword_argument', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '78', 'type': 'subscript', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'json_data'}; {'id': '80', 'type': 'string', 'children': [], 'value': "'message'"}; {'id': '81', 'type': 'keyword_argument', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'error_code'}; {'id': '83', 'type': 'subscript', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'json_data'}; {'id': '85', 'type': 'string', 'children': [], 'value': "'error_code'"}; {'id': '86', 'type': 'keyword_argument', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'request_id'}; {'id': '88', 'type': 'subscript', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'json_data'}; {'id': '90', 'type': 'string', 'children': [], 'value': "'request_id'"}
Gets a specific track
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_media_timestamp'}; {'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': 'last_timestamp'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '15', '20', '83', '91']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'local_renderer'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_latest_timestamp'}; {'id': '18', 'type': 'unary_operator', 'children': ['19'], 'value': '-'}; {'id': '19', 'type': 'float', 'children': [], 'value': '1e9999999999999999'}; {'id': '20', 'type': 'for_statement', 'children': ['21', '22', '27']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'iter_static_paths'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'block', 'children': ['28', '40', '48', '60', '73']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '31', 'type': 'binary_operator', 'children': ['32', '39'], 'value': '+'}; {'id': '32', 'type': 'binary_operator', 'children': ['33', '38'], 'value': '+'}; {'id': '33', 'type': 'attribute', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'static_root'}; {'id': '38', 'type': 'string', 'children': [], 'value': "'/'"}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'vprint'}; {'id': '45', 'type': 'argument_list', 'children': ['46', '47']}; {'id': '46', 'type': 'string', 'children': [], 'value': "'checking timestamp of path:'"}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '48', 'type': 'if_statement', 'children': ['49', '58']}; {'id': '49', 'type': 'not_operator', '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': 'os'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'isfile'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'continue_statement', 'children': []}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': '_latest_timestamp'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_latest_timestamp'}; {'id': '67', 'type': 'boolean_operator', 'children': ['68', '72'], 'value': 'or'}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'get_last_modified_timestamp'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': '_latest_timestamp'}; {'id': '73', 'type': 'if_statement', 'children': ['74', '81']}; {'id': '74', 'type': 'boolean_operator', 'children': ['75', '78'], 'value': 'and'}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '77'], 'value': 'is not'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'last_timestamp'}; {'id': '77', 'type': 'None', 'children': []}; {'id': '78', 'type': 'comparison_operator', 'children': ['79', '80'], 'value': '>'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': '_latest_timestamp'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'last_timestamp'}; {'id': '81', 'type': 'block', 'children': ['82']}; {'id': '82', 'type': 'break_statement', 'children': []}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'vprint'}; {'id': '88', 'type': 'argument_list', 'children': ['89', '90']}; {'id': '89', 'type': 'string', 'children': [], 'value': "'latest_timestamp:'"}; {'id': '90', 'type': 'identifier', 'children': [], 'value': '_latest_timestamp'}; {'id': '91', 'type': 'return_statement', 'children': ['92']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': '_latest_timestamp'}
Retrieves the most recent timestamp of the media in the static root. If last_timestamp is given, retrieves the first timestamp more recent than this value.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_var'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'var_name'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'not_found'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'try_statement', 'children': ['11', '44', '52']}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'for_statement', 'children': ['13', '14', '23']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '14', 'type': 'call', 'children': ['15', '21']}; {'id': '15', 'type': 'attribute', 'children': ['16', '20']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'var_name'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'.'"}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'try_statement', 'children': ['25', '32']}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '32', 'type': 'except_clause', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '44', 'type': 'except_clause', 'children': ['45', '49']}; {'id': '45', 'type': 'tuple', 'children': ['46', '47', '48']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'not_found'}; {'id': '52', 'type': 'else_clause', 'children': ['53']}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'data'}
Gets variable value from data dictionary.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'start'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '41']}; {'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': 'receiver'}; {'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': 'Receiver'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '19', '22', '25', '28', '31', '36']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'send_lock'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'senders'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'frames_received'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'callback'}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'receive_callback'}; {'id': '36', 'type': 'keyword_argument', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'fcs_nack'}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'fcs_nack'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '48']}; {'id': '43', 'type': 'attribute', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'receiver'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '48', 'type': 'argument_list', 'children': []}
Starts HDLC controller's threads.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '__getHyperSearchJobIDFilePath'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'permWorkDir'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'outputLabel'}; {'id': '7', 'type': 'block', 'children': ['8', '12', '19', '31']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'basePath'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'permWorkDir'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '17'], 'value': '%'}; {'id': '16', 'type': 'string', 'children': [], 'value': '"%s_HyperSearchJobID.pkl"'}; {'id': '17', 'type': 'tuple', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'outputLabel'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'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', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'basePath'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'filepath'}
Returns filepath where to store HyperSearch JobID Parameters: ---------------------------------------------------------------------- permWorkDir: Directory path for saved jobID file outputLabel: Label string for incorporating into file name for saved jobID retval: Filepath where to store HyperSearch JobID