sequence
stringlengths
902
12k
docstring
stringlengths
4
15.2k
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'queryEx'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'viewcls'}; {'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', '17', '33', '65']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '16']}; {'id': '13', 'type': 'subscript', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'itercls'"}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'viewcls'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '20', 'type': 'call', 'children': ['21', '28']}; {'id': '21', 'type': 'attribute', 'children': ['22', '27']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'AsyncBucket'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '31']}; {'id': '29', 'type': 'list_splat', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '31', 'type': 'dictionary_splat', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '33', 'type': 'if_statement', 'children': ['34', '38', '57']}; {'id': '34', 'type': 'not_operator', 'children': ['35']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'connected'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '48']}; {'id': '41', 'type': 'attribute', 'children': ['42', '47']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'connect'}; {'id': '46', 'type': 'argument_list', 'children': []}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'addCallback'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'lambda', 'children': ['50', '52']}; {'id': '50', 'type': 'lambda_parameters', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '56', 'type': 'argument_list', 'children': []}; {'id': '57', 'type': 'else_clause', 'children': ['58']}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '64', 'type': 'argument_list', 'children': []}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'o'}
Query a view, with the ``viewcls`` instance receiving events of the query as they arrive. :param type viewcls: A class (derived from :class:`AsyncViewBase`) to instantiate Other arguments are passed to the standard `query` method. This functions exactly like the :meth:`~couchbase.asynchronous.AsyncBucket.query` method, except it automatically schedules operations if the connection has not yet been negotiated.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'import_name'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'mod_name'}; {'id': '5', 'type': 'block', 'children': ['6', '23', '30', '35', '43']}; {'id': '6', 'type': 'try_statement', 'children': ['7', '16']}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'mod_obj_old'}; {'id': '11', 'type': 'subscript', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'modules'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'mod_name'}; {'id': '16', 'type': 'except_clause', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'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': 'mod_obj_old'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'if_statement', 'children': ['24', '27']}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '26'], 'value': 'is not'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'mod_obj_old'}; {'id': '26', 'type': 'None', 'children': []}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'mod_obj_old'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '__import__'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'mod_name'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'mod_obj'}; {'id': '38', 'type': 'subscript', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'modules'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'mod_name'}; {'id': '43', 'type': 'return_statement', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'mod_obj'}
Import a module by module name. @param mod_name: module name.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'login'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '6', 'type': 'keyword_separator', 'children': []}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'block', 'children': ['11', '17', '27']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_username'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'username'}; {'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': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_oauth'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'is_authenticated'}
Log in to Google Music. Parameters: username (str, Optional): Your Google Music username. Used for keeping stored OAuth tokens for multiple accounts separate. device_id (str, Optional): A mobile device ID or music manager uploader ID. Default: MAC address is used. token (dict, Optional): An OAuth token compatible with ``requests-oauthlib``. Returns: bool: ``True`` if successfully authenticated, ``False`` if not.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'move'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '24', '50']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '18']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '15'], 'value': '!='}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'outline'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'outline'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'raise_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'IntegrityError'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'string', 'children': [], 'value': "'Elements must be from the same outline!'"}; {'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': 'tree_manipulation'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'send'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '35', '38', '41', '44', '47']}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sender'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'keyword_argument', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'action'}; {'id': '40', 'type': 'string', 'children': [], 'value': "'move'"}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'target_node_type'}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'target_node'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '47', 'type': 'keyword_argument', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '57']}; {'id': '52', 'type': 'attribute', 'children': ['53', '56']}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '55', 'type': 'argument_list', 'children': []}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'move'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'pos'}
An override of the treebeard api in order to send a signal in advance.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'createmergerequest'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'project_id'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'sourcebranch'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'targetbranch'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'target_project_id'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'assignee_id'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '35', '75']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '19', 'type': 'dictionary', 'children': ['20', '23', '26', '29', '32']}; {'id': '20', 'type': 'pair', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'source_branch'"}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sourcebranch'}; {'id': '23', 'type': 'pair', 'children': ['24', '25']}; {'id': '24', 'type': 'string', 'children': [], 'value': "'target_branch'"}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'targetbranch'}; {'id': '26', 'type': 'pair', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': "'title'"}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '29', 'type': 'pair', 'children': ['30', '31']}; {'id': '30', 'type': 'string', 'children': [], 'value': "'assignee_id'"}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'assignee_id'}; {'id': '32', 'type': 'pair', 'children': ['33', '34']}; {'id': '33', 'type': 'string', 'children': [], 'value': "'target_project_id'"}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'target_project_id'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'requests'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '52', '55', '60', '65', '70']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': "'{0}/{1}/merge_requests'"}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'projects_url'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'project_id'}; {'id': '52', 'type': 'keyword_argument', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '55', 'type': 'keyword_argument', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '60', 'type': 'keyword_argument', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'verify'}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'verify_ssl'}; {'id': '65', 'type': 'keyword_argument', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'auth'}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'auth'}; {'id': '70', 'type': 'keyword_argument', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '75', 'type': 'if_statement', 'children': ['76', '81', '88']}; {'id': '76', 'type': 'comparison_operator', 'children': ['77', '80'], 'value': '=='}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'status_code'}; {'id': '80', 'type': 'integer', 'children': [], 'value': '201'}; {'id': '81', 'type': 'block', 'children': ['82']}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '87', 'type': 'argument_list', 'children': []}; {'id': '88', 'type': 'else_clause', 'children': ['89']}; {'id': '89', 'type': 'block', 'children': ['90']}; {'id': '90', 'type': 'return_statement', 'children': ['91']}; {'id': '91', 'type': 'False', 'children': []}
Create a new merge request. :param project_id: ID of the project originating the merge request :param sourcebranch: name of the branch to merge from :param targetbranch: name of the branch to merge to :param title: Title of the merge request :param assignee_id: Assignee user ID :return: dict of the new merge request
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'fopenat_rw'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'base_fd'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'return_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'fdopen'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '21']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'openat'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17', '18']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'base_fd'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'O_RDWR'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'rb+'"}
Does openat read-write, then does fdopen to get a file object
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'db_create'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'character_set'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'collate'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'dictionary_splat_pattern', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '13', 'type': 'block', 'children': ['14', '32', '40', '47', '55', '62', '71', '75', '90', '105', '109', '162']}; {'id': '14', 'type': 'if_statement', 'children': ['15', '21']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'db_exists'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '19', 'type': 'dictionary_splat', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '21', 'type': 'block', 'children': ['22', '30']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'DB \\'%s\\' already exists'"}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '30', 'type': 'return_statement', 'children': ['31']}; {'id': '31', 'type': 'False', 'children': []}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'dbc'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_connect'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'dictionary_splat', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '44']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '43'], 'value': 'is'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'dbc'}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'False', 'children': []}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'cur'}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'dbc'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '54', 'type': 'argument_list', 'children': []}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 's_name'}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'quote_identifier'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'qry'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'string', 'children': [], 'value': "'CREATE DATABASE IF NOT EXISTS {0}'"}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 's_name'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '74', 'type': 'dictionary', 'children': []}; {'id': '75', 'type': 'if_statement', 'children': ['76', '79']}; {'id': '76', 'type': 'comparison_operator', 'children': ['77', '78'], 'value': 'is not'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'character_set'}; {'id': '78', 'type': 'None', 'children': []}; {'id': '79', 'type': 'block', 'children': ['80', '84']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'augmented_assignment', 'children': ['82', '83'], 'value': '+='}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'qry'}; {'id': '83', 'type': 'string', 'children': [], 'value': "' CHARACTER SET %(character_set)s'"}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '89']}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '88', 'type': 'string', 'children': [], 'value': "'character_set'"}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'character_set'}; {'id': '90', 'type': 'if_statement', 'children': ['91', '94']}; {'id': '91', 'type': 'comparison_operator', 'children': ['92', '93'], 'value': 'is not'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'collate'}; {'id': '93', 'type': 'None', 'children': []}; {'id': '94', 'type': 'block', 'children': ['95', '99']}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'augmented_assignment', 'children': ['97', '98'], 'value': '+='}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'qry'}; {'id': '98', 'type': 'string', 'children': [], 'value': "' COLLATE %(collate)s'"}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'assignment', 'children': ['101', '104']}; {'id': '101', 'type': 'subscript', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '103', 'type': 'string', 'children': [], 'value': "'collate'"}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'collate'}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'augmented_assignment', 'children': ['107', '108'], 'value': '+='}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'qry'}; {'id': '108', 'type': 'string', 'children': [], 'value': "';'"}; {'id': '109', 'type': 'try_statement', 'children': ['110', '129']}; {'id': '110', 'type': 'block', 'children': ['111']}; {'id': '111', 'type': 'if_statement', 'children': ['112', '118']}; {'id': '112', 'type': 'call', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': '_execute'}; {'id': '114', 'type': 'argument_list', 'children': ['115', '116', '117']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'cur'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'qry'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '118', 'type': 'block', 'children': ['119', '127']}; {'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': 'log'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '124', 'type': 'argument_list', 'children': ['125', '126']}; {'id': '125', 'type': 'string', 'children': [], 'value': "'DB \\'%s\\' created'"}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '127', 'type': 'return_statement', 'children': ['128']}; {'id': '128', 'type': 'True', 'children': []}; {'id': '129', 'type': 'except_clause', 'children': ['130', '136']}; {'id': '130', 'type': 'as_pattern', 'children': ['131', '134']}; {'id': '131', 'type': 'attribute', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'MySQLdb'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'OperationalError'}; {'id': '134', 'type': 'as_pattern_target', 'children': ['135']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '136', 'type': 'block', 'children': ['137', '149', '155']}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'assignment', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'err'}; {'id': '140', 'type': 'call', 'children': ['141', '144']}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'string', 'children': [], 'value': "'MySQL Error {0}: {1}'"}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'list_splat', 'children': ['146']}; {'id': '146', 'type': 'attribute', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '149', 'type': 'expression_statement', 'children': ['150']}; {'id': '150', 'type': 'assignment', 'children': ['151', '154']}; {'id': '151', 'type': 'subscript', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': '__context__'}; {'id': '153', 'type': 'string', 'children': [], 'value': "'mysql.error'"}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'err'}; {'id': '155', 'type': 'expression_statement', 'children': ['156']}; {'id': '156', 'type': 'call', 'children': ['157', '160']}; {'id': '157', 'type': 'attribute', 'children': ['158', '159']}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '160', 'type': 'argument_list', 'children': ['161']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'err'}; {'id': '162', 'type': 'return_statement', 'children': ['163']}; {'id': '163', 'type': 'False', 'children': []}
Adds a databases to the MySQL server. name The name of the database to manage character_set The character set, if left empty the MySQL default will be used collate The collation, if left empty the MySQL default will be used CLI Example: .. code-block:: bash salt '*' mysql.db_create 'dbname' salt '*' mysql.db_create 'dbname' 'utf8' 'utf8_general_ci'
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'from_tree'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '6', 'type': 'list_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'treeish'}; {'id': '8', 'type': 'dictionary_splat_pattern', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '10', 'type': 'block', 'children': ['11', '36', '40', '62', '75', '84', '91', '104', '150']}; {'id': '11', 'type': 'if_statement', 'children': ['12', '25']}; {'id': '12', 'type': 'boolean_operator', 'children': ['13', '19'], 'value': 'or'}; {'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': 'treeish'}; {'id': '18', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '24'], 'value': '>'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'treeish'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'raise_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'binary_operator', 'children': ['31', '32'], 'value': '%'}; {'id': '31', 'type': 'string', 'children': [], 'value': '"Please specify between 1 and 3 treeish, got %i"'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'treeish'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'arg_list'}; {'id': '39', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '47']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '46'], 'value': '>'}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'treeish'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'block', 'children': ['48', '55']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'arg_list'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'string', 'children': [], 'value': '"--reset"'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'arg_list'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'string', 'children': [], 'value': '"--aggressive"'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'tmp_index'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'tempfile'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'mktemp'}; {'id': '69', 'type': 'argument_list', 'children': ['70', '71', '72']}; {'id': '70', 'type': 'string', 'children': [], 'value': "''"}; {'id': '71', 'type': 'string', 'children': [], 'value': "''"}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'git_dir'}; {'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': 'arg_list'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'binary_operator', 'children': ['82', '83'], 'value': '%'}; {'id': '82', 'type': 'string', 'children': [], 'value': '"--index-output=%s"'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'tmp_index'}; {'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': 'arg_list'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'treeish'}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'index_handler'}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'TemporaryFileSwap'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'join_path_native'}; {'id': '99', 'type': 'argument_list', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'git_dir'}; {'id': '103', 'type': 'string', 'children': [], 'value': "'index'"}; {'id': '104', 'type': 'try_statement', 'children': ['105', '133']}; {'id': '105', 'type': 'block', 'children': ['106', '118', '126', '130']}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '113']}; {'id': '108', 'type': 'attribute', 'children': ['109', '112']}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'git'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'read_tree'}; {'id': '113', 'type': 'argument_list', 'children': ['114', '116']}; {'id': '114', 'type': 'list_splat', 'children': ['115']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'arg_list'}; {'id': '116', 'type': 'dictionary_splat', 'children': ['117']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'assignment', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '121', 'type': 'call', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '123', 'type': 'argument_list', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'repo'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'tmp_index'}; {'id': '126', 'type': 'expression_statement', 'children': ['127']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '130', 'type': 'delete_statement', 'children': ['131']}; {'id': '131', 'type': '()', 'children': ['132']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'index_handler'}; {'id': '133', 'type': 'finally_clause', 'children': ['134']}; {'id': '134', 'type': 'block', 'children': ['135']}; {'id': '135', 'type': 'if_statement', 'children': ['136', '142']}; {'id': '136', 'type': 'call', 'children': ['137', '140']}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'osp'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '140', 'type': 'argument_list', 'children': ['141']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'tmp_index'}; {'id': '142', 'type': 'block', 'children': ['143']}; {'id': '143', 'type': 'expression_statement', 'children': ['144']}; {'id': '144', 'type': 'call', 'children': ['145', '148']}; {'id': '145', 'type': 'attribute', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '148', 'type': 'argument_list', 'children': ['149']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'tmp_index'}; {'id': '150', 'type': 'return_statement', 'children': ['151']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'index'}
Merge the given treeish revisions into a new index which is returned. The original index will remain unaltered :param repo: The repository treeish are located in. :param treeish: One, two or three Tree Objects, Commits or 40 byte hexshas. The result changes according to the amount of trees. If 1 Tree is given, it will just be read into a new index If 2 Trees are given, they will be merged into a new index using a two way merge algorithm. Tree 1 is the 'current' tree, tree 2 is the 'other' one. It behaves like a fast-forward. If 3 Trees are given, a 3-way merge will be performed with the first tree being the common ancestor of tree 2 and tree 3. Tree 2 is the 'current' tree, tree 3 is the 'other' one :param kwargs: Additional arguments passed to git-read-tree :return: New IndexFile instance. It will point to a temporary index location which does not exist anymore. If you intend to write such a merged Index, supply an alternate file_path to its 'write' method. :note: In the three-way merge case, --aggressive will be specified to automatically resolve more cases in a commonly correct manner. Specify trivial=True as kwarg to override that. As the underlying git-read-tree command takes into account the current index, it will be temporarily moved out of the way to assure there are no unsuspected interferences.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '16']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '10', '13']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'Name'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'Subject'}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'HtmlBody'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'TextBody'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'default_parameter', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'Alias'}; {'id': '15', 'type': 'None', 'children': []}; {'id': '16', 'type': 'block', 'children': ['17', '22', '41']}; {'id': '17', 'type': 'assert_statement', 'children': ['18', '21']}; {'id': '18', 'type': 'boolean_operator', 'children': ['19', '20'], 'value': 'or'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'TextBody'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'HtmlBody'}; {'id': '21', 'type': 'string', 'children': [], 'value': '"Provide either email TextBody or HtmlBody or both"'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '25', 'type': 'dictionary', 'children': ['26', '29', '32', '35', '38']}; {'id': '26', 'type': 'pair', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': '"Name"'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'Name'}; {'id': '29', 'type': 'pair', 'children': ['30', '31']}; {'id': '30', 'type': 'string', 'children': [], 'value': '"Subject"'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'Subject'}; {'id': '32', 'type': 'pair', 'children': ['33', '34']}; {'id': '33', 'type': 'string', 'children': [], 'value': '"HtmlBody"'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'HtmlBody'}; {'id': '35', 'type': 'pair', 'children': ['36', '37']}; {'id': '36', 'type': 'string', 'children': [], 'value': '"TextBody"'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'TextBody'}; {'id': '38', 'type': 'pair', 'children': ['39', '40']}; {'id': '39', 'type': 'string', 'children': [], 'value': '"Alias"'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'Alias'}; {'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': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_init_instance'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'call'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '53', '54']}; {'id': '52', 'type': 'string', 'children': [], 'value': '"POST"'}; {'id': '53', 'type': 'string', 'children': [], 'value': '"/templates"'}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'data'}
Creates a template. :param Name: Name of template :param Subject: The content to use for the Subject when this template is used to send email. :param HtmlBody: The content to use for the HtmlBody when this template is used to send email. :param TextBody: The content to use for the HtmlBody when this template is used to send email. :return:
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_process_change'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'server_description'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '51', '63', '69', '78', '105']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'td_old'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_description'}; {'id': '13', 'type': 'if_statement', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_publish_server'}; {'id': '17', 'type': 'block', 'children': ['18', '28']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'old_server_description'}; {'id': '21', 'type': 'subscript', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'td_old'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_server_descriptions'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'server_description'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'address'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'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': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_events'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'put'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'tuple', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_listeners'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'publish_server_description_changed'}; {'id': '42', 'type': 'tuple', 'children': ['43', '44', '45', '48']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'old_server_description'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'server_description'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'server_description'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'address'}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': '_topology_id'}; {'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': '_description'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'updated_topology_description'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': '_description'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'server_description'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': '_update_servers'}; {'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': 'self'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': '_receive_cluster_time_no_lock'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'server_description'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'cluster_time'}; {'id': '78', 'type': 'if_statement', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': '_publish_tp'}; {'id': '82', 'type': 'block', 'children': ['83']}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '90']}; {'id': '85', 'type': 'attribute', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': '_events'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'put'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'tuple', 'children': ['92', '97']}; {'id': '92', 'type': 'attribute', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': '_listeners'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'publish_topology_description_changed'}; {'id': '97', 'type': 'tuple', 'children': ['98', '99', '102']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'td_old'}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': '_description'}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': '_topology_id'}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '112']}; {'id': '107', 'type': 'attribute', 'children': ['108', '111']}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': '_condition'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'notify_all'}; {'id': '112', 'type': 'argument_list', 'children': []}
Process a new ServerDescription on an opened topology. Hold the lock when calling this.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'stop'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '32', '51', '142', '148']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'yield', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_stop_ubridge'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'if_statement', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_nvram_watcher'}; {'id': '17', 'type': 'block', 'children': ['18', '26']}; {'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': '_nvram_watcher'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '25', 'type': 'argument_list', 'children': []}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_nvram_watcher'}; {'id': '31', 'type': 'None', 'children': []}; {'id': '32', 'type': 'if_statement', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '_telnet_server'}; {'id': '36', 'type': 'block', 'children': ['37', '45']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '44']}; {'id': '39', 'type': 'attribute', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '_telnet_server'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': '_telnet_server'}; {'id': '50', 'type': 'None', 'children': []}; {'id': '51', 'type': 'if_statement', 'children': ['52', '57']}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'is_running'}; {'id': '56', 'type': 'argument_list', 'children': []}; {'id': '57', 'type': 'block', 'children': ['58', '64', '136']}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': '_terminate_process_iou'}; {'id': '63', 'type': 'argument_list', 'children': []}; {'id': '64', 'type': 'if_statement', 'children': ['65', '72']}; {'id': '65', 'type': 'comparison_operator', 'children': ['66', '71'], 'value': 'is'}; {'id': '66', 'type': 'attribute', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': '_iou_process'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'returncode'}; {'id': '71', 'type': 'None', 'children': []}; {'id': '72', 'type': 'block', 'children': ['73']}; {'id': '73', 'type': 'try_statement', 'children': ['74', '92']}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'yield', 'children': ['77']}; {'id': '77', 'type': 'call', 'children': ['78', '85']}; {'id': '78', 'type': 'attribute', 'children': ['79', '84']}; {'id': '79', 'type': 'attribute', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'gns3server'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'asyncio'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'wait_for_process_termination'}; {'id': '85', 'type': 'argument_list', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': '_iou_process'}; {'id': '89', 'type': 'keyword_argument', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '91', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '92', 'type': 'except_clause', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'asyncio'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'TimeoutError'}; {'id': '96', 'type': 'block', 'children': ['97']}; {'id': '97', 'type': 'if_statement', 'children': ['98', '105']}; {'id': '98', 'type': 'comparison_operator', 'children': ['99', '104'], 'value': 'is'}; {'id': '99', 'type': 'attribute', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': '_iou_process'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'returncode'}; {'id': '104', 'type': 'None', 'children': []}; {'id': '105', 'type': 'block', 'children': ['106', '122']}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '111']}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'string', 'children': [], 'value': '"IOU process {} is still running... killing it"'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'attribute', 'children': ['118', '121']}; {'id': '118', 'type': 'attribute', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': '_iou_process'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'pid'}; {'id': '122', 'type': 'try_statement', 'children': ['123', '132']}; {'id': '123', 'type': 'block', 'children': ['124']}; {'id': '124', 'type': 'expression_statement', 'children': ['125']}; {'id': '125', 'type': 'call', 'children': ['126', '131']}; {'id': '126', 'type': 'attribute', 'children': ['127', '130']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': '_iou_process'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'kill'}; {'id': '131', 'type': 'argument_list', 'children': []}; {'id': '132', 'type': 'except_clause', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'ProcessLookupError'}; {'id': '134', 'type': 'block', 'children': ['135']}; {'id': '135', 'type': 'pass_statement', 'children': []}; {'id': '136', 'type': 'expression_statement', 'children': ['137']}; {'id': '137', 'type': 'assignment', 'children': ['138', '141']}; {'id': '138', 'type': 'attribute', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': '_iou_process'}; {'id': '141', 'type': 'None', 'children': []}; {'id': '142', 'type': 'expression_statement', 'children': ['143']}; {'id': '143', 'type': 'assignment', 'children': ['144', '147']}; {'id': '144', 'type': 'attribute', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': '_started'}; {'id': '147', 'type': 'False', 'children': []}; {'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': 'self'}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'save_configs'}; {'id': '153', 'type': 'argument_list', 'children': []}
Stops the IOU process.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'mul'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'num'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'minimum'}; {'id': '8', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'maximum'}; {'id': '11', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'calc'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '23', '26', '29', '32', '35']}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'num'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'num'}; {'id': '26', 'type': 'keyword_argument', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'oper'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'mul'"}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'minimum'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'minimum'}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'maximum'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'maximum'}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ref'}
Multiplies together the ``num`` most recent values. Requires a list. USAGE: .. code-block:: yaml foo: calc.mul: - name: myregentry - num: 5
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_activity_comments'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'activity_id'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'markdown'}; {'id': '8', 'type': 'False', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13', '36']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'result_fetcher'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'functools'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'partial'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '26', '27', '30']}; {'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': 'protocol'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '26', 'type': 'string', 'children': [], 'value': "'/activities/{id}/comments'"}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'activity_id'}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'markdown'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'markdown'}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'BatchedResultsIterator'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '45', '48', '51']}; {'id': '40', 'type': 'keyword_argument', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'entity'}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'ActivityComment'}; {'id': '45', 'type': 'keyword_argument', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'bind_client'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'result_fetcher'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'result_fetcher'}; {'id': '51', 'type': 'keyword_argument', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'limit'}
Gets the comments for an activity. http://strava.github.io/api/v3/comments/#list :param activity_id: The activity for which to fetch comments. :type activity_id: int :param markdown: Whether to include markdown in comments (default is false/filterout). :type markdown: bool :param limit: Max rows to return (default unlimited). :type limit: int :return: An iterator of :class:`stravalib.model.ActivityComment` objects. :rtype: :class:`BatchedResultsIterator`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'destroy_list'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'list_id'}; {'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': 'List'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'tweepy_list_to_json'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '20']}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_client'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'destroy_list'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'keyword_argument', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'list_id'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'list_id'}
Destroy a list :param list_id: list ID number :return: The destroyed list object :rtype: :class:`~responsebot.models.List`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_stripe_api_version'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'validate'}; {'id': '9', 'type': 'True', 'children': []}; {'id': '10', 'type': 'block', 'children': ['11', '19', '43']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '14', 'type': 'boolean_operator', 'children': ['15', '16'], 'value': 'or'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'get_stripe_api_version'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'if_statement', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'validate'}; {'id': '21', 'type': 'block', 'children': ['22', '29']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'valid'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'validate_stripe_api_version'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '29', 'type': 'if_statement', 'children': ['30', '32']}; {'id': '30', 'type': 'not_operator', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'valid'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'raise_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'string', 'children': [], 'value': '"Bad stripe API version: {}"'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'stripe'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'api_version'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'version'}
Set the desired API version to use for Stripe requests. :param version: The version to set for the Stripe API. :type version: ``str`` :param validate: If True validate the value for the specified version). :type validate: ``bool``
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '20']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'which'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14', '17']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'jail'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'chroot'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'origin'}; {'id': '16', 'type': 'False', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'quiet'}; {'id': '19', 'type': 'False', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21', '25', '32', '39', '48', '55', '67', '74']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '24', 'type': 'string', 'children': [], 'value': "''"}; {'id': '25', 'type': 'if_statement', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'quiet'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'augmented_assignment', 'children': ['30', '31'], 'value': '+='}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '31', 'type': 'string', 'children': [], 'value': "'q'"}; {'id': '32', 'type': 'if_statement', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'origin'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'augmented_assignment', 'children': ['37', '38'], 'value': '+='}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '38', 'type': 'string', 'children': [], 'value': "'o'"}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': '_pkg'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46', '47']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'jail'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'chroot'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'string', 'children': [], 'value': "'which'"}; {'id': '55', 'type': 'if_statement', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'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': 'cmd'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'binary_operator', 'children': ['65', '66'], 'value': '+'}; {'id': '65', 'type': 'string', 'children': [], 'value': "'-'"}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'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': 'cmd'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '74', 'type': 'return_statement', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'subscript', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': '__salt__'}; {'id': '78', 'type': 'string', 'children': [], 'value': "'cmd.run'"}; {'id': '79', 'type': 'argument_list', 'children': ['80', '81', '84']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '81', 'type': 'keyword_argument', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'output_loglevel'}; {'id': '83', 'type': 'string', 'children': [], 'value': "'trace'"}; {'id': '84', 'type': 'keyword_argument', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'python_shell'}; {'id': '86', 'type': 'False', 'children': []}
Displays which package installed a specific file CLI Example: .. code-block:: bash salt '*' pkg.which <file name> jail Perform the check in the specified jail CLI Example: .. code-block:: bash salt '*' pkg.which <file name> jail=<jail name or id> chroot Perform the check in the specified chroot (ignored if ``jail`` is specified) root Perform the check in the specified root (ignored if ``jail`` is specified) CLI Example: .. code-block:: bash salt '*' pkg.which <file name> chroot=/path/to/chroot origin Shows the origin of the package instead of name-version. CLI Example: .. code-block:: bash salt '*' pkg.which <file name> origin=True quiet Quiet output. CLI Example: .. code-block:: bash salt '*' pkg.which <file name> quiet=True
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_shutter_level'}; {'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': 'level'}; {'id': '7', 'type': 'float', 'children': [], 'value': '0.0'}; {'id': '8', 'type': 'block', 'children': ['9', '24']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '12', 'type': 'dictionary', 'children': ['13', '16', '21']}; {'id': '13', 'type': 'pair', 'children': ['14', '15']}; {'id': '14', 'type': 'string', 'children': [], 'value': '"channelIndex"'}; {'id': '15', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '16', 'type': 'pair', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': '"deviceId"'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '21', 'type': 'pair', 'children': ['22', '23']}; {'id': '22', 'type': 'string', 'children': [], 'value': '"shutterLevel"'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'level'}; {'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': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_restCall'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'string', 'children': [], 'value': '"device/control/setShutterLevel"'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'data'}
sets the shutter level Args: level(float): the new level of the shutter. 0.0 = open, 1.0 = closed Returns: the result of the _restCall
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'fq_merge'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'R1'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'R2'}; {'id': '6', 'type': 'block', 'children': ['7', '20']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'itertools'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'cycle'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'list', 'children': ['16', '17', '18', '19'], 'value': '[1, 2, 3, 4]'}; {'id': '16', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '17', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '18', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '19', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '20', 'type': 'for_statement', 'children': ['21', '24', '29']}; {'id': '21', 'type': 'pattern_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'r1'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'r2'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'R1'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'R2'}; {'id': '29', 'type': 'block', 'children': ['30', '37', '48', '61', '74']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'next'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '37', 'type': 'if_statement', 'children': ['38', '41']}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '40'], 'value': '=='}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '40', 'type': 'integer', 'children': [], 'value': '1'}; {'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': 'pair'}; {'id': '45', 'type': 'list', 'children': ['46', '47'], 'value': '[[], []]'}; {'id': '46', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '47', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '55']}; {'id': '50', 'type': 'attribute', 'children': ['51', '54']}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'pair'}; {'id': '53', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'r1'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '60', 'type': 'argument_list', 'children': []}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'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': 'pair'}; {'id': '66', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'r2'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '73', 'type': 'argument_list', 'children': []}; {'id': '74', 'type': 'if_statement', 'children': ['75', '78']}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '77'], 'value': '=='}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '77', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '78', 'type': 'block', 'children': ['79']}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'yield', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'pair'}
merge separate fastq files
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'cut_from_chain'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'sciobj_model'}; {'id': '5', 'type': 'block', 'children': ['6', '59']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '11', '25', '44']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': '_is_head'}; {'id': '9', 'type': 'argument_list', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sciobj_model'}; {'id': '11', 'type': 'block', 'children': ['12', '20']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'old_pid'}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sciobj_model'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'obsoletes'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'did'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_cut_head_from_chain'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sciobj_model'}; {'id': '25', 'type': 'elif_clause', 'children': ['26', '30']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_is_tail'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'sciobj_model'}; {'id': '30', 'type': 'block', 'children': ['31', '39']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'old_pid'}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'sciobj_model'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'obsoleted_by'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'did'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_cut_tail_from_chain'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'sciobj_model'}; {'id': '44', 'type': 'else_clause', 'children': ['45']}; {'id': '45', 'type': 'block', 'children': ['46', '54']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'old_pid'}; {'id': '49', 'type': 'attribute', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sciobj_model'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'obsoleted_by'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'did'}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_cut_embedded_from_chain'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'sciobj_model'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': '_update_sid_to_last_existing_pid_map'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'old_pid'}
Remove an object from a revision chain. The object can be at any location in the chain, including the head or tail. Preconditions: - The object with the pid is verified to exist and to be a member of an revision chain. E.g., with: d1_gmn.app.views.asserts.is_existing_object(pid) d1_gmn.app.views.asserts.is_in_revision_chain(pid) Postconditions: - The given object is a standalone object with empty obsoletes, obsoletedBy and seriesId fields. - The previously adjacent objects in the chain are adjusted to close any gap that was created or remove dangling reference at the head or tail. - If the object was the last object in the chain and the chain has a SID, the SID reference is shifted over to the new last object in the chain.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getTriples'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'pointing'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '14', '18', '27']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sql'}; {'id': '9', 'type': 'string', 'children': [], 'value': '"SELECT id FROM triples t join triple_members m ON t.id=m.triple"'}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'augmented_assignment', 'children': ['12', '13'], 'value': '+='}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sql'}; {'id': '13', 'type': 'string', 'children': [], 'value': '" join bucket.exposure e on e.expnum=m.expnum "'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'augmented_assignment', 'children': ['16', '17'], 'value': '+='}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sql'}; {'id': '17', 'type': 'string', 'children': [], 'value': '" WHERE pointing=%s group by id order by e.expnum "'}; {'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': 'cfeps'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sql'}; {'id': '25', 'type': 'tuple', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'pointing'}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': '()', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'cfeps'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'fetchall'}; {'id': '33', 'type': 'argument_list', 'children': []}
Get all triples of a specified pointing ID. Defaults is to return a complete list triples.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_from_python_type'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'pytype'}; {'id': '8', 'type': 'block', 'children': ['9', '22', '40', '51', '66', '78', '87', '109', '132']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'json_schema'}; {'id': '12', 'type': 'dictionary', 'children': ['13']}; {'id': '13', 'type': 'pair', 'children': ['14', '15']}; {'id': '14', 'type': 'string', 'children': [], 'value': "'title'"}; {'id': '15', 'type': 'boolean_operator', 'children': ['16', '19'], 'value': 'or'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'attribute'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '22', 'type': 'for_statement', 'children': ['23', '26', '33']}; {'id': '23', 'type': 'pattern_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '26', 'type': 'call', 'children': ['27', '32']}; {'id': '27', 'type': 'attribute', 'children': ['28', '31']}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'TYPE_MAP'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'pytype'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '39']}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'json_schema'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'dump_only'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '50']}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'json_schema'}; {'id': '49', 'type': 'string', 'children': [], 'value': "'readonly'"}; {'id': '50', 'type': 'True', 'children': []}; {'id': '51', 'type': 'if_statement', 'children': ['52', '57']}; {'id': '52', 'type': 'comparison_operator', 'children': ['53', '56'], 'value': 'is not'}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'default'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'missing'}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '63']}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'json_schema'}; {'id': '62', 'type': 'string', 'children': [], 'value': "'default'"}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'default'}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'assignment', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'metadata'}; {'id': '69', 'type': 'call', 'children': ['70', '75']}; {'id': '70', 'type': 'attribute', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'metadata'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '75', 'type': 'argument_list', 'children': ['76', '77']}; {'id': '76', 'type': 'string', 'children': [], 'value': "'metadata'"}; {'id': '77', 'type': 'dictionary', 'children': []}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'metadata'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'metadata'}; {'id': '87', 'type': 'for_statement', 'children': ['88', '91', '96']}; {'id': '88', 'type': 'pattern_list', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'md_key'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'md_val'}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'metadata'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '95', 'type': 'argument_list', 'children': []}; {'id': '96', 'type': 'block', 'children': ['97', '103']}; {'id': '97', 'type': 'if_statement', 'children': ['98', '101']}; {'id': '98', 'type': 'comparison_operator', 'children': ['99', '100'], 'value': '=='}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'md_key'}; {'id': '100', 'type': 'string', 'children': [], 'value': "'metadata'"}; {'id': '101', 'type': 'block', 'children': ['102']}; {'id': '102', 'type': 'continue_statement', 'children': []}; {'id': '103', 'type': 'expression_statement', 'children': ['104']}; {'id': '104', 'type': 'assignment', 'children': ['105', '108']}; {'id': '105', 'type': 'subscript', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'json_schema'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'md_key'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'md_val'}; {'id': '109', 'type': 'if_statement', 'children': ['110', '117']}; {'id': '110', 'type': 'call', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '112', 'type': 'argument_list', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '117', 'type': 'block', 'children': ['118']}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'assignment', 'children': ['120', '123']}; {'id': '120', 'type': 'subscript', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'json_schema'}; {'id': '122', 'type': 'string', 'children': [], 'value': "'items'"}; {'id': '123', 'type': 'call', 'children': ['124', '127']}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': '_get_schema_for_field'}; {'id': '127', 'type': 'argument_list', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '129', 'type': 'attribute', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'container'}; {'id': '132', 'type': 'return_statement', 'children': ['133']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'json_schema'}
Get schema definition from python type.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load_model'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'model_name'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'epoch_num'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'data_shapes'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'label_shapes'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'label_names'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'gpus'}; {'id': '11', 'type': 'string', 'children': [], 'value': "''"}; {'id': '12', 'type': 'block', 'children': ['13', '28', '39', '54']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '19']}; {'id': '15', 'type': 'pattern_list', 'children': ['16', '17', '18']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sym'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'arg_params'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'aux_params'}; {'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': 'mx'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'load_checkpoint'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'model_name'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'epoch_num'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'mod'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'create_module'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35', '36', '37', '38']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'sym'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'data_shapes'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'label_shapes'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'label_names'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'gpus'}; {'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': 'mod'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'set_params'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '48', '51']}; {'id': '45', 'type': 'keyword_argument', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'arg_params'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'arg_params'}; {'id': '48', 'type': 'keyword_argument', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'aux_params'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'aux_params'}; {'id': '51', 'type': 'keyword_argument', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'allow_missing'}; {'id': '53', 'type': 'True', 'children': []}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'mod'}
Returns a module loaded with the provided model. Parameters ---------- model_name: str Prefix of the MXNet model name as stored on the local directory. epoch_num : int Epoch number of model we would like to load. input_shape: tuple The shape of the input data in the form of (batch_size, channels, height, width) files: list of strings List of URLs pertaining to files that need to be downloaded in order to use the model. data_shapes: list of tuples. List of tuples where each tuple is a pair of input variable name and its shape. label_shapes: list of (str, tuple) Typically is ``data_iter.provide_label``. label_names: list of str Name of the output labels in the MXNet symbolic graph. gpus: str Comma separated string of gpu ids on which inferences are executed. E.g. 3,5,6 would refer to GPUs 3, 5 and 6. If empty, we use CPU. Returns ------- MXNet module
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'prttex_summary_cnts_all'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'prt'}; {'id': '7', 'type': 'attribute', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'stdout'}; {'id': '10', 'type': 'block', 'children': ['11', '29']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'cnts'}; {'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_cnts_levels_depths_recs'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'obo'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_prttex_summary_cnts'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'prt'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'cnts'}
Print LaTeX format summary of level and depth counts for all active GO Terms.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '20']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'createUsageReport'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '11', '14', '17']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'reportname'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'queries'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'metadata'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'since'}; {'id': '10', 'type': 'string', 'children': [], 'value': '"LAST_DAY"'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'fromValue'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'toValue'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'aggregationInterval'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21', '29', '48', '79', '92', '117', '146', '152']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '28'], 'value': '+'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_url'}; {'id': '28', 'type': 'string', 'children': [], 'value': '"/add"'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '32', 'type': 'dictionary', 'children': ['33', '36']}; {'id': '33', 'type': 'pair', 'children': ['34', '35']}; {'id': '34', 'type': 'string', 'children': [], 'value': '"f"'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"json"'}; {'id': '36', 'type': 'pair', 'children': ['37', '38']}; {'id': '37', 'type': 'string', 'children': [], 'value': '"usagereport"'}; {'id': '38', 'type': 'dictionary', 'children': ['39', '42', '45']}; {'id': '39', 'type': 'pair', 'children': ['40', '41']}; {'id': '40', 'type': 'string', 'children': [], 'value': '"reportname"'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'reportname'}; {'id': '42', 'type': 'pair', 'children': ['43', '44']}; {'id': '43', 'type': 'string', 'children': [], 'value': '"since"'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'since'}; {'id': '45', 'type': 'pair', 'children': ['46', '47']}; {'id': '46', 'type': 'string', 'children': [], 'value': '"metadata"'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'metadata'}; {'id': '48', 'type': 'if_statement', 'children': ['49', '54', '64']}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'queries'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '62']}; {'id': '57', 'type': 'subscript', 'children': ['58', '61']}; {'id': '58', 'type': 'subscript', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '60', 'type': 'string', 'children': [], 'value': '"usagereport"'}; {'id': '61', 'type': 'string', 'children': [], 'value': '"queries"'}; {'id': '62', 'type': 'list', 'children': ['63'], 'value': '[queries]'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'queries'}; {'id': '64', 'type': 'elif_clause', 'children': ['65', '70']}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'queries'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '70', 'type': 'block', 'children': ['71']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '78']}; {'id': '73', 'type': 'subscript', 'children': ['74', '77']}; {'id': '74', 'type': 'subscript', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '76', 'type': 'string', 'children': [], 'value': '"usagereport"'}; {'id': '77', 'type': 'string', 'children': [], 'value': '"queries"'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'queries'}; {'id': '79', 'type': 'if_statement', 'children': ['80', '83']}; {'id': '80', 'type': 'comparison_operator', 'children': ['81', '82'], 'value': 'is not'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'aggregationInterval'}; {'id': '82', 'type': 'None', 'children': []}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '91']}; {'id': '86', 'type': 'subscript', 'children': ['87', '90']}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '89', 'type': 'string', 'children': [], 'value': '"usagereport"'}; {'id': '90', 'type': 'string', 'children': [], 'value': "'aggregationInterval'"}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'aggregationInterval'}; {'id': '92', 'type': 'if_statement', 'children': ['93', '100']}; {'id': '93', 'type': 'comparison_operator', 'children': ['94', '99'], 'value': '=='}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'since'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '98', 'type': 'argument_list', 'children': []}; {'id': '99', 'type': 'string', 'children': [], 'value': '"custom"'}; {'id': '100', 'type': 'block', 'children': ['101', '109']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'assignment', 'children': ['103', '108']}; {'id': '103', 'type': 'subscript', 'children': ['104', '107']}; {'id': '104', 'type': 'subscript', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '106', 'type': 'string', 'children': [], 'value': '"usagereport"'}; {'id': '107', 'type': 'string', 'children': [], 'value': "'to'"}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'toValue'}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'assignment', 'children': ['111', '116']}; {'id': '111', 'type': 'subscript', 'children': ['112', '115']}; {'id': '112', 'type': 'subscript', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '114', 'type': 'string', 'children': [], 'value': '"usagereport"'}; {'id': '115', 'type': 'string', 'children': [], 'value': "'from'"}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'fromValue'}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'assignment', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '120', 'type': 'call', 'children': ['121', '124']}; {'id': '121', 'type': 'attribute', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': '_post'}; {'id': '124', 'type': 'argument_list', 'children': ['125', '128', '131', '136', '141']}; {'id': '125', 'type': 'keyword_argument', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '128', 'type': 'keyword_argument', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'param_dict'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '131', 'type': 'keyword_argument', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'securityHandler'}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': '_securityHandler'}; {'id': '136', 'type': 'keyword_argument', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'proxy_port'}; {'id': '138', 'type': 'attribute', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': '_proxy_port'}; {'id': '141', 'type': 'keyword_argument', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'proxy_url'}; {'id': '143', 'type': 'attribute', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': '_proxy_url'}; {'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': 'self'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': '__init'}; {'id': '151', 'type': 'argument_list', 'children': []}; {'id': '152', 'type': 'return_statement', 'children': ['153']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'res'}
Creates a new usage report. A usage report is created by submitting a JSON representation of the usage report to this operation. Inputs: reportname - the unique name of the report since - the time duration of the report. The supported values are: LAST_DAY, LAST_WEEK, LAST_MONTH, LAST_YEAR, CUSTOM LAST_DAY represents a time range spanning the previous 24 hours. LAST_WEEK represents a time range spanning the previous 7 days. LAST_MONTH represents a time range spanning the previous 30 days. LAST_YEAR represents a time range spanning the previous 365 days. CUSTOM represents a time range that is specified using the from and to parameters. fromValue - optional value - The timestamp (milliseconds since UNIX epoch, namely January 1, 1970, 00:00:00 GMT) for the beginning period of the report. Only valid when since is CUSTOM toValue - optional value - The timestamp (milliseconds since UNIX epoch, namely January 1, 1970, 00:00:00 GMT) for the ending period of the report.Only valid when since is CUSTOM. aggregationInterval - Optional. Aggregation interval in minutes. Server metrics are aggregated and returned for time slices aggregated using the specified aggregation interval. The time range for the report, specified using the since parameter (and from and to when since is CUSTOM) is split into multiple slices, each covering an aggregation interval. Server metrics are then aggregated for each time slice and returned as data points in the report data. When the aggregationInterval is not specified, the following defaults are used: LAST_DAY: 30 minutes LAST_WEEK: 4 hours LAST_MONTH: 24 hours LAST_YEAR: 1 week CUSTOM: 30 minutes up to 1 day, 4 hours up to 1 week, 1 day up to 30 days, and 1 week for longer periods. If the samplingInterval specified in Usage Reports Settings is more than the aggregationInterval, the samplingInterval is used instead. queries - A list of queries for which to generate the report. You need to specify the list as an array of JSON objects representing the queries. Each query specifies the list of metrics to be queries for a given set of resourceURIs. The queries parameter has the following sub-parameters: resourceURIs - Comma separated list of resource URIs for which to report metrics. Specifies services or folders for which to gather metrics. The resourceURI is formatted as below: services/ - Entire Site services/Folder/ - Folder within a Site. Reports metrics aggregated across all services within that Folder and Sub-Folders. services/Folder/ServiceName.ServiceType - Service in a specified folder, for example: services/Map_bv_999.MapServer. services/ServiceName.ServiceType - Service in the root folder, for example: Map_bv_999.MapServer. metrics - Comma separated list of metrics to be reported. Supported metrics are: RequestCount - the number of requests received RequestsFailed - the number of requests that failed RequestsTimedOut - the number of requests that timed out RequestMaxResponseTime - the maximum response time RequestAvgResponseTime - the average response time ServiceActiveInstances - the maximum number of active (running) service instances sampled at 1 minute intervals, for a specified service metadata - Can be any JSON Object. Typically used for storing presentation tier data for the usage report, such as report title, colors, line-styles, etc. Also used to denote visibility in ArcGIS Server Manager for reports created with the Administrator Directory. To make any report created in the Administrator Directory visible to Manager, include "managerReport":true in the metadata JSON object. When this value is not set (default), reports are not visible in Manager. This behavior can be extended to any client that wants to interact with the Administrator Directory. Any user-created value will need to be processed by the client. Example: >>> queryObj = [{ "resourceURIs": ["services/Map_bv_999.MapServer"], "metrics": ["RequestCount"] }] >>> obj.createReport( reportname="SampleReport", queries=queryObj, metadata="This could be any String or JSON Object.", since="LAST_DAY" )
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'wsgi'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'start_response'}; {'id': '7', 'type': 'block', 'children': ['8', '15', '22']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'Request'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'Context'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '22', 'type': 'try_statement', 'children': ['23', '103']}; {'id': '23', 'type': 'block', 'children': ['24', '84', '97']}; {'id': '24', 'type': 'try_statement', 'children': ['25', '53', '65']}; {'id': '25', 'type': 'block', 'children': ['26', '34', '44']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '_run_callbacks'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'string', 'children': [], 'value': "'finalize'"}; {'id': '41', 'type': 'tuple', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'conditional_to'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '53', 'type': 'except_clause', 'children': ['54', '58']}; {'id': '54', 'type': 'as_pattern', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'HTTPException'}; {'id': '56', 'type': 'as_pattern_target', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '65', 'type': 'except_clause', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '67', 'type': 'block', 'children': ['68', '76']}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'handle_error'}; {'id': '73', 'type': 'argument_list', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '79', 'type': 'attribute', 'children': ['80', '83']}; {'id': '80', 'type': 'call', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'InternalServerError'}; {'id': '82', 'type': 'argument_list', 'children': []}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'response'}; {'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': 'response'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'add_callback'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'lambda', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': '_run_callbacks'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'string', 'children': [], 'value': "'close'"}; {'id': '97', 'type': 'return_statement', 'children': ['98']}; {'id': '98', 'type': 'call', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '100', 'type': 'argument_list', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'start_response'}; {'id': '103', 'type': 'finally_clause', 'children': ['104']}; {'id': '104', 'type': 'block', 'children': ['105']}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': '_run_callbacks'}; {'id': '110', 'type': 'argument_list', 'children': ['111', '112']}; {'id': '111', 'type': 'string', 'children': [], 'value': "'teardown'"}; {'id': '112', 'type': 'keyword_argument', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'log_errors'}; {'id': '114', 'type': 'True', 'children': []}
Implements the mapper's WSGI interface.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'save_boolean_setting'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'check_box'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'set_setting'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13', '18']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'check_box'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'isChecked'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'keyword_argument', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'qsettings'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'settings'}
Save boolean setting according to check_box state. :param key: Key to retrieve setting value. :type key: str :param check_box: Check box to show and set the setting. :type check_box: PyQt5.QtWidgets.QCheckBox.QCheckBox
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'do_create_tool_item'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '16', '23']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'proxy'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'SpinToolItem'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'list_splat', 'children': ['13']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_args_for_toolitem'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'connect_proxy'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'proxy'}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'proxy'}
This is called by the UIManager when it is time to instantiate the proxy
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_locs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'locs'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '13', '19', '36', '53', '61', '74']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': "'Sets the locations of the ticks'"}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_check_implicitly_registered'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'locs'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'locs'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '24']}; {'id': '21', 'type': 'tuple_pattern', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'vmin'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'vmax'}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'vi'}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'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': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'get_view_interval'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'if_statement', 'children': ['37', '44']}; {'id': '37', 'type': 'comparison_operator', 'children': ['38', '39'], 'value': '!='}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'vi'}; {'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': 'plot_obj'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'view_interval'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '52']}; {'id': '47', 'type': 'attribute', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'plot_obj'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'date_axis_info'}; {'id': '52', 'type': 'None', 'children': []}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '60']}; {'id': '55', 'type': 'attribute', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'plot_obj'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'view_interval'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'vi'}; {'id': '61', 'type': 'if_statement', 'children': ['62', '65']}; {'id': '62', 'type': 'comparison_operator', 'children': ['63', '64'], 'value': '<'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'vmax'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'vmin'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'assignment', 'children': ['68', '71']}; {'id': '68', 'type': 'tuple_pattern', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'vmin'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'vmax'}; {'id': '71', 'type': 'tuple', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'vmax'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'vmin'}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': '_set_default_format'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'vmin'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'vmax'}
Sets the locations of the ticks
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'location'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '18', '24', '54', '58', '65', '75', '91', '106', '118', '164']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'fastafile'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'fastafile'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'pwmfile'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'pwmfile'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'lwidth'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'width'}; {'id': '24', 'type': 'if_statement', 'children': ['25', '27']}; {'id': '25', 'type': 'not_operator', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'lwidth'}; {'id': '27', 'type': 'block', 'children': ['28', '35', '50']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'Fasta'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'fastafile'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'lwidth'}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'subscript', 'children': ['42', '49']}; {'id': '42', 'type': 'subscript', 'children': ['43', '48']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '49', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '53', 'type': 'None', 'children': []}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'jobs'}; {'id': '57', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'motifs'}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'pwmfile_to_motifs'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'pwmfile'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '68', 'type': 'list_comprehension', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'motif'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '72', 'type': 'for_in_clause', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'motif'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'motifs'}; {'id': '75', 'type': 'if_statement', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '83', 'type': 'call', 'children': ['84', '89']}; {'id': '84', 'type': 'attribute', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'string', 'children': [], 'value': '","'}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'n_cpus'}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'subscript', 'children': ['98', '105']}; {'id': '98', 'type': 'call', 'children': ['99', '104']}; {'id': '99', 'type': 'attribute', 'children': ['100', '103']}; {'id': '100', 'type': 'call', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'MotifConfig'}; {'id': '102', 'type': 'argument_list', 'children': []}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'get_default_params'}; {'id': '104', 'type': 'argument_list', 'children': []}; {'id': '105', 'type': 'string', 'children': [], 'value': '"ncpus"'}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'assignment', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'pool'}; {'id': '109', 'type': 'call', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'Pool'}; {'id': '111', 'type': 'argument_list', 'children': ['112', '115']}; {'id': '112', 'type': 'keyword_argument', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'processes'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'n_cpus'}; {'id': '115', 'type': 'keyword_argument', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'maxtasksperchild'}; {'id': '117', 'type': 'integer', 'children': [], 'value': '1000'}; {'id': '118', 'type': 'for_statement', 'children': ['119', '120', '121']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'motif'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'motifs'}; {'id': '121', 'type': 'block', 'children': ['122']}; {'id': '122', 'type': 'if_statement', 'children': ['123', '128']}; {'id': '123', 'type': 'comparison_operator', 'children': ['124', '127'], 'value': 'in'}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'motif'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'ids'}; {'id': '128', 'type': 'block', 'children': ['129', '144']}; {'id': '129', 'type': 'expression_statement', 'children': ['130']}; {'id': '130', 'type': 'assignment', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'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': 'os'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '138', 'type': 'argument_list', 'children': ['139']}; {'id': '139', 'type': 'binary_operator', 'children': ['140', '141'], 'value': '%'}; {'id': '140', 'type': 'string', 'children': [], 'value': '"%s_histogram"'}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'motif'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '144', 'type': 'expression_statement', 'children': ['145']}; {'id': '145', 'type': 'call', 'children': ['146', '149']}; {'id': '146', 'type': 'attribute', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'jobs'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '149', 'type': 'argument_list', 'children': ['150']}; {'id': '150', 'type': 'call', 'children': ['151', '154']}; {'id': '151', 'type': 'attribute', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'pool'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'apply_async'}; {'id': '154', 'type': 'argument_list', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'motif_localization'}; {'id': '156', 'type': 'tuple', 'children': ['157', '158', '159', '160', '161']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'fastafile'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'motif'}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'lwidth'}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '161', 'type': 'attribute', 'children': ['162', '163']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'cutoff'}; {'id': '164', 'type': 'for_statement', 'children': ['165', '166', '167']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'job'}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'jobs'}; {'id': '167', 'type': 'block', 'children': ['168']}; {'id': '168', 'type': 'expression_statement', 'children': ['169']}; {'id': '169', 'type': 'call', 'children': ['170', '173']}; {'id': '170', 'type': 'attribute', 'children': ['171', '172']}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'job'}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '173', 'type': 'argument_list', 'children': []}
Creates histrogram of motif location. Parameters ---------- args : argparse object Command line arguments.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getFileObjects'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '93']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '9', 'type': 'dictionary', 'children': ['10', '13', '18', '23', '28', '33', '38', '43', '48', '53', '58', '63', '68', '73', '78', '83', '88']}; {'id': '10', 'type': 'pair', 'children': ['11', '12']}; {'id': '11', 'type': 'string', 'children': [], 'value': "'project-file'"}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'pair', 'children': ['14', '15']}; {'id': '14', 'type': 'string', 'children': [], 'value': "'mapping-table-file'"}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'mapTableFile'}; {'id': '18', 'type': 'pair', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': "'channel-input-file'"}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'channelInputFile'}; {'id': '23', 'type': 'pair', 'children': ['24', '25']}; {'id': '24', 'type': 'string', 'children': [], 'value': "'precipitation-file'"}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'precipFile'}; {'id': '28', 'type': 'pair', 'children': ['29', '30']}; {'id': '29', 'type': 'string', 'children': [], 'value': "'storm-pipe-network-file'"}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'stormPipeNetworkFile'}; {'id': '33', 'type': 'pair', 'children': ['34', '35']}; {'id': '34', 'type': 'string', 'children': [], 'value': "'hmet-file'"}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'hmetFile'}; {'id': '38', 'type': 'pair', 'children': ['39', '40']}; {'id': '39', 'type': 'string', 'children': [], 'value': "'nwsrfs-file'"}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'nwsrfsFile'}; {'id': '43', 'type': 'pair', 'children': ['44', '45']}; {'id': '44', 'type': 'string', 'children': [], 'value': "'orographic-gage-file'"}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'orographicGageFile'}; {'id': '48', 'type': 'pair', 'children': ['49', '50']}; {'id': '49', 'type': 'string', 'children': [], 'value': "'grid-pipe-file'"}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'gridPipeFile'}; {'id': '53', 'type': 'pair', 'children': ['54', '55']}; {'id': '54', 'type': 'string', 'children': [], 'value': "'grid-stream-file'"}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'gridStreamFile'}; {'id': '58', 'type': 'pair', 'children': ['59', '60']}; {'id': '59', 'type': 'string', 'children': [], 'value': "'time-series-file'"}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'timeSeriesFiles'}; {'id': '63', 'type': 'pair', 'children': ['64', '65']}; {'id': '64', 'type': 'string', 'children': [], 'value': "'projection-file'"}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'projectionFile'}; {'id': '68', 'type': 'pair', 'children': ['69', '70']}; {'id': '69', 'type': 'string', 'children': [], 'value': "'replace-parameters-file'"}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'replaceParamFile'}; {'id': '73', 'type': 'pair', 'children': ['74', '75']}; {'id': '74', 'type': 'string', 'children': [], 'value': "'replace-value-file'"}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'replaceValFile'}; {'id': '78', 'type': 'pair', 'children': ['79', '80']}; {'id': '79', 'type': 'string', 'children': [], 'value': "'output-location-file'"}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'outputLocationFiles'}; {'id': '83', 'type': 'pair', 'children': ['84', '85']}; {'id': '84', 'type': 'string', 'children': [], 'value': "'maps'"}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'maps'}; {'id': '88', 'type': 'pair', 'children': ['89', '90']}; {'id': '89', 'type': 'string', 'children': [], 'value': "'link-node-datasets-file'"}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'linkNodeDatasets'}; {'id': '93', 'type': 'return_statement', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'files'}
Retrieve a dictionary of file objects. This is a utility method that can be used to programmatically access the GsshaPy file objects. Use this method in conjunction with the getFileKeys method to access only files that have been read into the database. Returns: dict: Dictionary with human readable keys and values of GsshaPy file object instances. Files that have not been read into the database will have a value of None.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'convert_to_match_query'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'ir_blocks'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '34', '43', '52', '59', '65', '86', '128', '135', '142']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'output_block'}; {'id': '9', 'type': 'subscript', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ir_blocks'}; {'id': '11', 'type': 'unary_operator', 'children': ['12'], 'value': '-'}; {'id': '12', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '13', 'type': 'if_statement', 'children': ['14', '20']}; {'id': '14', 'type': 'not_operator', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'output_block'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'ConstructResult'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'raise_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'AssertionError'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'concatenated_string', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': "u'Expected last IR block to be ConstructResult, found: '"}; {'id': '29', 'type': 'string', 'children': [], 'value': "u'{} {}'"}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'output_block'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'ir_blocks'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ir_except_output'}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ir_blocks'}; {'id': '39', 'type': 'slice', 'children': ['40', '41']}; {'id': '40', 'type': 'colon', 'children': []}; {'id': '41', 'type': 'unary_operator', 'children': ['42'], 'value': '-'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '48']}; {'id': '45', 'type': 'pattern_list', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'folds'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'ir_except_output_and_folds'}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'extract_folds_from_ir_blocks'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'ir_except_output'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'global_operation_ir_blocks_tuple'}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_extract_global_operations'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'ir_except_output_and_folds'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '64']}; {'id': '61', 'type': 'pattern_list', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'global_operation_blocks'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'pruned_ir_blocks'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'global_operation_ir_blocks_tuple'}; {'id': '65', 'type': 'if_statement', 'children': ['66', '72']}; {'id': '66', 'type': 'comparison_operator', 'children': ['67', '71'], 'value': '>'}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'global_operation_blocks'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '72', 'type': 'block', 'children': ['73']}; {'id': '73', 'type': 'raise_statement', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'AssertionError'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'call', 'children': ['78', '83']}; {'id': '78', 'type': 'attribute', 'children': ['79', '82']}; {'id': '79', 'type': 'concatenated_string', 'children': ['80', '81']}; {'id': '80', 'type': 'string', 'children': [], 'value': "u'Received IR blocks with multiple global operation blocks. Only one '"}; {'id': '81', 'type': 'string', 'children': [], 'value': "u'is allowed: {} {}'"}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '83', 'type': 'argument_list', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'global_operation_blocks'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'ir_blocks'}; {'id': '86', 'type': 'if_statement', 'children': ['87', '93', '122']}; {'id': '87', 'type': 'comparison_operator', 'children': ['88', '92'], 'value': '=='}; {'id': '88', 'type': 'call', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'global_operation_blocks'}; {'id': '92', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '93', 'type': 'block', 'children': ['94', '116']}; {'id': '94', 'type': 'if_statement', 'children': ['95', '103']}; {'id': '95', 'type': 'not_operator', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '98', 'type': 'argument_list', 'children': ['99', '102']}; {'id': '99', 'type': 'subscript', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'global_operation_blocks'}; {'id': '101', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'Filter'}; {'id': '103', 'type': 'block', 'children': ['104']}; {'id': '104', 'type': 'raise_statement', 'children': ['105']}; {'id': '105', 'type': 'call', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'AssertionError'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'call', 'children': ['109', '112']}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'string', 'children': [], 'value': "u'Received non-Filter global operation block. {}'"}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'subscript', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'global_operation_blocks'}; {'id': '115', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '116', 'type': 'expression_statement', 'children': ['117']}; {'id': '117', 'type': 'assignment', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'where_block'}; {'id': '119', 'type': 'subscript', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'global_operation_blocks'}; {'id': '121', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '122', 'type': 'else_clause', 'children': ['123']}; {'id': '123', 'type': 'block', 'children': ['124']}; {'id': '124', 'type': 'expression_statement', 'children': ['125']}; {'id': '125', 'type': 'assignment', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'where_block'}; {'id': '127', 'type': 'None', 'children': []}; {'id': '128', 'type': 'expression_statement', 'children': ['129']}; {'id': '129', 'type': 'assignment', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'match_steps'}; {'id': '131', 'type': 'call', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': '_split_ir_into_match_steps'}; {'id': '133', 'type': 'argument_list', 'children': ['134']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'pruned_ir_blocks'}; {'id': '135', 'type': 'expression_statement', 'children': ['136']}; {'id': '136', 'type': 'assignment', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'match_traversals'}; {'id': '138', 'type': 'call', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': '_split_match_steps_into_match_traversals'}; {'id': '140', 'type': 'argument_list', 'children': ['141']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'match_steps'}; {'id': '142', 'type': 'return_statement', 'children': ['143']}; {'id': '143', 'type': 'call', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'MatchQuery'}; {'id': '145', 'type': 'argument_list', 'children': ['146', '149', '152', '155']}; {'id': '146', 'type': 'keyword_argument', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'match_traversals'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'match_traversals'}; {'id': '149', 'type': 'keyword_argument', 'children': ['150', '151']}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'folds'}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'folds'}; {'id': '152', 'type': 'keyword_argument', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'output_block'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'output_block'}; {'id': '155', 'type': 'keyword_argument', 'children': ['156', '157']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'where_block'}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'where_block'}
Convert the list of IR blocks into a MatchQuery object, for easier manipulation.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'AddPorts'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'ports'}; {'id': '6', 'type': 'block', 'children': ['7', '57']}; {'id': '7', 'type': 'for_statement', 'children': ['8', '9', '10']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'ports'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'if_statement', 'children': ['12', '15', '37']}; {'id': '12', 'type': 'comparison_operator', 'children': ['13', '14'], 'value': 'in'}; {'id': '13', 'type': 'string', 'children': [], 'value': "'port_to'"}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'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': 'ports'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'Port'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28', '31', '34']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'protocol'"}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'port'"}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'port_to'"}; {'id': '37', 'type': 'else_clause', 'children': ['38']}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '46']}; {'id': '41', 'type': 'attribute', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'ports'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'Port'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51', '54']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '53', 'type': 'string', 'children': [], 'value': "'protocol'"}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'port'}; {'id': '56', 'type': 'string', 'children': [], 'value': "'port'"}; {'id': '57', 'type': 'return_statement', 'children': ['58']}; {'id': '58', 'type': '()', 'children': ['59']}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'Update'}; {'id': '63', 'type': 'argument_list', 'children': []}
Create one or more port access policies. Include a list of dicts with protocol, port, and port_to (optional - for range) keys. >>> clc.v2.Server("WA1BTDIX01").PublicIPs().public_ips[0] .AddPorts([{'protocol': 'TCP', 'port': '80' }, {'protocol': 'UDP', 'port': '10000', 'port_to': '15000'}]).WaitUntilComplete() 0
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'remove_all_cts_records_by'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'file_name'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'crypto_idfp'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '23']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'db'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'XonoticDB'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'load_path'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'file_name'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'db'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'remove_all_cts_records_by'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'crypto_idfp'}; {'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': 'db'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'save'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'file_name'}
Remove all cts records set by player with CRYPTO_IDFP
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'CreateNetworkConnectivityTauDEMTree'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'network_connectivity_tree_file'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'out_csv_file'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '15', '65', '79', '93']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'stream_id_array'}; {'id': '10', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'next_down_id_array'}; {'id': '14', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '15', 'type': 'with_statement', 'children': ['16', '26']}; {'id': '16', 'type': 'with_clause', 'children': ['17']}; {'id': '17', 'type': 'with_item', 'children': ['18']}; {'id': '18', 'type': 'as_pattern', 'children': ['19', '24']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'open_csv'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'network_connectivity_tree_file'}; {'id': '23', 'type': 'string', 'children': [], 'value': '"r"'}; {'id': '24', 'type': 'as_pattern_target', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'csvfile'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'for_statement', 'children': ['28', '29', '30']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'csvfile'}; {'id': '30', 'type': 'block', 'children': ['31', '39', '52']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'split_row'}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '38', 'type': 'argument_list', 'children': []}; {'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': 'stream_id_array'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '51']}; {'id': '46', 'type': 'attribute', 'children': ['47', '50']}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'split_row'}; {'id': '49', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '51', 'type': 'argument_list', 'children': []}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'next_down_id_array'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '64']}; {'id': '59', 'type': 'attribute', 'children': ['60', '63']}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'split_row'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '64', 'type': 'argument_list', 'children': []}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'stream_id_array'}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'stream_id_array'}; {'id': '74', 'type': 'keyword_argument', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'int32'}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'next_down_id_array'}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'next_down_id_array'}; {'id': '88', 'type': 'keyword_argument', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'int32'}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'StreamIDNextDownIDToConnectivity'}; {'id': '96', 'type': 'argument_list', 'children': ['97', '98', '99']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'stream_id_array'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'next_down_id_array'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'out_csv_file'}
Creates Network Connectivity input CSV file for RAPID based on the TauDEM network connectivity tree file
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_region_for_chip'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '8', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '9', 'type': 'block', 'children': ['10', '18', '38', '50', '56', '62', '84']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'shift'}; {'id': '13', 'type': 'binary_operator', 'children': ['14', '15'], 'value': '-'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '6'}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '17'], 'value': '*'}; {'id': '16', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'bit'}; {'id': '21', 'type': 'binary_operator', 'children': ['22', '29'], 'value': '+'}; {'id': '22', 'type': '()', 'children': ['23']}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '28'], 'value': '&'}; {'id': '24', 'type': '()', 'children': ['25']}; {'id': '25', 'type': 'binary_operator', 'children': ['26', '27'], 'value': '>>'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'shift'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '29', 'type': 'binary_operator', 'children': ['30', '31'], 'value': '*'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '31', 'type': '()', 'children': ['32']}; {'id': '32', 'type': 'binary_operator', 'children': ['33', '37'], 'value': '&'}; {'id': '33', 'type': '()', 'children': ['34']}; {'id': '34', 'type': 'binary_operator', 'children': ['35', '36'], 'value': '>>'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'shift'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'mask'}; {'id': '41', 'type': 'binary_operator', 'children': ['42', '43'], 'value': '^'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '0xffff'}; {'id': '43', 'type': '()', 'children': ['44']}; {'id': '44', 'type': 'binary_operator', 'children': ['45', '49'], 'value': '-'}; {'id': '45', 'type': '()', 'children': ['46']}; {'id': '46', 'type': 'binary_operator', 'children': ['47', '48'], 'value': '<<'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'shift'}; {'id': '49', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'nx'}; {'id': '53', 'type': 'binary_operator', 'children': ['54', '55'], 'value': '&'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'mask'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'ny'}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '61'], 'value': '&'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'mask'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '80'], 'value': '|'}; {'id': '66', 'type': 'binary_operator', 'children': ['67', '76'], 'value': '|'}; {'id': '67', 'type': 'binary_operator', 'children': ['68', '72'], 'value': '|'}; {'id': '68', 'type': '()', 'children': ['69']}; {'id': '69', 'type': 'binary_operator', 'children': ['70', '71'], 'value': '<<'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'nx'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '24'}; {'id': '72', 'type': '()', 'children': ['73']}; {'id': '73', 'type': 'binary_operator', 'children': ['74', '75'], 'value': '<<'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'ny'}; {'id': '75', 'type': 'integer', 'children': [], 'value': '16'}; {'id': '76', 'type': '()', 'children': ['77']}; {'id': '77', 'type': 'binary_operator', 'children': ['78', '79'], 'value': '<<'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '79', 'type': 'integer', 'children': [], 'value': '16'}; {'id': '80', 'type': '()', 'children': ['81']}; {'id': '81', 'type': 'binary_operator', 'children': ['82', '83'], 'value': '<<'}; {'id': '82', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'bit'}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'region'}
Get the region word for the given chip co-ordinates. Parameters ---------- x : int x co-ordinate y : int y co-ordinate level : int Level of region to build. 0 is the most coarse and 3 is the finest. When 3 is used the specified region will ONLY select the given chip, for other regions surrounding chips will also be selected. Returns ------- int A 32-bit value representing the co-ordinates of the chunk of SpiNNaker chips that should be selected and the blocks within this chunk that are selected. As long as bits (31:16) are the same these values may be OR-ed together to increase the number of sub-blocks selected.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_run'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '36', '64', '70', '76', '82', '95', '112', '122', '131']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '8', '13']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'node'}; {'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': 'node'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'relatives'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'launch_node_task'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '19', 'type': 'for_statement', 'children': ['20', '21', '26']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'node'}; {'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': 'node'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'relatives'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'wait_and_join'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'task'}; {'id': '36', 'type': 'if_statement', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'while_statement', 'children': ['44', '54']}; {'id': '44', 'type': 'not_operator', 'children': ['45']}; {'id': '45', 'type': 'attribute', 'children': ['46', '53']}; {'id': '46', 'type': 'attribute', 'children': ['47', '52']}; {'id': '47', 'type': 'attribute', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'task'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'siblings_permission'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'sleep'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': '_polling_time'}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'has_started'}; {'id': '69', 'type': 'True', 'children': []}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'main'}; {'id': '75', 'type': 'argument_list', 'children': []}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'siblings_permission'}; {'id': '81', 'type': 'True', 'children': []}; {'id': '82', 'type': 'for_statement', 'children': ['83', '84', '89']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '84', 'type': 'attribute', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'siblings'}; {'id': '89', 'type': 'block', 'children': ['90']}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'launch_node_task'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '95', 'type': 'for_statement', 'children': ['96', '97', '102']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '97', 'type': 'attribute', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'siblings'}; {'id': '102', 'type': 'block', 'children': ['103']}; {'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': 'self'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'wait_and_join'}; {'id': '108', 'type': 'argument_list', 'children': ['109']}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'task'}; {'id': '112', 'type': 'expression_statement', 'children': ['113']}; {'id': '113', 'type': 'assignment', 'children': ['114', '117']}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'finished_at'}; {'id': '117', 'type': 'call', 'children': ['118', '121']}; {'id': '118', 'type': 'attribute', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '121', 'type': 'argument_list', 'children': []}; {'id': '122', 'type': 'expression_statement', 'children': ['123']}; {'id': '123', 'type': 'call', 'children': ['124', '129']}; {'id': '124', 'type': 'attribute', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'scheduler'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'notify_execution'}; {'id': '129', 'type': 'argument_list', 'children': ['130']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '136']}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'has_finished'}; {'id': '136', 'type': 'True', 'children': []}
Run the task respecting dependencies
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'print_item_callback'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '9', 'type': 'argument_list', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'string', 'children': [], 'value': "'&listen [{}, {}={}]'"}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '22', '29']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'string', 'children': [], 'value': "'cmd'"}; {'id': '21', 'type': 'string', 'children': [], 'value': "''"}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '28', 'type': 'string', 'children': [], 'value': "''"}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35']}; {'id': '34', 'type': 'string', 'children': [], 'value': "'data'"}; {'id': '35', 'type': 'string', 'children': [], 'value': "''"}
Print an item callback, used by &listen.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'crypto_box_keypair'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '15', '25', '35', '48']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'assignment', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'pk'}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ffi'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'new'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'string', 'children': [], 'value': '"unsigned char[]"'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'crypto_box_PUBLICKEYBYTES'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sk'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'ffi'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'new'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': '"unsigned char[]"'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'crypto_box_SECRETKEYBYTES'}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'rc'}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'crypto_box_keypair'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'pk'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'sk'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ensure'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '42', '43']}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '41'], 'value': '=='}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'rc'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '42', 'type': 'string', 'children': [], 'value': "'Unexpected library error'"}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'raising'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'exc'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'RuntimeError'}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'tuple', 'children': ['50', '60']}; {'id': '50', 'type': 'subscript', 'children': ['51', '58']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'ffi'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'buffer'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'pk'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'crypto_box_PUBLICKEYBYTES'}; {'id': '58', 'type': 'slice', 'children': ['59']}; {'id': '59', 'type': 'colon', 'children': []}; {'id': '60', 'type': 'subscript', 'children': ['61', '68']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'ffi'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'buffer'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sk'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'crypto_box_SECRETKEYBYTES'}; {'id': '68', 'type': 'slice', 'children': ['69']}; {'id': '69', 'type': 'colon', 'children': []}
Returns a randomly generated public and secret key. :rtype: (bytes(public_key), bytes(secret_key))
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_property_values_with_defaults'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'classname'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'property_values'}; {'id': '7', 'type': 'block', 'children': ['8', '17', '24']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'final_values'}; {'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': 'get_default_property_values'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'classname'}; {'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': 'final_values'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'property_values'}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'final_values'}
Return the property values for the class, with default values applied where needed.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sanity_check_registered_locations_parent_locations'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'query_metadata_table'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '10', '13']}; {'id': '7', 'type': 'pattern_list', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'location'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'location_info'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'query_metadata_table'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'registered_locations'}; {'id': '13', 'type': 'block', 'children': ['14', '53']}; {'id': '14', 'type': 'if_statement', 'children': ['15', '31']}; {'id': '15', 'type': '()', 'children': ['16']}; {'id': '16', 'type': 'boolean_operator', 'children': ['17', '22'], 'value': 'and'}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': '!='}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'location'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'query_metadata_table'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'root_location'}; {'id': '22', 'type': 'not_operator', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '29']}; {'id': '24', 'type': 'attribute', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'query_metadata_table'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'root_location'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'is_revisited_at'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'location'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'if_statement', 'children': ['33', '38']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '37'], 'value': 'is'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'location_info'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'parent_location'}; {'id': '37', 'type': 'None', 'children': []}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'raise_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'AssertionError'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '50']}; {'id': '44', 'type': 'attribute', 'children': ['45', '49']}; {'id': '45', 'type': 'concatenated_string', 'children': ['46', '47', '48']}; {'id': '46', 'type': 'string', 'children': [], 'value': "u'Found a location that is not the root location of the query '"}; {'id': '47', 'type': 'string', 'children': [], 'value': "u'or a revisit of the root, but does not have a parent: '"}; {'id': '48', 'type': 'string', 'children': [], 'value': "u'{} {}'"}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'location'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'location_info'}; {'id': '53', 'type': 'if_statement', 'children': ['54', '59']}; {'id': '54', 'type': 'comparison_operator', 'children': ['55', '58'], 'value': 'is not'}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'location_info'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'parent_location'}; {'id': '58', 'type': 'None', 'children': []}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'query_metadata_table'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'get_location_info'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'location_info'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'parent_location'}
Assert that all registered locations' parent locations are also registered.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'log'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'block', 'children': ['9', '13', '17', '108', '113', '122', '131', '140']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'red'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'\\033[91m'"}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'endc'}; {'id': '16', 'type': 'string', 'children': [], 'value': "'\\033[0m'"}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'cfg'}; {'id': '20', 'type': 'dictionary', 'children': ['21', '24', '27', '52', '79']}; {'id': '21', 'type': 'pair', 'children': ['22', '23']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '23', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '24', 'type': 'pair', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': "'disable_existing_loggers'"}; {'id': '26', 'type': 'False', 'children': []}; {'id': '27', 'type': 'pair', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'formatters'"}; {'id': '29', 'type': 'dictionary', 'children': ['30', '39']}; {'id': '30', 'type': 'pair', 'children': ['31', '32']}; {'id': '31', 'type': 'string', 'children': [], 'value': "'stdout'"}; {'id': '32', 'type': 'dictionary', 'children': ['33', '36']}; {'id': '33', 'type': 'pair', 'children': ['34', '35']}; {'id': '34', 'type': 'string', 'children': [], 'value': "'format'"}; {'id': '35', 'type': 'string', 'children': [], 'value': "'[%(levelname)s]: %(asctime)s - %(message)s'"}; {'id': '36', 'type': 'pair', 'children': ['37', '38']}; {'id': '37', 'type': 'string', 'children': [], 'value': "'datefmt'"}; {'id': '38', 'type': 'string', 'children': [], 'value': "'%x %X'"}; {'id': '39', 'type': 'pair', 'children': ['40', '41']}; {'id': '40', 'type': 'string', 'children': [], 'value': "'stderr'"}; {'id': '41', 'type': 'dictionary', 'children': ['42', '49']}; {'id': '42', 'type': 'pair', 'children': ['43', '44']}; {'id': '43', 'type': 'string', 'children': [], 'value': "'format'"}; {'id': '44', 'type': 'binary_operator', 'children': ['45', '48'], 'value': '+'}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '47'], 'value': '+'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'red'}; {'id': '47', 'type': 'string', 'children': [], 'value': "'[%(levelname)s]: %(asctime)s - %(message)s'"}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'endc'}; {'id': '49', 'type': 'pair', 'children': ['50', '51']}; {'id': '50', 'type': 'string', 'children': [], 'value': "'datefmt'"}; {'id': '51', 'type': 'string', 'children': [], 'value': "'%x %X'"}; {'id': '52', 'type': 'pair', 'children': ['53', '54']}; {'id': '53', 'type': 'string', 'children': [], 'value': "'handlers'"}; {'id': '54', 'type': 'dictionary', 'children': ['55', '67']}; {'id': '55', 'type': 'pair', 'children': ['56', '57']}; {'id': '56', 'type': 'string', 'children': [], 'value': "'stdout'"}; {'id': '57', 'type': 'dictionary', 'children': ['58', '61', '64']}; {'id': '58', 'type': 'pair', 'children': ['59', '60']}; {'id': '59', 'type': 'string', 'children': [], 'value': "'class'"}; {'id': '60', 'type': 'string', 'children': [], 'value': "'logging.StreamHandler'"}; {'id': '61', 'type': 'pair', 'children': ['62', '63']}; {'id': '62', 'type': 'string', 'children': [], 'value': "'level'"}; {'id': '63', 'type': 'string', 'children': [], 'value': "'DEBUG'"}; {'id': '64', 'type': 'pair', 'children': ['65', '66']}; {'id': '65', 'type': 'string', 'children': [], 'value': "'formatter'"}; {'id': '66', 'type': 'string', 'children': [], 'value': "'stdout'"}; {'id': '67', 'type': 'pair', 'children': ['68', '69']}; {'id': '68', 'type': 'string', 'children': [], 'value': "'stderr'"}; {'id': '69', 'type': 'dictionary', 'children': ['70', '73', '76']}; {'id': '70', 'type': 'pair', 'children': ['71', '72']}; {'id': '71', 'type': 'string', 'children': [], 'value': "'class'"}; {'id': '72', 'type': 'string', 'children': [], 'value': "'logging.StreamHandler'"}; {'id': '73', 'type': 'pair', 'children': ['74', '75']}; {'id': '74', 'type': 'string', 'children': [], 'value': "'level'"}; {'id': '75', 'type': 'string', 'children': [], 'value': "'ERROR'"}; {'id': '76', 'type': 'pair', 'children': ['77', '78']}; {'id': '77', 'type': 'string', 'children': [], 'value': "'formatter'"}; {'id': '78', 'type': 'string', 'children': [], 'value': "'stderr'"}; {'id': '79', 'type': 'pair', 'children': ['80', '81']}; {'id': '80', 'type': 'string', 'children': [], 'value': "'loggers'"}; {'id': '81', 'type': 'dictionary', 'children': ['82', '95']}; {'id': '82', 'type': 'pair', 'children': ['83', '84']}; {'id': '83', 'type': 'string', 'children': [], 'value': "'info'"}; {'id': '84', 'type': 'dictionary', 'children': ['85', '89', '92']}; {'id': '85', 'type': 'pair', 'children': ['86', '87']}; {'id': '86', 'type': 'string', 'children': [], 'value': "'handlers'"}; {'id': '87', 'type': 'list', 'children': ['88'], 'value': "['stdout']"}; {'id': '88', 'type': 'string', 'children': [], 'value': "'stdout'"}; {'id': '89', 'type': 'pair', 'children': ['90', '91']}; {'id': '90', 'type': 'string', 'children': [], 'value': "'level'"}; {'id': '91', 'type': 'string', 'children': [], 'value': "'INFO'"}; {'id': '92', 'type': 'pair', 'children': ['93', '94']}; {'id': '93', 'type': 'string', 'children': [], 'value': "'propagate'"}; {'id': '94', 'type': 'True', 'children': []}; {'id': '95', 'type': 'pair', 'children': ['96', '97']}; {'id': '96', 'type': 'string', 'children': [], 'value': "'error'"}; {'id': '97', 'type': 'dictionary', 'children': ['98', '102', '105']}; {'id': '98', 'type': 'pair', 'children': ['99', '100']}; {'id': '99', 'type': 'string', 'children': [], 'value': "'handlers'"}; {'id': '100', 'type': 'list', 'children': ['101'], 'value': "['stderr']"}; {'id': '101', 'type': 'string', 'children': [], 'value': "'stderr'"}; {'id': '102', 'type': 'pair', 'children': ['103', '104']}; {'id': '103', 'type': 'string', 'children': [], 'value': "'level'"}; {'id': '104', 'type': 'string', 'children': [], 'value': "'ERROR'"}; {'id': '105', 'type': 'pair', 'children': ['106', '107']}; {'id': '106', 'type': 'string', 'children': [], 'value': "'propagate'"}; {'id': '107', 'type': 'False', 'children': []}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'call', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'dictConfig'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'cfg'}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'assignment', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'lg'}; {'id': '116', 'type': 'conditional_expression', 'children': ['117', '118', '121'], 'value': 'if'}; {'id': '117', 'type': 'string', 'children': [], 'value': "'info'"}; {'id': '118', 'type': 'comparison_operator', 'children': ['119', '120'], 'value': '=='}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '120', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '121', 'type': 'string', 'children': [], 'value': "'error'"}; {'id': '122', 'type': 'expression_statement', 'children': ['123']}; {'id': '123', 'type': 'assignment', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'lvl'}; {'id': '125', 'type': 'conditional_expression', 'children': ['126', '127', '130'], 'value': 'if'}; {'id': '126', 'type': 'integer', 'children': [], 'value': '20'}; {'id': '127', 'type': 'comparison_operator', 'children': ['128', '129'], 'value': '=='}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '129', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '130', 'type': 'integer', 'children': [], 'value': '40'}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '134', 'type': 'call', 'children': ['135', '138']}; {'id': '135', 'type': 'attribute', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '138', 'type': 'argument_list', 'children': ['139']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'lg'}; {'id': '140', 'type': 'expression_statement', 'children': ['141']}; {'id': '141', 'type': 'call', 'children': ['142', '145']}; {'id': '142', 'type': 'attribute', 'children': ['143', '144']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '145', 'type': 'argument_list', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'lvl'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'msg'}
Logs a message to the console, with optional level paramater Args: - msg (str): message to send to console - level (int): log level; 0 for info, 1 for error (default = 0)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_cutout'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '10']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '5', 'type': 'typed_default_parameter', 'children': ['6', '7', '9']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'n_holes'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'uniform_int'}; {'id': '9', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '10', 'type': 'typed_default_parameter', 'children': ['11', '12', '14']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '12', 'type': 'type', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'uniform_int'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '40'}; {'id': '15', 'type': 'block', 'children': ['16', '18', '30', '148']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'string', 'children': [], 'value': '"Cut out `n_holes` number of square holes of size `length` in image at random locations."'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '23']}; {'id': '20', 'type': 'pattern_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'w'}; {'id': '23', 'type': 'subscript', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '27', 'type': 'slice', 'children': ['28', '29']}; {'id': '28', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '29', 'type': 'colon', 'children': []}; {'id': '30', 'type': 'for_statement', 'children': ['31', '32', '36']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'n_holes'}; {'id': '36', 'type': 'block', 'children': ['37', '49', '61', '79', '97', '115', '133']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'h_y'}; {'id': '40', 'type': 'call', 'children': ['41', '46']}; {'id': '41', 'type': 'attribute', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'random'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'randint'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48']}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'h_x'}; {'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': 'np'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'random'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'randint'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '60']}; {'id': '59', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'w'}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'y1'}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'clip'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '77', '78']}; {'id': '72', 'type': 'binary_operator', 'children': ['73', '74'], 'value': '-'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'h_y'}; {'id': '74', 'type': 'binary_operator', 'children': ['75', '76'], 'value': '/'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '76', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '77', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'y2'}; {'id': '82', 'type': 'call', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'clip'}; {'id': '89', 'type': 'argument_list', 'children': ['90', '95', '96']}; {'id': '90', 'type': 'binary_operator', 'children': ['91', '92'], 'value': '+'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'h_y'}; {'id': '92', 'type': 'binary_operator', 'children': ['93', '94'], 'value': '/'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '94', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '95', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'assignment', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'x1'}; {'id': '100', 'type': 'call', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'int'}; {'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': 'np'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'clip'}; {'id': '107', 'type': 'argument_list', 'children': ['108', '113', '114']}; {'id': '108', 'type': 'binary_operator', 'children': ['109', '110'], 'value': '-'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'h_x'}; {'id': '110', 'type': 'binary_operator', 'children': ['111', '112'], 'value': '/'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '112', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '113', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'w'}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'assignment', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'x2'}; {'id': '118', 'type': 'call', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '120', 'type': 'argument_list', 'children': ['121']}; {'id': '121', 'type': 'call', 'children': ['122', '125']}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'clip'}; {'id': '125', 'type': 'argument_list', 'children': ['126', '131', '132']}; {'id': '126', 'type': 'binary_operator', 'children': ['127', '128'], 'value': '+'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'h_x'}; {'id': '128', 'type': 'binary_operator', 'children': ['129', '130'], 'value': '/'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '130', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '131', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'w'}; {'id': '133', 'type': 'expression_statement', 'children': ['134']}; {'id': '134', 'type': 'assignment', 'children': ['135', '147']}; {'id': '135', 'type': 'subscript', 'children': ['136', '137', '139', '143']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '137', 'type': 'slice', 'children': ['138']}; {'id': '138', 'type': 'colon', 'children': []}; {'id': '139', 'type': 'slice', 'children': ['140', '141', '142']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'y1'}; {'id': '141', 'type': 'colon', 'children': []}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'y2'}; {'id': '143', 'type': 'slice', 'children': ['144', '145', '146']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'x1'}; {'id': '145', 'type': 'colon', 'children': []}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'x2'}; {'id': '147', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '148', 'type': 'return_statement', 'children': ['149']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'x'}
Cut out `n_holes` number of square holes of size `length` in image at random locations.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'describe'}; {'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': 'OrderedDict'}; {'id': '9', 'type': 'argument_list', 'children': ['10']}; {'id': '10', 'type': 'list_comprehension', 'children': ['11', '18']}; {'id': '11', 'type': 'tuple', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'describe'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'for_in_clause', 'children': ['19', '22']}; {'id': '19', 'type': 'pattern_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '22', 'type': 'call', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '28', 'type': 'argument_list', 'children': []}
Describe all serialized fields. It returns dictionary of all fields description defined for this serializer using their own ``describe()`` methods with respect to order in which they are defined as class attributes. Returns: OrderedDict: serializer description
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '28']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'endpoint_create'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14', '17', '20', '23', '26']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'publicurl'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'internalurl'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'adminurl'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'profile'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'default_parameter', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'default_parameter', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '25', 'type': 'None', 'children': []}; {'id': '26', 'type': 'dictionary_splat_pattern', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '28', 'type': 'block', 'children': ['29', '38', '52', '65', '123']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'kstone'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'auth'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'profile'}; {'id': '36', 'type': 'dictionary_splat', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'keystone_service'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'service_get'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '47', '50']}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '47', 'type': 'keyword_argument', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'profile'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'profile'}; {'id': '50', 'type': 'dictionary_splat', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '52', 'type': 'if_statement', 'children': ['53', '59']}; {'id': '53', 'type': 'boolean_operator', 'children': ['54', '56'], 'value': 'or'}; {'id': '54', 'type': 'not_operator', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'keystone_service'}; {'id': '56', 'type': 'comparison_operator', 'children': ['57', '58'], 'value': 'in'}; {'id': '57', 'type': 'string', 'children': [], 'value': "'Error'"}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'keystone_service'}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'return_statement', 'children': ['61']}; {'id': '61', 'type': 'dictionary', 'children': ['62']}; {'id': '62', 'type': 'pair', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'Error'"}; {'id': '64', 'type': 'string', 'children': [], 'value': "'Could not find the specified service'"}; {'id': '65', 'type': 'if_statement', 'children': ['66', '69', '94']}; {'id': '66', 'type': 'comparison_operator', 'children': ['67', '68'], 'value': '>'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': '_OS_IDENTITY_API_VERSION'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '77']}; {'id': '72', 'type': 'attribute', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'kstone'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'endpoints'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'create'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '85', '88', '91']}; {'id': '78', 'type': 'keyword_argument', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '80', 'type': 'subscript', 'children': ['81', '84']}; {'id': '81', 'type': 'subscript', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'keystone_service'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '84', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '85', 'type': 'keyword_argument', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'region_id'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '88', 'type': 'keyword_argument', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '91', 'type': 'keyword_argument', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '94', 'type': 'else_clause', 'children': ['95']}; {'id': '95', 'type': 'block', 'children': ['96']}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '103']}; {'id': '98', 'type': 'attribute', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'kstone'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'endpoints'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'create'}; {'id': '103', 'type': 'argument_list', 'children': ['104', '107', '114', '117', '120']}; {'id': '104', 'type': 'keyword_argument', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '107', 'type': 'keyword_argument', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'service_id'}; {'id': '109', 'type': 'subscript', 'children': ['110', '113']}; {'id': '110', 'type': 'subscript', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'keystone_service'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '113', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '114', 'type': 'keyword_argument', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'publicurl'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'publicurl'}; {'id': '117', 'type': 'keyword_argument', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'adminurl'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'adminurl'}; {'id': '120', 'type': 'keyword_argument', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'internalurl'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'internalurl'}; {'id': '123', 'type': 'return_statement', 'children': ['124']}; {'id': '124', 'type': 'call', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'endpoint_get'}; {'id': '126', 'type': 'argument_list', 'children': ['127', '128', '129', '130', '131']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'profile'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '131', 'type': 'dictionary_splat', 'children': ['132']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'connection_args'}
Create an endpoint for an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_create nova 'http://public/url' 'http://internal/url' 'http://adminurl/url' region salt 'v3' keystone.endpoint_create nova url='http://public/url' interface='public' region='RegionOne'
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ScanForVolumeSystem'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'source_path_spec'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '27', '39', '80', '86', '101', '122', '148']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '15']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': '=='}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'source_path_spec'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'type_indicator'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'definitions'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'TYPE_INDICATOR_VSHADOW'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'None', 'children': []}; {'id': '18', 'type': 'if_statement', 'children': ['19', '24']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'source_path_spec'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'IsVolumeSystemRoot'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'source_path_spec'}; {'id': '27', 'type': 'if_statement', 'children': ['28', '36']}; {'id': '28', 'type': 'comparison_operator', 'children': ['29', '32'], 'value': '=='}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'source_path_spec'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'type_indicator'}; {'id': '32', 'type': '()', 'children': ['33']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'definitions'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'TYPE_INDICATOR_APFS_CONTAINER'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': 'None', 'children': []}; {'id': '39', 'type': 'try_statement', 'children': ['40', '57']}; {'id': '40', 'type': 'block', 'children': ['41']}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'type_indicators'}; {'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': 'analyzer'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'Analyzer'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'GetVolumeSystemTypeIndicators'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'source_path_spec'}; {'id': '52', 'type': 'keyword_argument', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'resolver_context'}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_resolver_context'}; {'id': '57', 'type': 'except_clause', 'children': ['58', '64']}; {'id': '58', 'type': 'as_pattern', 'children': ['59', '62']}; {'id': '59', 'type': 'tuple', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'IOError'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'RuntimeError'}; {'id': '62', 'type': 'as_pattern_target', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'exception'}; {'id': '64', 'type': 'block', 'children': ['65']}; {'id': '65', 'type': 'raise_statement', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'errors'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'BackEndError'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '78']}; {'id': '72', 'type': 'attribute', 'children': ['73', '77']}; {'id': '73', 'type': '()', 'children': ['74']}; {'id': '74', 'type': 'concatenated_string', 'children': ['75', '76']}; {'id': '75', 'type': 'string', 'children': [], 'value': "'Unable to process source path specification with error: '"}; {'id': '76', 'type': 'string', 'children': [], 'value': "'{0!s}'"}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '78', 'type': 'argument_list', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'exception'}; {'id': '80', 'type': 'if_statement', 'children': ['81', '83']}; {'id': '81', 'type': 'not_operator', 'children': ['82']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'type_indicators'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'None', 'children': []}; {'id': '86', 'type': 'if_statement', 'children': ['87', '93']}; {'id': '87', 'type': 'comparison_operator', 'children': ['88', '92'], 'value': '>'}; {'id': '88', 'type': 'call', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'type_indicators'}; {'id': '92', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '93', 'type': 'block', 'children': ['94']}; {'id': '94', 'type': 'raise_statement', 'children': ['95']}; {'id': '95', 'type': 'call', 'children': ['96', '99']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'errors'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'BackEndError'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'string', 'children': [], 'value': "'Unsupported source found more than one volume system types.'"}; {'id': '101', 'type': 'if_statement', 'children': ['102', '119']}; {'id': '102', 'type': '()', 'children': ['103']}; {'id': '103', 'type': 'boolean_operator', 'children': ['104', '111'], 'value': 'and'}; {'id': '104', 'type': 'comparison_operator', 'children': ['105', '108'], 'value': '=='}; {'id': '105', 'type': 'subscript', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'type_indicators'}; {'id': '107', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'definitions'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'TYPE_INDICATOR_TSK_PARTITION'}; {'id': '111', 'type': 'comparison_operator', 'children': ['112', '115'], 'value': 'in'}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'source_path_spec'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'type_indicator'}; {'id': '115', 'type': 'list', 'children': ['116'], 'value': '[\n definitions.TYPE_INDICATOR_TSK_PARTITION]'}; {'id': '116', 'type': 'attribute', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'definitions'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'TYPE_INDICATOR_TSK_PARTITION'}; {'id': '119', 'type': 'block', 'children': ['120']}; {'id': '120', 'type': 'return_statement', 'children': ['121']}; {'id': '121', 'type': 'None', 'children': []}; {'id': '122', 'type': 'if_statement', 'children': ['123', '130']}; {'id': '123', 'type': 'comparison_operator', 'children': ['124', '127'], 'value': 'in'}; {'id': '124', 'type': 'subscript', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'type_indicators'}; {'id': '126', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'definitions'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'VOLUME_SYSTEM_TYPE_INDICATORS'}; {'id': '130', 'type': 'block', 'children': ['131']}; {'id': '131', 'type': 'return_statement', 'children': ['132']}; {'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': 'path_spec_factory'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'Factory'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'NewPathSpec'}; {'id': '138', 'type': 'argument_list', 'children': ['139', '142', '145']}; {'id': '139', 'type': 'subscript', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'type_indicators'}; {'id': '141', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '142', 'type': 'keyword_argument', 'children': ['143', '144']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'location'}; {'id': '144', 'type': 'string', 'children': [], 'value': "'/'"}; {'id': '145', 'type': 'keyword_argument', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'source_path_spec'}; {'id': '148', 'type': 'return_statement', 'children': ['149']}; {'id': '149', 'type': 'call', 'children': ['150', '155']}; {'id': '150', 'type': 'attribute', 'children': ['151', '154']}; {'id': '151', 'type': 'attribute', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'path_spec_factory'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'Factory'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'NewPathSpec'}; {'id': '155', 'type': 'argument_list', 'children': ['156', '159']}; {'id': '156', 'type': 'subscript', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'type_indicators'}; {'id': '158', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '159', 'type': 'keyword_argument', 'children': ['160', '161']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'source_path_spec'}
Scans the path specification for a supported volume system format. Args: source_path_spec (PathSpec): source path specification. Returns: PathSpec: volume system path specification or None if no supported volume system type was found. Raises: BackEndError: if the source cannot be scanned or more than one volume system type is found.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'AddMethod'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'in_sig'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'out_sig'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '10', 'type': 'block', 'children': ['11', '21', '33', '56', '73', '82', '88', '106', '122']}; {'id': '11', 'type': 'if_statement', 'children': ['12', '14']}; {'id': '12', 'type': 'not_operator', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'n_args'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'dbus'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'Signature'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'in_sig'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '36', 'type': 'lambda', 'children': ['37', '43']}; {'id': '37', 'type': 'lambda_parameters', 'children': ['38', '39', '41']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'list_splat_pattern', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '41', 'type': 'dictionary_splat_pattern', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'DBusMockObject'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'mock_method'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49', '50', '51', '52', '54']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'in_sig'}; {'id': '52', 'type': 'list_splat', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '54', 'type': 'dictionary_splat', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'dbus_method'}; {'id': '59', 'type': 'call', 'children': ['60', '71']}; {'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': 'dbus'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '68', 'type': 'keyword_argument', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'out_signature'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'out_sig'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'assignment', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'dbus_method'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'dbus_method'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': '_dbus_in_signature'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'in_sig'}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'assignment', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'dbus_method'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': '_dbus_args'}; {'id': '93', 'type': 'list_comprehension', 'children': ['94', '97']}; {'id': '94', 'type': 'binary_operator', 'children': ['95', '96'], 'value': '%'}; {'id': '95', 'type': 'string', 'children': [], 'value': "'arg%i'"}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '97', 'type': 'for_in_clause', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '99', 'type': 'call', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '101', 'type': 'argument_list', 'children': ['102', '103']}; {'id': '102', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '103', 'type': 'binary_operator', 'children': ['104', '105'], 'value': '+'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'n_args'}; {'id': '105', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '106', 'type': 'if_statement', 'children': ['107', '112']}; {'id': '107', 'type': 'comparison_operator', 'children': ['108', '109'], 'value': '=='}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '112', 'type': 'block', 'children': ['113']}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'call', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'setattr'}; {'id': '116', 'type': 'argument_list', 'children': ['117', '120', '121']}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'dbus_method'}; {'id': '122', 'type': 'expression_statement', 'children': ['123']}; {'id': '123', 'type': 'assignment', 'children': ['124', '138']}; {'id': '124', 'type': 'subscript', 'children': ['125', '134']}; {'id': '125', 'type': 'call', 'children': ['126', '131']}; {'id': '126', 'type': 'attribute', 'children': ['127', '130']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'methods'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '131', 'type': 'argument_list', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '133', 'type': 'dictionary', 'children': []}; {'id': '134', 'type': 'call', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '136', 'type': 'argument_list', 'children': ['137']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '138', 'type': 'tuple', 'children': ['139', '140', '141', '142']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'in_sig'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'out_sig'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'code'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'dbus_method'}
Add a method to this object interface: D-Bus interface to add this to. For convenience you can specify '' here to add the method to the object's main interface (as specified on construction). name: Name of the method in_sig: Signature of input arguments; for example "ias" for a method that takes an int32 and a string array as arguments; see http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-signatures out_sig: Signature of output arguments; for example "s" for a method that returns a string; use '' for methods that do not return anything. code: Python 3 code to run in the method call; you have access to the arguments through the "args" list, and can set the return value by assigning a value to the "ret" variable. You can also read the global "objects" variable, which is a dictionary mapping object paths to DBusMockObject instances. For keeping state across method calls, you are free to use normal Python members of the "self" object, which will be persistent for the whole mock's life time. E. g. you can have a method with "self.my_state = True", and another method that returns it with "ret = self.my_state". When specifying '', the method will not do anything (except logging) and return None.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'decrypt_seal'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'bytes'}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'bytes'}; {'id': '11', 'type': 'block', 'children': ['12', '23', '34']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'curve25519_public_key'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'libnacl'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'crypto_sign_ed25519_pk_to_curve25519'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'vk'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'curve25519_secret_key'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'libnacl'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'crypto_sign_ed25519_sk_to_curve25519'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'sk'}; {'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': 'libnacl'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'crypto_box_seal_open'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41', '42']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'curve25519_public_key'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'curve25519_secret_key'}
Decrypt bytes data with a curve25519 version of the ed25519 key pair :param data: Encrypted data :return:
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_context_arguments'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '25']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'cargs'}; {'id': '9', 'type': 'dictionary', 'children': []}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '15']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '__context_stack'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'cargs'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'context_arguments'}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'cargs'}
Return a dictionary containing the current context arguments.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_toc_reference'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'app'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'toc'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'docname'}; {'id': '8', 'type': 'block', 'children': ['9', '123']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '27', '43', '73']}; {'id': '10', 'type': 'boolean_operator', 'children': ['11', '18'], 'value': 'and'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'document'}; {'id': '27', 'type': 'block', 'children': ['28', '32']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'ref_id'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'docname'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'toc_reference'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_find_toc_node'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39', '40']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'toc'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'ref_id'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '43', 'type': 'elif_clause', 'children': ['44', '51']}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '51', 'type': 'block', 'children': ['52', '62']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'ref_id'}; {'id': '55', 'type': 'subscript', 'children': ['56', '61']}; {'id': '56', 'type': 'subscript', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'attributes'}; {'id': '60', 'type': 'string', 'children': [], 'value': '"ids"'}; {'id': '61', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'toc_reference'}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_find_toc_node'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '69', '70']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'toc'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'ref_id'}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '73', 'type': 'else_clause', 'children': ['74']}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'try_statement', 'children': ['76', '102']}; {'id': '76', 'type': 'block', 'children': ['77', '91']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'ref_id'}; {'id': '80', 'type': 'subscript', 'children': ['81', '90']}; {'id': '81', 'type': 'subscript', 'children': ['82', '89']}; {'id': '82', 'type': 'attribute', 'children': ['83', '88']}; {'id': '83', 'type': 'subscript', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '87', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'attributes'}; {'id': '89', 'type': 'string', 'children': [], 'value': '"ids"'}; {'id': '90', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'toc_reference'}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': '_find_toc_node'}; {'id': '96', 'type': 'argument_list', 'children': ['97', '98', '99']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'toc'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'ref_id'}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'addnodes'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '102', 'type': 'except_clause', 'children': ['103', '109']}; {'id': '103', 'type': 'as_pattern', 'children': ['104', '107']}; {'id': '104', 'type': 'tuple', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'IndexError'}; {'id': '107', 'type': 'as_pattern_target', 'children': ['108']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '109', 'type': 'block', 'children': ['110', '119']}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'call', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'LOGGER'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '115', 'type': 'argument_list', 'children': ['116']}; {'id': '116', 'type': 'binary_operator', 'children': ['117', '118'], 'value': '%'}; {'id': '117', 'type': 'string', 'children': [], 'value': '"Invalid desc node: %s"'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'assignment', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'toc_reference'}; {'id': '122', 'type': 'None', 'children': []}; {'id': '123', 'type': 'return_statement', 'children': ['124']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'toc_reference'}
Logic that understands maps a specific node to it's part of the toctree. It takes a specific incoming ``node``, and returns the actual TOC Tree node that is said reference.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'shutdown'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '18', '34', '46']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'inputQueue'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'inputQueue'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'inputQueue'}; {'id': '17', 'type': 'None', 'children': []}; {'id': '18', 'type': 'for_statement', 'children': ['19', '20', '26']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'numWorkers'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'inputQueue'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'put'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'None', 'children': []}; {'id': '34', 'type': 'for_statement', 'children': ['35', '36', '39']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'thread'}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'workerThreads'}; {'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': 'thread'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '45', 'type': 'argument_list', 'children': []}; {'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': 'BatchSystemSupport'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'workerCleanup'}; {'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': 'workerCleanupInfo'}
Cleanly terminate worker threads. Add sentinels to inputQueue equal to maxThreads. Join all worker threads.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_calf'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'spec'}; {'id': '6', 'type': 'block', 'children': ['7', '14', '21', '28', '35']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'prepare'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'spec'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'compile'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'spec'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'assemble'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'spec'}; {'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': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'link'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'spec'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'finalize'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'spec'}
The main call, assuming the base spec is prepared. Also, no advices will be triggered.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reorient_wf'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'string', 'children': [], 'value': "'ReorientWorkflow'"}; {'id': '7', 'type': 'block', 'children': ['8', '19', '39', '59', '78', '100', '128']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'workflow'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'pe'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'Workflow'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'inputnode'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'pe'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'Node'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '36']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'niu'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'IdentityInterface'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '34', 'type': 'list', 'children': ['35'], 'value': "['in_file']"}; {'id': '35', 'type': 'string', 'children': [], 'value': "'in_file'"}; {'id': '36', 'type': 'keyword_argument', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '38', 'type': 'string', 'children': [], 'value': "'inputnode'"}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'outputnode'}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'pe'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'Node'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '56']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'niu'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'IdentityInterface'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'keyword_argument', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '54', 'type': 'list', 'children': ['55'], 'value': "['out_file']"}; {'id': '55', 'type': 'string', 'children': [], 'value': "'out_file'"}; {'id': '56', 'type': 'keyword_argument', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '58', 'type': 'string', 'children': [], 'value': "'outputnode'"}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'deoblique'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'pe'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'Node'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '75']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'afni'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'Refit'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'keyword_argument', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'deoblique'}; {'id': '74', 'type': 'True', 'children': []}; {'id': '75', 'type': 'keyword_argument', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '77', 'type': 'string', 'children': [], 'value': "'deoblique'"}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'reorient'}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'pe'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'Node'}; {'id': '85', 'type': 'argument_list', 'children': ['86', '97']}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'afni'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'Resample'}; {'id': '90', 'type': 'argument_list', 'children': ['91', '94']}; {'id': '91', 'type': 'keyword_argument', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'orientation'}; {'id': '93', 'type': 'string', 'children': [], 'value': "'RPI'"}; {'id': '94', 'type': 'keyword_argument', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'outputtype'}; {'id': '96', 'type': 'string', 'children': [], 'value': "'NIFTI_GZ'"}; {'id': '97', 'type': 'keyword_argument', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '99', 'type': 'string', 'children': [], 'value': "'reorient'"}; {'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': 'workflow'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'connect'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'list', 'children': ['107', '114', '121'], 'value': "[\n (inputnode, deoblique, [('in_file', 'in_file')]),\n (deoblique, reorient, [('out_file', 'in_file')]),\n (reorient, outputnode, [('out_file', 'out_file')])\n ]"}; {'id': '107', 'type': 'tuple', 'children': ['108', '109', '110']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'inputnode'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'deoblique'}; {'id': '110', 'type': 'list', 'children': ['111'], 'value': "[('in_file', 'in_file')]"}; {'id': '111', 'type': 'tuple', 'children': ['112', '113']}; {'id': '112', 'type': 'string', 'children': [], 'value': "'in_file'"}; {'id': '113', 'type': 'string', 'children': [], 'value': "'in_file'"}; {'id': '114', 'type': 'tuple', 'children': ['115', '116', '117']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'deoblique'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'reorient'}; {'id': '117', 'type': 'list', 'children': ['118'], 'value': "[('out_file', 'in_file')]"}; {'id': '118', 'type': 'tuple', 'children': ['119', '120']}; {'id': '119', 'type': 'string', 'children': [], 'value': "'out_file'"}; {'id': '120', 'type': 'string', 'children': [], 'value': "'in_file'"}; {'id': '121', 'type': 'tuple', 'children': ['122', '123', '124']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'reorient'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'outputnode'}; {'id': '124', 'type': 'list', 'children': ['125'], 'value': "[('out_file', 'out_file')]"}; {'id': '125', 'type': 'tuple', 'children': ['126', '127']}; {'id': '126', 'type': 'string', 'children': [], 'value': "'out_file'"}; {'id': '127', 'type': 'string', 'children': [], 'value': "'out_file'"}; {'id': '128', 'type': 'return_statement', 'children': ['129']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'workflow'}
A workflow to reorient images to 'RPI' orientation
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'convert'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '18', '32', '44', '64', '77', '95', '115', '125', '135', '141', '148', '157']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'downloaded'}; {'id': '11', 'type': 'False', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'raise_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'serror'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'string', 'children': [], 'value': '"Track not downloaded, can\'t convert file.."'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'filetype'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'magic'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'from_file'}; {'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': 'filepath'}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'mime'}; {'id': '31', 'type': 'True', 'children': []}; {'id': '32', 'type': 'if_statement', 'children': ['33', '36']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '35'], 'value': '=='}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'filetype'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"audio/mpeg"'}; {'id': '36', 'type': 'block', 'children': ['37', '42']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'string', 'children': [], 'value': '"File is already in mp3 format. Skipping convert."'}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'False', 'children': []}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'rootpath'}; {'id': '47', 'type': 'call', 'children': ['48', '53']}; {'id': '48', 'type': 'attribute', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '60']}; {'id': '55', 'type': 'attribute', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'backupdir'}; {'id': '67', 'type': 'binary_operator', 'children': ['68', '71'], 'value': '+'}; {'id': '68', 'type': 'binary_operator', 'children': ['69', '70'], 'value': '+'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'rootpath'}; {'id': '70', 'type': 'string', 'children': [], 'value': '"/backups/"'}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'string', 'children': [], 'value': '"username"'}; {'id': '77', 'type': 'if_statement', 'children': ['78', '87']}; {'id': '78', 'type': 'not_operator', 'children': ['79']}; {'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': 'exists'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'backupdir'}; {'id': '87', 'type': 'block', 'children': ['88']}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'call', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'makedirs'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'backupdir'}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'assignment', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'backupfile'}; {'id': '98', 'type': 'binary_operator', 'children': ['99', '100'], 'value': '%'}; {'id': '99', 'type': 'string', 'children': [], 'value': '"%s/%s%s"'}; {'id': '100', 'type': 'tuple', 'children': ['101', '102', '107']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'backupdir'}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'gen_filename'}; {'id': '106', 'type': 'argument_list', 'children': []}; {'id': '107', 'type': 'call', 'children': ['108', '111']}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'get_file_extension'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'assignment', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'newfile'}; {'id': '118', 'type': 'binary_operator', 'children': ['119', '120'], 'value': '%'}; {'id': '119', 'type': 'string', 'children': [], 'value': '"%s.mp3"'}; {'id': '120', 'type': 'call', 'children': ['121', '124']}; {'id': '121', 'type': 'attribute', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'filename_without_extension'}; {'id': '124', 'type': 'argument_list', 'children': []}; {'id': '125', 'type': 'expression_statement', 'children': ['126']}; {'id': '126', 'type': 'call', 'children': ['127', '130']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'rename'}; {'id': '130', 'type': 'argument_list', 'children': ['131', '134']}; {'id': '131', 'type': 'attribute', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'backupfile'}; {'id': '135', 'type': 'expression_statement', 'children': ['136']}; {'id': '136', 'type': 'assignment', 'children': ['137', '140']}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'newfile'}; {'id': '141', 'type': 'expression_statement', 'children': ['142']}; {'id': '142', 'type': 'call', 'children': ['143', '144']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'binary_operator', 'children': ['146', '147'], 'value': '%'}; {'id': '146', 'type': 'string', 'children': [], 'value': '"Converting to %s.."'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'newfile'}; {'id': '148', 'type': 'expression_statement', 'children': ['149']}; {'id': '149', 'type': 'assignment', 'children': ['150', '151']}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'song'}; {'id': '151', 'type': 'call', 'children': ['152', '155']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'AudioSegment'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'from_file'}; {'id': '155', 'type': 'argument_list', 'children': ['156']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'backupfile'}; {'id': '157', 'type': 'return_statement', 'children': ['158']}; {'id': '158', 'type': 'call', 'children': ['159', '162']}; {'id': '159', 'type': 'attribute', 'children': ['160', '161']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'song'}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'export'}; {'id': '162', 'type': 'argument_list', 'children': ['163', '164']}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'newfile'}; {'id': '164', 'type': 'keyword_argument', 'children': ['165', '166']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '166', 'type': 'string', 'children': [], 'value': '"mp3"'}
Convert file in mp3 format.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'readFromFile'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '6', 'type': 'block', 'children': ['7', '19', '40', '56']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'load'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '19', 'type': 'try_statement', 'children': ['20', '31']}; {'id': '20', 'type': 'block', 'children': ['21']}; {'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': 'coeffs'}; {'id': '26', 'type': 'subscript', 'children': ['27', '30']}; {'id': '27', 'type': 'subscript', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '29', 'type': 'string', 'children': [], 'value': "'coeffs'"}; {'id': '30', 'type': 'tuple', 'children': []}; {'id': '31', 'type': 'except_clause', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'coeffs'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '40', 'type': 'try_statement', 'children': ['41', '52']}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '47', 'type': 'subscript', 'children': ['48', '51']}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '50', 'type': 'string', 'children': [], 'value': "'opts'"}; {'id': '51', 'type': 'tuple', 'children': []}; {'id': '52', 'type': 'except_clause', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'KeyError'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'pass_statement', 'children': []}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'coeffs'}
read the distortion coeffs from file
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dollars_to_math'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '17', '29', '31', '35', '68', '79', '88', '97', '107', '117', '133']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '17', 'type': 'if_statement', 'children': ['18', '27']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '25'], 'value': '=='}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'find'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'string', 'children': [], 'value': '"$"'}; {'id': '25', 'type': 'unary_operator', 'children': ['26'], 'value': '-'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'return_statement', 'children': []}; {'id': '29', 'type': 'global_statement', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_data'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_data'}; {'id': '34', 'type': 'dictionary', 'children': []}; {'id': '35', 'type': 'function_definition', 'children': ['36', '37', '39']}; {'id': '36', 'type': 'function_name', 'children': [], 'value': 'repl'}; {'id': '37', 'type': 'parameters', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'matchobj'}; {'id': '39', 'type': 'block', 'children': ['40', '42', '51', '60', '66']}; {'id': '40', 'type': 'global_statement', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_data'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'matchobj'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '54', 'type': 'binary_operator', 'children': ['55', '56'], 'value': '%'}; {'id': '55', 'type': 'string', 'children': [], 'value': '"___XXX_REPL_%d___"'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_data'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '65']}; {'id': '62', 'type': 'subscript', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': '_data'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '66', 'type': 'return_statement', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'sub'}; {'id': '75', 'type': 'argument_list', 'children': ['76', '77', '78']}; {'id': '76', 'type': 'string', 'children': [], 'value': 'r"({[^{}$]*\\$[^{}$]*\\$[^{}]*})"'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'repl'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'dollars'}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'compile'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'string', 'children': [], 'value': 'r"(?<!\\$)(?<!\\\\)\\$([^\\$]+?)\\$"'}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'assignment', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'slashdollar'}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'compile'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'string', 'children': [], 'value': 'r"\\\\\\$"'}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'assignment', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '100', 'type': 'call', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'dollars'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'sub'}; {'id': '104', 'type': 'argument_list', 'children': ['105', '106']}; {'id': '105', 'type': 'string', 'children': [], 'value': 'r":math:`\\1`"'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'assignment', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '110', 'type': 'call', 'children': ['111', '114']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'slashdollar'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'sub'}; {'id': '114', 'type': 'argument_list', 'children': ['115', '116']}; {'id': '115', 'type': 'string', 'children': [], 'value': 'r"$"'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '117', 'type': 'for_statement', 'children': ['118', '119', '120']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': '_data'}; {'id': '120', 'type': 'block', 'children': ['121']}; {'id': '121', 'type': 'expression_statement', 'children': ['122']}; {'id': '122', 'type': 'assignment', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '124', 'type': 'call', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '128', 'type': 'argument_list', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '130', 'type': 'subscript', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': '_data'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '133', 'type': 'expression_statement', 'children': ['134']}; {'id': '134', 'type': 'assignment', 'children': ['135', '139']}; {'id': '135', 'type': 'subscript', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '137', 'type': 'slice', 'children': ['138']}; {'id': '138', 'type': 'colon', 'children': []}; {'id': '139', 'type': 'list', 'children': ['140'], 'value': '[s]'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 's'}
r""" Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of strings like "``$HOME``". Don't make any changes on lines starting with spaces, because those are indented and hence part of a block of code or examples. This also doesn't replaces dollar signs enclosed in curly braces, to avoid nested math environments, such as :: $f(n) = 0 \text{ if $n$ is prime}$ Thus the above line would get changed to `f(n) = 0 \text{ if $n$ is prime}`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_merge_map'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'partial'}; {'id': '7', 'type': 'block', 'children': ['8', '16', '23', '34']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'proto'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'kv_pb'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'KeyValues'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'proto'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'set_key'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '32']}; {'id': '25', 'type': 'attribute', 'children': ['26', '31']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'proto'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'value_list'}; {'id': '30', 'type': 'argument_list', 'children': []}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'yield', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'proto'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'Encode'}; {'id': '40', 'type': 'argument_list', 'children': []}
A map function used in merge phase. Stores (key, values) into KeyValues proto and yields its serialization. Args: key: values key. values: values themselves. partial: True if more values for this key will follow. False otherwise. Yields: The proto.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_distributed_seismicity_source_nodes'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '29', '44', '56', '68', '80']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'source_nodes'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'source_nodes'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'Node'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': '"magScaleRel"'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '22', 'type': 'attribute', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'magnitude_scaling_relationship'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'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': 'source_nodes'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'Node'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'string', 'children': [], 'value': '"ruptAspectRatio"'}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'rupture_aspect_ratio'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'source_nodes'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'obj_to_node'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'mfd'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'source_nodes'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'build_nodal_plane_dist'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'nodal_plane_distribution'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'source_nodes'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'build_hypo_depth_dist'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'hypocenter_distribution'}; {'id': '80', 'type': 'return_statement', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'source_nodes'}
Returns list of nodes of attributes common to all distributed seismicity source classes :param source: Seismic source as instance of :class: `openquake.hazardlib.source.area.AreaSource` or :class: `openquake.hazardlib.source.point.PointSource` :returns: List of instances of :class:`openquake.baselib.node.Node`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'classname'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'javabridge'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'call'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '17', '18']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'jobject'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"getClass"'}; {'id': '18', 'type': 'string', 'children': [], 'value': '"()Ljava/lang/Class;"'}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'javabridge'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'call'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26', '27']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '26', 'type': 'string', 'children': [], 'value': '"getName"'}; {'id': '27', 'type': 'string', 'children': [], 'value': '"()Ljava/lang/String;"'}
Returns the Java classname in dot-notation. :return: the Java classname :rtype: str
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'find_module'}; {'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', '23', '37']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'defmodule'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'EnvFindDefmodule'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_env'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'encode'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'if_statement', 'children': ['24', '29']}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '26'], 'value': '=='}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'defmodule'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'ffi'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'NULL'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'raise_statement', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'LookupError'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'binary_operator', 'children': ['35', '36'], 'value': '%'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"Module \'%s\' not found"'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'Module'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': '_env'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'defmodule'}
Find the Module by its name.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'StrikeDip'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '7', 'type': 'block', 'children': ['8', '16', '36', '48', '54', '65', '76', '99', '111']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'r2d'}; {'id': '11', 'type': 'binary_operator', 'children': ['12', '13'], 'value': '/'}; {'id': '12', 'type': 'integer', 'children': [], 'value': '180'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'pi'}; {'id': '16', 'type': 'if_statement', 'children': ['17', '20']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': '<'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '19', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '20', 'type': 'block', 'children': ['21', '26', '31']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '24', 'type': 'unary_operator', 'children': ['25'], 'value': '-'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '29', 'type': 'unary_operator', 'children': ['30'], 'value': '-'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '34', 'type': 'unary_operator', 'children': ['35'], 'value': '-'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'strike'}; {'id': '39', 'type': 'binary_operator', 'children': ['40', '47'], 'value': '*'}; {'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': 'arctan2'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'r2d'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'strike'}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '53'], 'value': '-'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'strike'}; {'id': '53', 'type': 'integer', 'children': [], 'value': '90'}; {'id': '54', 'type': 'while_statement', 'children': ['55', '58']}; {'id': '55', 'type': 'comparison_operator', 'children': ['56', '57'], 'value': '>='}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'strike'}; {'id': '57', 'type': 'integer', 'children': [], 'value': '360'}; {'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': 'strike'}; {'id': '62', 'type': 'binary_operator', 'children': ['63', '64'], 'value': '-'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'strike'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '360'}; {'id': '65', 'type': 'while_statement', 'children': ['66', '69']}; {'id': '66', 'type': 'comparison_operator', 'children': ['67', '68'], 'value': '<'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'strike'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'strike'}; {'id': '73', 'type': 'binary_operator', 'children': ['74', '75'], 'value': '+'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'strike'}; {'id': '75', 'type': 'integer', 'children': [], 'value': '360'}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '79', 'type': 'call', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'sqrt'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'binary_operator', 'children': ['85', '92'], 'value': '+'}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'power'}; {'id': '89', 'type': 'argument_list', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '91', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '92', 'type': 'call', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'power'}; {'id': '96', 'type': 'argument_list', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '98', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'assignment', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'dip'}; {'id': '102', 'type': 'binary_operator', 'children': ['103', '110'], 'value': '*'}; {'id': '103', 'type': 'call', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'arctan2'}; {'id': '107', 'type': 'argument_list', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'r2d'}; {'id': '111', 'type': 'return_statement', 'children': ['112']}; {'id': '112', 'type': 'tuple', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'strike'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'dip'}
Finds strike and dip of plane given normal vector having components n, e, and u. Adapted from MATLAB script `bb.m <http://www.ceri.memphis.edu/people/olboyd/Software/Software.html>`_ written by Andy Michael and Oliver Boyd.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'synergy_to_datetime'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'time_qualifier'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'timeperiod'}; {'id': '6', 'type': 'block', 'children': ['7', '64']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11', '16', '25', '34', '43', '52']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': '=='}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'time_qualifier'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'QUALIFIER_HOURLY'}; {'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': 'date_format'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'SYNERGY_HOURLY_PATTERN'}; {'id': '16', 'type': 'elif_clause', 'children': ['17', '20']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': '=='}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'time_qualifier'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'QUALIFIER_DAILY'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'date_format'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'SYNERGY_DAILY_PATTERN'}; {'id': '25', 'type': 'elif_clause', 'children': ['26', '29']}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '28'], 'value': '=='}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'time_qualifier'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'QUALIFIER_MONTHLY'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'date_format'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'SYNERGY_MONTHLY_PATTERN'}; {'id': '34', 'type': 'elif_clause', 'children': ['35', '38']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': '=='}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'time_qualifier'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'QUALIFIER_YEARLY'}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'date_format'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'SYNERGY_YEARLY_PATTERN'}; {'id': '43', 'type': 'elif_clause', 'children': ['44', '47']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '46'], 'value': '=='}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'time_qualifier'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'QUALIFIER_REAL_TIME'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'date_format'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'SYNERGY_SESSION_PATTERN'}; {'id': '52', 'type': 'else_clause', 'children': ['53']}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'raise_statement', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'string', 'children': [], 'value': "'unknown time qualifier: {0}'"}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'time_qualifier'}; {'id': '64', 'type': 'return_statement', 'children': ['65']}; {'id': '65', 'type': 'call', 'children': ['66', '75']}; {'id': '66', 'type': 'attribute', 'children': ['67', '74']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'strptime'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'timeperiod'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'date_format'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'keyword_argument', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'tzinfo'}; {'id': '78', 'type': 'None', 'children': []}
method receives timeperiod in Synergy format YYYYMMDDHH and convert it to UTC _naive_ datetime
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'verify_login'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'dictionary_splat_pattern', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '10', 'type': 'block', 'children': ['11', '17', '23', '31', '47']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '16']}; {'id': '13', 'type': 'subscript', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'connection_user'"}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '22']}; {'id': '19', 'type': 'subscript', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'connection_pass'"}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'password'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'dbc'}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_connect'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'dictionary_splat', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'connection_args'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '35']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': 'is'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'dbc'}; {'id': '34', 'type': 'None', 'children': []}; {'id': '35', 'type': 'block', 'children': ['36', '45']}; {'id': '36', 'type': 'if_statement', 'children': ['37', '40']}; {'id': '37', 'type': 'comparison_operator', 'children': ['38', '39'], 'value': 'in'}; {'id': '38', 'type': 'string', 'children': [], 'value': "'mysql.error'"}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '__context__'}; {'id': '40', 'type': 'block', 'children': ['41']}; {'id': '41', 'type': 'delete_statement', 'children': ['42']}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': '__context__'}; {'id': '44', 'type': 'string', 'children': [], 'value': "'mysql.error'"}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'False', 'children': []}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'True', 'children': []}
Attempt to login using the provided credentials. If successful, return true. Otherwise, return False. CLI Example: .. code-block:: bash salt '*' mysql.verify_login root password
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'state_counts'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'gamma'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'T'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'return_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '22', '25']}; {'id': '16', 'type': 'subscript', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'gamma'}; {'id': '18', 'type': 'slice', 'children': ['19', '20', '21']}; {'id': '19', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '20', 'type': 'colon', 'children': []}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'T'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'out'}
Sum the probabilities of being in state i to time t Parameters ---------- gamma : ndarray((T,N), dtype = float), optional, default = None gamma[t,i] is the probabilty at time t to be in state i ! T : int number of time steps Returns ------- count : numpy.array shape (N) count[i] is the summed probabilty to be in state i ! See Also -------- state_probabilities : to calculate `gamma`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'moments'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '20', '35']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'moment1'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'statstools'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'calc_mean_time'}; {'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': 'delays'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'coefs'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'moment2'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'statstools'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'calc_mean_time_deviation'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '31', '34']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'delays'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'coefs'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'moment1'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'list', 'children': ['42', '43'], 'value': '[moment1, moment2]'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'moment1'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'moment2'}
The first two time delay weighted statistical moments of the MA coefficients.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'is_tagged'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'required_tags'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'has_tags'}; {'id': '6', 'type': 'block', 'children': ['7', '22', '26', '42']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '13', '16']}; {'id': '8', 'type': 'boolean_operator', 'children': ['9', '11'], 'value': 'and'}; {'id': '9', 'type': 'not_operator', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'required_tags'}; {'id': '11', 'type': 'not_operator', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'has_tags'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'True', 'children': []}; {'id': '16', 'type': 'elif_clause', 'children': ['17', '19']}; {'id': '17', 'type': 'not_operator', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'required_tags'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'False', 'children': []}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'found_tags'}; {'id': '25', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '26', 'type': 'for_statement', 'children': ['27', '28', '29']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'required_tags'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'if_statement', 'children': ['31', '34']}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '33'], 'value': 'in'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'has_tags'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'found_tags'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '48'], 'value': '=='}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'found_tags'}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'required_tags'}
Checks if tags match
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dist'}; {'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', '17', '27']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'dx'}; {'id': '10', 'type': 'binary_operator', 'children': ['11', '14'], 'value': '-'}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'dy'}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '24'], 'value': '-'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'y'}; {'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': 'math'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sqrt'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'binary_operator', 'children': ['34', '37'], 'value': '+'}; {'id': '34', 'type': 'binary_operator', 'children': ['35', '36'], 'value': '**'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'dx'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '39'], 'value': '**'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'dy'}; {'id': '39', 'type': 'integer', 'children': [], 'value': '2'}
Distance to some other point.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_check_not_empty'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'string'}; {'id': '5', 'type': 'block', 'children': ['6', '14']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'string'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'string'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'if_statement', 'children': ['15', '21']}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '20'], 'value': '=='}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'string'}; {'id': '20', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '21', 'type': 'block', 'children': ['22', '26']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'message'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'The string should not be empty'"}; {'id': '26', 'type': 'raise_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'pp'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'ParseException'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'message'}
Checks that the string is not empty. If it is empty an exception is raised, stopping the validation. This is used for compulsory alphanumeric fields. :param string: the field value
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'activate'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'lang'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'block', 'children': ['8', '23', '46', '54']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '12']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': 'is'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'lang'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'lang'}; {'id': '16', 'type': 'subscript', 'children': ['17', '22']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'locale'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'getlocale'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'tr'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'gettext'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'translation'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32', '41', '43']}; {'id': '31', 'type': 'string', 'children': [], 'value': '"argparse"'}; {'id': '32', 'type': 'call', 'children': ['33', '38']}; {'id': '33', 'type': 'attribute', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'locpath'}; {'id': '40', 'type': 'string', 'children': [], 'value': '"locale"'}; {'id': '41', 'type': 'list', 'children': ['42'], 'value': '[lang]'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'lang'}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'fallback'}; {'id': '45', 'type': 'True', 'children': []}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'argparse'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'tr'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'gettext'}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'argparse'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'ngettext'}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'tr'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'ngettext'}
Activate a translation for lang. If lang is None, then the language of locale.getdefaultlocale() is used. If the translation file does not exist, the original messages will be used.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getOutputName'}; {'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', '15', '28']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '10', 'type': 'subscript', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'outputNames'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '15', 'type': 'if_statement', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'inmemory'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '23', 'type': 'subscript', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'virtualOutputs'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'val'}
Return the name of the file or PyFITS object associated with that name, depending on the setting of self.inmemory.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'delete_policy'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'pol_id'}; {'id': '6', 'type': 'block', 'children': ['7', '23', '29']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '13']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': 'not in'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'pol_id'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'policies'}; {'id': '13', 'type': 'block', 'children': ['14', '22']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'LOG'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'string', 'children': [], 'value': '"Invalid policy %s"'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'pol_id'}; {'id': '22', 'type': 'return_statement', 'children': []}; {'id': '23', 'type': 'delete_statement', 'children': ['24']}; {'id': '24', 'type': 'subscript', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'policies'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'pol_id'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'augmented_assignment', 'children': ['31', '34'], 'value': '-='}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'policy_cnt'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '1'}
Deletes the policy from the local dictionary.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_system'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'model_folder'}; {'id': '5', 'type': 'block', 'children': ['6', '18', '47', '68', '75', '82']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'model_description_file'}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'model_folder'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"info.yml"'}; {'id': '18', 'type': 'if_statement', 'children': ['19', '28']}; {'id': '19', 'type': 'not_operator', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '26']}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'isfile'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'model_description_file'}; {'id': '28', 'type': 'block', 'children': ['29', '39']}; {'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': 'logging'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '38']}; {'id': '35', 'type': 'concatenated_string', 'children': ['36', '37']}; {'id': '36', 'type': 'string', 'children': [], 'value': '"You are probably not in the folder of a model, because "'}; {'id': '37', 'type': 'string', 'children': [], 'value': '"%s is not a file. (-m argument)"'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'model_description_file'}; {'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': 'sys'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'exit'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'unary_operator', 'children': ['46'], 'value': '-'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'with_statement', 'children': ['48', '58']}; {'id': '48', 'type': 'with_clause', 'children': ['49']}; {'id': '49', 'type': 'with_item', 'children': ['50']}; {'id': '50', 'type': 'as_pattern', 'children': ['51', '56']}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'model_description_file'}; {'id': '55', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '56', 'type': 'as_pattern_target', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'ymlfile'}; {'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': 'model_desc'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'yaml'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'load'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'ymlfile'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'feature_desc'}; {'id': '71', 'type': 'call', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': '_get_description'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'model_desc'}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'preprocessing_desc'}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': '_get_description'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'feature_desc'}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'tuple', 'children': ['84', '85', '86']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'preprocessing_desc'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'feature_desc'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'model_desc'}
Return the preprocessing description, the feature description and the model description.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'elapsed'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '36', '45', '84']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '9', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '20']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ss'}; {'id': '12', 'type': 'subscript', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'starts_and_stops'}; {'id': '16', 'type': 'slice', 'children': ['17', '18']}; {'id': '17', 'type': 'colon', 'children': []}; {'id': '18', 'type': 'unary_operator', 'children': ['19'], 'value': '-'}; {'id': '19', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'augmented_assignment', 'children': ['23', '24'], 'value': '+='}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '24', 'type': 'call', 'children': ['25', '35']}; {'id': '25', 'type': 'attribute', 'children': ['26', '34']}; {'id': '26', 'type': '()', 'children': ['27']}; {'id': '27', 'type': 'binary_operator', 'children': ['28', '31'], 'value': '-'}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'ss'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'stop'"}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'ss'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'start'"}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'total_seconds'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ss'}; {'id': '39', 'type': 'subscript', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'starts_and_stops'}; {'id': '43', 'type': 'unary_operator', 'children': ['44'], 'value': '-'}; {'id': '44', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '45', 'type': 'if_statement', 'children': ['46', '49', '65']}; {'id': '46', 'type': 'subscript', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'ss'}; {'id': '48', 'type': 'string', 'children': [], 'value': "'stop'"}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'augmented_assignment', 'children': ['52', '53'], 'value': '+='}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '53', 'type': 'call', 'children': ['54', '64']}; {'id': '54', 'type': 'attribute', 'children': ['55', '63']}; {'id': '55', 'type': '()', 'children': ['56']}; {'id': '56', 'type': 'binary_operator', 'children': ['57', '60'], 'value': '-'}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'ss'}; {'id': '59', 'type': 'string', 'children': [], 'value': "'stop'"}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'ss'}; {'id': '62', 'type': 'string', 'children': [], 'value': "'start'"}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'total_seconds'}; {'id': '64', 'type': 'argument_list', 'children': []}; {'id': '65', 'type': 'else_clause', 'children': ['66']}; {'id': '66', 'type': 'block', 'children': ['67']}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'augmented_assignment', 'children': ['69', '70'], 'value': '+='}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '70', 'type': 'call', 'children': ['71', '83']}; {'id': '71', 'type': 'attribute', 'children': ['72', '82']}; {'id': '72', 'type': '()', 'children': ['73']}; {'id': '73', 'type': 'binary_operator', 'children': ['74', '79'], 'value': '-'}; {'id': '74', 'type': 'call', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'doublethink'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'utcnow'}; {'id': '78', 'type': 'argument_list', 'children': []}; {'id': '79', 'type': 'subscript', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'ss'}; {'id': '81', 'type': 'string', 'children': [], 'value': "'start'"}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'total_seconds'}; {'id': '83', 'type': 'argument_list', 'children': []}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'dt'}
Returns elapsed crawl time as a float in seconds. This metric includes all the time that a site was in active rotation, including any time it spent waiting for its turn to be brozzled. In contrast `Site.active_brozzling_time` only counts time when a brozzler worker claimed the site and was actively brozzling it.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'smartread'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'with_statement', 'children': ['7', '17']}; {'id': '7', 'type': 'with_clause', 'children': ['8']}; {'id': '8', 'type': 'with_item', 'children': ['9']}; {'id': '9', 'type': 'as_pattern', 'children': ['10', '15']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '14', 'type': 'string', 'children': [], 'value': '"rb"'}; {'id': '15', 'type': 'as_pattern_target', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '17', 'type': 'block', 'children': ['18', '26', '35']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'read'}; {'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': 'result'}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'chardet'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'detect'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'subscript', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '43', 'type': 'string', 'children': [], 'value': '"encoding"'}
Read text from file, automatically detect encoding. ``chardet`` required.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'powerDown'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'powerup'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '14', '33']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '13'], 'value': 'is'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'for_statement', 'children': ['16', '19', '24']}; {'id': '16', 'type': 'pattern_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'powerup'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_getPowerupInterfaces'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'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': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'powerDown'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'powerup'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '33', 'type': 'else_clause', 'children': ['34']}; {'id': '34', 'type': 'block', 'children': ['35', '77']}; {'id': '35', 'type': 'for_statement', 'children': ['36', '37', '69']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'cable'}; {'id': '37', 'type': 'call', 'children': ['38', '43']}; {'id': '38', 'type': 'attribute', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': '_PowerupConnector'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'AND'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '53', '64']}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '52'], 'value': '=='}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': '_PowerupConnector'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '57'], 'value': '=='}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': '_PowerupConnector'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'unicode'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'qual'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '68'], 'value': '=='}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_PowerupConnector'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'powerup'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'powerup'}; {'id': '69', 'type': 'block', 'children': ['70', '76']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'cable'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'deleteFromStore'}; {'id': '75', 'type': 'argument_list', 'children': []}; {'id': '76', 'type': 'return_statement', 'children': []}; {'id': '77', 'type': 'raise_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'binary_operator', 'children': ['82', '83'], 'value': '%'}; {'id': '82', 'type': 'string', 'children': [], 'value': '"Not powered up for %r with %r"'}; {'id': '83', 'type': 'tuple', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'interface'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'powerup'}
Remove a powerup. If no interface is specified, and the type of the object being installed has a "powerupInterfaces" attribute (containing either a sequence of interfaces, or a sequence of (interface, priority) tuples), the target will be powered down with this object on those interfaces. If this object has a "__getPowerupInterfaces__" method, it will be called with an iterable of (interface, priority) tuples. The iterable of (interface, priority) tuples it returns will then be uninstalled. (Note particularly that if powerups are added or removed to the collection described above between calls to powerUp and powerDown, more powerups or less will be removed than were installed.)
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'remove_file_data'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'file_id'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'try_statement', 'children': ['10', '51']}; {'id': '10', 'type': 'block', 'children': ['11', '20', '27', '33', '41']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'FileInstance'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'file_id'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '25']}; {'id': '21', 'type': 'not_operator', 'children': ['22']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'writable'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'return_statement', 'children': []}; {'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': 'delete'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '40']}; {'id': '35', 'type': 'attribute', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'db'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'commit'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '50']}; {'id': '43', 'type': 'attribute', 'children': ['44', '49']}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'storage'}; {'id': '48', 'type': 'argument_list', 'children': []}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'delete'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'except_clause', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'IntegrityError'}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'if_statement', 'children': ['55', '57']}; {'id': '55', 'type': 'not_operator', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'raise_statement', 'children': []}
Remove file instance and associated data. :param file_id: The :class:`invenio_files_rest.models.FileInstance` ID. :param silent: It stops propagation of a possible arised IntegrityError exception. (Default: ``True``) :raises sqlalchemy.exc.IntegrityError: Raised if the database removal goes wrong and silent is set to ``False``.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'validate_properties'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '10', '17']}; {'id': '7', 'type': 'pattern_list', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'property_type'}; {'id': '10', 'type': 'call', 'children': ['11', '16']}; {'id': '11', 'type': 'attribute', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'property_types'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18', '26', '39']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '26', 'type': 'if_statement', 'children': ['27', '37']}; {'id': '27', 'type': 'boolean_operator', 'children': ['28', '31'], 'value': 'and'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'property_type'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'supports_intrinsics'}; {'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': '_is_intrinsic_function'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'continue_statement', 'children': []}; {'id': '39', 'type': 'if_statement', 'children': ['40', '43', '64']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '42'], 'value': 'is'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '42', 'type': 'None', 'children': []}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'if_statement', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'property_type'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'required'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'raise_statement', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'InvalidResourceException'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'logical_id'}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'string', 'children': [], 'value': '"Missing required property \'{property_name}\'."'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'keyword_argument', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'property_name'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '64', 'type': 'elif_clause', 'children': ['65', '75']}; {'id': '65', 'type': 'not_operator', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'property_type'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'validate'}; {'id': '70', 'type': 'argument_list', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '72', 'type': 'keyword_argument', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'should_raise'}; {'id': '74', 'type': 'False', 'children': []}; {'id': '75', 'type': 'block', 'children': ['76']}; {'id': '76', 'type': 'raise_statement', 'children': ['77']}; {'id': '77', 'type': 'call', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'InvalidResourceException'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'logical_id'}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'string', 'children': [], 'value': '"Type of property \'{property_name}\' is invalid."'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'keyword_argument', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'property_name'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'name'}
Validates that the required properties for this Resource have been populated, and that all properties have valid values. :returns: True if all properties are valid :rtype: bool :raises TypeError: if any properties are invalid
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'shape'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '22']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_shape'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_populate_from_rasterio_object'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'read_image'}; {'id': '21', 'type': 'False', 'children': []}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_shape'}
Raster shape.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getInfoMutator'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '19', '100', '125']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '10']}; {'id': '7', 'type': 'attribute', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': '_infoMutator'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_infoMutator'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'infoItems'}; {'id': '18', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '19', 'type': 'for_statement', 'children': ['20', '21', '24']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'sourceDescriptor'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '24', 'type': 'block', 'children': ['25', '33', '42', '52', '58']}; {'id': '25', 'type': 'if_statement', 'children': ['26', '31']}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '30'], 'value': 'is not'}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'sourceDescriptor'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'layerName'}; {'id': '30', 'type': 'None', 'children': []}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'continue_statement', 'children': []}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'loc'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'Location'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sourceDescriptor'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'location'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sourceFont'}; {'id': '45', 'type': 'subscript', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'fonts'}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'sourceDescriptor'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '52', 'type': 'if_statement', 'children': ['53', '56']}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '55'], 'value': 'is'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'sourceFont'}; {'id': '55', 'type': 'None', 'children': []}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'continue_statement', 'children': []}; {'id': '58', 'type': 'if_statement', 'children': ['59', '66', '82']}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'sourceFont'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '65', 'type': 'string', 'children': [], 'value': '"toMathInfo"'}; {'id': '66', 'type': 'block', 'children': ['67']}; {'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': 'infoItems'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'tuple', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'loc'}; {'id': '75', 'type': 'call', 'children': ['76', '81']}; {'id': '76', 'type': 'attribute', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'sourceFont'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'toMathInfo'}; {'id': '81', 'type': 'argument_list', 'children': []}; {'id': '82', 'type': 'else_clause', 'children': ['83']}; {'id': '83', 'type': 'block', 'children': ['84']}; {'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': 'infoItems'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'tuple', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'loc'}; {'id': '92', 'type': 'call', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'mathInfoClass'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'sourceFont'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '107']}; {'id': '102', 'type': 'pattern_list', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'bias'}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': '_infoMutator'}; {'id': '107', 'type': 'call', 'children': ['108', '111']}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'getVariationModel'}; {'id': '111', 'type': 'argument_list', 'children': ['112', '113', '118']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'infoItems'}; {'id': '113', 'type': 'keyword_argument', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'axes'}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'serializedAxes'}; {'id': '118', 'type': 'keyword_argument', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'bias'}; {'id': '120', 'type': 'call', 'children': ['121', '124']}; {'id': '121', 'type': 'attribute', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'newDefaultLocation'}; {'id': '124', 'type': 'argument_list', 'children': []}; {'id': '125', 'type': 'return_statement', 'children': ['126']}; {'id': '126', 'type': 'attribute', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': '_infoMutator'}
Returns a info mutator
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'read_login'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'collector'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'image'}; {'id': '6', 'type': 'dictionary_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '8', 'type': 'block', 'children': ['9', '19']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'docker_api'}; {'id': '12', 'type': 'attribute', 'children': ['13', '18']}; {'id': '13', 'type': 'subscript', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'collector'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'configuration'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"harpoon"'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'docker_api'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '28']}; {'id': '21', 'type': 'attribute', 'children': ['22', '27']}; {'id': '22', 'type': 'subscript', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'collector'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'configuration'}; {'id': '26', 'type': 'string', 'children': [], 'value': '"authentication"'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'login'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30', '31', '34']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'docker_api'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'image'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'is_pushing'}; {'id': '33', 'type': 'False', 'children': []}; {'id': '34', 'type': 'keyword_argument', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'global_docker'}; {'id': '36', 'type': 'True', 'children': []}
Login to a docker registry with read permissions
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_provider_links'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '24', '33', '48', '64', '70']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '16']}; {'id': '7', 'type': 'not_operator', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'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': '_my_map'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'providerLinkIds'"}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'raise_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'errors'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'IllegalState'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'string', 'children': [], 'value': "'no providerLinkIds'"}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'mgr'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_get_provider_manager'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': "'RESOURCE'"}; {'id': '33', 'type': 'if_statement', 'children': ['34', '40']}; {'id': '34', 'type': 'not_operator', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'mgr'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'supports_resource_lookup'}; {'id': '39', 'type': 'argument_list', 'children': []}; {'id': '40', 'type': 'block', 'children': ['41']}; {'id': '41', 'type': 'raise_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'errors'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'OperationFailed'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'string', 'children': [], 'value': "'Resource does not support Resource lookup'"}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'mgr'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'get_resource_lookup_session'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'keyword_argument', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'proxy'}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62', '63']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'string', 'children': [], 'value': '"_proxy"'}; {'id': '63', 'type': 'None', 'children': []}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'use_federated_bin_view'}; {'id': '69', 'type': 'argument_list', 'children': []}; {'id': '70', 'type': 'return_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'lookup_session'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'get_resources_by_ids'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'get_provider_link_ids'}; {'id': '80', 'type': 'argument_list', 'children': []}
Gets the ``Resources`` representing the source of this asset in order from the most recent provider to the originating source. return: (osid.resource.ResourceList) - the provider chain raise: OperationFailed - unable to complete request *compliance: mandatory -- This method must be implemented.*
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'match_serializers'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'serializers'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'default_media_type'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'return_statement', 'children': ['9']}; {'id': '9', 'type': 'boolean_operator', 'children': ['10', '16'], 'value': 'or'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_match_serializers_by_query_arg'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'serializers'}; {'id': '16', 'type': 'call', 'children': ['17', '21']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19', '20']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_match_serializers_by_accept_headers'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'serializers'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'default_media_type'}
Choose serializer for a given request based on query arg or headers. Checks if query arg `format` (by default) is present and tries to match the serializer based on the arg value, by resolving the mimetype mapped to the arg value. Otherwise, chooses the serializer by retrieving the best quality `Accept` headers and matching its value (mimetype). :param serializers: Dictionary of serializers. :param default_media_type: The default media type. :returns: Best matching serializer based on `format` query arg first, then client `Accept` headers or None if no matching serializer.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_flux_bounds'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'r_id'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'flux_limits'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'equation'}; {'id': '9', 'type': 'block', 'children': ['10', '55', '99', '113', '127']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '22', '45']}; {'id': '11', 'type': 'boolean_operator', 'children': ['12', '15'], 'value': 'or'}; {'id': '12', 'type': 'comparison_operator', 'children': ['13', '14'], 'value': 'not in'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'r_id'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'flux_limits'}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '21'], 'value': 'is'}; {'id': '16', 'type': 'subscript', 'children': ['17', '20']}; {'id': '17', 'type': 'subscript', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'flux_limits'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'r_id'}; {'id': '20', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '21', 'type': 'None', 'children': []}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'if_statement', 'children': ['24', '31', '36']}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '28'], 'value': '=='}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'equation'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'direction'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'Direction'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'Forward'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '36', 'type': 'else_clause', 'children': ['37']}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '41', 'type': 'unary_operator', 'children': ['42'], 'value': '-'}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'default_flux_limit'}; {'id': '45', 'type': 'else_clause', 'children': ['46']}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '50', 'type': 'subscript', 'children': ['51', '54']}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'flux_limits'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'r_id'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '55', 'type': 'if_statement', 'children': ['56', '67', '89']}; {'id': '56', 'type': 'boolean_operator', 'children': ['57', '60'], 'value': 'or'}; {'id': '57', 'type': 'comparison_operator', 'children': ['58', '59'], 'value': 'not in'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'r_id'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'flux_limits'}; {'id': '60', 'type': 'comparison_operator', 'children': ['61', '66'], 'value': 'is'}; {'id': '61', 'type': 'subscript', 'children': ['62', '65']}; {'id': '62', 'type': 'subscript', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'flux_limits'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'r_id'}; {'id': '65', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '66', 'type': 'None', 'children': []}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'if_statement', 'children': ['69', '76', '81']}; {'id': '69', 'type': 'comparison_operator', 'children': ['70', '73'], 'value': '=='}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'equation'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'direction'}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'Direction'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'Reverse'}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '80', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '81', 'type': 'else_clause', 'children': ['82']}; {'id': '82', 'type': 'block', 'children': ['83']}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'assignment', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'default_flux_limit'}; {'id': '89', 'type': 'else_clause', 'children': ['90']}; {'id': '90', 'type': 'block', 'children': ['91']}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '94', 'type': 'subscript', 'children': ['95', '98']}; {'id': '95', 'type': 'subscript', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'flux_limits'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'r_id'}; {'id': '98', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '99', 'type': 'if_statement', 'children': ['100', '105']}; {'id': '100', 'type': 'comparison_operator', 'children': ['101', '104'], 'value': '=='}; {'id': '101', 'type': 'binary_operator', 'children': ['102', '103'], 'value': '%'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '103', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '104', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '105', 'type': 'block', 'children': ['106']}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'assignment', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '109', 'type': 'call', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '113', 'type': 'if_statement', 'children': ['114', '119']}; {'id': '114', 'type': 'comparison_operator', 'children': ['115', '118'], 'value': '=='}; {'id': '115', 'type': 'binary_operator', 'children': ['116', '117'], 'value': '%'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '117', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '118', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '119', 'type': 'block', 'children': ['120']}; {'id': '120', 'type': 'expression_statement', 'children': ['121']}; {'id': '121', 'type': 'assignment', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '123', 'type': 'call', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '125', 'type': 'argument_list', 'children': ['126']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '127', 'type': 'return_statement', 'children': ['128']}; {'id': '128', 'type': 'expression_list', 'children': ['129', '133']}; {'id': '129', 'type': 'call', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'text_type'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '133', 'type': 'call', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'text_type'}; {'id': '135', 'type': 'argument_list', 'children': ['136']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'upper'}
Read reaction's limits to set up strings for limits in the output file.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'canonicalize'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'parsed_op'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '19', '63']}; {'id': '6', 'type': 'assert_statement', 'children': ['7']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '9'], 'value': 'in'}; {'id': '8', 'type': 'string', 'children': [], 'value': "'op'"}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'parsed_op'}; {'id': '10', 'type': 'assert_statement', 'children': ['11']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '18'], 'value': '=='}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'subscript', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'parsed_op'}; {'id': '17', 'type': 'string', 'children': [], 'value': "'op'"}; {'id': '18', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '27', '34', '49']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '26'], 'value': '=='}; {'id': '21', 'type': 'subscript', 'children': ['22', '25']}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'parsed_op'}; {'id': '24', 'type': 'string', 'children': [], 'value': "'op'"}; {'id': '25', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'TRANSFER_KEEP_DATA'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '33']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'parsed_op'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'keep_data'"}; {'id': '33', 'type': 'True', 'children': []}; {'id': '34', 'type': 'elif_clause', 'children': ['35', '42']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '41'], 'value': '=='}; {'id': '36', 'type': 'subscript', 'children': ['37', '40']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'parsed_op'}; {'id': '39', 'type': 'string', 'children': [], 'value': "'op'"}; {'id': '40', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'TRANSFER_REMOVE_DATA'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'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': 'parsed_op'}; {'id': '47', 'type': 'string', 'children': [], 'value': "'keep_data'"}; {'id': '48', 'type': 'False', 'children': []}; {'id': '49', 'type': 'else_clause', 'children': ['50']}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'raise_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'string', 'children': [], 'value': '"Invalid op \'{}\'"'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'parsed_op'}; {'id': '62', 'type': 'string', 'children': [], 'value': "'op'"}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'parsed_op'}
Get the "canonical form" of this operation, putting it into a form where it can be serialized to form a consensus hash. This method is meant to preserve compatibility across blockstackd releases. For NAME_TRANSFER, this means: * add 'keep_data' flag
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'delete_cookie'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'dictionary_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '8', 'type': 'block', 'children': ['9', '16', '22']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '14']}; {'id': '11', 'type': 'subscript', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '13', 'type': 'string', 'children': [], 'value': "'max_age'"}; {'id': '14', 'type': 'unary_operator', 'children': ['15'], 'value': '-'}; {'id': '15', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '21']}; {'id': '18', 'type': 'subscript', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '20', 'type': 'string', 'children': [], 'value': "'expires'"}; {'id': '21', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'set_cookie'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29', '30']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '29', 'type': 'string', 'children': [], 'value': "''"}; {'id': '30', 'type': 'dictionary_splat', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
Delete a cookie. Be sure to use the same `domain` and `path` parameters as used to create the cookie.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'compose'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '19', '23', '38', '63', '92']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'client'}; {'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': '_require_client'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'query_params'}; {'id': '22', 'type': 'dictionary', 'children': []}; {'id': '23', 'type': 'if_statement', 'children': ['24', '29']}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '28'], 'value': 'is not'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'user_project'}; {'id': '28', 'type': 'None', 'children': []}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '35']}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'query_params'}; {'id': '34', 'type': 'string', 'children': [], 'value': '"userProject"'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'user_project'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '41', 'type': 'dictionary', 'children': ['42', '54']}; {'id': '42', 'type': 'pair', 'children': ['43', '44']}; {'id': '43', 'type': 'string', 'children': [], 'value': '"sourceObjects"'}; {'id': '44', 'type': 'list_comprehension', 'children': ['45', '51']}; {'id': '45', 'type': 'dictionary', 'children': ['46']}; {'id': '46', 'type': 'pair', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': '"name"'}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '51', 'type': 'for_in_clause', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'source'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'sources'}; {'id': '54', 'type': 'pair', 'children': ['55', '56']}; {'id': '55', 'type': 'string', 'children': [], 'value': '"destination"'}; {'id': '56', 'type': 'call', 'children': ['57', '62']}; {'id': '57', 'type': 'attribute', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': '_properties'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '62', 'type': 'argument_list', 'children': []}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'api_response'}; {'id': '66', 'type': 'call', 'children': ['67', '72']}; {'id': '67', 'type': 'attribute', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': '_connection'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'api_request'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '76', '83', '86', '89']}; {'id': '73', 'type': 'keyword_argument', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '75', 'type': 'string', 'children': [], 'value': '"POST"'}; {'id': '76', 'type': 'keyword_argument', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '78', 'type': 'binary_operator', 'children': ['79', '82'], 'value': '+'}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '82', 'type': 'string', 'children': [], 'value': '"/compose"'}; {'id': '83', 'type': 'keyword_argument', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'query_params'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'query_params'}; {'id': '86', 'type': 'keyword_argument', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '89', 'type': 'keyword_argument', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': '_target_object'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': '_set_properties'}; {'id': '97', 'type': 'argument_list', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'api_response'}
Concatenate source blobs into this one. If :attr:`user_project` is set on the bucket, bills the API request to that project. :type sources: list of :class:`Blob` :param sources: blobs whose contents will be composed into this blob. :type client: :class:`~google.cloud.storage.client.Client` or ``NoneType`` :param client: Optional. The client to use. If not passed, falls back to the ``client`` stored on the blob's bucket.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'filter_records'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'records'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'for_statement', 'children': ['8', '9', '10']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'records'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'try_statement', 'children': ['12', '51']}; {'id': '12', 'type': 'block', 'children': ['13', '22', '25', '48']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'filtered'}; {'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': 'filter_record'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '22', 'type': 'assert_statement', 'children': ['23']}; {'id': '23', 'type': '()', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'filtered'}; {'id': '25', 'type': 'if_statement', 'children': ['26', '33', '40']}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '30'], 'value': '=='}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'filtered'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'augmented_assignment', 'children': ['36', '39'], 'value': '+='}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'passed_unchanged'}; {'id': '39', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '40', 'type': 'else_clause', 'children': ['41']}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'augmented_assignment', 'children': ['44', '47'], 'value': '+='}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'passed_changed'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'yield', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'filtered'}; {'id': '51', 'type': 'except_clause', 'children': ['52', '56']}; {'id': '52', 'type': 'as_pattern', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'FailedFilter'}; {'id': '54', 'type': 'as_pattern_target', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '56', 'type': 'block', 'children': ['57', '63', '69']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'augmented_assignment', 'children': ['59', '62'], 'value': '+='}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'failed'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '69', 'type': 'if_statement', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'listener'}; {'id': '73', 'type': 'block', 'children': ['74']}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'listener'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '81', '82', '87']}; {'id': '80', 'type': 'string', 'children': [], 'value': "'failed_filter'"}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '82', 'type': 'keyword_argument', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'filter_name'}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '87', 'type': 'keyword_argument', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'v'}
Apply the filter to records
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'fixPoint'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'plotterPoint'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'canvasPoint'}; {'id': '7', 'type': 'block', 'children': ['8', '10', '35', '60']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'string', 'children': [], 'value': "'adjust visibleBox.xymin so that canvasPoint is plotted at plotterPoint'"}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', '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': 'visibleBox'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'xmin'}; {'id': '17', 'type': 'binary_operator', 'children': ['18', '21'], 'value': '-'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'canvasPoint'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'x'}; {'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': 'canvasW'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'binary_operator', 'children': ['27', '30'], 'value': '-'}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'plotterPoint'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '30', 'type': 'attribute', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'plotviewBox'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'xmin'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'visibleBox'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'ymin'}; {'id': '42', 'type': 'binary_operator', 'children': ['43', '46'], 'value': '-'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'canvasPoint'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'y'}; {'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': 'canvasH'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '55'], 'value': '-'}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'plotterPoint'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '55', 'type': 'attribute', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'plotviewBox'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'ymin'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'refresh'}; {'id': '65', 'type': 'argument_list', 'children': []}
adjust visibleBox.xymin so that canvasPoint is plotted at plotterPoint
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_skip_frame'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '23', '41']}; {'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': '_get_line'}; {'id': '11', 'type': 'argument_list', 'children': []}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'num_atoms'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'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': '_get_line'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'if_statement', 'children': ['24', '35']}; {'id': '24', 'type': 'boolean_operator', 'children': ['25', '30'], 'value': 'and'}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '29'], 'value': 'is not'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'num_atoms'}; {'id': '29', 'type': 'None', 'children': []}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '34'], 'value': '!='}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'num_atoms'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'num_atoms'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'raise_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'string', 'children': [], 'value': '"The number of atoms must be the same over the entire file."'}; {'id': '41', 'type': 'for_statement', 'children': ['42', '43', '49']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'binary_operator', 'children': ['47', '48'], 'value': '+'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'num_atoms'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '_get_line'}; {'id': '55', 'type': 'argument_list', 'children': []}
Skip one frame
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_parameterize_string'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'raw'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '14', '62', '71', '82']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 's_index'}; {'id': '13', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '14', 'type': 'for_statement', 'children': ['15', '16', '22']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_PARAMETER_PATTERN'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'finditer'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'raw'}; {'id': '22', 'type': 'block', 'children': ['23', '39', '54']}; {'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': 'parts'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'raw'}; {'id': '31', 'type': 'slice', 'children': ['32', '33', '34']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 's_index'}; {'id': '33', 'type': 'colon', 'children': []}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '38', 'type': 'argument_list', 'children': []}; {'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': 'parts'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'dictionary', 'children': ['46']}; {'id': '46', 'type': 'pair', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': 'u"Ref"'}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 's_index'}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '61', 'type': 'argument_list', 'children': []}; {'id': '62', 'type': 'if_statement', 'children': ['63', '65']}; {'id': '63', 'type': 'not_operator', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'return_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'GenericHelperFn'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'raw'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'subscript', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'raw'}; {'id': '79', 'type': 'slice', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 's_index'}; {'id': '81', 'type': 'colon', 'children': []}; {'id': '82', 'type': 'return_statement', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'GenericHelperFn'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'dictionary', 'children': ['87']}; {'id': '87', 'type': 'pair', 'children': ['88', '89']}; {'id': '88', 'type': 'string', 'children': [], 'value': 'u"Fn::Join"'}; {'id': '89', 'type': 'list', 'children': ['90', '91'], 'value': '[u"", parts]'}; {'id': '90', 'type': 'string', 'children': [], 'value': 'u""'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'parts'}
Substitute placeholders in a string using CloudFormation references Args: raw (`str`): String to be processed. Byte strings are not supported; decode them before passing them to this function. Returns: `str` | :class:`troposphere.GenericHelperFn`: An expression with placeholders from the input replaced, suitable to be passed to Troposphere to be included in CloudFormation template. This will be the input string without modification if no substitutions are found, and a composition of CloudFormation calls otherwise.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getresponse'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '25', '43', '87', '93', '99', '105', '124']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '18']}; {'id': '7', 'type': 'boolean_operator', 'children': ['8', '11'], 'value': 'and'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '__response'}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '__response'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'isclosed'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '__response'}; {'id': '24', 'type': 'None', 'children': []}; {'id': '25', 'type': 'if_statement', 'children': ['26', '35']}; {'id': '26', 'type': 'boolean_operator', 'children': ['27', '32'], 'value': 'or'}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '31'], 'value': '!='}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '__state'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_CS_REQ_SENT'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '__response'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'raise_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ResponseNotReady'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '__state'}; {'id': '43', 'type': 'if_statement', 'children': ['44', '49', '69']}; {'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': 'debuglevel'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'response_class'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '61', '64']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'sock'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'debuglevel'}; {'id': '64', 'type': 'keyword_argument', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': '_method'}; {'id': '69', 'type': 'else_clause', 'children': ['70']}; {'id': '70', 'type': 'block', 'children': ['71']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '74', 'type': 'call', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'response_class'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'sock'}; {'id': '82', 'type': 'keyword_argument', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': '_method'}; {'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': 'response'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'begin'}; {'id': '92', 'type': 'argument_list', 'children': []}; {'id': '93', 'type': 'assert_statement', 'children': ['94']}; {'id': '94', 'type': 'comparison_operator', 'children': ['95', '98'], 'value': '!='}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'will_close'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': '_UNKNOWN'}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'assignment', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': '__state'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': '_CS_IDLE'}; {'id': '105', 'type': 'if_statement', 'children': ['106', '109', '116']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'will_close'}; {'id': '109', 'type': 'block', 'children': ['110']}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'call', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '115', 'type': 'argument_list', 'children': []}; {'id': '116', 'type': 'else_clause', 'children': ['117']}; {'id': '117', 'type': 'block', 'children': ['118']}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'assignment', 'children': ['120', '123']}; {'id': '120', 'type': 'attribute', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': '__response'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '124', 'type': 'return_statement', 'children': ['125']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'response'}
Get the response from the server. If the HTTPConnection is in the correct state, returns an instance of HTTPResponse or of whatever object is returned by class the response_class variable. If a request has not been sent or if a previous response has not be handled, ResponseNotReady is raised. If the HTTP response indicates that the connection should be closed, then it will be closed before the response is returned. When the connection is closed, the underlying socket is closed.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'default_channel_ops'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'nqubits'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '8', '19']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'gates'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'cartesian_product'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '16']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'TOMOGRAPHY_GATES'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'repeat'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'nqubits'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'yield', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'qt'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'tensor'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'list_splat', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'gates'}
Generate the tomographic pre- and post-rotations of any number of qubits as qutip operators. :param int nqubits: The number of qubits to perform tomography on. :return: Qutip object corresponding to the tomographic rotation. :rtype: Qobj
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'deserialize_basic'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '7', 'type': 'block', 'children': ['8', '38', '100', '112']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '16']}; {'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': 'attr'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'ET'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'Element'}; {'id': '16', 'type': 'block', 'children': ['17', '23']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '23', 'type': 'if_statement', 'children': ['24', '26']}; {'id': '24', 'type': 'not_operator', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'if_statement', 'children': ['28', '31', '34']}; {'id': '28', 'type': 'comparison_operator', 'children': ['29', '30'], 'value': '=='}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '30', 'type': 'string', 'children': [], 'value': '"str"'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'string', 'children': [], 'value': "''"}; {'id': '34', 'type': 'else_clause', 'children': ['35']}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'None', 'children': []}; {'id': '38', 'type': 'if_statement', 'children': ['39', '42']}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '41'], 'value': '=='}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'bool'"}; {'id': '42', 'type': 'block', 'children': ['43', '90']}; {'id': '43', 'type': 'if_statement', 'children': ['44', '51', '57']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '46'], 'value': 'in'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '46', 'type': 'list', 'children': ['47', '48', '49', '50'], 'value': '[True, False, 1, 0]'}; {'id': '47', 'type': 'True', 'children': []}; {'id': '48', 'type': 'False', 'children': []}; {'id': '49', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'return_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '57', 'type': 'elif_clause', 'children': ['58', '63']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'basestring'}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'if_statement', 'children': ['65', '74', '77']}; {'id': '65', 'type': 'comparison_operator', 'children': ['66', '71'], 'value': 'in'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '70', 'type': 'argument_list', 'children': []}; {'id': '71', 'type': 'list', 'children': ['72', '73'], 'value': "['true', '1']"}; {'id': '72', 'type': 'string', 'children': [], 'value': "'true'"}; {'id': '73', 'type': 'string', 'children': [], 'value': "'1'"}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'return_statement', 'children': ['76']}; {'id': '76', 'type': 'True', 'children': []}; {'id': '77', 'type': 'elif_clause', 'children': ['78', '87']}; {'id': '78', 'type': 'comparison_operator', 'children': ['79', '84'], 'value': 'in'}; {'id': '79', 'type': 'call', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '83', 'type': 'argument_list', 'children': []}; {'id': '84', 'type': 'list', 'children': ['85', '86'], 'value': "['false', '0']"}; {'id': '85', 'type': 'string', 'children': [], 'value': "'false'"}; {'id': '86', 'type': 'string', 'children': [], 'value': "'0'"}; {'id': '87', 'type': 'block', 'children': ['88']}; {'id': '88', 'type': 'return_statement', 'children': ['89']}; {'id': '89', 'type': 'False', 'children': []}; {'id': '90', 'type': 'raise_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'string', 'children': [], 'value': '"Invalid boolean value: {}"'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '100', 'type': 'if_statement', 'children': ['101', '104']}; {'id': '101', 'type': 'comparison_operator', 'children': ['102', '103'], 'value': '=='}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '103', 'type': 'string', 'children': [], 'value': "'str'"}; {'id': '104', 'type': 'block', 'children': ['105']}; {'id': '105', 'type': 'return_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'deserialize_unicode'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '112', 'type': 'return_statement', 'children': ['113']}; {'id': '113', 'type': 'call', 'children': ['114', '118']}; {'id': '114', 'type': 'call', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'eval'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'data_type'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'attr'}
Deserialize baisc builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as valid bool values. :param str attr: response string to be deserialized. :param str data_type: deserialization data type. :rtype: str, int, float or bool :raises: TypeError if string format is not valid.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'unwrap'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '69']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': '=='}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'algorithm'}; {'id': '11', 'type': 'string', 'children': [], 'value': "'rsa'"}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '18']}; {'id': '15', 'type': 'subscript', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'string', 'children': [], 'value': "'private_key'"}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'parsed'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '25']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '24'], 'value': '=='}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'algorithm'}; {'id': '24', 'type': 'string', 'children': [], 'value': "'dsa'"}; {'id': '25', 'type': 'block', 'children': ['26', '34']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '29', 'type': 'subscript', 'children': ['30', '33']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'private_key_algorithm'"}; {'id': '33', 'type': 'string', 'children': [], 'value': "'parameters'"}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'DSAPrivateKey'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'dictionary', 'children': ['39', '42', '47', '52', '57', '62']}; {'id': '39', 'type': 'pair', 'children': ['40', '41']}; {'id': '40', 'type': 'string', 'children': [], 'value': "'version'"}; {'id': '41', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '42', 'type': 'pair', 'children': ['43', '44']}; {'id': '43', 'type': 'string', 'children': [], 'value': "'p'"}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '46', 'type': 'string', 'children': [], 'value': "'p'"}; {'id': '47', 'type': 'pair', 'children': ['48', '49']}; {'id': '48', 'type': 'string', 'children': [], 'value': "'q'"}; {'id': '49', 'type': 'subscript', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '51', 'type': 'string', 'children': [], 'value': "'q'"}; {'id': '52', 'type': 'pair', 'children': ['53', '54']}; {'id': '53', 'type': 'string', 'children': [], 'value': "'g'"}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '56', 'type': 'string', 'children': [], 'value': "'g'"}; {'id': '57', 'type': 'pair', 'children': ['58', '59']}; {'id': '58', 'type': 'string', 'children': [], 'value': "'public_key'"}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'public_key'}; {'id': '62', 'type': 'pair', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'private_key'"}; {'id': '64', 'type': 'attribute', 'children': ['65', '68']}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'string', 'children': [], 'value': "'private_key'"}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'parsed'}; {'id': '69', 'type': 'if_statement', 'children': ['70', '75']}; {'id': '70', 'type': 'comparison_operator', 'children': ['71', '74'], 'value': '=='}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'algorithm'}; {'id': '74', 'type': 'string', 'children': [], 'value': "'ec'"}; {'id': '75', 'type': 'block', 'children': ['76', '84', '94', '102']}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '79', 'type': 'attribute', 'children': ['80', '83']}; {'id': '80', 'type': 'subscript', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'string', 'children': [], 'value': "'private_key'"}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'parsed'}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '89']}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '88', 'type': 'string', 'children': [], 'value': "'parameters'"}; {'id': '89', 'type': 'subscript', 'children': ['90', '93']}; {'id': '90', 'type': 'subscript', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '92', 'type': 'string', 'children': [], 'value': "'private_key_algorithm'"}; {'id': '93', 'type': 'string', 'children': [], 'value': "'parameters'"}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '99']}; {'id': '96', 'type': 'subscript', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '98', 'type': 'string', 'children': [], 'value': "'public_key'"}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'public_key'}; {'id': '102', 'type': 'return_statement', 'children': ['103']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'output'}
Unwraps the private key into an RSAPrivateKey, DSAPrivateKey or ECPrivateKey object :return: An RSAPrivateKey, DSAPrivateKey or ECPrivateKey object
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'GetAPFSVolumeByPathSpec'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'path_spec'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '23']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'volume_index'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'apfs_helper'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'APFSContainerPathSpecGetVolumeIndex'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'path_spec'}; {'id': '16', 'type': 'if_statement', 'children': ['17', '20']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': 'is'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'volume_index'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'return_statement', 'children': ['22']}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '30']}; {'id': '25', 'type': 'attribute', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_fsapfs_container'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'get_volume'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'volume_index'}
Retrieves an APFS volume for a path specification. Args: path_spec (PathSpec): path specification. Returns: pyfsapfs.volume: an APFS volume or None if not available.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'selection_r'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'acquisition_function'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'samples_y_aggregation'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'x_bounds'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'x_types'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'regressor_gp'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'num_starting_points'}; {'id': '11', 'type': 'integer', 'children': [], 'value': '100'}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'minimize_constraints_fun'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '35', '50']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'minimize_starting_points'}; {'id': '19', 'type': 'list_comprehension', 'children': ['20', '27', '28']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'lib_data'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'rand'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'x_bounds'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'x_types'}; {'id': '27', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '28', 'type': 'for_in_clause', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34']}; {'id': '33', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'num_starting_points'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'outputs'}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'selection'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '42', '43', '44', '45', '46', '47']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'acquisition_function'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'samples_y_aggregation'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'x_bounds'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'x_types'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'regressor_gp'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'minimize_starting_points'}; {'id': '47', 'type': 'keyword_argument', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'minimize_constraints_fun'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'minimize_constraints_fun'}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'outputs'}
Selecte R value
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_vlanid'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '6', 'type': 'block', 'children': ['7', '13']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'segment'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'bottom_bound_segment'}; {'id': '13', 'type': 'if_statement', 'children': ['14', '22']}; {'id': '14', 'type': 'boolean_operator', 'children': ['15', '16'], 'value': 'and'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'segment'}; {'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': 'check_segment'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'segment'}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'segment'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'api'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'SEGMENTATION_ID'}
Returns vlan_id associated with a bound VLAN segment.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get'}; {'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': 'id'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '29', '47']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '23']}; {'id': '13', 'type': 'not_operator', 'children': ['14']}; {'id': '14', 'type': 'binary_operator', 'children': ['15', '19'], 'value': '^'}; {'id': '15', 'type': '()', 'children': ['16']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '18'], 'value': 'is'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': '()', 'children': ['20']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '22'], 'value': 'is'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'raise_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'string', 'children': [], 'value': '"Either id or name must be set (but not both!)"'}; {'id': '29', 'type': 'if_statement', 'children': ['30', '33']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': 'is not'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '32', 'type': 'None', 'children': []}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '43']}; {'id': '36', 'type': 'attribute', 'children': ['37', '42']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'TaskQueueManager'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'subscript', 'children': ['49', '60']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'filters'}; {'id': '56', 'type': 'dictionary', 'children': ['57']}; {'id': '57', 'type': 'pair', 'children': ['58', '59']}; {'id': '58', 'type': 'string', 'children': [], 'value': '"name"'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '60', 'type': 'integer', 'children': [], 'value': '0'}
Get a task queue. Either the id xor the name of the task type must be specified. Args: id (int, optional): The id of the task type to get. name (str, optional): The name of the task type to get. Returns: :class:`saltant.models.task_queue.TaskQueue`: A task queue model instance representing the task queue requested. Raises: ValueError: Neither id nor name were set *or* both id and name were set.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '__walk_rec'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'top'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '30', '34']}; {'id': '9', 'type': 'boolean_operator', 'children': ['10', '21'], 'value': 'or'}; {'id': '10', 'type': 'boolean_operator', 'children': ['11', '13'], 'value': 'or'}; {'id': '11', 'type': 'not_operator', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'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': 'os'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'islink'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'top'}; {'id': '21', 'type': 'not_operator', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'isdir'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'top'}; {'id': '30', 'type': 'block', 'children': ['31']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'yield', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'top'}; {'id': '34', 'type': 'else_clause', 'children': ['35']}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'for_statement', 'children': ['37', '41', '47']}; {'id': '37', 'type': 'pattern_list', 'children': ['38', '39', '40']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'walk'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'top'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'yield', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'root'}
Yields each subdirectories of top, doesn't follow symlinks. If rec is false, only yield top. @param top: root directory. @type top: string @param rec: recursive flag. @type rec: bool @return: path of one subdirectory. @rtype: string
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'intSize'}; {'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': 'if_statement', 'children': ['8', '11', '14', '21', '28', '35', '42', '49']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': '<'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'integer', 'children': [], 'value': '8'}; {'id': '14', 'type': 'elif_clause', 'children': ['15', '18']}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '17'], 'value': '<='}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '17', 'type': 'integer', 'children': [], 'value': '0xFF'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '21', 'type': 'elif_clause', 'children': ['22', '25']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '24'], 'value': '<='}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '0xFFFF'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'return_statement', 'children': ['27']}; {'id': '27', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '28', 'type': 'elif_clause', 'children': ['29', '32']}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '31'], 'value': '<='}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '0xFFFFFFFF'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '35', 'type': 'elif_clause', 'children': ['36', '39']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '38'], 'value': '<='}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '0x7FFFFFFFFFFFFFFF'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'integer', 'children': [], 'value': '8'}; {'id': '42', 'type': 'elif_clause', 'children': ['43', '46']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': '<='}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '45', 'type': 'integer', 'children': [], 'value': '0xffffffffffffffff'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'integer', 'children': [], 'value': '16'}; {'id': '49', 'type': 'else_clause', 'children': ['50']}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'raise_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'InvalidPlistException'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'string', 'children': [], 'value': '"Core Foundation can\'t handle integers with size greater than 8 bytes."'}
Returns the number of bytes necessary to store the given integer.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_final_frame_length'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'header'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'final_frame_bytes'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '15', '23', '27', '31', '39']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'final_frame_length'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'augmented_assignment', 'children': ['13', '14'], 'value': '+='}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'final_frame_length'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'augmented_assignment', 'children': ['17', '18'], 'value': '+='}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'final_frame_length'}; {'id': '18', 'type': 'attribute', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'header'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'algorithm'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'iv_len'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'augmented_assignment', 'children': ['25', '26'], 'value': '+='}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'final_frame_length'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'augmented_assignment', 'children': ['29', '30'], 'value': '+='}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'final_frame_length'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'final_frame_bytes'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'augmented_assignment', 'children': ['33', '34'], 'value': '+='}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'final_frame_length'}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'header'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'algorithm'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'auth_len'}; {'id': '39', 'type': 'return_statement', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'final_frame_length'}
Calculates the length of a final ciphertext frame, given a complete header and the number of bytes of ciphertext in the final frame. :param header: Complete message header object :type header: aws_encryption_sdk.structures.MessageHeader :param int final_frame_bytes: Bytes of ciphertext in the final frame :rtype: int