sequence
stringlengths 902
12k
| docstring
stringlengths 4
15.2k
|
---|---|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_pid_file_variable'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'db'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '55']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'pid_file'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'try_statement', 'children': ['12', '45']}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'with_statement', 'children': ['14', '27']}; {'id': '14', 'type': 'with_clause', 'children': ['15']}; {'id': '15', 'type': 'with_item', 'children': ['16']}; {'id': '16', 'type': 'as_pattern', 'children': ['17', '25']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'closing'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'db'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'as_pattern_target', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '27', 'type': 'block', 'children': ['28', '35']}; {'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': 'cursor'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'string', 'children': [], 'value': '"SHOW VARIABLES LIKE \'pid_file\'"'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'pid_file'}; {'id': '38', 'type': 'subscript', 'children': ['39', '44']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'fetchone'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '45', 'type': 'except_clause', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'string', 'children': [], 'value': '"Error while fetching pid_file variable of MySQL."'}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'pid_file'}
|
Get the `pid_file` variable
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'mirror'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'BaseBoardT'}; {'id': '8', 'type': 'type', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'BaseBoardT'}; {'id': '10', 'type': 'block', 'children': ['11', '20', '44']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'board'}; {'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': 'transform'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'flip_vertical'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '33']}; {'id': '22', 'type': 'pattern_list', 'children': ['23', '28']}; {'id': '23', 'type': 'subscript', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'board'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'occupied_co'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'WHITE'}; {'id': '28', 'type': 'subscript', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'board'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'occupied_co'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'BLACK'}; {'id': '33', 'type': 'expression_list', 'children': ['34', '39']}; {'id': '34', 'type': 'subscript', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'board'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'occupied_co'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'BLACK'}; {'id': '39', 'type': 'subscript', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'board'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'occupied_co'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'WHITE'}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'board'}
|
Returns a mirrored copy of the board.
The board is mirrored vertically and piece colors are swapped, so that
the position is equivalent modulo color.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'count_characters'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '16', '58']}; {'id': '8', 'type': 'call', 'children': ['9', '14']}; {'id': '9', 'type': 'attribute', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'isfile'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'with_statement', 'children': ['18', '28']}; {'id': '18', 'type': 'with_clause', 'children': ['19']}; {'id': '19', 'type': 'with_item', 'children': ['20']}; {'id': '20', 'type': 'as_pattern', 'children': ['21', '26']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'rb'"}; {'id': '26', 'type': 'as_pattern_target', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'in_f'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'for_statement', 'children': ['30', '31', '32']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'in_f'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'for_statement', 'children': ['34', '35', '36']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'char'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '36', 'type': 'block', 'children': ['37', '48']}; {'id': '37', 'type': 'if_statement', 'children': ['38', '41']}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '40'], 'value': 'not in'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'char'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '47']}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'char'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '53']}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'char'}; {'id': '53', 'type': 'binary_operator', 'children': ['54', '57'], 'value': '+'}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'char'}; {'id': '57', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '58', 'type': 'elif_clause', 'children': ['59', '67']}; {'id': '59', 'type': 'call', 'children': ['60', '65']}; {'id': '60', 'type': 'attribute', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'isdir'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'for_statement', 'children': ['69', '70', '76']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '70', 'type': 'call', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'listdir'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'count_characters'}; {'id': '80', 'type': 'argument_list', 'children': ['81', '90']}; {'id': '81', 'type': 'call', 'children': ['82', '87']}; {'id': '82', 'type': 'attribute', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '87', 'type': 'argument_list', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'root'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'out'}
|
Count the occurrances of the different characters in the files
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reload'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'encoding'}; {'id': '6', 'type': 'block', 'children': ['7', '18']}; {'id': '7', 'type': 'assert_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '14']}; {'id': '9', 'type': 'attribute', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '27', '30']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'encoding'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'encoding'}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'use_cached_encoding'}; {'id': '32', 'type': 'False', 'children': []}
|
Reload the file with another encoding.
:param encoding: the new encoding to use to reload the file.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '33']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'wgan'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '9', '15', '21', '26', '31']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'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': 'DataBunch'}; {'id': '9', 'type': 'typed_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'generator'}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'nn'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'Module'}; {'id': '15', 'type': 'typed_parameter', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'critic'}; {'id': '17', 'type': 'type', 'children': ['18']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'nn'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'Module'}; {'id': '21', 'type': 'typed_default_parameter', 'children': ['22', '23', '25']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'switcher'}; {'id': '23', 'type': 'type', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'Callback'}; {'id': '25', 'type': 'None', 'children': []}; {'id': '26', 'type': 'typed_default_parameter', 'children': ['27', '28', '30']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'clip'}; {'id': '28', 'type': 'type', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '30', 'type': 'float', 'children': [], 'value': '0.01'}; {'id': '31', 'type': 'dictionary_splat_pattern', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'learn_kwargs'}; {'id': '33', 'type': 'block', 'children': ['34', '36']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'string', 'children': [], 'value': '"Create a WGAN from `data`, `generator` and `critic`."'}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41', '42', '43', '46', '49', '52', '55']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'generator'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'critic'}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'NoopLoss'}; {'id': '45', 'type': 'argument_list', 'children': []}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'WassersteinLoss'}; {'id': '48', 'type': 'argument_list', 'children': []}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'switcher'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'switcher'}; {'id': '52', 'type': 'keyword_argument', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'clip'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'clip'}; {'id': '55', 'type': 'dictionary_splat', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'learn_kwargs'}
|
Create a WGAN from `data`, `generator` and `critic`.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'currency_format'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '5', 'type': 'block', 'children': ['6', '20', '27', '37', '60', '67', '81', '93']}; {'id': '6', 'type': 'try_statement', 'children': ['7', '15']}; {'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': 'cents'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '15', 'type': 'except_clause', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'negative'}; {'id': '23', 'type': '()', 'children': ['24']}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '26'], 'value': '<'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '27', 'type': 'if_statement', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'negative'}; {'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': 'cents'}; {'id': '33', 'type': 'binary_operator', 'children': ['34', '36'], 'value': '*'}; {'id': '34', 'type': 'unary_operator', 'children': ['35'], 'value': '-'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '37', 'type': 'if_statement', 'children': ['38', '41', '46']}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '40'], 'value': '<'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '40', 'type': 'integer', 'children': [], 'value': '100'}; {'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': 'dollars'}; {'id': '45', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '46', 'type': 'else_clause', 'children': ['47']}; {'id': '47', 'type': 'block', 'children': ['48', '54']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'dollars'}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '53'], 'value': '/'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '53', 'type': 'integer', 'children': [], 'value': '100'}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '59'], 'value': '%'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '59', 'type': 'integer', 'children': [], 'value': '100'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'centstr'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'cents'}; {'id': '67', 'type': 'if_statement', 'children': ['68', '74']}; {'id': '68', 'type': 'comparison_operator', 'children': ['69', '73'], 'value': '<'}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'centstr'}; {'id': '73', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'centstr'}; {'id': '78', 'type': 'binary_operator', 'children': ['79', '80'], 'value': '+'}; {'id': '79', 'type': 'string', 'children': [], 'value': "'0'"}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'centstr'}; {'id': '81', 'type': 'if_statement', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'negative'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'binary_operator', 'children': ['86', '87'], 'value': '%'}; {'id': '86', 'type': 'string', 'children': [], 'value': '"- $%s.%s"'}; {'id': '87', 'type': 'tuple', 'children': ['88', '92']}; {'id': '88', 'type': 'call', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'intcomma'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'dollars'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'centstr'}; {'id': '93', 'type': 'return_statement', 'children': ['94']}; {'id': '94', 'type': 'binary_operator', 'children': ['95', '96'], 'value': '%'}; {'id': '95', 'type': 'string', 'children': [], 'value': '"$%s.%s"'}; {'id': '96', 'type': 'tuple', 'children': ['97', '101']}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'intcomma'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'dollars'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'centstr'}
|
Format currency with symbol and decimal points.
>> currency_format(-600)
- $6.00
TODO: Add localization support.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'shell'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '10', '12', '18', '30']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': '" A helper command to be used for shell integration "'}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '10', 'type': 'print_statement', 'children': ['11']}; {'id': '11', 'type': 'string', 'children': [], 'value': '"\n print "'}; {'id': '12', 'type': 'print_statement', 'children': ['13']}; {'id': '13', 'type': 'binary_operator', 'children': ['14', '15'], 'value': '%'}; {'id': '14', 'type': 'string', 'children': [], 'value': '"export MAKESITE_HOME=%s"'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '18', 'type': 'print_statement', 'children': ['19']}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '21'], 'value': '%'}; {'id': '20', 'type': 'string', 'children': [], 'value': '"source %s"'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'BASEDIR'}; {'id': '29', 'type': 'string', 'children': [], 'value': "'shell.sh'"}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'print'}
|
A helper command to be used for shell integration
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_tags'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'tags'}; {'id': '6', 'type': 'block', 'children': ['7', '20']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '14']}; {'id': '8', 'type': 'not_operator', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'tags'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'list'}; {'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': 'tags'}; {'id': '18', 'type': 'list', 'children': ['19'], 'value': '[tags]'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'tags'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '27']}; {'id': '22', 'type': 'attribute', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_bugsy'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '35', '38']}; {'id': '28', 'type': 'binary_operator', 'children': ['29', '30'], 'value': '%'}; {'id': '29', 'type': 'string', 'children': [], 'value': "'bug/comment/%s/tags'"}; {'id': '30', 'type': 'subscript', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_comment'}; {'id': '34', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '37', 'type': 'string', 'children': [], 'value': "'PUT'"}; {'id': '38', 'type': 'keyword_argument', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '40', 'type': 'dictionary', 'children': ['41']}; {'id': '41', 'type': 'pair', 'children': ['42', '43']}; {'id': '42', 'type': 'string', 'children': [], 'value': '"add"'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'tags'}
|
Add tags to the comments
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_twoByteStringToNum'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'bytestring'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'numberOfDecimals'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'signed'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '26', '37', '45', '49', '62', '70', '77', '83']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_checkString'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17', '20', '23']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'bytestring'}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'minlength'}; {'id': '19', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'maxlength'}; {'id': '22', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'bytestring'"}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_checkInt'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31', '34']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'numberOfDecimals'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'minvalue'}; {'id': '33', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '34', 'type': 'keyword_argument', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'number of decimals'"}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '_checkBool'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'signed'}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '44', 'type': 'string', 'children': [], 'value': "'signed parameter'"}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'formatcode'}; {'id': '48', 'type': 'string', 'children': [], 'value': "'>'"}; {'id': '49', 'type': 'if_statement', 'children': ['50', '51', '56']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'signed'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'augmented_assignment', 'children': ['54', '55'], 'value': '+='}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'formatcode'}; {'id': '55', 'type': 'string', 'children': [], 'value': "'h'"}; {'id': '56', 'type': 'else_clause', 'children': ['57']}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'augmented_assignment', 'children': ['60', '61'], 'value': '+='}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'formatcode'}; {'id': '61', 'type': 'string', 'children': [], 'value': "'H'"}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'fullregister'}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_unpack'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'formatcode'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'bytestring'}; {'id': '70', 'type': 'if_statement', 'children': ['71', '74']}; {'id': '71', 'type': 'comparison_operator', 'children': ['72', '73'], 'value': '=='}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'numberOfDecimals'}; {'id': '73', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'return_statement', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'fullregister'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'divisor'}; {'id': '80', 'type': 'binary_operator', 'children': ['81', '82'], 'value': '**'}; {'id': '81', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'numberOfDecimals'}; {'id': '83', 'type': 'return_statement', 'children': ['84']}; {'id': '84', 'type': 'binary_operator', 'children': ['85', '86'], 'value': '/'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'fullregister'}; {'id': '86', 'type': 'call', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'divisor'}
|
Convert a two-byte string to a numerical value, possibly scaling it.
Args:
* bytestring (str): A string of length 2.
* numberOfDecimals (int): The number of decimals. Defaults to 0.
* signed (bol): Whether large positive values should be interpreted as negative values.
Returns:
The numerical value (int or float) calculated from the ``bytestring``.
Raises:
TypeError, ValueError
Use the parameter ``signed=True`` if converting a bytestring that can hold
negative values. Then upper range data will be automatically converted into
negative return values (two's complement).
Use ``numberOfDecimals=1`` to divide the received data by 10 before returning the value.
Similarly ``numberOfDecimals=2`` will divide the received data by 100 before returning the value.
The byte order is big-endian, meaning that the most significant byte is sent first.
For example:
A string ``\\x03\\x02`` (which has the length 2) corresponds to 0302 (hex) = 770 (dec). If
``numberOfDecimals = 1``, then this is converted to 77.0 (float).
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_privileges'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '15']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'string', 'children': [], 'value': "'GET_USER_PRIVILEGES'"}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'dispatch'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22', '23']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'GET'"}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'auth'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'auth'}
|
Get privledges for this user.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_header'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'default'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'return_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '19']}; {'id': '12', 'type': 'attribute', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_handler'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'default'}
|
Retrieves the value of a header
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'random_choice'}; {'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': 'actions'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'random_state'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '19', '39', '59']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'random_state'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'check_random_state'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'random_state'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '23', '31']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '22'], 'value': 'is not'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '31', 'type': 'else_clause', 'children': ['32']}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'num_actions'}; {'id': '39', 'type': 'if_statement', 'children': ['40', '43', '48']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '42'], 'value': '=='}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '48', 'type': 'else_clause', 'children': ['49']}; {'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': 'idx'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'random_state'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'randint'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '59', 'type': 'if_statement', 'children': ['60', '63', '68']}; {'id': '60', 'type': 'comparison_operator', 'children': ['61', '62'], 'value': 'is not'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '62', 'type': 'None', 'children': []}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'return_statement', 'children': ['65']}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '68', 'type': 'else_clause', 'children': ['69']}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'return_statement', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'idx'}
|
Return a pure action chosen randomly from `actions`.
Parameters
----------
actions : array_like(int), optional(default=None)
An array of integers representing pure actions.
random_state : int or np.random.RandomState, optional
Random seed (integer) or np.random.RandomState instance to
set the initial state of the random number generator for
reproducibility. If None, a randomly initialized RandomState
is used.
Returns
-------
scalar(int)
If `actions` is given, returns an integer representing a
pure action chosen randomly from `actions`; if not, an
action is chosen randomly from the player's all actions.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_subprocess_method'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '6', 'type': 'block', 'children': ['7', '35', '49']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'Popen'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '25', '30']}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '24'], 'value': '+'}; {'id': '16', 'type': 'binary_operator', 'children': ['17', '21'], 'value': '+'}; {'id': '17', 'type': 'list', 'children': ['18'], 'value': '[self._ipmitool_path]'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_ipmitool_path'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'stdout'}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'PIPE'}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'stderr'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'PIPE'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '44']}; {'id': '37', 'type': 'pattern_list', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'communicate'}; {'id': '48', 'type': 'argument_list', 'children': []}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'status'}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'returncode'}
|
Use the subprocess module to execute ipmitool commands
and and set status
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_call'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'x'}; {'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': 'if_statement', 'children': ['11', '14', '24']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '13'], 'value': 'is'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'subscript', 'children': ['17', '23']}; {'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': 'prod_op'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '24', 'type': 'else_clause', 'children': ['25']}; {'id': '25', 'type': 'block', 'children': ['26', '43', '55']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'wrapped_out'}; {'id': '29', 'type': 'call', 'children': ['30', '37']}; {'id': '30', 'type': 'attribute', 'children': ['31', '36']}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'prod_op'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'element'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '40']}; {'id': '38', 'type': 'list', 'children': ['39'], 'value': '[out]'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '40', 'type': 'keyword_argument', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'cast'}; {'id': '42', 'type': 'False', 'children': []}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'pspace_result'}; {'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': 'prod_op'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '52', 'type': 'keyword_argument', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'wrapped_out'}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'pspace_result'}; {'id': '58', 'type': 'integer', 'children': [], 'value': '0'}
|
Apply operators to ``x`` and sum.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ValidateStopTimesForTrip'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'trip'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'stop_times'}; {'id': '8', 'type': 'block', 'children': ['9', '14', '18', '22', '48', '120']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'prev_departure_secs'}; {'id': '12', 'type': 'unary_operator', 'children': ['13'], 'value': '-'}; {'id': '13', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_potentially_same_time'}; {'id': '17', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_fully_specified_same_time'}; {'id': '21', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '22', 'type': 'function_definition', 'children': ['23', '24', '25']}; {'id': '23', 'type': 'function_name', 'children': [], 'value': 'CheckSameTimeCount'}; {'id': '24', 'type': 'parameters', 'children': []}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'if_statement', 'children': ['27', '36']}; {'id': '27', 'type': '()', 'children': ['28']}; {'id': '28', 'type': 'boolean_operator', 'children': ['29', '33'], 'value': 'and'}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '31'], 'value': '!='}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'prev_departure_secs'}; {'id': '31', 'type': 'unary_operator', 'children': ['32'], 'value': '-'}; {'id': '32', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '35'], 'value': '>'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_fully_specified_same_time'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'TooManyConsecutiveStopTimesWithSameTime'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '46', '47']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'trip'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'trip_id'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_fully_specified_same_time'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'prev_departure_secs'}; {'id': '48', 'type': 'for_statement', 'children': ['49', '52', '56']}; {'id': '49', 'type': 'pattern_list', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'st'}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'stop_times'}; {'id': '56', 'type': 'block', 'children': ['57', '75', '114']}; {'id': '57', 'type': 'if_statement', 'children': ['58', '69']}; {'id': '58', 'type': 'boolean_operator', 'children': ['59', '64'], 'value': 'or'}; {'id': '59', 'type': 'comparison_operator', 'children': ['60', '63'], 'value': 'is'}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'st'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'arrival_secs'}; {'id': '63', 'type': 'None', 'children': []}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '68'], 'value': 'is'}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'st'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'departure_secs'}; {'id': '68', 'type': 'None', 'children': []}; {'id': '69', 'type': 'block', 'children': ['70', '74']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'augmented_assignment', 'children': ['72', '73'], 'value': '+='}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_potentially_same_time'}; {'id': '73', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '74', 'type': 'continue_statement', 'children': []}; {'id': '75', 'type': 'if_statement', 'children': ['76', '90', '100']}; {'id': '76', 'type': '()', 'children': ['77']}; {'id': '77', 'type': 'boolean_operator', 'children': ['78', '83'], 'value': 'and'}; {'id': '78', 'type': 'comparison_operator', 'children': ['79', '80'], 'value': '=='}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'prev_departure_secs'}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'st'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'arrival_secs'}; {'id': '83', 'type': 'comparison_operator', 'children': ['84', '87'], 'value': '=='}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'st'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'arrival_secs'}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'st'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'departure_secs'}; {'id': '90', 'type': 'block', 'children': ['91', '95']}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'augmented_assignment', 'children': ['93', '94'], 'value': '+='}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_potentially_same_time'}; {'id': '94', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'assignment', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_fully_specified_same_time'}; {'id': '98', 'type': '()', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_potentially_same_time'}; {'id': '100', 'type': 'else_clause', 'children': ['101']}; {'id': '101', 'type': 'block', 'children': ['102', '106', '110']}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'call', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'CheckSameTimeCount'}; {'id': '105', 'type': 'argument_list', 'children': []}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'assignment', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_potentially_same_time'}; {'id': '109', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'assignment', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'consecutive_stop_times_with_fully_specified_same_time'}; {'id': '113', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '114', 'type': 'expression_statement', 'children': ['115']}; {'id': '115', 'type': 'assignment', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'prev_departure_secs'}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'st'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'departure_secs'}; {'id': '120', 'type': 'expression_statement', 'children': ['121']}; {'id': '121', 'type': 'call', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'CheckSameTimeCount'}; {'id': '123', 'type': 'argument_list', 'children': []}
|
Checks for the stop times of a trip.
Ensure that a trip does not have too many consecutive stop times with the
same departure/arrival time.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_raw_data'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'mac'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'response_format'}; {'id': '8', 'type': 'string', 'children': [], 'value': "'json'"}; {'id': '9', 'type': 'block', 'children': ['10', '24', '42', '52']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '13', 'type': 'dictionary', 'children': ['14', '19']}; {'id': '14', 'type': 'pair', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_FORMAT_F'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'response_format'}; {'id': '19', 'type': 'pair', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_SEARCH_F'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'mac'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'response'}; {'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': '__decode_str'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '41']}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '__call_api'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '__url'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'utf-8'"}; {'id': '42', 'type': 'if_statement', 'children': ['43', '49']}; {'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': 'response'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'response'}; {'id': '52', 'type': 'raise_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'EmptyResponseException'}; {'id': '55', 'type': 'argument_list', 'children': []}
|
Get data from API as string.
Keyword arguments:
mac -- MAC address or OUI for searching
response_format -- supported types you can see on the https://macaddress.io
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_load_file'}; {'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', '25', '43', '52', '124', '131', '137', '148']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '10', 'type': 'call', 'children': ['11', '16']}; {'id': '11', 'type': 'attribute', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'abspath'}; {'id': '16', 'type': 'argument_list', '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': 'os'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'expanduser'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '25', 'type': 'if_statement', 'children': ['26', '35']}; {'id': '26', 'type': 'not_operator', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'isfile'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'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': 'Exception'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '42'], 'value': '%'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'File %s does not exist'"}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'vtki'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'get_ext'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '52', 'type': 'if_statement', 'children': ['53', '56', '65', '78', '91', '104', '117']}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '55'], 'value': '=='}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '55', 'type': 'string', 'children': [], 'value': "'.ply'"}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'vtk'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'vtkPLYReader'}; {'id': '64', 'type': 'argument_list', 'children': []}; {'id': '65', 'type': 'elif_clause', 'children': ['66', '69']}; {'id': '66', 'type': 'comparison_operator', 'children': ['67', '68'], 'value': '=='}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '68', 'type': 'string', 'children': [], 'value': "'.stl'"}; {'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': 'reader'}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'vtk'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'vtkSTLReader'}; {'id': '77', 'type': 'argument_list', 'children': []}; {'id': '78', 'type': 'elif_clause', 'children': ['79', '82']}; {'id': '79', 'type': 'comparison_operator', 'children': ['80', '81'], 'value': '=='}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '81', 'type': 'string', 'children': [], 'value': "'.vtk'"}; {'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': 'reader'}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'vtk'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'vtkPolyDataReader'}; {'id': '90', 'type': 'argument_list', 'children': []}; {'id': '91', 'type': 'elif_clause', 'children': ['92', '95']}; {'id': '92', 'type': 'comparison_operator', 'children': ['93', '94'], 'value': '=='}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '94', 'type': 'string', 'children': [], 'value': "'.vtp'"}; {'id': '95', 'type': 'block', 'children': ['96']}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'assignment', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'vtk'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'vtkXMLPolyDataReader'}; {'id': '103', 'type': 'argument_list', 'children': []}; {'id': '104', 'type': 'elif_clause', 'children': ['105', '108']}; {'id': '105', 'type': 'comparison_operator', 'children': ['106', '107'], 'value': '=='}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '107', 'type': 'string', 'children': [], 'value': "'.obj'"}; {'id': '108', 'type': 'block', 'children': ['109']}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'assignment', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'vtk'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'vtkOBJReader'}; {'id': '116', 'type': 'argument_list', 'children': []}; {'id': '117', 'type': 'else_clause', 'children': ['118']}; {'id': '118', 'type': 'block', 'children': ['119']}; {'id': '119', 'type': 'raise_statement', 'children': ['120']}; {'id': '120', 'type': 'call', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'string', 'children': [], 'value': '\'Filetype must be either "ply", "stl", "vtk", "vtp", or "obj".\''}; {'id': '124', 'type': 'expression_statement', 'children': ['125']}; {'id': '125', 'type': 'call', 'children': ['126', '129']}; {'id': '126', 'type': 'attribute', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'SetFileName'}; {'id': '129', 'type': 'argument_list', 'children': ['130']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'call', 'children': ['133', '136']}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'Update'}; {'id': '136', 'type': 'argument_list', 'children': []}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'call', 'children': ['139', '142']}; {'id': '139', 'type': 'attribute', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'ShallowCopy'}; {'id': '142', 'type': 'argument_list', 'children': ['143']}; {'id': '143', 'type': 'call', 'children': ['144', '147']}; {'id': '144', 'type': 'attribute', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'reader'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'GetOutput'}; {'id': '147', 'type': 'argument_list', 'children': []}; {'id': '148', 'type': 'if_statement', 'children': ['149', '158']}; {'id': '149', 'type': 'not_operator', 'children': ['150']}; {'id': '150', 'type': 'call', 'children': ['151', '154']}; {'id': '151', 'type': 'attribute', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'any'}; {'id': '154', 'type': 'argument_list', 'children': ['155']}; {'id': '155', 'type': 'attribute', 'children': ['156', '157']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'points'}; {'id': '158', 'type': 'block', 'children': ['159']}; {'id': '159', 'type': 'raise_statement', 'children': ['160']}; {'id': '160', 'type': 'call', 'children': ['161', '162']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'AssertionError'}; {'id': '162', 'type': 'argument_list', 'children': ['163']}; {'id': '163', 'type': 'string', 'children': [], 'value': "'Empty or invalid file'"}
|
Load a surface mesh from a mesh file.
Mesh file may be an ASCII or binary ply, stl, or vtk mesh file.
Parameters
----------
filename : str
Filename of mesh to be loaded. File type is inferred from the
extension of the filename
Notes
-----
Binary files load much faster than ASCII.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_display_panel_by_id'}; {'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': 'identifier'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'DisplayPanel'}; {'id': '11', 'type': 'block', 'children': ['12', '44']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'display_panel'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'next'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '43']}; {'id': '18', 'type': 'generator_expression', 'children': ['19', '20', '29']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'display_panel'}; {'id': '20', 'type': 'for_in_clause', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'display_panel'}; {'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': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '__document_controller'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'workspace_controller'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'display_panels'}; {'id': '29', 'type': 'if_clause', 'children': ['30']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '38'], 'value': '=='}; {'id': '31', 'type': 'call', 'children': ['32', '37']}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'display_panel'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '42', 'type': 'argument_list', 'children': []}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'conditional_expression', 'children': ['46', '50', '51'], 'value': 'if'}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'DisplayPanel'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'display_panel'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'display_panel'}; {'id': '51', 'type': 'None', 'children': []}
|
Return display panel with the identifier.
.. versionadded:: 1.0
Status: Provisional
Scriptable: Yes
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_initialize_client_from_environment'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '12']}; {'id': '5', 'type': 'global_statement', 'children': ['6', '7', '8', '9', '10', '11']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': '_client'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'project_id'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'write_key'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'read_key'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'master_key'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'base_url'}; {'id': '12', 'type': 'if_statement', 'children': ['13', '16']}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '15'], 'value': 'is'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_client'}; {'id': '15', 'type': 'None', 'children': []}; {'id': '16', 'type': 'block', 'children': ['17', '30', '43', '56', '69', '82', '91']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'project_id'}; {'id': '20', 'type': 'boolean_operator', 'children': ['21', '22'], 'value': 'or'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'project_id'}; {'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': 'environ'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"KEEN_PROJECT_ID"'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'write_key'}; {'id': '33', 'type': 'boolean_operator', 'children': ['34', '35'], 'value': 'or'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'write_key'}; {'id': '35', 'type': 'call', 'children': ['36', '41']}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'string', 'children': [], 'value': '"KEEN_WRITE_KEY"'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'read_key'}; {'id': '46', 'type': 'boolean_operator', 'children': ['47', '48'], 'value': 'or'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'read_key'}; {'id': '48', 'type': 'call', 'children': ['49', '54']}; {'id': '49', 'type': 'attribute', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'string', 'children': [], 'value': '"KEEN_READ_KEY"'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'master_key'}; {'id': '59', 'type': 'boolean_operator', 'children': ['60', '61'], 'value': 'or'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'master_key'}; {'id': '61', 'type': 'call', 'children': ['62', '67']}; {'id': '62', 'type': 'attribute', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'string', 'children': [], 'value': '"KEEN_MASTER_KEY"'}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'base_url'}; {'id': '72', 'type': 'boolean_operator', 'children': ['73', '74'], 'value': 'or'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'base_url'}; {'id': '74', 'type': 'call', 'children': ['75', '80']}; {'id': '75', 'type': 'attribute', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'environ'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'string', 'children': [], 'value': '"KEEN_BASE_URL"'}; {'id': '82', 'type': 'if_statement', 'children': ['83', '85']}; {'id': '83', 'type': 'not_operator', 'children': ['84']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'project_id'}; {'id': '85', 'type': 'block', 'children': ['86']}; {'id': '86', 'type': 'raise_statement', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'InvalidEnvironmentError'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'string', 'children': [], 'value': '"Please set the KEEN_PROJECT_ID environment variable or set keen.project_id!"'}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': '_client'}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'KeenClient'}; {'id': '96', 'type': 'argument_list', 'children': ['97', '98', '101', '104', '107']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'project_id'}; {'id': '98', 'type': 'keyword_argument', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'write_key'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'write_key'}; {'id': '101', 'type': 'keyword_argument', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'read_key'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'read_key'}; {'id': '104', 'type': 'keyword_argument', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'master_key'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'master_key'}; {'id': '107', 'type': 'keyword_argument', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'base_url'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'base_url'}
|
Initialize a KeenClient instance using environment variables.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'string_to_enum'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'enumeration'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'strict'}; {'id': '8', 'type': 'True', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'default_value'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13', '26', '57', '72', '87']}; {'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': 'enumeration'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'Enum'}; {'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': 'ValueError'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'string', 'children': [], 'value': "'The specified enumeration is not an instance of Enum'"}; {'id': '26', 'type': 'if_statement', 'children': ['27', '31']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'is_undefined'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '31', 'type': 'block', 'children': ['32', '40', '55']}; {'id': '32', 'type': 'if_statement', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'strict'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'raise_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'string', 'children': [], 'value': "'The value cannot be null'"}; {'id': '40', 'type': 'if_statement', 'children': ['41', '49']}; {'id': '41', 'type': 'boolean_operator', 'children': ['42', '45'], 'value': 'and'}; {'id': '42', 'type': 'comparison_operator', 'children': ['43', '44'], 'value': 'is not'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'default_value'}; {'id': '44', 'type': 'None', 'children': []}; {'id': '45', 'type': 'not_operator', 'children': ['46']}; {'id': '46', 'type': 'comparison_operator', 'children': ['47', '48'], 'value': 'in'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'default_value'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'enumeration'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'raise_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'string', 'children': [], 'value': "'The default value must be an item of the specified enumeration'"}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'default_value'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '60', 'type': 'list_comprehension', 'children': ['61', '62', '65']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '62', 'type': 'for_in_clause', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'enumeration'}; {'id': '65', 'type': 'if_clause', 'children': ['66']}; {'id': '66', 'type': 'comparison_operator', 'children': ['67', '71'], 'value': '=='}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '72', 'type': 'if_statement', 'children': ['73', '79']}; {'id': '73', 'type': 'comparison_operator', 'children': ['74', '78'], 'value': '=='}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '78', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'raise_statement', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'binary_operator', 'children': ['85', '86'], 'value': '%'}; {'id': '85', 'type': 'string', 'children': [], 'value': '\'The specified string "%s" does not represent any item of the enumeration\''}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '87', 'type': 'return_statement', 'children': ['88']}; {'id': '88', 'type': 'subscript', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '90', 'type': 'integer', 'children': [], 'value': '0'}
|
Return the item of an enumeration that corresponds to the specified
string representation.
@param value: string representation of an item of a Python
enumeration.
@param enumeration: a Python enumeration.
@param strict: indicate whether the value must correspond to an
item of the specified Python enumeration or if ``None`` value is
accepted.
@return: the item of the Python enumeration the specified string
representation corresponds to.
@raise ValueError: if the enumeration is not an instance of
``Enum``, or if the string representation doesn't correspond
to any item of the given Python enumeration, or if the default
value is not an item of the given Python enumeration.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '__call'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'uri'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '11', 'type': 'string', 'children': [], 'value': '"get"'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'try_statement', 'children': ['14', '43', '65', '95']}; {'id': '14', 'type': 'block', 'children': ['15', '27', '39']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'resp'}; {'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_response'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24', '25', '26']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'uri'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '26', 'type': 'False', 'children': []}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'rjson'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'resp'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'dictionary_splat', 'children': ['36']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'json_options'}; {'id': '39', 'type': 'assert_statement', 'children': ['40']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'resp'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'ok'}; {'id': '43', 'type': 'except_clause', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'AssertionError'}; {'id': '45', 'type': 'block', 'children': ['46', '60']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'string', 'children': [], 'value': '"OCode-{}: {}"'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'resp'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'status_code'}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'rjson'}; {'id': '59', 'type': 'string', 'children': [], 'value': '"message"'}; {'id': '60', 'type': 'raise_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'BadRequest'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '65', 'type': 'except_clause', 'children': ['66', '70']}; {'id': '66', 'type': 'as_pattern', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '68', 'type': 'as_pattern_target', 'children': ['69']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '70', 'type': 'block', 'children': ['71', '80', '90']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '74', 'type': 'call', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'string', 'children': [], 'value': '"Bad response: {}"'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '78', 'type': 'argument_list', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '85', 'type': 'argument_list', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '87', 'type': 'keyword_argument', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'exc_info'}; {'id': '89', 'type': 'True', 'children': []}; {'id': '90', 'type': 'raise_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'BadRequest'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '95', 'type': 'else_clause', 'children': ['96']}; {'id': '96', 'type': 'block', 'children': ['97']}; {'id': '97', 'type': 'return_statement', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'rjson'}
|
Only returns the response, nor the status_code
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_getTrafficClassAndFlowLabel'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12', '28', '46', '66']}; {'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': 'tf'}; {'id': '11', 'type': 'integer', 'children': [], 'value': '0x0'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'expression_list', 'children': ['15', '25']}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '22'], 'value': '+'}; {'id': '16', 'type': '()', 'children': ['17']}; {'id': '17', 'type': 'binary_operator', 'children': ['18', '21'], 'value': '<<'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'tc_ecn'}; {'id': '21', 'type': 'integer', 'children': [], 'value': '6'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'tc_dscp'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'flowlabel'}; {'id': '28', 'type': 'elif_clause', 'children': ['29', '34']}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '33'], 'value': '=='}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '33', 'type': 'integer', 'children': [], 'value': '0x1'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'expression_list', 'children': ['37', '43']}; {'id': '37', 'type': '()', 'children': ['38']}; {'id': '38', 'type': 'binary_operator', 'children': ['39', '42'], 'value': '<<'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'tc_ecn'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '6'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'flowlabel'}; {'id': '46', 'type': 'elif_clause', 'children': ['47', '52']}; {'id': '47', 'type': 'comparison_operator', 'children': ['48', '51'], 'value': '=='}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '51', 'type': 'integer', 'children': [], 'value': '0x2'}; {'id': '52', 'type': 'block', 'children': ['53']}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'expression_list', 'children': ['55', '65']}; {'id': '55', 'type': 'binary_operator', 'children': ['56', '62'], 'value': '+'}; {'id': '56', 'type': '()', 'children': ['57']}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '61'], 'value': '<<'}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'tc_ecn'}; {'id': '61', 'type': 'integer', 'children': [], 'value': '6'}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'tc_dscp'}; {'id': '65', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '66', 'type': 'else_clause', 'children': ['67']}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'return_statement', 'children': ['69']}; {'id': '69', 'type': 'expression_list', 'children': ['70', '71']}; {'id': '70', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '0'}
|
Page 6, draft feb 2011
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'parse_qs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'qs'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'keep_blank_values'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'strict_parsing'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'keep_attr_order'}; {'id': '13', 'type': 'True', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15', '28', '48']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'od'}; {'id': '18', 'type': 'conditional_expression', 'children': ['19', '23', '24'], 'value': 'if'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'DefaultOrderedDict'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'keep_attr_order'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'defaultdict'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '28', 'type': 'for_statement', 'children': ['29', '32', '38']}; {'id': '29', 'type': 'pattern_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'parse_qsl'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36', '37']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'qs'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'keep_blank_values'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'strict_parsing'}; {'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': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'od'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'od'}
|
Kind of like urlparse.parse_qs, except returns an ordered dict.
Also avoids replicating that function's bad habit of overriding the
built-in 'dict' type.
Taken from below with modification:
<https://bitbucket.org/btubbs/thumpy/raw/8cdece404f15/thumpy.py>
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'call_or_cast'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '8', 'type': 'dictionary', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'nowait'}; {'id': '11', 'type': 'False', 'children': []}; {'id': '12', 'type': 'dictionary_splat_pattern', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '27']}; {'id': '17', 'type': '()', 'children': ['18']}; {'id': '18', 'type': 'boolean_operator', 'children': ['19', '24'], 'value': 'or'}; {'id': '19', 'type': 'boolean_operator', 'children': ['20', '21'], 'value': 'and'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'nowait'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'cast'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'call'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29', '30']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '30', 'type': 'dictionary_splat', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
|
Apply remote `method` asynchronously or synchronously depending
on the value of `nowait`.
:param method: The name of the remote method to perform.
:param args: Dictionary of arguments for the method.
:keyword nowait: If false the call will block until the result
is available and return it (default), if true the call will be
non-blocking and no result will be returned.
:keyword retry: If set to true then message sending will be retried
in the event of connection failures. Default is decided by the
:attr:`retry` attributed.
:keyword retry_policy: Override retry policies.
See :attr:`retry_policy`. This must be a dictionary, and keys will
be merged with the default retry policy.
:keyword timeout: Timeout to wait for replies in seconds as a float
(**only relevant in blocking mode**).
:keyword limit: Limit number of replies to wait for
(**only relevant in blocking mode**).
:keyword callback: If provided, this callback will be called for every
reply received (**only relevant in blocking mode**).
:keyword \*\*props: Additional message properties.
See :meth:`kombu.Producer.publish`.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'send_cons3rt_agent_logs'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '34', '50']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'binary_operator', 'children': ['15', '18'], 'value': '+'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'cls_logger'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'.send_cons3rt_agent_logs'"}; {'id': '19', 'type': 'if_statement', 'children': ['20', '25']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '24'], 'value': 'is'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'cons3rt_agent_log_dir'}; {'id': '24', 'type': 'None', 'children': []}; {'id': '25', 'type': 'block', 'children': ['26', '33']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'warn'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': "'There is not CONS3RT agent log directory on this system'"}; {'id': '33', 'type': 'return_statement', 'children': []}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'string', 'children': [], 'value': "'Searching for log files in directory: {d}'"}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'keyword_argument', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'cons3rt_agent_log_dir'}; {'id': '50', 'type': 'for_statement', 'children': ['51', '52', '60']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'listdir'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'cons3rt_agent_log_dir'}; {'id': '60', 'type': 'block', 'children': ['61', '75']}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'item_path'}; {'id': '64', 'type': 'call', 'children': ['65', '70']}; {'id': '65', 'type': 'attribute', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '70', 'type': 'argument_list', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'cons3rt_agent_log_dir'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '75', 'type': 'if_statement', 'children': ['76', '84']}; {'id': '76', 'type': 'call', 'children': ['77', '82']}; {'id': '77', 'type': 'attribute', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'isfile'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'item_path'}; {'id': '84', 'type': 'block', 'children': ['85', '99']}; {'id': '85', 'type': 'expression_statement', 'children': ['86']}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'string', 'children': [], 'value': "'Sending email with cons3rt agent log file: {f}'"}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'keyword_argument', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'item_path'}; {'id': '99', 'type': 'try_statement', 'children': ['100', '110', '156']}; {'id': '100', 'type': 'block', 'children': ['101']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'send_text_file'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'keyword_argument', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'text_file'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'item_path'}; {'id': '110', 'type': 'except_clause', 'children': ['111', '115']}; {'id': '111', 'type': 'tuple', 'children': ['112', '113', '114']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'OSError'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'AssetMailerError'}; {'id': '115', 'type': 'block', 'children': ['116', '127', '151']}; {'id': '116', 'type': 'expression_statement', 'children': ['117']}; {'id': '117', 'type': 'assignment', 'children': ['118', '122']}; {'id': '118', 'type': 'pattern_list', 'children': ['119', '120', '121']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'ex'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'trace'}; {'id': '122', 'type': 'call', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'exc_info'}; {'id': '126', 'type': 'argument_list', 'children': []}; {'id': '127', 'type': 'expression_statement', 'children': ['128']}; {'id': '128', 'type': 'assignment', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '130', 'type': 'call', 'children': ['131', '134']}; {'id': '131', 'type': 'attribute', 'children': ['132', '133']}; {'id': '132', 'type': 'string', 'children': [], 'value': "'{n}: There was a problem sending CONS3RT agent log file: {f}\\n{e}'"}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '134', 'type': 'argument_list', 'children': ['135', '142', '145']}; {'id': '135', 'type': 'keyword_argument', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '137', 'type': 'attribute', 'children': ['138', '141']}; {'id': '138', 'type': 'attribute', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'ex'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '142', 'type': 'keyword_argument', 'children': ['143', '144']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'item_path'}; {'id': '145', 'type': 'keyword_argument', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '147', 'type': 'call', 'children': ['148', '149']}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '149', 'type': 'argument_list', 'children': ['150']}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'ex'}; {'id': '151', 'type': 'raise_statement', 'children': ['152']}; {'id': '152', 'type': 'expression_list', 'children': ['153', '154', '155']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'AssetMailerError'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'trace'}; {'id': '156', 'type': 'else_clause', 'children': ['157']}; {'id': '157', 'type': 'block', 'children': ['158']}; {'id': '158', 'type': 'expression_statement', 'children': ['159']}; {'id': '159', 'type': 'call', 'children': ['160', '163']}; {'id': '160', 'type': 'attribute', 'children': ['161', '162']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '163', 'type': 'argument_list', 'children': ['164']}; {'id': '164', 'type': 'call', 'children': ['165', '168']}; {'id': '165', 'type': 'attribute', 'children': ['166', '167']}; {'id': '166', 'type': 'string', 'children': [], 'value': "'Successfully sent email with file: {f}'"}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '168', 'type': 'argument_list', 'children': ['169']}; {'id': '169', 'type': 'keyword_argument', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'item_path'}
|
Send the cons3rt agent log file
:return:
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_field_mro'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'field_name'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '58']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'if_statement', 'children': ['14', '19']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'__mro__'"}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'for_statement', 'children': ['21', '22', '28']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_class'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'inspect'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'getmro'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '28', 'type': 'block', 'children': ['29', '38']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'values_'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36', '37']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '_class'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'field_name'}; {'id': '37', 'type': 'None', 'children': []}; {'id': '38', 'type': 'if_statement', 'children': ['39', '42']}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '41'], 'value': 'is not'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'values_'}; {'id': '41', 'type': 'None', 'children': []}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'union'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'make_list'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'values_'}; {'id': '58', 'type': 'return_statement', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'res'}
|
Goes up the mro and looks for the specified field.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_market_history'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'market'}; {'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': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_api_query'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '19', '28']}; {'id': '13', 'type': 'keyword_argument', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'path_dict'}; {'id': '15', 'type': 'dictionary', 'children': ['16']}; {'id': '16', 'type': 'pair', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'API_V1_1'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'/public/getmarkethistory'"}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '21', 'type': 'dictionary', 'children': ['22', '25']}; {'id': '22', 'type': 'pair', 'children': ['23', '24']}; {'id': '23', 'type': 'string', 'children': [], 'value': "'market'"}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'market'}; {'id': '25', 'type': 'pair', 'children': ['26', '27']}; {'id': '26', 'type': 'string', 'children': [], 'value': "'marketname'"}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'market'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'protection'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'PROTECTION_PUB'}
|
Used to retrieve the latest trades that have occurred for a
specific market.
Endpoint:
1.1 /market/getmarkethistory
2.0 NO Equivalent
Example ::
{'success': True,
'message': '',
'result': [ {'Id': 5625015,
'TimeStamp': '2017-08-31T01:29:50.427',
'Quantity': 7.31008193,
'Price': 0.00177639,
'Total': 0.01298555,
'FillType': 'FILL',
'OrderType': 'BUY'},
...
]
}
:param market: String literal for the market (ex: BTC-LTC)
:type market: str
:return: Market history in JSON
:rtype : dict
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_current_names'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'dsn'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'pc'}; {'id': '7', 'type': 'block', 'children': ['8', '12', '16', '70']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_table_name'}; {'id': '11', 'type': 'string', 'children': [], 'value': '""'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_variable_name'}; {'id': '15', 'type': 'string', 'children': [], 'value': '""'}; {'id': '16', 'type': 'try_statement', 'children': ['17', '40']}; {'id': '17', 'type': 'block', 'children': ['18', '29']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_table_name'}; {'id': '21', 'type': 'subscript', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': "'{}_tableName'"}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'pc'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_variable_name'}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'current'}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'string', 'children': [], 'value': "'{}_variableName'"}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'pc'}; {'id': '40', 'type': 'except_clause', 'children': ['41', '45']}; {'id': '41', 'type': 'as_pattern', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '43', 'type': 'as_pattern_target', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '45', 'type': 'block', 'children': ['46', '57']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'string', 'children': [], 'value': '"Error: Unable to collapse time series: {}, {}"'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'dsn'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'logger_ts'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'string', 'children': [], 'value': '"get_current: {}, {}"'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'dsn'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '70', 'type': 'return_statement', 'children': ['71']}; {'id': '71', 'type': 'expression_list', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': '_table_name'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': '_variable_name'}
|
Get the table name and variable name from the given time series entry
:param dict current: Time series entry
:param str pc: paleoData or chronData
:return str _table_name:
:return str _variable_name:
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'rpc_call'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'dictionary_splat_pattern', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '14', 'type': 'block', 'children': ['15', '19', '25', '51', '63', '80', '88', '103']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '18', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'if_statement', 'children': ['26', '31', '39']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '39', 'type': 'else_clause', 'children': ['40']}; {'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': 'args'}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'as_tuple'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'method_key'}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'string', 'children': [], 'value': '"{0}.{1}"'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'format'}; {'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': 'scheme_name'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '63', 'type': 'if_statement', 'children': ['64', '69']}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '66'], 'value': 'not in'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'method_key'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'methods'}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'raise_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'AssertionError'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'string', 'children': [], 'value': '"Unknown method: {0}"'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '78', 'type': 'argument_list', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '83', 'type': 'subscript', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'methods'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'method_key'}; {'id': '88', 'type': 'if_statement', 'children': ['89', '94']}; {'id': '89', 'type': 'call', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '91', 'type': 'argument_list', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '93', 'type': 'string', 'children': [], 'value': "'request'"}; {'id': '94', 'type': 'block', 'children': ['95']}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'insert'}; {'id': '100', 'type': 'argument_list', 'children': ['101', '102']}; {'id': '101', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '103', 'type': 'return_statement', 'children': ['104']}; {'id': '104', 'type': 'call', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '106', 'type': 'argument_list', 'children': ['107', '109']}; {'id': '107', 'type': 'list_splat', 'children': ['108']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '109', 'type': 'dictionary_splat', 'children': ['110']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
|
Call a RPC method.
return object: a result
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sphlat'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'colat'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'lons'}; {'id': '7', 'type': 'block', 'children': ['8', '17', '26', '35', '43', '51', '59', '86']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'ctypes'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'c_double'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'colat'}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'ctypes'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'c_double'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'colat'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'lons'}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'ctypes'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'c_double'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'lons'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'radius'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'ctypes'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'c_double'}; {'id': '42', 'type': 'argument_list', 'children': []}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'lon'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'ctypes'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'c_double'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'ctypes'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'c_double'}; {'id': '58', 'type': 'argument_list', 'children': []}; {'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': 'libspice'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'sphcyl_c'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '66', '67', '68', '74', '80']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'colat'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'lons'}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'ctypes'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'byref'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'radius'}; {'id': '74', 'type': 'call', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'ctypes'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'byref'}; {'id': '78', 'type': 'argument_list', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'lon'}; {'id': '80', 'type': 'call', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'ctypes'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'byref'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '86', 'type': 'return_statement', 'children': ['87']}; {'id': '87', 'type': 'expression_list', 'children': ['88', '91', '94']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'radius'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'lon'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'value'}
|
Convert from spherical coordinates to latitudinal coordinates.
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/sphlat_c.html
:param r: Distance of the point from the origin.
:type r: float
:param colat: Angle of the point from positive z axis (radians).
:type colat: float
:param lons: Angle of the point from the XZ plane (radians).
:type lons: float
:return:
Distance of a point from the origin,
Angle of the point from the XZ plane in radians,
Angle of the point from the XY plane in radians.
:rtype: tuple
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_set_load_action'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'read_complete'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '135', '146']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '18', '31', '69', '82', '96', '121']}; {'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': '_have_all_records'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'block', 'children': ['19', '23', '27']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '31', 'type': 'elif_clause', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'read_complete'}; {'id': '33', 'type': 'block', 'children': ['34', '38']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '38', 'type': 'if_statement', 'children': ['39', '40', '50']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'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': 'mem_addr'}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': '_next_address'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '50', 'type': 'else_clause', 'children': ['51']}; {'id': '51', 'type': 'block', 'children': ['52', '61', '65']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': '_next_address'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '69', 'type': 'elif_clause', 'children': ['70', '75']}; {'id': '70', 'type': 'boolean_operator', 'children': ['71', '72'], 'value': 'and'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '72', 'type': 'comparison_operator', 'children': ['73', '74'], 'value': '<'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'ALDB_RECORD_RETRIES'}; {'id': '75', 'type': 'block', 'children': ['76']}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '79', 'type': 'binary_operator', 'children': ['80', '81'], 'value': '+'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '81', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '82', 'type': 'elif_clause', 'children': ['83', '89']}; {'id': '83', 'type': 'boolean_operator', 'children': ['84', '86'], 'value': 'and'}; {'id': '84', 'type': 'not_operator', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '86', 'type': 'comparison_operator', 'children': ['87', '88'], 'value': '<'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'ALDB_ALL_RECORD_RETRIES'}; {'id': '89', 'type': 'block', 'children': ['90']}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'assignment', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '93', 'type': 'binary_operator', 'children': ['94', '95'], 'value': '+'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '95', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '96', 'type': 'elif_clause', 'children': ['97', '103']}; {'id': '97', 'type': 'boolean_operator', 'children': ['98', '100'], 'value': 'and'}; {'id': '98', 'type': 'not_operator', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '100', 'type': 'comparison_operator', 'children': ['101', '102'], 'value': '>='}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'ALDB_ALL_RECORD_RETRIES'}; {'id': '103', 'type': 'block', 'children': ['104', '113', '117']}; {'id': '104', 'type': 'expression_statement', 'children': ['105']}; {'id': '105', 'type': 'assignment', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'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': '_next_address'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'assignment', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '116', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'assignment', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '120', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '121', 'type': 'else_clause', 'children': ['122']}; {'id': '122', 'type': 'block', 'children': ['123', '127', '131']}; {'id': '123', 'type': 'expression_statement', 'children': ['124']}; {'id': '124', 'type': 'assignment', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '126', 'type': 'None', 'children': []}; {'id': '127', 'type': 'expression_statement', 'children': ['128']}; {'id': '128', 'type': 'assignment', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '130', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '134', 'type': 'integer', 'children': [], 'value': '0'}; {'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': '_load_action'}; {'id': '140', 'type': 'call', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'LoadAction'}; {'id': '142', 'type': 'argument_list', 'children': ['143', '144', '145']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'retries'}; {'id': '146', 'type': 'if_statement', 'children': ['147', '150']}; {'id': '147', 'type': 'comparison_operator', 'children': ['148', '149'], 'value': 'is not'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '149', 'type': 'None', 'children': []}; {'id': '150', 'type': 'block', 'children': ['151']}; {'id': '151', 'type': 'expression_statement', 'children': ['152']}; {'id': '152', 'type': 'call', 'children': ['153', '156']}; {'id': '153', 'type': 'attribute', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': '_LOGGER'}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '156', 'type': 'argument_list', 'children': ['157', '158', '163', '168']}; {'id': '157', 'type': 'string', 'children': [], 'value': "'Load action: addr: %04x rec_count: %d retries: %d'"}; {'id': '158', 'type': 'attribute', 'children': ['159', '162']}; {'id': '159', 'type': 'attribute', 'children': ['160', '161']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '161', 'type': 'identifier', 'children': [], 'value': '_load_action'}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'mem_addr'}; {'id': '163', 'type': 'attribute', 'children': ['164', '167']}; {'id': '164', 'type': 'attribute', 'children': ['165', '166']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '166', 'type': 'identifier', 'children': [], 'value': '_load_action'}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'rec_count'}; {'id': '168', 'type': 'attribute', 'children': ['169', '172']}; {'id': '169', 'type': 'attribute', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '171', 'type': 'identifier', 'children': [], 'value': '_load_action'}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'retries'}
|
Calculate the next record to read.
If the last record was successful and one record was being read then
look for the next record until we get to the high water mark.
If the last read was successful and all records were being read then
look for the first record.
if the last read was unsuccessful and one record was being read then
repeat the last read until max retries
If the last read was unsuccessful and all records were being read then
repeat the last read until max retries or look for the first record.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_ctype'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'rtype'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'cfunc'}; {'id': '6', 'type': 'list_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '8', 'type': 'block', 'children': ['9', '20', '27', '33']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'val_p'}; {'id': '12', 'type': 'call', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'backend'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ffi'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'new'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'rtype'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '25'], 'value': '+'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '25', 'type': 'tuple', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'val_p'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'cfunc'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'list_splat', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'val_p'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '0'}
|
Call a C function that takes a pointer as its last argument and
return the C object that it contains after the function has finished.
:param rtype: C data type is filled by the function
:param cfunc: C function to call
:param args: Arguments to call function with
:return: A pointer to the specified data type
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_config'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '6', 'type': 'block', 'children': ['7', '20', '31']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'app_facade'}; {'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': 'client'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'ApplicationFacade'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'from_connection'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'connection'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27', '30']}; {'id': '26', 'type': 'string', 'children': [], 'value': "'Setting config for %s: %s'"}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'await', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'app_facade'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'Set'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'config'}
|
Set configuration options for this application.
:param config: Dict of configuration to set
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_fit_and_score_ensemble'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'cv'}; {'id': '8', 'type': 'dictionary_splat_pattern', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'fit_params'}; {'id': '10', 'type': 'block', 'children': ['11', '20', '33', '44', '111', '131']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'fit_params_steps'}; {'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': '_split_fit_params'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'fit_params'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'folds'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'cv'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '38']}; {'id': '35', 'type': 'pattern_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'base_estimators'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'kernel_cache'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_get_base_estimators'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '47', 'type': 'call', 'children': ['48', '61']}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'Parallel'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '56']}; {'id': '51', 'type': 'keyword_argument', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'n_jobs'}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'n_jobs'}; {'id': '56', 'type': 'keyword_argument', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'verbose'}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'verbose'}; {'id': '61', 'type': 'generator_expression', 'children': ['62', '91', '101']}; {'id': '62', 'type': 'call', 'children': ['63', '67']}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'delayed'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_fit_and_score_fold'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '72', '80', '81', '84', '85', '86', '89', '90']}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'clone'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'estimator'}; {'id': '72', 'type': 'conditional_expression', 'children': ['73', '74', '77'], 'value': 'if'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '74', 'type': 'comparison_operator', 'children': ['75', '76'], 'value': 'not in'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'kernel_cache'}; {'id': '77', 'type': 'subscript', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'kernel_cache'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'scorer'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'train_index'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'test_index'}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'fit_params_steps'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'fold'}; {'id': '91', 'type': 'for_in_clause', 'children': ['92', '97']}; {'id': '92', 'type': 'pattern_list', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '94', 'type': 'tuple_pattern', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'estimator'}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'base_estimators'}; {'id': '101', 'type': 'for_in_clause', 'children': ['102', '107']}; {'id': '102', 'type': 'pattern_list', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'fold'}; {'id': '104', 'type': 'tuple_pattern', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'train_index'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'test_index'}; {'id': '107', 'type': 'call', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '109', 'type': 'argument_list', 'children': ['110']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'folds'}; {'id': '111', 'type': 'if_statement', 'children': ['112', '118']}; {'id': '112', 'type': 'comparison_operator', 'children': ['113', '117'], 'value': '>'}; {'id': '113', 'type': 'call', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '115', 'type': 'argument_list', 'children': ['116']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'kernel_cache'}; {'id': '117', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '118', 'type': 'block', 'children': ['119']}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'assignment', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '122', 'type': 'call', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': '_restore_base_estimators'}; {'id': '126', 'type': 'argument_list', 'children': ['127', '128', '129', '130']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'kernel_cache'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'folds'}; {'id': '131', 'type': 'return_statement', 'children': ['132']}; {'id': '132', 'type': 'call', 'children': ['133', '136']}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': '_create_base_ensemble'}; {'id': '136', 'type': 'argument_list', 'children': ['137', '138', '142']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '138', 'type': 'call', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '140', 'type': 'argument_list', 'children': ['141']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'base_estimators'}; {'id': '142', 'type': 'call', 'children': ['143', '144']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'folds'}
|
Create a cross-validated model by training a model for each fold with the same model parameters
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'content'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'overwrite'}; {'id': '10', 'type': 'True', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'encoding'}; {'id': '13', 'type': 'string', 'children': [], 'value': "'utf-8'"}; {'id': '14', 'type': 'block', 'children': ['15', '56']}; {'id': '15', 'type': 'if_statement', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '17', 'type': 'block', 'children': ['18', '33']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'download'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '27', '30']}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'wait'}; {'id': '26', 'type': 'True', 'children': []}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'overwrite'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'overwrite'}; {'id': '33', 'type': 'with_statement', 'children': ['34', '49']}; {'id': '34', 'type': 'with_clause', 'children': ['35']}; {'id': '35', 'type': 'with_item', 'children': ['36']}; {'id': '36', 'type': 'as_pattern', 'children': ['37', '47']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'io'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43', '44']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'encoding'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'encoding'}; {'id': '47', 'type': 'as_pattern_target', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '55', 'type': 'argument_list', 'children': []}; {'id': '56', 'type': 'with_statement', 'children': ['57', '67']}; {'id': '57', 'type': 'with_clause', 'children': ['58']}; {'id': '58', 'type': 'with_item', 'children': ['59']}; {'id': '59', 'type': 'as_pattern', 'children': ['60', '65']}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'tempfile'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'NamedTemporaryFile'}; {'id': '64', 'type': 'argument_list', 'children': []}; {'id': '65', 'type': 'as_pattern_target', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'tmpfile'}; {'id': '67', 'type': 'block', 'children': ['68', '85']}; {'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': 'download'}; {'id': '73', 'type': 'argument_list', 'children': ['74', '77', '82']}; {'id': '74', 'type': 'keyword_argument', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'wait'}; {'id': '76', 'type': 'True', 'children': []}; {'id': '77', 'type': 'keyword_argument', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'tmpfile'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '82', 'type': 'keyword_argument', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'overwrite'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'overwrite'}; {'id': '85', 'type': 'with_statement', 'children': ['86', '103']}; {'id': '86', 'type': 'with_clause', 'children': ['87']}; {'id': '87', 'type': 'with_item', 'children': ['88']}; {'id': '88', 'type': 'as_pattern', 'children': ['89', '101']}; {'id': '89', 'type': 'call', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'io'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '93', 'type': 'argument_list', 'children': ['94', '97', '98']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'tmpfile'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '97', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '98', 'type': 'keyword_argument', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'encoding'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'encoding'}; {'id': '101', 'type': 'as_pattern_target', 'children': ['102']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '103', 'type': 'block', 'children': ['104']}; {'id': '104', 'type': 'return_statement', 'children': ['105']}; {'id': '105', 'type': 'call', 'children': ['106', '109']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'fp'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '109', 'type': 'argument_list', 'children': []}
|
Downloads file to the specified path or as temporary file
and reads the file content in memory.
Should not be used on very large files.
:param path: Path for file download If omitted tmp file will be used.
:param overwrite: Overwrite file if exists locally
:param encoding: File encoding, by default it is UTF-8
:return: File content.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_shade_hdrgos'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'dictionary_splat_pattern', 'children': ['5']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '25', '36', '51']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': 'in'}; {'id': '9', 'type': 'string', 'children': [], 'value': "'shade_hdrgos'"}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'subscript', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'shade_hdrgos'"}; {'id': '16', 'type': 'if_statement', 'children': ['17', '20']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': 'in'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'hdrgo_prt'"}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'return_statement', 'children': ['22']}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '24', 'type': 'string', 'children': [], 'value': "'hdrgo_prt'"}; {'id': '25', 'type': 'if_statement', 'children': ['26', '33']}; {'id': '26', 'type': 'boolean_operator', 'children': ['27', '30'], 'value': 'and'}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '29'], 'value': 'in'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'section_sortby'"}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'section_sortby'"}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'False', 'children': []}; {'id': '36', 'type': 'if_statement', 'children': ['37', '48']}; {'id': '37', 'type': 'boolean_operator', 'children': ['38', '41'], 'value': 'and'}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '40'], 'value': 'in'}; {'id': '39', 'type': 'string', 'children': [], 'value': "'top_n'"}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '47']}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '46', 'type': 'string', 'children': [], 'value': "'top_n'"}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'False', 'children': []}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'True', 'children': []}
|
If no hdrgo_prt specified, and these conditions are present -> hdrgo_prt=F.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'top_sections'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '33']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'top_line'}; {'id': '9', 'type': 'subscript', 'children': ['10', '18']}; {'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': 'text'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'\\n'"}; {'id': '18', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'sections'}; {'id': '22', 'type': 'binary_operator', 'children': ['23', '32'], 'value': '-'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'top_line'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'string', 'children': [], 'value': "'+'"}; {'id': '32', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'sections'}
|
The number of sections that touch the top side.
Returns
-------
sections : int
The number of sections on the top
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'countok'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '25', '54']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'ok'}; {'id': '9', 'type': 'call', 'children': ['10', '23']}; {'id': '10', 'type': 'attribute', 'children': ['11', '22']}; {'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': 'ones'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'stars'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '25', 'type': 'for_statement', 'children': ['26', '27', '30']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'constraints'}; {'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': 'c'}; {'id': '34', 'type': 'subscript', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'constraints'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '39', 'type': 'if_statement', 'children': ['40', '47']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '44'], 'value': 'not in'}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'selectfrac_skip'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'augmented_assignment', 'children': ['50', '51'], 'value': '&='}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'ok'}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'ok'}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'ok'}
|
Boolean array showing which stars pass all count constraints.
A "count constraint" is a constraint that affects the number of stars.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'do_commit_amends'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'commit_cumalative_count'}; {'id': '9', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '13']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'days'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'MARKED_DAYS'}; {'id': '13', 'type': 'block', 'children': ['14', '33']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'amend_date'}; {'id': '17', 'type': 'call', 'children': ['18', '31']}; {'id': '18', 'type': 'attribute', 'children': ['19', '30']}; {'id': '19', 'type': '()', 'children': ['20']}; {'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': 'end_date'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'timedelta'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'days'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'strftime'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': '"%Y-%m-%d %H:%M:%S"'}; {'id': '33', 'type': 'for_statement', 'children': ['34', '35', '42']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'commit_number_in_a_day'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'max_commits'}; {'id': '42', 'type': 'block', 'children': ['43', '47', '76', '91']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'augmented_assignment', 'children': ['45', '46'], 'value': '+='}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'commit_cumalative_count'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'check_call'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '71']}; {'id': '53', 'type': 'list', 'children': ['54', '55', '56', '57', '62', '63'], 'value': '[\'git\', \'commit\', \'--amend\', "--date=\'<" + amend_date + " + 0530 >\' ", \'-C\',\n \'HEAD~{commit_number}\'.format(commit_number=commit_cumalative_count)]'}; {'id': '54', 'type': 'string', 'children': [], 'value': "'git'"}; {'id': '55', 'type': 'string', 'children': [], 'value': "'commit'"}; {'id': '56', 'type': 'string', 'children': [], 'value': "'--amend'"}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '61'], 'value': '+'}; {'id': '58', 'type': 'binary_operator', 'children': ['59', '60'], 'value': '+'}; {'id': '59', 'type': 'string', 'children': [], 'value': '"--date=\'<"'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'amend_date'}; {'id': '61', 'type': 'string', 'children': [], 'value': '" + 0530 >\' "'}; {'id': '62', 'type': 'string', 'children': [], 'value': "'-C'"}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'string', 'children': [], 'value': "'HEAD~{commit_number}'"}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'keyword_argument', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'commit_number'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'commit_cumalative_count'}; {'id': '71', 'type': 'keyword_argument', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'cwd'}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'repository_name'}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'check_call'}; {'id': '81', 'type': 'argument_list', 'children': ['82', '86']}; {'id': '82', 'type': 'list', 'children': ['83', '84', '85'], 'value': "['git', 'pull', '--no-edit']"}; {'id': '83', 'type': 'string', 'children': [], 'value': "'git'"}; {'id': '84', 'type': 'string', 'children': [], 'value': "'pull'"}; {'id': '85', 'type': 'string', 'children': [], 'value': "'--no-edit'"}; {'id': '86', 'type': 'keyword_argument', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'cwd'}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'repository_name'}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'call', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'check_call'}; {'id': '96', 'type': 'argument_list', 'children': ['97', '102']}; {'id': '97', 'type': 'list', 'children': ['98', '99', '100', '101'], 'value': "['git', 'push', 'origin', 'master']"}; {'id': '98', 'type': 'string', 'children': [], 'value': "'git'"}; {'id': '99', 'type': 'string', 'children': [], 'value': "'push'"}; {'id': '100', 'type': 'string', 'children': [], 'value': "'origin'"}; {'id': '101', 'type': 'string', 'children': [], 'value': "'master'"}; {'id': '102', 'type': 'keyword_argument', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'cwd'}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'repository_name'}
|
Amends the Commit to form the heart
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'disallow'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '5', 'type': 'block', 'children': ['6', '56']}; {'id': '6', 'type': 'function_definition', 'children': ['7', '8', '10']}; {'id': '7', 'type': 'function_name', 'children': [], 'value': 'disallowed'}; {'id': '8', 'type': 'parameters', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '10', 'type': 'block', 'children': ['11', '17', '54']}; {'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': 'cls'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'unsupported_nodes'}; {'id': '16', 'type': 'tuple', 'children': []}; {'id': '17', 'type': 'for_statement', 'children': ['18', '19', '20']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '20', 'type': 'block', 'children': ['21', '29', '40', '47']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'new_method'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_node_not_implemented'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'string', 'children': [], 'value': "'visit_{node}'"}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'augmented_assignment', 'children': ['42', '45'], 'value': '+='}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'unsupported_nodes'}; {'id': '45', 'type': 'tuple', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'setattr'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '52', '53']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'new_method'}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'disallowed'}
|
Decorator to disallow certain nodes from parsing. Raises a
NotImplementedError instead.
Returns
-------
disallowed : callable
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_sh_ids'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'identity'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'backend_name'}; {'id': '7', 'type': 'block', 'children': ['8', '19', '29']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'identity_tuple'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'identity'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'sh_ids'}; {'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': '__get_sh_ids_cache'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'identity_tuple'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'backend_name'}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sh_ids'}
|
Return the Sorting Hat id and uuid for an identity
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_convert_to_degress'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '23', '35', '43', '51', '63', '71', '79', '91']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'd0'}; {'id': '10', 'type': 'subscript', 'children': ['11', '14']}; {'id': '11', 'type': 'subscript', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '13', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'd1'}; {'id': '18', 'type': 'subscript', 'children': ['19', '22']}; {'id': '19', 'type': 'subscript', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '21', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '22', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '26', 'type': 'binary_operator', 'children': ['27', '31'], 'value': '/'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'd0'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'd1'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'm0'}; {'id': '38', 'type': 'subscript', 'children': ['39', '42']}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'm1'}; {'id': '46', 'type': 'subscript', 'children': ['47', '50']}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '49', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '54', 'type': 'binary_operator', 'children': ['55', '59'], 'value': '/'}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'm0'}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'm1'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 's0'}; {'id': '66', 'type': 'subscript', 'children': ['67', '70']}; {'id': '67', 'type': 'subscript', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '69', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '70', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 's1'}; {'id': '74', 'type': 'subscript', 'children': ['75', '78']}; {'id': '75', 'type': 'subscript', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '77', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '78', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '82', 'type': 'binary_operator', 'children': ['83', '87'], 'value': '/'}; {'id': '83', 'type': 'call', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 's0'}; {'id': '87', 'type': 'call', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 's1'}; {'id': '91', 'type': 'return_statement', 'children': ['92']}; {'id': '92', 'type': 'binary_operator', 'children': ['93', '99'], 'value': '+'}; {'id': '93', 'type': 'binary_operator', 'children': ['94', '95'], 'value': '+'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '95', 'type': '()', 'children': ['96']}; {'id': '96', 'type': 'binary_operator', 'children': ['97', '98'], 'value': '/'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '98', 'type': 'float', 'children': [], 'value': '60.0'}; {'id': '99', 'type': '()', 'children': ['100']}; {'id': '100', 'type': 'binary_operator', 'children': ['101', '102'], 'value': '/'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '102', 'type': 'float', 'children': [], 'value': '3600.0'}
|
Helper function to convert the GPS coordinates stored in the EXIF to degress in float format
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'time_window'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'window_width_ms'}; {'id': '6', 'type': 'block', 'children': ['7', '32']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'Operator'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '16', '19', '20', '29']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_generate_uuid'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'OpType'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'TimeWindow'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"TimeWindow"'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'num_instances'}; {'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': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'env'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'parallelism'}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'window_width_ms'}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '__register'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'op'}
|
Applies a system time window to the stream.
Attributes:
window_width_ms (int): The length of the window in ms.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_geodetic_to_cartesian'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'lon'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'alt'}; {'id': '8', 'type': 'block', 'children': ['9', '36', '72', '86', '100', '115']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'C'}; {'id': '12', 'type': 'binary_operator', 'children': ['13', '16'], 'value': '/'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'Earth'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'sqrt'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'binary_operator', 'children': ['22', '23'], 'value': '-'}; {'id': '22', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '35'], 'value': '**'}; {'id': '24', 'type': '()', 'children': ['25']}; {'id': '25', 'type': 'binary_operator', 'children': ['26', '29'], 'value': '*'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'Earth'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sin'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'S'}; {'id': '39', 'type': 'binary_operator', 'children': ['40', '52'], 'value': '/'}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '44'], 'value': '*'}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'Earth'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '44', 'type': '()', 'children': ['45']}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '47'], 'value': '-'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'binary_operator', 'children': ['48', '51'], 'value': '**'}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'Earth'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '51', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'sqrt'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'binary_operator', 'children': ['58', '59'], 'value': '-'}; {'id': '58', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '71'], 'value': '**'}; {'id': '60', 'type': '()', 'children': ['61']}; {'id': '61', 'type': 'binary_operator', 'children': ['62', '65'], 'value': '*'}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'Earth'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'sin'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'r_d'}; {'id': '75', 'type': 'binary_operator', 'children': ['76', '80'], 'value': '*'}; {'id': '76', 'type': '()', 'children': ['77']}; {'id': '77', 'type': 'binary_operator', 'children': ['78', '79'], 'value': '+'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'C'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'alt'}; {'id': '80', 'type': 'call', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'cos'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'r_k'}; {'id': '89', 'type': 'binary_operator', 'children': ['90', '94'], 'value': '*'}; {'id': '90', 'type': '()', 'children': ['91']}; {'id': '91', 'type': 'binary_operator', 'children': ['92', '93'], 'value': '+'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'S'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'alt'}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'sin'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'assignment', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'norm'}; {'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': 'sqrt'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'binary_operator', 'children': ['109', '112'], 'value': '+'}; {'id': '109', 'type': 'binary_operator', 'children': ['110', '111'], 'value': '**'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'r_d'}; {'id': '111', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '112', 'type': 'binary_operator', 'children': ['113', '114'], 'value': '**'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'r_k'}; {'id': '114', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '115', 'type': 'return_statement', 'children': ['116']}; {'id': '116', 'type': 'binary_operator', 'children': ['117', '118'], 'value': '*'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'norm'}; {'id': '118', 'type': 'call', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'list', 'children': ['124', '137', '150'], 'value': '[\n np.cos(lat) * np.cos(lon),\n np.cos(lat) * np.sin(lon),\n np.sin(lat)\n ]'}; {'id': '124', 'type': 'binary_operator', 'children': ['125', '131'], 'value': '*'}; {'id': '125', 'type': 'call', 'children': ['126', '129']}; {'id': '126', 'type': 'attribute', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'cos'}; {'id': '129', 'type': 'argument_list', 'children': ['130']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '131', 'type': 'call', 'children': ['132', '135']}; {'id': '132', 'type': 'attribute', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'cos'}; {'id': '135', 'type': 'argument_list', 'children': ['136']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'lon'}; {'id': '137', 'type': 'binary_operator', 'children': ['138', '144'], 'value': '*'}; {'id': '138', 'type': 'call', 'children': ['139', '142']}; {'id': '139', 'type': 'attribute', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'cos'}; {'id': '142', 'type': 'argument_list', 'children': ['143']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'lat'}; {'id': '144', 'type': 'call', 'children': ['145', '148']}; {'id': '145', 'type': 'attribute', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'sin'}; {'id': '148', 'type': 'argument_list', 'children': ['149']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'lon'}; {'id': '150', 'type': 'call', 'children': ['151', '154']}; {'id': '151', 'type': 'attribute', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'sin'}; {'id': '154', 'type': 'argument_list', 'children': ['155']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'lat'}
|
Conversion from latitude, longitude and altitude coordinates to
cartesian with respect to an ellipsoid
Args:
lat (float): Latitude in radians
lon (float): Longitude in radians
alt (float): Altitude to sea level in meters
Return:
numpy.array: 3D element (in meters)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_interpolated'}; {'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': 'identifier', 'children': [], 'value': 'extent'}; {'id': '7', 'type': 'block', 'children': ['8', '16', '24']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'result'}; {'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': 'copy'}; {'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': 'result'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'interpolate'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'extent'}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'result'}
|
Return a new vector that has been moved towards the given target by
the given extent. The extent should be between 0 and 1.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'decode'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'type', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'Iterable'}; {'id': '7', 'type': 'block', 'children': ['8', '28']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '21']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '18'], 'value': 'not in'}; {'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': 'data'}; {'id': '14', 'type': 'slice', 'children': ['15', '16', '17']}; {'id': '15', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '16', 'type': 'colon', 'children': []}; {'id': '17', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '18', 'type': 'tuple', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': "b'd'"}; {'id': '20', 'type': 'string', 'children': [], 'value': "b'l'"}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'return_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': '__wrap_with_tuple'}; {'id': '27', 'type': 'argument_list', 'children': []}; {'id': '28', 'type': 'return_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': '__parse'}; {'id': '33', 'type': 'argument_list', 'children': []}
|
Start of decode process. Returns final results.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_apply_credentials'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7', '10']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'auto_refresh'}; {'id': '6', 'type': 'True', 'children': []}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'default_parameter', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14', '24', '66']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '17', 'type': 'attribute', 'children': ['18', '23']}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'get_credentials'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'access_token'}; {'id': '24', 'type': 'if_statement', 'children': ['25', '28']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': 'is'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'auto_refresh'}; {'id': '27', 'type': 'True', 'children': []}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'if_statement', 'children': ['30', '33', '48']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': 'is'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '32', 'type': 'None', 'children': []}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'refresh'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '45']}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'access_token'}; {'id': '44', 'type': 'None', 'children': []}; {'id': '45', 'type': 'keyword_argument', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '48', 'type': 'elif_clause', 'children': ['49', '54']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'jwt_is_expired'}; {'id': '53', 'type': 'argument_list', 'children': []}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'refresh'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'keyword_argument', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'timeout'}; {'id': '65', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'dictionary', 'children': ['73']}; {'id': '73', 'type': 'pair', 'children': ['74', '75']}; {'id': '74', 'type': 'string', 'children': [], 'value': "'Authorization'"}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'string', 'children': [], 'value': '"Bearer {}"'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '79', 'type': 'argument_list', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'token'}
|
Update Authorization header.
Update request headers with latest `access_token`. Perform token
`refresh` if token is ``None``.
Args:
auto_refresh (bool): Perform token refresh if access_token is ``None`` or expired. Defaults to ``True``.
credentials (class): Read-only credentials.
headers (class): Requests `CaseInsensitiveDict`.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'do_random'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'try_statement', 'children': ['8', '16']}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'return_statement', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'random'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'choice'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '16', 'type': 'except_clause', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'IndexError'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '26']}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'environment'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'undefined'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'string', 'children': [], 'value': "'No random item, sequence was empty.'"}
|
Return a random item from the sequence.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sonar_data'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '6', 'type': 'block', 'children': ['7', '17', '23', '43', '47', '55', '149']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '10', 'type': 'subscript', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '12', 'type': 'slice', 'children': ['13', '14', '15']}; {'id': '13', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '14', 'type': 'colon', 'children': []}; {'id': '15', 'type': 'unary_operator', 'children': ['16'], 'value': '-'}; {'id': '16', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'pin_number'}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'data'}; {'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': 'val'}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'binary_operator', 'children': ['30', '38'], 'value': '+'}; {'id': '30', 'type': '()', 'children': ['31']}; {'id': '31', 'type': 'binary_operator', 'children': ['32', '37'], 'value': '<<'}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'PrivateConstants'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'MSB'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '7'}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'PrivateConstants'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'LSB'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'reply_data'}; {'id': '46', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '50', 'type': 'subscript', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'active_sonar_map'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'pin_number'}; {'id': '55', 'type': 'if_statement', 'children': ['56', '61', '133']}; {'id': '56', 'type': 'comparison_operator', 'children': ['57', '60'], 'value': 'is not'}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '59', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '60', 'type': 'None', 'children': []}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'if_statement', 'children': ['63', '68']}; {'id': '63', 'type': 'comparison_operator', 'children': ['64', '67'], 'value': '!='}; {'id': '64', 'type': 'subscript', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '66', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '68', 'type': 'block', 'children': ['69', '75', '83']}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '74']}; {'id': '71', 'type': 'subscript', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '73', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'assignment', 'children': ['77', '82']}; {'id': '77', 'type': 'subscript', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'active_sonar_map'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'pin_number'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '83', 'type': 'if_statement', 'children': ['84', '87']}; {'id': '84', 'type': 'subscript', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '86', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '87', 'type': 'block', 'children': ['88', '95', '102']}; {'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': 'reply_data'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'pin_number'}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'reply_data'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '100', 'type': 'argument_list', 'children': ['101']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '102', 'type': 'if_statement', 'children': ['103', '106', '115']}; {'id': '103', 'type': 'subscript', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '105', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '106', 'type': 'block', 'children': ['107']}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'await', 'children': ['109']}; {'id': '109', 'type': 'call', 'children': ['110', '113']}; {'id': '110', 'type': 'subscript', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '112', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '113', 'type': 'argument_list', 'children': ['114']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'reply_data'}; {'id': '115', 'type': 'else_clause', 'children': ['116']}; {'id': '116', 'type': 'block', 'children': ['117', '123']}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'assignment', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'loop'}; {'id': '120', 'type': 'attribute', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'loop'}; {'id': '123', 'type': 'expression_statement', 'children': ['124']}; {'id': '124', 'type': 'call', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'loop'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'call_soon'}; {'id': '128', 'type': 'argument_list', 'children': ['129', '132']}; {'id': '129', 'type': 'subscript', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '131', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'reply_data'}; {'id': '133', 'type': 'else_clause', 'children': ['134']}; {'id': '134', 'type': 'block', 'children': ['135', '141']}; {'id': '135', 'type': 'expression_statement', 'children': ['136']}; {'id': '136', 'type': 'assignment', 'children': ['137', '140']}; {'id': '137', 'type': 'subscript', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '139', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '141', 'type': 'expression_statement', 'children': ['142']}; {'id': '142', 'type': 'assignment', 'children': ['143', '148']}; {'id': '143', 'type': 'subscript', 'children': ['144', '147']}; {'id': '144', 'type': 'attribute', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'active_sonar_map'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'pin_number'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'sonar_pin_entry'}; {'id': '149', 'type': 'expression_statement', 'children': ['150']}; {'id': '150', 'type': 'await', 'children': ['151']}; {'id': '151', 'type': 'call', 'children': ['152', '155']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'asyncio'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'sleep'}; {'id': '155', 'type': 'argument_list', 'children': ['156']}; {'id': '156', 'type': 'attribute', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'sleep_tune'}
|
This method handles the incoming sonar data message and stores
the data in the response table.
:param data: Message data from Firmata
:returns: No return value.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'query_names'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'pat'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'for_statement', 'children': ['8', '9', '16']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'chnames'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'if_statement', 'children': ['18', '27']}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'fnmatch'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'fnmatchcase'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '26']}; {'id': '23', 'type': 'subscript', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'pat'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'print_statement', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'item'}
|
pat a shell pattern. See fnmatch.fnmatchcase. Print the
results to stdout.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'write_json'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'with_statement', 'children': ['7', '32']}; {'id': '7', 'type': 'with_clause', 'children': ['8']}; {'id': '8', 'type': 'with_item', 'children': ['9']}; {'id': '9', 'type': 'as_pattern', 'children': ['10', '30']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '29']}; {'id': '13', 'type': 'binary_operator', 'children': ['14', '28'], 'value': '+'}; {'id': '14', 'type': 'binary_operator', 'children': ['15', '20'], 'value': '+'}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '19'], 'value': '+'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'results_folder_name'}; {'id': '19', 'type': 'string', 'children': [], 'value': "'/results-'"}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'get_global_count'}; {'id': '27', 'type': 'argument_list', 'children': []}; {'id': '28', 'type': 'string', 'children': [], 'value': "'.json'"}; {'id': '29', 'type': 'string', 'children': [], 'value': "'a'"}; {'id': '30', 'type': 'as_pattern_target', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'dump'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'f'}
|
Dump data into json file.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ref'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '28', '31']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'RefTrace'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '15', '18', '22', '25']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'filehandle'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'readonly'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'yield', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'flush'}; {'id': '36', 'type': 'argument_list', 'children': []}
|
A write-back version of Trace
Returns
-------
ref : RefTrace
`ref` is returned in a context manager, and must be in a ``with``
statement
Notes
-----
.. versionadded:: 1.6
Examples
--------
>>> with trace.ref as ref:
... ref[10] += 1.617
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'translate_state'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '6', 'type': 'block', 'children': ['7', '17', '31']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '14']}; {'id': '8', 'type': 'not_operator', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'basestring'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '20', 'type': 'call', 'children': ['21', '28']}; {'id': '21', 'type': 'attribute', 'children': ['22', '27']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'capitalize'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"_"'}; {'id': '30', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 's'}
|
Translate the given state string
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'require_bool'}; {'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': 'key'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '11', 'type': 'block', 'children': ['12', '21', '36']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'v'}; {'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': 'get_bool'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '25']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '24'], 'value': 'is'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '24', 'type': 'None', 'children': []}; {'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': 'ConfigMissingError'}; {'id': '29', 'type': 'argument_list', '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': 'full_key'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'v'}
|
Returns a configuration value, as a bool, by its given key. If it doesn't exist, or the
configuration value is not a legal bool, an error is thrown.
:param str key: The requested configuration key.
:return: The configuration key's value.
:rtype: bool
:raises ConfigMissingError: The configuration value did not exist.
:raises ConfigTypeError: The configuration value existed but couldn't be coerced to bool.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'tilequeue_rawr_seed_all'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cfg'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'peripherals'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '23', '32', '37', '43', '47', '81']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'rawr_yaml'}; {'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': 'cfg'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'yml'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'rawr'"}; {'id': '18', 'type': 'assert_statement', 'children': ['19', '22']}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '21'], 'value': 'is not'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'rawr_yaml'}; {'id': '21', 'type': 'None', 'children': []}; {'id': '22', 'type': 'string', 'children': [], 'value': "'Missing rawr configuration in yaml'"}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'group_by_zoom'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'rawr_yaml'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'string', 'children': [], 'value': "'group-zoom'"}; {'id': '32', 'type': 'assert_statement', 'children': ['33', '36']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '35'], 'value': 'is not'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'group_by_zoom'}; {'id': '35', 'type': 'None', 'children': []}; {'id': '36', 'type': 'string', 'children': [], 'value': "'Missing group-zoom rawr config'"}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'max_coord'}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '42'], 'value': '**'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'group_by_zoom'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'coords'}; {'id': '46', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '47', 'type': 'for_statement', 'children': ['48', '49', '54']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '53']}; {'id': '52', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'max_coord'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'for_statement', 'children': ['56', '57', '62']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '61']}; {'id': '60', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'max_coord'}; {'id': '62', 'type': 'block', 'children': ['63']}; {'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': 'coords'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'Coordinate'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '75', '78']}; {'id': '72', 'type': 'keyword_argument', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'zoom'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'group_by_zoom'}; {'id': '75', 'type': 'keyword_argument', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '78', 'type': 'keyword_argument', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'call', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': '_tilequeue_rawr_seed'}; {'id': '84', 'type': 'argument_list', 'children': ['85', '86', '87']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'cfg'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'peripherals'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'coords'}
|
command to enqueue all the tiles at the group-by zoom
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_model'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'appname'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'modelname'}; {'id': '7', 'type': 'block', 'children': ['8', '17', '25', '29', '46']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'app'}; {'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_app'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'appname'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'models'}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'app'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'get_models'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '28', 'type': 'None', 'children': []}; {'id': '29', 'type': 'for_statement', 'children': ['30', '31', '32']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'mod'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'models'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'if_statement', 'children': ['34', '39']}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '38'], 'value': '=='}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'mod'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '__name__'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'modelname'}; {'id': '39', 'type': 'block', 'children': ['40', '44']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'mod'}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'msg'}; {'id': '49', 'type': 'binary_operator', 'children': ['50', '53'], 'value': '+'}; {'id': '50', 'type': 'binary_operator', 'children': ['51', '52'], 'value': '+'}; {'id': '51', 'type': 'string', 'children': [], 'value': '"Model "'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'modelname'}; {'id': '53', 'type': 'string', 'children': [], 'value': '" not found"'}
|
return model or None
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'stored_bind'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '6', 'type': 'block', 'children': ['7', '21', '33', '44', '64']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '13']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': 'is'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_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': 'bind'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'store'}; {'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': '_bound_pangler_store'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '32', 'type': 'dictionary', 'children': []}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '44', 'type': 'if_statement', 'children': ['45', '48']}; {'id': '45', 'type': 'comparison_operator', 'children': ['46', '47'], 'value': 'is'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '47', 'type': 'None', 'children': []}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '52', 'type': 'assignment', 'children': ['53', '58']}; {'id': '53', 'type': 'subscript', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'bind'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '64', 'type': 'return_statement', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'p'}
|
Bind an instance to this Pangler, using the bound Pangler store.
This method functions identically to `bind`, except that it might
return a Pangler which was previously bound to the provided instance.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'path_distance'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'points'}; {'id': '5', 'type': 'block', 'children': ['6', '24', '38']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'vecs'}; {'id': '9', 'type': 'subscript', 'children': ['10', '19', '21']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'diff'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'points'}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '18', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '19', 'type': 'slice', 'children': ['20']}; {'id': '20', 'type': 'colon', 'children': []}; {'id': '21', 'type': 'slice', 'children': ['22', '23']}; {'id': '22', 'type': 'colon', 'children': []}; {'id': '23', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'd2'}; {'id': '27', 'type': 'list_comprehension', 'children': ['28', '35']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'dot'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '35', 'type': 'for_in_clause', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'vecs'}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sqrt'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'd2'}
|
Compute the path distance from given set of points
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'connectivity'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'measure_names'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'nfft'}; {'id': '11', 'type': 'integer', 'children': [], 'value': '512'}; {'id': '12', 'type': 'block', 'children': ['13', '22']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'con'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'Connectivity'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20', '21']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'nfft'}; {'id': '22', 'type': 'try_statement', 'children': ['23', '32']}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '31']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'con'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'measure_names'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'except_clause', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '38', 'type': 'generator_expression', 'children': ['39', '48']}; {'id': '39', 'type': 'tuple', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '41', 'type': 'call', 'children': ['42', '47']}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'con'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'for_in_clause', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'measure_names'}
|
Calculate connectivity measures.
Parameters
----------
measure_names : str or list of str
Name(s) of the connectivity measure(s) to calculate. See
:class:`Connectivity` for supported measures.
b : array, shape (n_channels, n_channels * model_order)
VAR model coefficients. See :ref:`var-model-coefficients` for details
about the arrangement of coefficients.
c : array, shape (n_channels, n_channels), optional
Covariance matrix of the driving noise process. Identity matrix is used
if set to None (default).
nfft : int, optional
Number of frequency bins to calculate. Note that these points cover the
range between 0 and half the sampling rate.
Returns
-------
result : array, shape (n_channels, n_channels, `nfft`)
An array of shape (m, m, nfft) is returned if measures is a string. If
measures is a list of strings, a dictionary is returned, where each key
is the name of the measure, and the corresponding values are arrays of
shape (m, m, nfft).
Notes
-----
When using this function, it is more efficient to get several measures at
once than calling the function multiple times.
Examples
--------
>>> c = connectivity(['DTF', 'PDC'], [[0.3, 0.6], [0.0, 0.9]])
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'count_async'}; {'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': 'limit'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'dictionary_splat_pattern', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'q_options'}; {'id': '10', 'type': 'block', 'children': ['11', '19']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'qry'}; {'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': '_fix_namespace'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'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': 'qry'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_count_async'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '28']}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '28', 'type': 'dictionary_splat', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'q_options'}
|
Count the number of query results, up to a limit.
This is the asynchronous version of Query.count().
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_uri'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '6', 'type': 'block', 'children': ['7', '20', '42']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '17']}; {'id': '8', 'type': 'boolean_operator', 'children': ['9', '10'], 'value': 'and'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '10', 'type': 'not_operator', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'string', 'children': [], 'value': "'/'"}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'uri'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': '"{0}://{1}{2}{3}"'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '31', '36', '41']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_protocol'}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'real_connection'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'host'}; {'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': '_port_postfix'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'uri'}
|
Returns request absolute URI
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'from_object'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'conditional_expression', 'children': ['8', '9', '14', '15'], 'value': 'if'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'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': 'obj'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'Contact'}; {'id': '14', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'Contact'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '29', '32', '49']}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'cast'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'string_to_enum'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'Contact'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'ContactName'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'is_primary'}; {'id': '34', 'type': 'boolean_operator', 'children': ['35', '38'], 'value': 'and'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'is_primary'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'cast'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'string_to_boolean'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'is_primary'}; {'id': '46', 'type': 'keyword_argument', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'strict'}; {'id': '48', 'type': 'True', 'children': []}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'is_verified'}; {'id': '51', 'type': 'boolean_operator', 'children': ['52', '55'], 'value': 'and'}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'is_verified'}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'cast'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'string_to_boolean'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'is_verified'}; {'id': '63', 'type': 'keyword_argument', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'strict'}; {'id': '65', 'type': 'True', 'children': []}
|
Convert an object representing a contact information to an instance
`Contact`.
@param obj: an object containg the following attributes:
* `name`: an item of the enumeration `ContactName` representing the
type of this contact information.
* `value`: value of this contact information representing by a string,
such as ``+84.01272170781``, the formatted value for a telephone
number property.
* `is_primary`: indicate whether this contact property is the first to
be used to contact the entity that this contact information
corresponds to. There is only one primary contact property for a
given property name (e.g., `EMAIL`, `PHONE`, `WEBSITE`).
* `is_verified`: indicate whether this contact information has been
verified, whether it has been grabbed from a trusted Social
Networking Service (SNS), or whether through a challenge/response
process.
@raise ValueError: if the value of this contact information is null.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'on_network_adapter_change'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'network_adapter'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'change_adapter'}; {'id': '7', 'type': 'block', 'children': ['8', '21', '34']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '15']}; {'id': '9', 'type': 'not_operator', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'network_adapter'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'INetworkAdapter'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'raise_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'string', 'children': [], 'value': '"network_adapter can only be an instance of type INetworkAdapter"'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '28']}; {'id': '22', 'type': 'not_operator', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'change_adapter'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'raise_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'string', 'children': [], 'value': '"change_adapter can only be an instance of type bool"'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '_call'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'string', 'children': [], 'value': '"onNetworkAdapterChange"'}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'in_p'}; {'id': '43', 'type': 'list', 'children': ['44', '45'], 'value': '[network_adapter, change_adapter]'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'network_adapter'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'change_adapter'}
|
Triggered when settings of a network adapter of the
associated virtual machine have changed.
in network_adapter of type :class:`INetworkAdapter`
in change_adapter of type bool
raises :class:`VBoxErrorInvalidVmState`
Session state prevents operation.
raises :class:`VBoxErrorInvalidObjectState`
Session type prevents operation.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'minutes_in_range'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'start_minute'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'end_minute'}; {'id': '7', 'type': 'block', 'children': ['8', '20', '32', '47']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'start_idx'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'searchsorted'}; {'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': '_trading_minutes_nanos'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'start_minute'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'end_idx'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'searchsorted'}; {'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': '_trading_minutes_nanos'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'end_minute'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '32', 'type': 'if_statement', 'children': ['33', '42']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '37'], 'value': '=='}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'end_minute'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '37', 'type': 'subscript', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_trading_minutes_nanos'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'end_idx'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'augmented_assignment', 'children': ['45', '46'], 'value': '+='}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'end_idx'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'subscript', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'all_minutes'}; {'id': '52', 'type': 'slice', 'children': ['53', '54', '55']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'start_idx'}; {'id': '54', 'type': 'colon', 'children': []}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'end_idx'}
|
Given start and end minutes, return all the calendar minutes
in that range, inclusive.
Given minutes don't need to be calendar minutes.
Parameters
----------
start_minute: pd.Timestamp
The minute representing the start of the desired range.
end_minute: pd.Timestamp
The minute representing the end of the desired range.
Returns
-------
pd.DatetimeIndex
The minutes in the desired range.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'diffuse_template'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'dictionary_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '7', 'type': 'block', 'children': ['8', '18', '26', '33', '45', '63']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'kwargs_copy'}; {'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': 'base_dict'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'kwargs_copy'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'dictionary_splat', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_replace_none'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'kwargs_copy'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'localpath'}; {'id': '36', 'type': 'call', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'NameFactory'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'diffuse_template_format'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'dictionary_splat', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'kwargs_copy'}; {'id': '45', 'type': 'if_statement', 'children': ['46', '53']}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '52']}; {'id': '51', 'type': 'string', 'children': [], 'value': "'fullpath'"}; {'id': '52', 'type': 'False', 'children': []}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'fullpath'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'keyword_argument', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'localpath'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'localpath'}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'localpath'}
|
return the file name for other diffuse map templates
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_process'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '6', 'type': 'block', 'children': ['7', '29']}; {'id': '7', 'type': 'try_statement', 'children': ['8', '18']}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'loads'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '18', 'type': 'except_clause', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '20', 'type': 'block', 'children': ['21', '28']}; {'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': 'logger'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'string', 'children': [], 'value': "'Received invalid JSON from client. Ignoring.'"}; {'id': '28', 'type': 'return_statement', 'children': []}; {'id': '29', 'type': 'if_statement', 'children': ['30', '35', '43', '61', '100']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '34'], 'value': '=='}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'cmd'"}; {'id': '34', 'type': 'string', 'children': [], 'value': "'run-command'"}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_run_command'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '43', 'type': 'elif_clause', 'children': ['44', '49']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '48'], 'value': '=='}; {'id': '45', 'type': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '47', 'type': 'string', 'children': [], 'value': "'cmd'"}; {'id': '48', 'type': 'string', 'children': [], 'value': "'in'"}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '57']}; {'id': '52', 'type': 'attribute', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': '_pipeinput'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'send_text'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'subscript', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '60', 'type': 'string', 'children': [], 'value': "'data'"}; {'id': '61', 'type': 'elif_clause', 'children': ['62', '67']}; {'id': '62', 'type': 'comparison_operator', 'children': ['63', '66'], 'value': '=='}; {'id': '63', 'type': 'subscript', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '65', 'type': 'string', 'children': [], 'value': "'cmd'"}; {'id': '66', 'type': 'string', 'children': [], 'value': "'size'"}; {'id': '67', 'type': 'block', 'children': ['68', '74', '92']}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '71', 'type': 'subscript', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '73', 'type': 'string', 'children': [], 'value': "'data'"}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'assignment', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '79', 'type': 'call', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'Size'}; {'id': '81', 'type': 'argument_list', 'children': ['82', '87']}; {'id': '82', 'type': 'keyword_argument', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'rows'}; {'id': '84', 'type': 'subscript', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '86', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '87', 'type': 'keyword_argument', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '89', 'type': 'subscript', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '91', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'call', 'children': ['94', '99']}; {'id': '94', 'type': 'attribute', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'pymux'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'invalidate'}; {'id': '99', 'type': 'argument_list', 'children': []}; {'id': '100', 'type': 'elif_clause', 'children': ['101', '106']}; {'id': '101', 'type': 'comparison_operator', 'children': ['102', '105'], 'value': '=='}; {'id': '102', 'type': 'subscript', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '104', 'type': 'string', 'children': [], 'value': "'cmd'"}; {'id': '105', 'type': 'string', 'children': [], 'value': "'start-gui'"}; {'id': '106', 'type': 'block', 'children': ['107', '116', '122', '128', '145', '150']}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'assignment', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'detach_other_clients'}; {'id': '110', 'type': 'call', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'subscript', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '115', 'type': 'string', 'children': [], 'value': "'detach-others'"}; {'id': '116', 'type': 'expression_statement', 'children': ['117']}; {'id': '117', 'type': 'assignment', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'color_depth'}; {'id': '119', 'type': 'subscript', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '121', 'type': 'string', 'children': [], 'value': "'color-depth'"}; {'id': '122', 'type': 'expression_statement', 'children': ['123']}; {'id': '123', 'type': 'assignment', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'term'}; {'id': '125', 'type': 'subscript', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'packet'}; {'id': '127', 'type': 'string', 'children': [], 'value': "'term'"}; {'id': '128', 'type': 'if_statement', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'detach_other_clients'}; {'id': '130', 'type': 'block', 'children': ['131']}; {'id': '131', 'type': 'for_statement', 'children': ['132', '133', '138']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '133', 'type': 'attribute', 'children': ['134', '137']}; {'id': '134', 'type': 'attribute', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'pymux'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'connections'}; {'id': '138', 'type': 'block', 'children': ['139']}; {'id': '139', 'type': 'expression_statement', 'children': ['140']}; {'id': '140', 'type': 'call', 'children': ['141', '144']}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'detach_and_close'}; {'id': '144', 'type': 'argument_list', 'children': []}; {'id': '145', 'type': 'expression_statement', 'children': ['146']}; {'id': '146', 'type': 'call', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '148', 'type': 'argument_list', 'children': ['149']}; {'id': '149', 'type': 'string', 'children': [], 'value': "'Create app...'"}; {'id': '150', 'type': 'expression_statement', 'children': ['151']}; {'id': '151', 'type': 'call', 'children': ['152', '155']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': '_create_app'}; {'id': '155', 'type': 'argument_list', 'children': ['156', '159']}; {'id': '156', 'type': 'keyword_argument', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'color_depth'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'color_depth'}; {'id': '159', 'type': 'keyword_argument', 'children': ['160', '161']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'term'}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'term'}
|
Process packet received from client.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'currency_context'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '23', '35', '41', '54']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '9', 'type': 'subscript', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '11', 'type': 'string', 'children': [], 'value': "'request'"}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'currency_code'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'memoize_nullary'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'lambda', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'get_currency_code'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '28']}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'CURRENCIES'"}; {'id': '28', 'type': 'call', 'children': ['29', '34']}; {'id': '29', 'type': 'attribute', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'Currency'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'active'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '40']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '39', 'type': 'string', 'children': [], 'value': "'CURRENCY_CODE'"}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'currency_code'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '46']}; {'id': '43', 'type': 'subscript', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '45', 'type': 'string', 'children': [], 'value': "'CURRENCY'"}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'memoize_nullary'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'lambda', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'get_currency'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'currency_code'}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'string', 'children': [], 'value': "''"}
|
Use instead of context processor
Context variables are only valid within the block scope
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'show_tabulated'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'begin'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'middle'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '8', 'type': 'block', 'children': ['9', '21']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'internal_assert'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '19', '20']}; {'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': 'begin'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'info_tabulation'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"info message too long"'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'begin'}; {'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': 'show'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'binary_operator', 'children': ['28', '43'], 'value': '+'}; {'id': '28', 'type': 'binary_operator', 'children': ['29', '42'], 'value': '+'}; {'id': '29', 'type': 'binary_operator', 'children': ['30', '41'], 'value': '+'}; {'id': '30', 'type': 'binary_operator', 'children': ['31', '32'], 'value': '+'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'begin'}; {'id': '32', 'type': 'binary_operator', 'children': ['33', '34'], 'value': '*'}; {'id': '33', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '34', 'type': '()', 'children': ['35']}; {'id': '35', 'type': 'binary_operator', 'children': ['36', '37'], 'value': '-'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'info_tabulation'}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'begin'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'middle'}; {'id': '42', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'end'}
|
Shows a tabulated message.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create_user'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'claims'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '25']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'email'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'claims'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'string', 'children': [], 'value': "'email'"}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'get_username'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'claims'}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '34']}; {'id': '27', 'type': 'attribute', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'UserModel'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'objects'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'create_user'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'email'}
|
Return object for a newly created user account.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'unregister'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '17', '29']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': 'not in'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'command'}; {'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': '_commands'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18']}; {'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': 'log'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'binary_operator', 'children': ['27', '28'], 'value': '%'}; {'id': '27', 'type': 'string', 'children': [], 'value': '"Can not unregister command %s"'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '29', 'type': 'else_clause', 'children': ['30']}; {'id': '30', 'type': 'block', 'children': ['31', '40', '47']}; {'id': '31', 'type': 'delete_statement', 'children': ['32']}; {'id': '32', 'type': '()', 'children': ['33']}; {'id': '33', 'type': 'subscript', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_click_root_command'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'commands'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '40', 'type': 'delete_statement', 'children': ['41']}; {'id': '41', 'type': '()', 'children': ['42']}; {'id': '42', 'type': 'subscript', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_commands'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '54']}; {'id': '49', 'type': 'attribute', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'binary_operator', 'children': ['56', '57'], 'value': '%'}; {'id': '56', 'type': 'string', 'children': [], 'value': '"Command %s got unregistered"'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'command'}
|
Unregisters an existing command, so that this command is no longer available on the command line interface.
This function is mainly used during plugin deactivation.
:param command: Name of the command
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'purge'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'datasets'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'reuses'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'organizations'}; {'id': '7', 'type': 'block', 'children': ['8', '19', '35', '51', '67']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'purge_all'}; {'id': '11', 'type': 'not_operator', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'any'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'tuple', 'children': ['16', '17', '18']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'datasets'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'reuses'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'organizations'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '23']}; {'id': '20', 'type': 'boolean_operator', 'children': ['21', '22'], 'value': 'or'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'purge_all'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'datasets'}; {'id': '23', 'type': 'block', 'children': ['24', '31']}; {'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': 'log'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'string', 'children': [], 'value': "'Purging datasets'"}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'purge_datasets'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'if_statement', 'children': ['36', '39']}; {'id': '36', 'type': 'boolean_operator', 'children': ['37', '38'], 'value': 'or'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'purge_all'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'reuses'}; {'id': '39', 'type': 'block', 'children': ['40', '47']}; {'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': 'log'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'string', 'children': [], 'value': "'Purging reuses'"}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'purge_reuses'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'if_statement', 'children': ['52', '55']}; {'id': '52', 'type': 'boolean_operator', 'children': ['53', '54'], 'value': 'or'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'purge_all'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'organizations'}; {'id': '55', 'type': 'block', 'children': ['56', '63']}; {'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': 'log'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'string', 'children': [], 'value': "'Purging organizations'"}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'purge_organizations'}; {'id': '66', 'type': 'argument_list', 'children': []}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'success'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'string', 'children': [], 'value': "'Done'"}
|
Permanently remove data flagged as deleted.
If no model flag is given, all models are purged.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'datapt_to_wcspt'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'datapt'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'coords'}; {'id': '8', 'type': 'string', 'children': [], 'value': "'data'"}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'naxispath'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13', '18']}; {'id': '13', 'type': 'if_statement', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'naxispath'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'raise_statement', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'NotImplementedError'}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'asarray'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'list_comprehension', 'children': ['25', '40']}; {'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': 'pixtoradec'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '37']}; {'id': '30', 'type': 'tuple', 'children': ['31', '34']}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'pt'}; {'id': '33', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'pt'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'coords'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'coords'}; {'id': '40', 'type': 'for_in_clause', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'pt'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'datapt'}
|
Convert multiple data points to WCS.
Parameters
----------
datapt : array-like
Pixel coordinates in the format of
``[[x0, y0, ...], [x1, y1, ...], ..., [xn, yn, ...]]``.
coords : 'data' or None, optional, default to 'data'
Expresses whether the data coordinate is indexed from zero.
naxispath : list-like or None, optional, defaults to None
A sequence defining the pixel indexes > 2D, if any.
Returns
-------
wcspt : array-like
WCS coordinates in the format of
``[[ra0, dec0], [ra1, dec1], ..., [ran, decn]]``.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'move_to_clipboard'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'files_queryset'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'folders_queryset'}; {'id': '8', 'type': 'block', 'children': ['9', '20', '29', '40', '46', '52', '57', '74', '101', '106', '111', '131']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '17']}; {'id': '10', 'type': 'not_operator', 'children': ['11']}; {'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': 'has_change_permission'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'raise_statement', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'PermissionDenied'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '26']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '25'], 'value': '!='}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'POST'"}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'None', 'children': []}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'clipboard'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'tools'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'get_user_clipboard'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'check_files_edit_permissions'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'files_queryset'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'check_folder_edit_permissions'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'folders_queryset'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'files_count'}; {'id': '55', 'type': 'list', 'children': ['56'], 'value': '[0]'}; {'id': '56', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '57', 'type': 'function_definition', 'children': ['58', '59', '61']}; {'id': '58', 'type': 'function_name', 'children': [], 'value': 'move_files'}; {'id': '59', 'type': 'parameters', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'augmented_assignment', 'children': ['64', '67'], 'value': '+='}; {'id': '64', 'type': 'subscript', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'files_count'}; {'id': '66', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'tools'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'move_file_to_clipboard'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'clipboard'}; {'id': '74', 'type': 'function_definition', 'children': ['75', '76', '78']}; {'id': '75', 'type': 'function_name', 'children': [], 'value': 'move_folders'}; {'id': '76', 'type': 'parameters', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'folders'}; {'id': '78', 'type': 'block', 'children': ['79']}; {'id': '79', 'type': 'for_statement', 'children': ['80', '81', '82']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'folders'}; {'id': '82', 'type': 'block', 'children': ['83', '90']}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'move_files'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'move_folders'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '100']}; {'id': '95', 'type': 'attribute', 'children': ['96', '99']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '100', 'type': 'argument_list', 'children': []}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'move_files'}; {'id': '104', 'type': 'argument_list', 'children': ['105']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'files_queryset'}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'move_folders'}; {'id': '109', 'type': 'argument_list', 'children': ['110']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'folders_queryset'}; {'id': '111', 'type': 'expression_statement', 'children': ['112']}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'message_user'}; {'id': '116', 'type': 'argument_list', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '118', 'type': 'binary_operator', 'children': ['119', '125'], 'value': '%'}; {'id': '119', 'type': 'call', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '121', 'type': 'argument_list', 'children': ['122']}; {'id': '122', 'type': 'concatenated_string', 'children': ['123', '124']}; {'id': '123', 'type': 'string', 'children': [], 'value': '"Successfully moved %(count)d files to "'}; {'id': '124', 'type': 'string', 'children': [], 'value': '"clipboard."'}; {'id': '125', 'type': 'dictionary', 'children': ['126']}; {'id': '126', 'type': 'pair', 'children': ['127', '128']}; {'id': '127', 'type': 'string', 'children': [], 'value': '"count"'}; {'id': '128', 'type': 'subscript', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'files_count'}; {'id': '130', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '131', 'type': 'return_statement', 'children': ['132']}; {'id': '132', 'type': 'None', 'children': []}
|
Action which moves the selected files and files in selected folders
to clipboard.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'jwt_required'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'realm'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'block', 'children': ['8', '48']}; {'id': '8', 'type': 'function_definition', 'children': ['9', '10', '12']}; {'id': '9', 'type': 'function_name', 'children': [], 'value': 'wrapper'}; {'id': '10', 'type': 'parameters', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '12', 'type': 'block', 'children': ['13', '46']}; {'id': '13', 'type': 'decorated_definition', 'children': ['14', '19']}; {'id': '14', 'type': 'decorator', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'wraps'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '19', 'type': 'function_definition', 'children': ['20', '21', '26']}; {'id': '20', 'type': 'function_name', 'children': [], 'value': 'decorator'}; {'id': '21', 'type': 'parameters', 'children': ['22', '24']}; {'id': '22', 'type': 'list_splat_pattern', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '24', 'type': 'dictionary_splat_pattern', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '26', 'type': 'block', 'children': ['27', '38']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_jwt_required'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'boolean_operator', 'children': ['32', '33'], 'value': 'or'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'realm'}; {'id': '33', 'type': 'subscript', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'current_app'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '37', 'type': 'string', 'children': [], 'value': "'JWT_DEFAULT_REALM'"}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '44']}; {'id': '42', 'type': 'list_splat', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '44', 'type': 'dictionary_splat', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'decorator'}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'wrapper'}
|
View decorator that requires a valid JWT token to be present in the request
:param realm: an optional realm
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'remove_alert'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'thing_name'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'return_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_request'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15', '21', '27']}; {'id': '14', 'type': 'string', 'children': [], 'value': "'get'"}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'/remove/alert/for/{0}'"}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'thing_name'}; {'id': '21', 'type': 'keyword_argument', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '23', 'type': 'dictionary', 'children': ['24']}; {'id': '24', 'type': 'pair', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': "'key'"}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'session'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'session'}
|
Remove an alert for the given thing
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dbmin20years'}; {'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': 'value'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '38']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '13']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': 'is not'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '12', 'type': 'None', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'try_statement', 'children': ['15', '23']}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '23', 'type': 'except_clause', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'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': 'call', 'children': ['31', '36']}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'concatenated_string', 'children': ['33', '34']}; {'id': '33', 'type': 'string', 'children': [], 'value': "'value {} need to be of type float '"}; {'id': '34', 'type': 'string', 'children': [], 'value': "'for field `dbmin20years`'"}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '_dbmin20years'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'value'}
|
Corresponds to IDD Field `dbmin20years`
20-year return period values for minimum extreme dry-bulb temperature
Args:
value (float): value for IDD Field `dbmin20years`
Unit: C
if `value` is None it will not be checked against the
specification and is assumed to be a missing value
Raises:
ValueError: if `value` is not a valid value
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'export'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '6', 'type': 'block', 'children': ['7', '17', '26']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'dictexporter'}; {'id': '10', 'type': 'boolean_operator', 'children': ['11', '14'], 'value': 'or'}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'dictexporter'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'DictExporter'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'dictexporter'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'export'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '26', 'type': 'return_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '33', 'type': 'dictionary_splat', 'children': ['34']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
|
Return JSON for tree starting at `node`.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'parse_mailto'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'mailto_str'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '13', '137']}; {'id': '7', 'type': 'call', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'mailto_str'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'string', 'children': [], 'value': "'mailto:'"}; {'id': '13', 'type': 'block', 'children': ['14', '18', '38', '42', '46', '57', '67', '133']}; {'id': '14', 'type': 'import_statement', 'children': ['15']}; {'id': '15', 'type': 'dotted_name', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'urllib'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'parse'}; {'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': 'to_str'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'parms_str'}; {'id': '23', 'type': 'subscript', 'children': ['24', '34']}; {'id': '24', 'type': 'call', 'children': ['25', '32']}; {'id': '25', 'type': 'attribute', 'children': ['26', '31']}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'mailto_str'}; {'id': '28', 'type': 'slice', 'children': ['29', '30']}; {'id': '29', 'type': 'integer', 'children': [], 'value': '7'}; {'id': '30', 'type': 'colon', 'children': []}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'partition'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'string', 'children': [], 'value': "'?'"}; {'id': '34', 'type': 'slice', 'children': ['35', '36', '37']}; {'id': '35', 'type': 'colon', 'children': []}; {'id': '36', 'type': 'colon', 'children': []}; {'id': '37', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '41', 'type': 'dictionary', 'children': []}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '45', 'type': 'string', 'children': [], 'value': "u''"}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'to'}; {'id': '49', 'type': 'call', 'children': ['50', '55']}; {'id': '50', 'type': 'attribute', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'urllib'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'parse'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'unquote'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'to_str'}; {'id': '57', 'type': 'if_statement', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'to'}; {'id': '59', 'type': 'block', 'children': ['60']}; {'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': 'headers'}; {'id': '64', 'type': 'string', 'children': [], 'value': "'To'"}; {'id': '65', 'type': 'list', 'children': ['66'], 'value': '[to]'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'to'}; {'id': '67', 'type': 'for_statement', 'children': ['68', '69', '75']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'parms_str'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'string', 'children': [], 'value': "'&'"}; {'id': '75', 'type': 'block', 'children': ['76', '92', '100']}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '81']}; {'id': '78', 'type': 'pattern_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '81', 'type': 'subscript', 'children': ['82', '88']}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'partition'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'string', 'children': [], 'value': "'='"}; {'id': '88', 'type': 'slice', 'children': ['89', '90', '91']}; {'id': '89', 'type': 'colon', 'children': []}; {'id': '90', 'type': 'colon', 'children': []}; {'id': '91', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'assignment', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '95', 'type': 'call', 'children': ['96', '99']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'capitalize'}; {'id': '99', 'type': 'argument_list', 'children': []}; {'id': '100', 'type': 'if_statement', 'children': ['101', '104', '116']}; {'id': '101', 'type': 'comparison_operator', 'children': ['102', '103'], 'value': '=='}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '103', 'type': 'string', 'children': [], 'value': "'Body'"}; {'id': '104', 'type': 'block', 'children': ['105']}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'assignment', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '108', 'type': 'call', 'children': ['109', '114']}; {'id': '109', 'type': 'attribute', 'children': ['110', '113']}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'urllib'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'parse'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'unquote'}; {'id': '114', 'type': 'argument_list', 'children': ['115']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '116', 'type': 'elif_clause', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '118', 'type': 'block', 'children': ['119']}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'assignment', 'children': ['121', '124']}; {'id': '121', 'type': 'subscript', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '124', 'type': 'list', 'children': ['125'], 'value': '[urllib.parse.unquote(value)]'}; {'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': 'urllib'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'parse'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'unquote'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '133', 'type': 'return_statement', 'children': ['134']}; {'id': '134', 'type': 'tuple', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '137', 'type': 'else_clause', 'children': ['138']}; {'id': '138', 'type': 'block', 'children': ['139']}; {'id': '139', 'type': 'return_statement', 'children': ['140']}; {'id': '140', 'type': 'tuple', 'children': ['141', '142']}; {'id': '141', 'type': 'None', 'children': []}; {'id': '142', 'type': 'None', 'children': []}
|
Interpret mailto-string
:param mailto_str: the string to interpret. Must conform to :rfc:2368.
:type mailto_str: str
:return: the header fields and the body found in the mailto link as a tuple
of length two
:rtype: tuple(dict(str->list(str)), str)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getCodecList'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '24', '33', '37', '81']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '13', '18']}; {'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': 'checkVersion'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'string', 'children': [], 'value': "'1.4'"}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"core show codecs"'}; {'id': '18', 'type': 'else_clause', 'children': ['19']}; {'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': 'cmd'}; {'id': '23', 'type': 'string', 'children': [], 'value': '"show codecs"'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'cmdresp'}; {'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': 'executeCommand'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'info_dict'}; {'id': '36', 'type': 'dictionary', 'children': []}; {'id': '37', 'type': 'for_statement', 'children': ['38', '39', '44']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'cmdresp'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'splitlines'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'block', 'children': ['45', '55']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'mobj'}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54']}; {'id': '53', 'type': 'string', 'children': [], 'value': "'\\s*(\\d+)\\s+\\((.+)\\)\\s+\\((.+)\\)\\s+(\\w+)\\s+(\\w+)\\s+\\((.+)\\)$'"}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '55', 'type': 'if_statement', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'mobj'}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '68']}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'info_dict'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'mobj'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '68', 'type': 'tuple', 'children': ['69', '75']}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'mobj'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'mobj'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '79', 'type': 'argument_list', 'children': ['80']}; {'id': '80', 'type': 'integer', 'children': [], 'value': '6'}; {'id': '81', 'type': 'return_statement', 'children': ['82']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'info_dict'}
|
Query Asterisk Manager Interface for defined codecs.
CLI Command - core show codecs
@return: Dictionary - Short Name -> (Type, Long Name)
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '29']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'create_toolbutton'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14', '17', '20', '23', '26']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'shortcut'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'icon'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'tip'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'toggled'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'default_parameter', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'triggered'}; {'id': '22', 'type': 'None', 'children': []}; {'id': '23', 'type': 'default_parameter', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'autoraise'}; {'id': '25', 'type': 'True', 'children': []}; {'id': '26', 'type': 'default_parameter', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'text_beside_icon'}; {'id': '28', 'type': 'False', 'children': []}; {'id': '29', 'type': 'block', 'children': ['30', '37', '49', '74', '95', '107', '114', '128', '149', '161']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'button'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'QToolButton'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '37', 'type': 'if_statement', 'children': ['38', '41']}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '40'], 'value': 'is not'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '40', 'type': 'None', 'children': []}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'button'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'setText'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '49', 'type': 'if_statement', 'children': ['50', '53']}; {'id': '50', 'type': 'comparison_operator', 'children': ['51', '52'], 'value': 'is not'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'icon'}; {'id': '52', 'type': 'None', 'children': []}; {'id': '53', 'type': 'block', 'children': ['54', '67']}; {'id': '54', 'type': 'if_statement', 'children': ['55', '59']}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'is_text_string'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'icon'}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'icon'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'get_icon'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'icon'}; {'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': 'button'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'setIcon'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'icon'}; {'id': '74', 'type': 'if_statement', 'children': ['75', '82']}; {'id': '75', 'type': 'boolean_operator', 'children': ['76', '79'], 'value': 'or'}; {'id': '76', 'type': 'comparison_operator', 'children': ['77', '78'], 'value': 'is not'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '78', 'type': 'None', 'children': []}; {'id': '79', 'type': 'comparison_operator', 'children': ['80', '81'], 'value': 'is not'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'tip'}; {'id': '81', 'type': 'None', 'children': []}; {'id': '82', 'type': 'block', 'children': ['83']}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'button'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'setToolTip'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'conditional_expression', 'children': ['90', '91', '94'], 'value': 'if'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '91', 'type': 'comparison_operator', 'children': ['92', '93'], 'value': 'is'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'tip'}; {'id': '93', 'type': 'None', 'children': []}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'tip'}; {'id': '95', 'type': 'if_statement', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'text_beside_icon'}; {'id': '97', 'type': 'block', 'children': ['98']}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'button'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'setToolButtonStyle'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'Qt'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'ToolButtonTextBesideIcon'}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'call', 'children': ['109', '112']}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'button'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'setAutoRaise'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'autoraise'}; {'id': '114', 'type': 'if_statement', 'children': ['115', '118']}; {'id': '115', 'type': 'comparison_operator', 'children': ['116', '117'], 'value': 'is not'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'triggered'}; {'id': '117', 'type': 'None', 'children': []}; {'id': '118', 'type': 'block', 'children': ['119']}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'call', 'children': ['121', '126']}; {'id': '121', 'type': 'attribute', 'children': ['122', '125']}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'button'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'clicked'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'connect'}; {'id': '126', 'type': 'argument_list', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'triggered'}; {'id': '128', 'type': 'if_statement', 'children': ['129', '132']}; {'id': '129', 'type': 'comparison_operator', 'children': ['130', '131'], 'value': 'is not'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'toggled'}; {'id': '131', 'type': 'None', 'children': []}; {'id': '132', 'type': 'block', 'children': ['133', '142']}; {'id': '133', 'type': 'expression_statement', 'children': ['134']}; {'id': '134', 'type': 'call', 'children': ['135', '140']}; {'id': '135', 'type': 'attribute', 'children': ['136', '139']}; {'id': '136', 'type': 'attribute', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'button'}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'toggled'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'connect'}; {'id': '140', 'type': 'argument_list', 'children': ['141']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'toggled'}; {'id': '142', 'type': 'expression_statement', 'children': ['143']}; {'id': '143', 'type': 'call', 'children': ['144', '147']}; {'id': '144', 'type': 'attribute', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'button'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'setCheckable'}; {'id': '147', 'type': 'argument_list', 'children': ['148']}; {'id': '148', 'type': 'True', 'children': []}; {'id': '149', 'type': 'if_statement', 'children': ['150', '153']}; {'id': '150', 'type': 'comparison_operator', 'children': ['151', '152'], 'value': 'is not'}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'shortcut'}; {'id': '152', 'type': 'None', 'children': []}; {'id': '153', 'type': 'block', 'children': ['154']}; {'id': '154', 'type': 'expression_statement', 'children': ['155']}; {'id': '155', 'type': 'call', 'children': ['156', '159']}; {'id': '156', 'type': 'attribute', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'button'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'setShortcut'}; {'id': '159', 'type': 'argument_list', 'children': ['160']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'shortcut'}; {'id': '161', 'type': 'return_statement', 'children': ['162']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'button'}
|
Create a QToolButton
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_ctypes_code_parameter'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'parameter'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'position'}; {'id': '7', 'type': 'block', 'children': ['8', '33', '42']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'mdict'}; {'id': '11', 'type': 'dictionary', 'children': ['12', '15', '18', '21', '24', '27', '30']}; {'id': '12', 'type': 'pair', 'children': ['13', '14']}; {'id': '13', 'type': 'string', 'children': [], 'value': "'indices'"}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_ctypes_indices'}; {'id': '15', 'type': 'pair', 'children': ['16', '17']}; {'id': '16', 'type': 'string', 'children': [], 'value': "'variable'"}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_ctypes_variables'}; {'id': '18', 'type': 'pair', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': "'out'"}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_ctypes_out'}; {'id': '21', 'type': 'pair', 'children': ['22', '23']}; {'id': '22', 'type': 'string', 'children': [], 'value': "'regular'"}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_ctypes_regular'}; {'id': '24', 'type': 'pair', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': "'saved'"}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '_ctypes_saved'}; {'id': '27', 'type': 'pair', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'assign'"}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_ctypes_assign'}; {'id': '30', 'type': 'pair', 'children': ['31', '32']}; {'id': '31', 'type': 'string', 'children': [], 'value': "'clean'"}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_ctypes_clean'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'mdict'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'position'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'parameter'}; {'id': '42', 'type': 'if_statement', 'children': ['43', '46']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': 'is not'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'block', 'children': ['47', '53', '60']}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '52']}; {'id': '49', 'type': 'pattern_list', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'blank'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '60', 'type': 'if_statement', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'blank'}; {'id': '62', 'type': 'block', 'children': ['63']}; {'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': 'lines'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'string', 'children': [], 'value': '""'}
|
Returns the code for the specified parameter being written into a subroutine wrapper.
:arg position: one of ['indices', 'variable', 'out', 'regular', 'saved', 'assign', 'clean']
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '19', '21']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_close_callback'}; {'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': 'callback'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'generic_type', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'Optional'}; {'id': '10', 'type': 'type_parameter', 'children': ['11']}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'generic_type', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'Callable'}; {'id': '14', 'type': 'type_parameter', 'children': ['15', '17']}; {'id': '15', 'type': 'type', 'children': ['16']}; {'id': '16', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '17', 'type': 'type', 'children': ['18']}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'type', 'children': ['20']}; {'id': '20', 'type': 'None', 'children': []}; {'id': '21', 'type': 'block', 'children': ['22', '28']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '_close_callback'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'callback'}; {'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': '_maybe_add_error_listener'}; {'id': '33', 'type': 'argument_list', 'children': []}
|
Call the given callback when the stream is closed.
This mostly is not necessary for applications that use the
`.Future` interface; all outstanding ``Futures`` will resolve
with a `StreamClosedError` when the stream is closed. However,
it is still useful as a way to signal that the stream has been
closed while no other read or write is in progress.
Unlike other callback-based interfaces, ``set_close_callback``
was not removed in Tornado 6.0.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'read'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '5', 'type': 'block', 'children': ['6', '24']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'cur_dir'}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'abspath'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '__file__'}; {'id': '24', 'type': 'with_statement', 'children': ['25', '47']}; {'id': '25', 'type': 'with_clause', 'children': ['26']}; {'id': '26', 'type': 'with_item', 'children': ['27']}; {'id': '27', 'type': 'as_pattern', 'children': ['28', '45']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'codecs'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '43', '44']}; {'id': '33', 'type': 'call', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'cur_dir'}; {'id': '41', 'type': 'list_splat', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '43', 'type': 'string', 'children': [], 'value': '"rb"'}; {'id': '44', 'type': 'string', 'children': [], 'value': '"utf-8"'}; {'id': '45', 'type': 'as_pattern_target', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'read'}; {'id': '53', 'type': 'argument_list', 'children': []}
|
Build an absolute path from parts array and and return the contents
of the resulting file. Assume UTF-8 encoding.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'bootstrap_buttons'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '27', '33']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'parse_token_contents'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '20']}; {'id': '17', 'type': 'subscript', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"nodelist"'}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'parser'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'parse'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'tuple', 'children': ['26']}; {'id': '26', 'type': 'string', 'children': [], 'value': '"endbuttons"'}; {'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': 'parser'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'delete_first_token'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ButtonsNode'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'dictionary_splat', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
|
Render buttons for form
**Tag name**::
buttons
**Parameters**:
submit
Text for a submit button
reset
Text for a reset button
**Usage**::
{% buttons %}{% endbuttons %}
**Example**::
{% buttons submit='OK' reset="Cancel" %}{% endbuttons %}
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_acls_recursive'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'depth'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'include_ephemerals'}; {'id': '8', 'type': 'block', 'children': ['9', '21', '28']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'yield', 'children': ['11']}; {'id': '11', 'type': 'expression_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '13', 'type': 'subscript', 'children': ['14', '20']}; {'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_acls'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '20', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '26']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '24'], 'value': '=='}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'depth'}; {'id': '24', 'type': 'unary_operator', 'children': ['25'], 'value': '-'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': []}; {'id': '28', 'type': 'for_statement', 'children': ['29', '32', '42']}; {'id': '29', 'type': 'pattern_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'tpath'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'tree'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '38', '39']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'depth'}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'full_path'}; {'id': '41', 'type': 'True', 'children': []}; {'id': '42', 'type': 'block', 'children': ['43', '60', '71']}; {'id': '43', 'type': 'try_statement', 'children': ['44', '56']}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '50']}; {'id': '47', 'type': 'pattern_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'acls'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'get_acls'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'tpath'}; {'id': '56', 'type': 'except_clause', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'NoNodeError'}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'continue_statement', 'children': []}; {'id': '60', 'type': 'if_statement', 'children': ['61', '69']}; {'id': '61', 'type': 'boolean_operator', 'children': ['62', '64'], 'value': 'and'}; {'id': '62', 'type': 'not_operator', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'include_ephemerals'}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '68'], 'value': '!='}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'ephemeralOwner'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'continue_statement', 'children': []}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'yield', 'children': ['73']}; {'id': '73', 'type': 'expression_list', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'tpath'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'acls'}
|
A recursive generator wrapper for get_acls
:param path: path from which to start
:param depth: depth of the recursion (-1 no recursion, 0 means no limit)
:param include_ephemerals: get ACLs for ephemerals too
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'fit_for_distance'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '27']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '8', '15']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'prop'}; {'id': '8', 'type': 'call', 'children': ['9', '14']}; {'id': '9', 'type': 'attribute', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'properties'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'if_statement', 'children': ['17', '24']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': 'in'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'prop'}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'ic'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'bands'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'True', 'children': []}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'False', 'children': []}
|
``True`` if any of the properties are apparent magnitudes.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'assign'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'dst'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '13', '15', '29']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': '=='}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'null'"}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': []}; {'id': '15', 'type': 'elif_clause', 'children': ['16', '21']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '18'], 'value': 'in'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '18', 'type': 'tuple', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': "'write'"}; {'id': '20', 'type': 'string', 'children': [], 'value': "'inplace'"}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '28']}; {'id': '24', 'type': 'subscript', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'dst'}; {'id': '26', 'type': 'slice', 'children': ['27']}; {'id': '27', 'type': 'colon', 'children': []}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'src'}; {'id': '29', 'type': 'elif_clause', 'children': ['30', '33']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': '=='}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'add'"}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'augmented_assignment', 'children': ['36', '40'], 'value': '+='}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'dst'}; {'id': '38', 'type': 'slice', 'children': ['39']}; {'id': '39', 'type': 'colon', 'children': []}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'src'}
|
Helper function for assigning into dst depending on requirements.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'container_instance_from_string'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '5', 'type': 'block', 'children': ['6', '41']}; {'id': '6', 'type': 'try_statement', 'children': ['7', '27']}; {'id': '7', 'type': 'block', 'children': ['8', '20']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '13']}; {'id': '10', 'type': 'pattern_list', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'rsplit'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'string', 'children': [], 'value': "'_'"}; {'id': '19', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '27', 'type': 'except_clause', 'children': ['28', '31']}; {'id': '28', 'type': 'tuple', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'raise_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'binary_operator', 'children': ['39', '40'], 'value': '%'}; {'id': '39', 'type': 'string', 'children': [], 'value': '"Invalid container id %r"'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'id'}; {'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': '_proto'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'ContainerInstance'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '50']}; {'id': '47', 'type': 'keyword_argument', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'service_name'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'service'}; {'id': '50', 'type': 'keyword_argument', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'instance'}
|
Create a ContainerInstance from an id string
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'push_primary_analyses_for_removal'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'analysis_request'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'analyses'}; {'id': '7', 'type': 'block', 'children': ['8', '20', '27']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'to_remove'}; {'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': 'analyses_to_remove'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'analysis_request'}; {'id': '19', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'to_remove'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'analyses'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '34']}; {'id': '29', 'type': 'subscript', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'analyses_to_remove'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'analysis_request'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'to_remove'}
|
Stores the analyses to be removed after partitions creation
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_focus'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '17']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': '"Set the focus in the underlying body widget."'}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': "'setting focus to %s '"}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '24']}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'set_focus'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'pos'}
|
Set the focus in the underlying body widget.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'delete_info'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '23', '31', '39', '57', '84', '91', '102']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'head'}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'head'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'vcf_handle'}; {'id': '18', 'type': 'attribute', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'handle'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '39', 'type': 'if_statement', 'children': ['40', '42']}; {'id': '40', 'type': 'not_operator', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '42', 'type': 'block', 'children': ['43', '50']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'string', 'children': [], 'value': '"No info provided"'}; {'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': 'sys'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'exit'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'string', 'children': [], 'value': '"Please provide a info string"'}; {'id': '57', 'type': 'if_statement', 'children': ['58', '64']}; {'id': '58', 'type': 'not_operator', 'children': ['59']}; {'id': '59', 'type': 'comparison_operator', 'children': ['60', '61'], 'value': 'in'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'head'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'info_dict'}; {'id': '64', 'type': 'block', 'children': ['65', '77']}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'string', 'children': [], 'value': '"Info \'{0}\' is not specified in vcf header"'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'exit'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'string', 'children': [], 'value': '"Please provide a valid info field"'}; {'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': 'head'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'remove_header'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'call', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'print_headers'}; {'id': '94', 'type': 'argument_list', 'children': ['95', '96', '99']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'head'}; {'id': '96', 'type': 'keyword_argument', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '99', 'type': 'keyword_argument', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '102', 'type': 'for_statement', 'children': ['103', '104', '105']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'vcf_handle'}; {'id': '105', 'type': 'block', 'children': ['106', '114', '126']}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'assignment', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '109', 'type': 'call', 'children': ['110', '113']}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'rstrip'}; {'id': '113', 'type': 'argument_list', 'children': []}; {'id': '114', 'type': 'expression_statement', 'children': ['115']}; {'id': '115', 'type': 'assignment', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'new_line'}; {'id': '117', 'type': 'call', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'remove_vcf_info'}; {'id': '119', 'type': 'argument_list', 'children': ['120', '123']}; {'id': '120', 'type': 'keyword_argument', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'keyword'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '123', 'type': 'keyword_argument', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'variant_line'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '126', 'type': 'expression_statement', 'children': ['127']}; {'id': '127', 'type': 'call', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'print_variant'}; {'id': '129', 'type': 'argument_list', 'children': ['130', '133', '136']}; {'id': '130', 'type': 'keyword_argument', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'variant_line'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'new_line'}; {'id': '133', 'type': 'keyword_argument', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '136', 'type': 'keyword_argument', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'silent'}
|
Delete a info field from all variants in a vcf
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'resize2fs'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'device'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '39']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'string', 'children': [], 'value': "'resize2fs {0}'"}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'device'}; {'id': '15', 'type': 'try_statement', 'children': ['16', '29']}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'subscript', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '__salt__'}; {'id': '23', 'type': 'string', 'children': [], 'value': "'cmd.run_all'"}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '26', 'type': 'keyword_argument', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'python_shell'}; {'id': '28', 'type': 'False', 'children': []}; {'id': '29', 'type': 'except_clause', 'children': ['30', '36']}; {'id': '30', 'type': 'as_pattern', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'CalledProcessError'}; {'id': '34', 'type': 'as_pattern_target', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'err'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': 'False', 'children': []}; {'id': '39', 'type': 'if_statement', 'children': ['40', '45']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '44'], 'value': '=='}; {'id': '41', 'type': 'subscript', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'retcode'"}; {'id': '44', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'True', 'children': []}
|
Resizes the filesystem.
CLI Example:
.. code-block:: bash
salt '*' disk.resize2fs /dev/sda1
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_object'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '27', '37', '45', '56', '152']}; {'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': '_object'}; {'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': '_object'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_object'}; {'id': '20', 'type': 'call', 'children': ['21', '26']}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'get_object'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'if_statement', 'children': ['28', '32']}; {'id': '28', 'type': 'not_operator', 'children': ['29']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'AUDITOR_EVENT_TYPES'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_object'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '40', 'type': 'attribute', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '48', 'type': 'call', 'children': ['49', '54']}; {'id': '49', 'type': 'attribute', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'AUDITOR_EVENT_TYPES'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '56', 'type': 'if_statement', 'children': ['57', '71', '104']}; {'id': '57', 'type': 'boolean_operator', 'children': ['58', '63'], 'value': 'and'}; {'id': '58', 'type': 'boolean_operator', 'children': ['59', '62'], 'value': 'and'}; {'id': '59', 'type': 'comparison_operator', 'children': ['60', '61'], 'value': '=='}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '61', 'type': 'string', 'children': [], 'value': "'GET'"}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'is_user'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'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': 'request'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'auditor'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '81', '86', '95']}; {'id': '78', 'type': 'keyword_argument', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '81', 'type': 'keyword_argument', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': '_object'}; {'id': '86', 'type': 'keyword_argument', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'actor_id'}; {'id': '88', 'type': 'attribute', 'children': ['89', '94']}; {'id': '89', 'type': 'attribute', 'children': ['90', '93']}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '95', 'type': 'keyword_argument', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'actor_name'}; {'id': '97', 'type': 'attribute', 'children': ['98', '103']}; {'id': '98', 'type': 'attribute', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '104', 'type': 'elif_clause', 'children': ['105', '119']}; {'id': '105', 'type': 'boolean_operator', 'children': ['106', '111'], 'value': 'and'}; {'id': '106', 'type': 'boolean_operator', 'children': ['107', '110'], 'value': 'and'}; {'id': '107', 'type': 'comparison_operator', 'children': ['108', '109'], 'value': '=='}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '109', 'type': 'string', 'children': [], 'value': "'DELETE'"}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '111', 'type': 'call', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'is_user'}; {'id': '113', 'type': 'argument_list', 'children': ['114']}; {'id': '114', 'type': 'attribute', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '119', 'type': 'block', 'children': ['120']}; {'id': '120', 'type': 'expression_statement', 'children': ['121']}; {'id': '121', 'type': 'call', 'children': ['122', '125']}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'auditor'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '125', 'type': 'argument_list', 'children': ['126', '129', '134', '143']}; {'id': '126', 'type': 'keyword_argument', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '129', 'type': 'keyword_argument', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '131', 'type': 'attribute', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': '_object'}; {'id': '134', 'type': 'keyword_argument', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'actor_id'}; {'id': '136', 'type': 'attribute', 'children': ['137', '142']}; {'id': '137', 'type': 'attribute', 'children': ['138', '141']}; {'id': '138', 'type': 'attribute', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '143', 'type': 'keyword_argument', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'actor_name'}; {'id': '145', 'type': 'attribute', 'children': ['146', '151']}; {'id': '146', 'type': 'attribute', 'children': ['147', '150']}; {'id': '147', 'type': 'attribute', 'children': ['148', '149']}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'user'}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'username'}; {'id': '152', 'type': 'return_statement', 'children': ['153']}; {'id': '153', 'type': 'attribute', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '155', 'type': 'identifier', 'children': [], 'value': '_object'}
|
We memoize the access to this function in case a second call is made.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'db_exists'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'impl'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'working_dir'}; {'id': '7', 'type': 'block', 'children': ['8', '18']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'get_snapshots_filename'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'impl'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'working_dir'}; {'id': '18', 'type': 'return_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': 'os'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'path'}
|
Does the chainstate db exist?
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'run_bottleneck_on_image'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'sess'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'image_data'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'image_data_tensor'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'decoded_image_tensor'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'resized_input_tensor'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'bottleneck_tensor'}; {'id': '10', 'type': 'block', 'children': ['11', '24', '37', '46']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'resized_input_values'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sess'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'decoded_image_tensor'}; {'id': '20', 'type': 'dictionary', 'children': ['21']}; {'id': '21', 'type': 'pair', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'image_data_tensor'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'image_data'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'bottleneck_values'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'sess'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'bottleneck_tensor'}; {'id': '33', 'type': 'dictionary', 'children': ['34']}; {'id': '34', 'type': 'pair', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'resized_input_tensor'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'resized_input_values'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'bottleneck_values'}; {'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': 'squeeze'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'bottleneck_values'}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'bottleneck_values'}
|
Runs inference on an image to extract the 'bottleneck' summary layer.
Args:
sess: Current active TensorFlow Session.
image_data: String of raw JPEG data.
image_data_tensor: Input data layer in the graph.
decoded_image_tensor: Output of initial image resizing and preprocessing.
resized_input_tensor: The input node of the recognition graph.
bottleneck_tensor: Layer before the final softmax.
Returns:
Numpy array of bottleneck values.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13', '19']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getElementByWdomId'}; {'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': 'id'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'generic_type', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'Union'}; {'id': '10', 'type': 'type_parameter', 'children': ['11']}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '13', 'type': 'type', 'children': ['14']}; {'id': '14', 'type': 'generic_type', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'Optional'}; {'id': '16', 'type': 'type_parameter', 'children': ['17']}; {'id': '17', 'type': 'type', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'WebEventTarget'}; {'id': '19', 'type': 'block', 'children': ['20', '27', '38']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'elm'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'getElementByWdomId'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '27', 'type': 'if_statement', 'children': ['28', '35']}; {'id': '28', 'type': 'boolean_operator', 'children': ['29', '30'], 'value': 'and'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'elm'}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '34'], 'value': 'is'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'elm'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'ownerDocument'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'elm'}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'None', 'children': []}
|
Get an element node with ``wdom_id``.
If this document does not have the element with the id, return None.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'apply_gates_to_fd'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'stilde_dict'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'gates'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '37', '61']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'outdict'}; {'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': 'stilde_dict'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'strain_dict'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'list_comprehension', 'children': ['25', '34']}; {'id': '25', 'type': 'list', 'children': ['26', '27'], 'value': '[ifo, outdict[ifo].to_timeseries()]'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'ifo'}; {'id': '27', 'type': 'call', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'outdict'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'ifo'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'to_timeseries'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'for_in_clause', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ifo'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'gates'}; {'id': '37', 'type': 'for_statement', 'children': ['38', '41', '50']}; {'id': '38', 'type': 'pattern_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'ifo'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '41', 'type': 'call', 'children': ['42', '49']}; {'id': '42', 'type': 'attribute', 'children': ['43', '48']}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'apply_gates_to_td'}; {'id': '45', 'type': 'argument_list', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'strain_dict'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'gates'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '49', 'type': 'argument_list', 'children': []}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '56']}; {'id': '53', 'type': 'subscript', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'outdict'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'ifo'}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'to_frequencyseries'}; {'id': '60', 'type': 'argument_list', 'children': []}; {'id': '61', 'type': 'return_statement', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'outdict'}
|
Applies the given dictionary of gates to the given dictionary of
strain in the frequency domain.
Gates are applied by IFFT-ing the strain data to the time domain, applying
the gate, then FFT-ing back to the frequency domain.
Parameters
----------
stilde_dict : dict
Dictionary of frequency-domain strain, keyed by the ifos.
gates : dict
Dictionary of gates. Keys should be the ifo to apply the data to,
values are a tuple giving the central time of the gate, the half
duration, and the taper duration.
Returns
-------
dict
Dictionary of frequency-domain strain with the gates applied.
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'search_info'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'search_index'}; {'id': '6', 'type': 'block', 'children': ['7', '28', '34']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'ddoc_search_info'}; {'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': 'r_session'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': "'/'"}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'list', 'children': ['23', '26', '27'], 'value': "[self.document_url, '_search_info', search_index]"}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'document_url'}; {'id': '26', 'type': 'string', 'children': [], 'value': "'_search_info'"}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'search_index'}; {'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': 'ddoc_search_info'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'raise_for_status'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'response_to_json_dict'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ddoc_search_info'}
|
Retrieves information about a specified search index within the design
document, returns dictionary
GET databasename/_design/{ddoc}/_search_info/{search_index}
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '30', '32']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'setup'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '10', '15', '20', '25']}; {'id': '4', 'type': 'keyword_separator', 'children': []}; {'id': '5', 'type': 'typed_default_parameter', 'children': ['6', '7', '9']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'verbose'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '9', 'type': 'False', 'children': []}; {'id': '10', 'type': 'typed_default_parameter', 'children': ['11', '12', '14']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'quiet'}; {'id': '12', 'type': 'type', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '14', 'type': 'False', 'children': []}; {'id': '15', 'type': 'typed_default_parameter', 'children': ['16', '17', '19']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '17', 'type': 'type', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"auto"'}; {'id': '20', 'type': 'typed_default_parameter', 'children': ['21', '22', '24']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '22', 'type': 'type', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '24', 'type': 'string', 'children': [], 'value': '"auto"'}; {'id': '25', 'type': 'typed_default_parameter', 'children': ['26', '27', '29']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'timestamp'}; {'id': '27', 'type': 'type', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '29', 'type': 'False', 'children': []}; {'id': '30', 'type': 'type', 'children': ['31']}; {'id': '31', 'type': 'None', 'children': []}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '_setup'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '40', '43', '46', '49']}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'verbose'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'verbose'}; {'id': '40', 'type': 'keyword_argument', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'quiet'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'quiet'}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '46', 'type': 'keyword_argument', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'timestamp'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'timestamp'}
|
Configure behavior of message functions.
:param verbose: Whether :func:`debug` messages should get printed
:param quiet: Hide every message except :func:`warning`, :func:`error`, and
:func:`fatal`
:param color: Choices: 'auto', 'always', or 'never'. Whether to color output.
By default ('auto'), only use color when output is a terminal.
:param title: Ditto for setting terminal title
:param timestamp: Whether to prefix every message with a time stamp
|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'write'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '9', 'type': 'block', 'children': ['10', '32', '46']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '16']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '15'], 'value': 'in'}; {'id': '12', 'type': 'subscript', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '14', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'(w'"}; {'id': '16', 'type': 'block', 'children': ['17', '31']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '24']}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '27', 'type': 'slice', 'children': ['28', '29']}; {'id': '28', 'type': 'colon', 'children': []}; {'id': '29', 'type': 'unary_operator', 'children': ['30'], 'value': '-'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '31', 'type': 'return_statement', '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': 'access_log'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '44']}; {'id': '39', 'type': 'attribute', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'access_log'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '53']}; {'id': '48', 'type': 'attribute', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '56', 'type': 'slice', 'children': ['57', '58']}; {'id': '57', 'type': 'colon', 'children': []}; {'id': '58', 'type': 'unary_operator', 'children': ['59'], 'value': '-'}; {'id': '59', 'type': 'integer', 'children': [], 'value': '1'}
|
Write to appropriate target.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.