sequence
stringlengths
557
12.7k
docstring
stringlengths
4
15.2k
(module (function_definition (function_name_to_string) function_name_to_string (parameters (identifier_self) identifier_self (identifier_obj) identifier_obj )parameters (block (try_statement (block (expression_statement (assignment (identifier_converted) identifier_converted (list_comprehension (call (identifier_str) identifier_str (argument_list (identifier_element) identifier_element )argument_list )call (for_in_clause (identifier_element) identifier_element (identifier_obj) identifier_obj )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_string) identifier_string (call (attribute (string_',') string_',' (identifier_join) identifier_join )attribute (argument_list (identifier_converted) identifier_converted )argument_list )call )assignment )expression_statement )block (except_clause (identifier_TypeError) identifier_TypeError (block (expression_statement (assignment (identifier_string) identifier_string (call (identifier_str) identifier_str (argument_list (identifier_obj) identifier_obj )argument_list )call )assignment )expression_statement )block )except_clause )try_statement (return_statement (identifier_string) identifier_string )return_statement )block )function_definition )module
Picks up an object and transforms it into a string, by coercing each element in an iterable to a string and then joining them, or by trying to coerce the object directly
(module (function_definition (function_name_color) function_name_color (parameters (identifier_nickname) identifier_nickname )parameters (block (expression_statement (assignment (identifier__hex) identifier__hex (subscript (call (attribute (call (identifier_md5) identifier_md5 (argument_list (identifier_nickname) identifier_nickname )argument_list )call (identifier_hexdigest) identifier_hexdigest )attribute (argument_list )argument_list )call (slice (colon) colon (integer_6) integer_6 )slice )subscript )assignment )expression_statement (expression_statement (assignment (identifier_darken) identifier_darken (lambda (lambda_parameters (identifier_s) identifier_s )lambda_parameters (call (identifier_str) identifier_str (argument_list (call (identifier_int) identifier_int (argument_list (call (identifier_round) identifier_round (argument_list (binary_operator (call (identifier_int) identifier_int (argument_list (identifier_s) identifier_s (integer_16) integer_16 )argument_list )call (float_.7) float_.7 )binary_operator )argument_list )call )argument_list )call )argument_list )call )lambda )assignment )expression_statement (return_statement (binary_operator (string_"rgb(%s)") string_"rgb(%s)" (call (attribute (string_",") string_"," (identifier_join) identifier_join )attribute (argument_list (list_comprehension (call (identifier_darken) identifier_darken (argument_list (subscript (identifier__hex) identifier__hex (slice (identifier_i) identifier_i (colon) colon (binary_operator (identifier_i) identifier_i (integer_2) integer_2 )binary_operator )slice )subscript )argument_list )call (for_in_clause (identifier_i) identifier_i (subscript (call (identifier_range) identifier_range (argument_list (integer_6) integer_6 )argument_list )call (slice (colon) colon (colon) colon (integer_2) integer_2 )slice )subscript )for_in_clause )list_comprehension )argument_list )call )binary_operator )return_statement )block )function_definition )module
Provides a consistent color for a nickname. Uses first 6 chars of nickname's md5 hash, and then slightly darkens the rgb values for use on a light background.
(module (function_definition (function_name_post) function_name_post (parameters (identifier_self) identifier_self (identifier_ddata) identifier_ddata (default_parameter (identifier_url) identifier_url (identifier_SETUP_ENDPOINT) identifier_SETUP_ENDPOINT )default_parameter (default_parameter (identifier_referer) identifier_referer (identifier_SETUP_ENDPOINT) identifier_SETUP_ENDPOINT )default_parameter )parameters (block (expression_statement (assignment (identifier_headers) identifier_headers (call (attribute (identifier_HEADERS) identifier_HEADERS (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_referer) identifier_referer (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_headers) identifier_headers (identifier_pop) identifier_pop )attribute (argument_list (string_'Referer') string_'Referer' )argument_list )call )expression_statement )block (else_clause (block (expression_statement (assignment (subscript (identifier_headers) identifier_headers (string_'Referer') string_'Referer' )subscript (identifier_referer) identifier_referer )assignment )expression_statement )block )else_clause )if_statement (if_statement (comparison_operator (string_'csrfmiddlewaretoken') string_'csrfmiddlewaretoken' (call (attribute (identifier_ddata) identifier_ddata (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call )comparison_operator (block (expression_statement (assignment (subscript (identifier_ddata) identifier_ddata (string_'csrfmiddlewaretoken') string_'csrfmiddlewaretoken' )subscript (attribute (attribute (identifier_self) identifier_self (identifier__parent) identifier__parent )attribute (identifier_csrftoken) identifier_csrftoken )attribute )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_req) identifier_req (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier__parent) identifier__parent )attribute (identifier_client) identifier_client )attribute (identifier_post) identifier_post )attribute (argument_list (identifier_url) identifier_url (keyword_argument (identifier_headers) identifier_headers (identifier_headers) identifier_headers )keyword_argument (keyword_argument (identifier_data) identifier_data (identifier_ddata) identifier_ddata )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_req) identifier_req (identifier_status_code) identifier_status_code )attribute (integer_200) integer_200 )comparison_operator (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_update) identifier_update )attribute (argument_list )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Method to update some attributes on namespace.
(module (function_definition (function_name_int_check) function_name_int_check (parameters (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (default_parameter (identifier_func) identifier_func (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_func) identifier_func (boolean_operator (identifier_func) identifier_func (subscript (subscript (call (attribute (identifier_inspect) identifier_inspect (identifier_stack) identifier_stack )attribute (argument_list )argument_list )call (integer_2) integer_2 )subscript (integer_3) integer_3 )subscript )boolean_operator )assignment )expression_statement (for_statement (identifier_var) identifier_var (identifier_args) identifier_args (block (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_var) identifier_var (attribute (identifier_numbers) identifier_numbers (identifier_Integral) identifier_Integral )attribute )argument_list )call )not_operator (block (expression_statement (assignment (identifier_name) identifier_name (attribute (call (identifier_type) identifier_type (argument_list (identifier_var) identifier_var )argument_list )call (identifier___name__) identifier___name__ )attribute )assignment )expression_statement (raise_statement (call (identifier_ComplexError) identifier_ComplexError (argument_list (string_f'Function {func} expected integral number, {name} got instead.') string_f'Function {func} expected integral number, {name} got instead.' )argument_list )call )raise_statement )block )if_statement )block )for_statement )block )function_definition )module
Check if arguments are integrals.
(module (function_definition (function_name_stem_singular_word) function_name_stem_singular_word (parameters (identifier_self) identifier_self (identifier_word) identifier_word )parameters (block (expression_statement (assignment (identifier_context) identifier_context (call (identifier_Context) identifier_Context (argument_list (identifier_word) identifier_word (attribute (identifier_self) identifier_self (identifier_dictionary) identifier_dictionary )attribute (attribute (identifier_self) identifier_self (identifier_visitor_provider) identifier_visitor_provider )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_context) identifier_context (identifier_execute) identifier_execute )attribute (argument_list )argument_list )call )expression_statement (return_statement (attribute (identifier_context) identifier_context (identifier_result) identifier_result )attribute )return_statement )block )function_definition )module
Stem a singular word to its common stem form.
(module (function_definition (function_name_index_missing_documents) function_name_index_missing_documents (parameters (identifier_self) identifier_self (identifier_documents) identifier_documents (default_parameter (identifier_request) identifier_request (None) None )default_parameter )parameters (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_info) identifier_info )attribute (argument_list (call (attribute (concatenated_string (string_'Trying to index documents of type `{}` missing from ') string_'Trying to index documents of type `{}` missing from ' (string_'`{}` index') string_'`{}` index' )concatenated_string (identifier_format) identifier_format )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_doc_type) identifier_doc_type )attribute (attribute (identifier_self) identifier_self (identifier_index_name) identifier_index_name )attribute )argument_list )call )argument_list )call )expression_statement (if_statement (not_operator (identifier_documents) identifier_documents )not_operator (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_info) identifier_info )attribute (argument_list (string_'No documents to index') string_'No documents to index' )argument_list )call )expression_statement (return_statement )return_statement )block )if_statement (expression_statement (assignment (identifier_query_kwargs) identifier_query_kwargs (call (identifier_dict) identifier_dict (argument_list (keyword_argument (identifier_index) identifier_index (attribute (identifier_self) identifier_self (identifier_index_name) identifier_index_name )attribute )keyword_argument (keyword_argument (identifier_doc_type) identifier_doc_type (attribute (identifier_self) identifier_self (identifier_doc_type) identifier_doc_type )attribute )keyword_argument (keyword_argument (identifier_fields) identifier_fields (list (string_'_id') string_'_id' )list )keyword_argument (keyword_argument (identifier_body) identifier_body (dictionary (pair (string_'ids') string_'ids' (list_comprehension (subscript (identifier_d) identifier_d (string_'_pk') string_'_pk' )subscript (for_in_clause (identifier_d) identifier_d (identifier_documents) identifier_documents )for_in_clause )list_comprehension )pair )dictionary )keyword_argument )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_response) identifier_response (call (attribute (attribute (identifier_self) identifier_self (identifier_api) identifier_api )attribute (identifier_mget) identifier_mget )attribute (argument_list (dictionary_splat (identifier_query_kwargs) identifier_query_kwargs )dictionary_splat )argument_list )call )assignment )expression_statement )block (except_clause (identifier_IndexNotFoundException) identifier_IndexNotFoundException (block (expression_statement (assignment (identifier_indexed_ids) identifier_indexed_ids (call (identifier_set) identifier_set (argument_list )argument_list )call )assignment )expression_statement )block )except_clause (else_clause (block (expression_statement (assignment (identifier_indexed_ids) identifier_indexed_ids (call (identifier_set) identifier_set (generator_expression (subscript (identifier_d) identifier_d (string_'_id') string_'_id' )subscript (for_in_clause (identifier_d) identifier_d (subscript (identifier_response) identifier_response (string_'docs') string_'docs' )subscript )for_in_clause (if_clause (call (attribute (identifier_d) identifier_d (identifier_get) identifier_get )attribute (argument_list (string_'found') string_'found' )argument_list )call )if_clause )generator_expression )call )assignment )expression_statement )block )else_clause )try_statement (expression_statement (assignment (identifier_documents) identifier_documents (list_comprehension (identifier_d) identifier_d (for_in_clause (identifier_d) identifier_d (identifier_documents) identifier_documents )for_in_clause (if_clause (comparison_operator (call (identifier_str) identifier_str (argument_list (subscript (identifier_d) identifier_d (string_'_pk') string_'_pk' )subscript )argument_list )call (identifier_indexed_ids) identifier_indexed_ids )comparison_operator )if_clause )list_comprehension )assignment )expression_statement (if_statement (not_operator (identifier_documents) identifier_documents )not_operator (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_info) identifier_info )attribute (argument_list (call (attribute (concatenated_string (string_'No documents of type `{}` are missing from ') string_'No documents of type `{}` are missing from ' (string_'index `{}`') string_'index `{}`' )concatenated_string (identifier_format) identifier_format )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_doc_type) identifier_doc_type )attribute (attribute (identifier_self) identifier_self (identifier_index_name) identifier_index_name )attribute )argument_list )call )argument_list )call )expression_statement (return_statement )return_statement )block )if_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__bulk) identifier__bulk )attribute (argument_list (string_'index') string_'index' (identifier_documents) identifier_documents (identifier_request) identifier_request )argument_list )call )expression_statement )block )function_definition )module
Index documents that are missing from ES index. Determines which documents are missing using ES `mget` call which returns a list of document IDs as `documents`. Then missing `documents` from that list are indexed.
(module (function_definition (function_name__print_err) function_name__print_err (parameters (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern )parameters (block (if_statement (not_operator (attribute (identifier_CFG) identifier_CFG (identifier_debug) identifier_debug )attribute )not_operator (block (return_statement )return_statement )block )if_statement (if_statement (not_operator (identifier_args) identifier_args )not_operator (block (return_statement )return_statement )block )if_statement (expression_statement (assignment (identifier_encoding) identifier_encoding (conditional_expression (string_'utf8') string_'utf8' (comparison_operator (attribute (identifier_os) identifier_os (identifier_name) identifier_name )attribute (string_'posix') string_'posix' )comparison_operator (string_'gbk') string_'gbk' )conditional_expression )assignment )expression_statement (expression_statement (assignment (identifier_args) identifier_args (list_comprehension (call (identifier__cs) identifier__cs (argument_list (identifier_a) identifier_a (identifier_encoding) identifier_encoding )argument_list )call (for_in_clause (identifier_a) identifier_a (identifier_args) identifier_args )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_f_back) identifier_f_back (None) None )assignment )expression_statement (try_statement (block (raise_statement (identifier_Exception) identifier_Exception )raise_statement )block (except_clause (block (expression_statement (assignment (identifier_f_back) identifier_f_back (attribute (attribute (attribute (identifier_sys) identifier_sys (identifier_exc_traceback) identifier_exc_traceback )attribute (identifier_tb_frame) identifier_tb_frame )attribute (identifier_f_back) identifier_f_back )attribute )assignment )expression_statement )block )except_clause )try_statement (expression_statement (assignment (identifier_f_name) identifier_f_name (attribute (attribute (identifier_f_back) identifier_f_back (identifier_f_code) identifier_f_code )attribute (identifier_co_name) identifier_co_name )attribute )assignment )expression_statement (expression_statement (assignment (identifier_filename) identifier_filename (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_basename) identifier_basename )attribute (argument_list (attribute (attribute (identifier_f_back) identifier_f_back (identifier_f_code) identifier_f_code )attribute (identifier_co_filename) identifier_co_filename )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_m_name) identifier_m_name (subscript (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_splitext) identifier_splitext )attribute (argument_list (identifier_filename) identifier_filename )argument_list )call (integer_0) integer_0 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_prefix) identifier_prefix (call (attribute (parenthesized_expression (binary_operator (string_'[%s.%s]') string_'[%s.%s]' (tuple (identifier_m_name) identifier_m_name (identifier_f_name) identifier_f_name )tuple )binary_operator )parenthesized_expression (identifier_ljust) identifier_ljust )attribute (argument_list (integer_20) integer_20 (string_' ') string_' ' )argument_list )call )assignment )expression_statement (print_statement (binary_operator (attribute (identifier_bcolors) identifier_bcolors (identifier_FAIL) identifier_FAIL )attribute (binary_operator (string_'[%s]') string_'[%s]' (call (identifier_str) identifier_str (argument_list (call (attribute (attribute (identifier_datetime) identifier_datetime (identifier_datetime) identifier_datetime )attribute (identifier_now) identifier_now )attribute (argument_list )argument_list )call )argument_list )call )binary_operator )binary_operator (identifier_prefix) identifier_prefix (binary_operator (call (attribute (string_' ') string_' ' (identifier_join) identifier_join )attribute (argument_list (identifier_args) identifier_args )argument_list )call (attribute (identifier_bcolors) identifier_bcolors (identifier_ENDC) identifier_ENDC )attribute )binary_operator )print_statement )block )function_definition )module
Print errors. *args list, list of printing contents
(module (function_definition (function_name_iss_spi_divisor) function_name_iss_spi_divisor (parameters (identifier_self) identifier_self (identifier_sck) identifier_sck )parameters (block (expression_statement (assignment (identifier__divisor) identifier__divisor (binary_operator (parenthesized_expression (binary_operator (integer_6000000) integer_6000000 (identifier_sck) identifier_sck )binary_operator )parenthesized_expression (integer_1) integer_1 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_divisor) identifier_divisor (call (identifier_int) identifier_int (argument_list (identifier__divisor) identifier__divisor )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_divisor) identifier_divisor (identifier__divisor) identifier__divisor )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_'Non-integer SCK divisor.') string_'Non-integer SCK divisor.' )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (comparison_operator (integer_1) integer_1 (identifier_divisor) identifier_divisor (integer_256) integer_256 )comparison_operator )not_operator (block (expression_statement (assignment (identifier_error) identifier_error (parenthesized_expression (call (attribute (concatenated_string (string_"The value of sck_divisor, {}, ") string_"The value of sck_divisor, {}, " (string_"is not between 0 and 255") string_"is not between 0 and 255" )concatenated_string (identifier_format) identifier_format )attribute (argument_list (identifier_divisor) identifier_divisor )argument_list )call )parenthesized_expression )assignment )expression_statement (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (identifier_error) identifier_error )argument_list )call )raise_statement )block )if_statement (return_statement (identifier_divisor) identifier_divisor )return_statement )block )function_definition )module
Calculate a USBISS SPI divisor value from the input SPI clock speed :param sck: SPI clock frequency :type sck: int :returns: ISS SCK divisor :rtype: int
(module (function_definition (function_name__get_history_minute_window) function_name__get_history_minute_window (parameters (identifier_self) identifier_self (identifier_assets) identifier_assets (identifier_end_dt) identifier_end_dt (identifier_bar_count) identifier_bar_count (identifier_field_to_use) identifier_field_to_use )parameters (block (try_statement (block (expression_statement (assignment (identifier_minutes_for_window) identifier_minutes_for_window (call (attribute (attribute (identifier_self) identifier_self (identifier_trading_calendar) identifier_trading_calendar )attribute (identifier_minutes_window) identifier_minutes_window )attribute (argument_list (identifier_end_dt) identifier_end_dt (unary_operator (identifier_bar_count) identifier_bar_count )unary_operator )argument_list )call )assignment )expression_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__handle_minute_history_out_of_bounds) identifier__handle_minute_history_out_of_bounds )attribute (argument_list (identifier_bar_count) identifier_bar_count )argument_list )call )expression_statement )block )except_clause )try_statement (if_statement (comparison_operator (subscript (identifier_minutes_for_window) identifier_minutes_for_window (integer_0) integer_0 )subscript (attribute (identifier_self) identifier_self (identifier__first_trading_minute) identifier__first_trading_minute )attribute )comparison_operator (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__handle_minute_history_out_of_bounds) identifier__handle_minute_history_out_of_bounds )attribute (argument_list (identifier_bar_count) identifier_bar_count )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (identifier_asset_minute_data) identifier_asset_minute_data (call (attribute (identifier_self) identifier_self (identifier__get_minute_window_data) identifier__get_minute_window_data )attribute (argument_list (identifier_assets) identifier_assets (identifier_field_to_use) identifier_field_to_use (identifier_minutes_for_window) identifier_minutes_for_window )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_pd) identifier_pd (identifier_DataFrame) identifier_DataFrame )attribute (argument_list (identifier_asset_minute_data) identifier_asset_minute_data (keyword_argument (identifier_index) identifier_index (identifier_minutes_for_window) identifier_minutes_for_window )keyword_argument (keyword_argument (identifier_columns) identifier_columns (identifier_assets) identifier_assets )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Internal method that returns a dataframe containing history bars of minute frequency for the given sids.
(module (function_definition (function_name__get_value_from_match) function_name__get_value_from_match (parameters (identifier_self) identifier_self (identifier_key) identifier_key (identifier_match) identifier_match )parameters (block (expression_statement (assignment (identifier_value) identifier_value (subscript (call (attribute (identifier_match) identifier_match (identifier_groups) identifier_groups )attribute (argument_list (integer_1) integer_1 )argument_list )call (integer_0) integer_0 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_clean_value) identifier_clean_value (call (attribute (call (attribute (call (identifier_str) identifier_str (argument_list (identifier_value) identifier_value )argument_list )call (identifier_lstrip) identifier_lstrip )attribute (argument_list )argument_list )call (identifier_rstrip) identifier_rstrip )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_clean_value) identifier_clean_value (string_'true') string_'true' )comparison_operator (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__log) identifier__log )attribute (identifier_info) identifier_info )attribute (argument_list (string_'Got value of "%s" as boolean true.') string_'Got value of "%s" as boolean true.' (identifier_key) identifier_key )argument_list )call )expression_statement (return_statement (True) True )return_statement )block )if_statement (if_statement (comparison_operator (identifier_clean_value) identifier_clean_value (string_'false') string_'false' )comparison_operator (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__log) identifier__log )attribute (identifier_info) identifier_info )attribute (argument_list (string_'Got value of "%s" as boolean false.') string_'Got value of "%s" as boolean false.' (identifier_key) identifier_key )argument_list )call )expression_statement (return_statement (False) False )return_statement )block )if_statement (try_statement (block (expression_statement (assignment (identifier_float_value) identifier_float_value (call (identifier_float) identifier_float (argument_list (identifier_clean_value) identifier_clean_value )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__log) identifier__log )attribute (identifier_info) identifier_info )attribute (argument_list (string_'Got value of "%s" as float "%f".') string_'Got value of "%s" as float "%f".' (identifier_key) identifier_key (identifier_float_value) identifier_float_value )argument_list )call )expression_statement (return_statement (identifier_float_value) identifier_float_value )return_statement )block (except_clause (identifier_ValueError) identifier_ValueError (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__log) identifier__log )attribute (identifier_info) identifier_info )attribute (argument_list (string_'Got value of "%s" as string "%s".') string_'Got value of "%s" as string "%s".' (identifier_key) identifier_key (identifier_clean_value) identifier_clean_value )argument_list )call )expression_statement (return_statement (identifier_clean_value) identifier_clean_value )return_statement )block )except_clause )try_statement )block )function_definition )module
Gets the value of the property in the given MatchObject. Args: key (str): Key of the property looked-up. match (MatchObject): The matched property. Return: The discovered value, as a string or boolean.
(module (function_definition (function_name_get) function_name_get (parameters (identifier_cls) identifier_cls (default_parameter (identifier_scope) identifier_scope (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_scope) identifier_scope (None) None )comparison_operator (block (expression_statement (assignment (identifier_scope) identifier_scope (attribute (identifier_cls) identifier_cls (identifier_default) identifier_default )attribute )assignment )expression_statement )block )if_statement (if_statement (boolean_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_scope) identifier_scope (identifier_string_types) identifier_string_types )argument_list )call (comparison_operator (identifier_scope) identifier_scope (attribute (identifier_cls) identifier_cls (identifier__keywords) identifier__keywords )attribute )comparison_operator )boolean_operator (block (return_statement (call (identifier_getattr) identifier_getattr (argument_list (identifier_cls) identifier_cls (identifier_scope) identifier_scope )argument_list )call )return_statement )block )if_statement (return_statement (identifier_scope) identifier_scope )return_statement )block )function_definition )module
Return default or predefined URLs from keyword, pass through ``scope``.
(module (function_definition (function_name_load) function_name_load (parameters (identifier_self) identifier_self (identifier_carddict) identifier_carddict )parameters (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_code) identifier_code )attribute (subscript (identifier_carddict) identifier_carddict (string_"code") string_"code" )subscript )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (identifier_self) identifier_self (identifier_code) identifier_code )attribute (identifier_text_type) identifier_text_type )argument_list )call (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_code) identifier_code )attribute (call (identifier_eval) identifier_eval (argument_list (attribute (identifier_self) identifier_self (identifier_code) identifier_code )attribute )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute (subscript (identifier_carddict) identifier_carddict (string_"name") string_"name" )subscript )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_abilities) identifier_abilities )attribute (subscript (identifier_carddict) identifier_carddict (string_"abilities") string_"abilities" )subscript )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (identifier_self) identifier_self (identifier_abilities) identifier_abilities )attribute (identifier_text_type) identifier_text_type )argument_list )call (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_abilities) identifier_abilities )attribute (call (identifier_eval) identifier_eval (argument_list (attribute (identifier_self) identifier_self (identifier_abilities) identifier_abilities )attribute )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_attributes) identifier_attributes )attribute (subscript (identifier_carddict) identifier_carddict (string_"attributes") string_"attributes" )subscript )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (identifier_self) identifier_self (identifier_attributes) identifier_attributes )attribute (identifier_text_type) identifier_text_type )argument_list )call (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_attributes) identifier_attributes )attribute (call (identifier_eval) identifier_eval (argument_list (attribute (identifier_self) identifier_self (identifier_attributes) identifier_attributes )attribute )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_info) identifier_info )attribute (subscript (identifier_carddict) identifier_carddict (string_"info") string_"info" )subscript )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (identifier_self) identifier_self (identifier_info) identifier_info )attribute (identifier_text_type) identifier_text_type )argument_list )call (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_info) identifier_info )attribute (call (identifier_eval) identifier_eval (argument_list (attribute (identifier_self) identifier_self (identifier_info) identifier_info )attribute )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (identifier_self) identifier_self )return_statement )block )function_definition )module
Takes a carddict as produced by ``Card.save`` and sets this card instances information to the previously saved cards information.
(module (function_definition (function_name_list) function_name_list (parameters (identifier_self) identifier_self (default_parameter (identifier_cart_glob) identifier_cart_glob (list (string_'*.json') string_'*.json' )list )default_parameter )parameters (block (expression_statement (assignment (identifier_carts) identifier_carts (list )list )assignment )expression_statement (for_statement (identifier_glob) identifier_glob (identifier_cart_glob) identifier_cart_glob (block (if_statement (not_operator (call (attribute (identifier_glob) identifier_glob (identifier_endswith) identifier_endswith )attribute (argument_list (string_'.json') string_'.json' )argument_list )call )not_operator (block (expression_statement (assignment (identifier_search_glob) identifier_search_glob (binary_operator (identifier_glob) identifier_glob (string_".json") string_".json" )binary_operator )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_search_glob) identifier_search_glob (identifier_glob) identifier_glob )assignment )expression_statement )block )else_clause )if_statement (for_statement (identifier_cart) identifier_cart (call (attribute (attribute (identifier_juicer) identifier_juicer (identifier_utils) identifier_utils )attribute (identifier_find_pattern) identifier_find_pattern )attribute (argument_list (attribute (identifier_Constants) identifier_Constants (identifier_CART_LOCATION) identifier_CART_LOCATION )attribute (identifier_search_glob) identifier_search_glob )argument_list )call (block (expression_statement (assignment (identifier_cart_name) identifier_cart_name (call (attribute (subscript (call (attribute (identifier_cart) identifier_cart (identifier_split) identifier_split )attribute (argument_list (string_'/') string_'/' )argument_list )call (unary_operator (integer_1) integer_1 )unary_operator )subscript (identifier_replace) identifier_replace )attribute (argument_list (string_'.json') string_'.json' (string_'') string_'' )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_carts) identifier_carts (identifier_append) identifier_append )attribute (argument_list (identifier_cart_name) identifier_cart_name )argument_list )call )expression_statement )block )for_statement )block )for_statement (return_statement (identifier_carts) identifier_carts )return_statement )block )function_definition )module
List all carts
(module (function_definition (function_name_get_weights) function_name_get_weights (parameters (identifier_self) identifier_self (identifier_data) identifier_data (identifier_F) identifier_F )parameters (block (expression_statement (assignment (identifier_beta) identifier_beta (call (attribute (identifier_np) identifier_np (identifier_var) identifier_var )attribute (argument_list (identifier_data) identifier_data )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_trans_F) identifier_trans_F (call (attribute (attribute (identifier_F) identifier_F (identifier_T) identifier_T )attribute (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_W) identifier_W (call (attribute (identifier_np) identifier_np (identifier_zeros) identifier_zeros )attribute (argument_list (tuple (attribute (identifier_self) identifier_self (identifier_K) identifier_K )attribute (subscript (attribute (identifier_data) identifier_data (identifier_shape) identifier_shape )attribute (integer_1) integer_1 )subscript )tuple )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_weight_method) identifier_weight_method )attribute (string_'rr') string_'rr' )comparison_operator (block (expression_statement (assignment (identifier_W) identifier_W (call (attribute (attribute (identifier_np) identifier_np (identifier_linalg) identifier_linalg )attribute (identifier_solve) identifier_solve )attribute (argument_list (binary_operator (call (attribute (identifier_trans_F) identifier_trans_F (identifier_dot) identifier_dot )attribute (argument_list (identifier_F) identifier_F )argument_list )call (binary_operator (identifier_beta) identifier_beta (call (attribute (identifier_np) identifier_np (identifier_identity) identifier_identity )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_K) identifier_K )attribute )argument_list )call )binary_operator )binary_operator (call (attribute (identifier_trans_F) identifier_trans_F (identifier_dot) identifier_dot )attribute (argument_list (identifier_data) identifier_data )argument_list )call )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_W) identifier_W (call (attribute (attribute (identifier_np) identifier_np (identifier_linalg) identifier_linalg )attribute (identifier_solve) identifier_solve )attribute (argument_list (call (attribute (identifier_trans_F) identifier_trans_F (identifier_dot) identifier_dot )attribute (argument_list (identifier_F) identifier_F )argument_list )call (call (attribute (identifier_trans_F) identifier_trans_F (identifier_dot) identifier_dot )attribute (argument_list (identifier_data) identifier_data )argument_list )call )argument_list )call )assignment )expression_statement )block )else_clause )if_statement (return_statement (identifier_W) identifier_W )return_statement )block )function_definition )module
Calculate weight matrix based on fMRI data and factors Parameters ---------- data : 2D array, with shape [n_voxel, n_tr] fMRI data from one subject F : 2D array, with shape [n_voxel,self.K] The latent factors from fMRI data. Returns ------- W : 2D array, with shape [K, n_tr] The weight matrix from fMRI data.
(module (function_definition (function_name_key_description) function_name_key_description (parameters (identifier_self) identifier_self )parameters (block (expression_statement (string_"Return a description of the key") string_"Return a description of the key" )expression_statement (expression_statement (assignment (pattern_list (identifier_vk) identifier_vk (identifier_scan) identifier_scan (identifier_flags) identifier_flags )pattern_list (call (attribute (identifier_self) identifier_self (identifier__get_key_info) identifier__get_key_info )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_desc) identifier_desc (string_'') string_'' )assignment )expression_statement (if_statement (identifier_vk) identifier_vk (block (if_statement (comparison_operator (identifier_vk) identifier_vk (identifier_CODE_NAMES) identifier_CODE_NAMES )comparison_operator (block (expression_statement (assignment (identifier_desc) identifier_desc (subscript (identifier_CODE_NAMES) identifier_CODE_NAMES (identifier_vk) identifier_vk )subscript )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_desc) identifier_desc (binary_operator (string_"VK %d") string_"VK %d" (identifier_vk) identifier_vk )binary_operator )assignment )expression_statement )block )else_clause )if_statement )block (else_clause (block (expression_statement (assignment (identifier_desc) identifier_desc (binary_operator (string_"%s") string_"%s" (attribute (identifier_self) identifier_self (identifier_key) identifier_key )attribute )binary_operator )assignment )expression_statement )block )else_clause )if_statement (return_statement (identifier_desc) identifier_desc )return_statement )block )function_definition )module
Return a description of the key
(module (function_definition (function_name__sumterm_prime) function_name__sumterm_prime (parameters (identifier_lexer) identifier_lexer )parameters (block (expression_statement (assignment (identifier_tok) identifier_tok (call (identifier_next) identifier_next (argument_list (identifier_lexer) identifier_lexer )argument_list )call )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_tok) identifier_tok (identifier_OP_or) identifier_OP_or )argument_list )call (block (expression_statement (assignment (identifier_xorterm) identifier_xorterm (call (identifier__xorterm) identifier__xorterm (argument_list (identifier_lexer) identifier_lexer )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_sumterm_prime) identifier_sumterm_prime (call (identifier__sumterm_prime) identifier__sumterm_prime (argument_list (identifier_lexer) identifier_lexer )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_sumterm_prime) identifier_sumterm_prime (None) None )comparison_operator (block (return_statement (identifier_xorterm) identifier_xorterm )return_statement )block (else_clause (block (return_statement (tuple (string_'or') string_'or' (identifier_xorterm) identifier_xorterm (identifier_sumterm_prime) identifier_sumterm_prime )tuple )return_statement )block )else_clause )if_statement )block (else_clause (block (expression_statement (call (attribute (identifier_lexer) identifier_lexer (identifier_unpop_token) identifier_unpop_token )attribute (argument_list (identifier_tok) identifier_tok )argument_list )call )expression_statement (return_statement (None) None )return_statement )block )else_clause )if_statement )block )function_definition )module
Return a sum term' expression, eliminates left recursion.
(module (function_definition (function_name_module) function_name_module (parameters (identifier_command) identifier_command (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern )parameters (block (if_statement (comparison_operator (string_'MODULESHOME') string_'MODULESHOME' (attribute (identifier_os) identifier_os (identifier_environ) identifier_environ )attribute )comparison_operator (block (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (concatenated_string (string_'payu: warning: No Environment Modules found; skipping {0} call.') string_'payu: warning: No Environment Modules found; skipping {0} call.' (string_'') string_'' )concatenated_string (identifier_format) identifier_format )attribute (argument_list (identifier_command) identifier_command )argument_list )call )argument_list )call )expression_statement (return_statement )return_statement )block )if_statement (expression_statement (assignment (identifier_modulecmd) identifier_modulecmd (parenthesized_expression (call (attribute (string_'{0}/bin/modulecmd') string_'{0}/bin/modulecmd' (identifier_format) identifier_format )attribute (argument_list (subscript (attribute (identifier_os) identifier_os (identifier_environ) identifier_environ )attribute (string_'MODULESHOME') string_'MODULESHOME' )subscript )argument_list )call )parenthesized_expression )assignment )expression_statement (expression_statement (assignment (identifier_cmd) identifier_cmd (call (attribute (string_'{0} python {1} {2}') string_'{0} python {1} {2}' (identifier_format) identifier_format )attribute (argument_list (identifier_modulecmd) identifier_modulecmd (identifier_command) identifier_command (call (attribute (string_' ') string_' ' (identifier_join) identifier_join )attribute (argument_list (identifier_args) identifier_args )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_envs) identifier_envs (identifier__) identifier__ )pattern_list (call (attribute (call (attribute (identifier_subprocess) identifier_subprocess (identifier_Popen) identifier_Popen )attribute (argument_list (call (attribute (identifier_shlex) identifier_shlex (identifier_split) identifier_split )attribute (argument_list (identifier_cmd) identifier_cmd )argument_list )call (keyword_argument (identifier_stdout) identifier_stdout (attribute (identifier_subprocess) identifier_subprocess (identifier_PIPE) identifier_PIPE )attribute )keyword_argument )argument_list )call (identifier_communicate) identifier_communicate )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_exec) identifier_exec (argument_list (identifier_envs) identifier_envs )argument_list )call )expression_statement )block )function_definition )module
Run the modulecmd tool and use its Python-formatted output to set the environment variables.
(module (function_definition (function_name_removeDefaultAttributeValue) function_name_removeDefaultAttributeValue (parameters (identifier_node) identifier_node (identifier_attribute) identifier_attribute )parameters (block (if_statement (not_operator (call (attribute (identifier_node) identifier_node (identifier_hasAttribute) identifier_hasAttribute )attribute (argument_list (attribute (identifier_attribute) identifier_attribute (identifier_name) identifier_name )attribute )argument_list )call )not_operator (block (return_statement (integer_0) integer_0 )return_statement )block )if_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (identifier_attribute) identifier_attribute (identifier_value) identifier_value )attribute (identifier_str) identifier_str )argument_list )call (block (if_statement (comparison_operator (call (attribute (identifier_node) identifier_node (identifier_getAttribute) identifier_getAttribute )attribute (argument_list (attribute (identifier_attribute) identifier_attribute (identifier_name) identifier_name )attribute )argument_list )call (attribute (identifier_attribute) identifier_attribute (identifier_value) identifier_value )attribute )comparison_operator (block (if_statement (boolean_operator (parenthesized_expression (comparison_operator (attribute (identifier_attribute) identifier_attribute (identifier_conditions) identifier_conditions )attribute (None) None )comparison_operator )parenthesized_expression (call (attribute (identifier_attribute) identifier_attribute (identifier_conditions) identifier_conditions )attribute (argument_list (identifier_node) identifier_node )argument_list )call )boolean_operator (block (expression_statement (call (attribute (identifier_node) identifier_node (identifier_removeAttribute) identifier_removeAttribute )attribute (argument_list (attribute (identifier_attribute) identifier_attribute (identifier_name) identifier_name )attribute )argument_list )call )expression_statement (return_statement (integer_1) integer_1 )return_statement )block )if_statement )block )if_statement )block (else_clause (block (expression_statement (assignment (identifier_nodeValue) identifier_nodeValue (call (identifier_SVGLength) identifier_SVGLength (argument_list (call (attribute (identifier_node) identifier_node (identifier_getAttribute) identifier_getAttribute )attribute (argument_list (attribute (identifier_attribute) identifier_attribute (identifier_name) identifier_name )attribute )argument_list )call )argument_list )call )assignment )expression_statement (if_statement (parenthesized_expression (boolean_operator (parenthesized_expression (comparison_operator (attribute (identifier_attribute) identifier_attribute (identifier_value) identifier_value )attribute (None) None )comparison_operator )parenthesized_expression (parenthesized_expression (boolean_operator (parenthesized_expression (comparison_operator (attribute (identifier_nodeValue) identifier_nodeValue (identifier_value) identifier_value )attribute (attribute (identifier_attribute) identifier_attribute (identifier_value) identifier_value )attribute )comparison_operator )parenthesized_expression (not_operator (parenthesized_expression (comparison_operator (attribute (identifier_nodeValue) identifier_nodeValue (identifier_units) identifier_units )attribute (attribute (identifier_Unit) identifier_Unit (identifier_INVALID) identifier_INVALID )attribute )comparison_operator )parenthesized_expression )not_operator )boolean_operator )parenthesized_expression )boolean_operator )parenthesized_expression (block (if_statement (parenthesized_expression (boolean_operator (boolean_operator (parenthesized_expression (comparison_operator (attribute (identifier_attribute) identifier_attribute (identifier_units) identifier_units )attribute (None) None )comparison_operator )parenthesized_expression (parenthesized_expression (comparison_operator (attribute (identifier_nodeValue) identifier_nodeValue (identifier_units) identifier_units )attribute (attribute (identifier_attribute) identifier_attribute (identifier_units) identifier_units )attribute )comparison_operator )parenthesized_expression )boolean_operator (parenthesized_expression (boolean_operator (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (identifier_attribute) identifier_attribute (identifier_units) identifier_units )attribute (identifier_list) identifier_list )argument_list )call (comparison_operator (attribute (identifier_nodeValue) identifier_nodeValue (identifier_units) identifier_units )attribute (attribute (identifier_attribute) identifier_attribute (identifier_units) identifier_units )attribute )comparison_operator )boolean_operator )parenthesized_expression )boolean_operator )parenthesized_expression (block (if_statement (boolean_operator (parenthesized_expression (comparison_operator (attribute (identifier_attribute) identifier_attribute (identifier_conditions) identifier_conditions )attribute (None) None )comparison_operator )parenthesized_expression (call (attribute (identifier_attribute) identifier_attribute (identifier_conditions) identifier_conditions )attribute (argument_list (identifier_node) identifier_node )argument_list )call )boolean_operator (block (expression_statement (call (attribute (identifier_node) identifier_node (identifier_removeAttribute) identifier_removeAttribute )attribute (argument_list (attribute (identifier_attribute) identifier_attribute (identifier_name) identifier_name )attribute )argument_list )call )expression_statement (return_statement (integer_1) integer_1 )return_statement )block )if_statement )block )if_statement )block )if_statement )block )else_clause )if_statement (return_statement (integer_0) integer_0 )return_statement )block )function_definition )module
Removes the DefaultAttribute 'attribute' from 'node' if specified conditions are fulfilled Warning: Does NOT check if the attribute is actually valid for the passed element type for increased preformance!
(module (function_definition (function_name_IOC_TYPECHECK) function_name_IOC_TYPECHECK (parameters (identifier_t) identifier_t )parameters (block (expression_statement (assignment (identifier_result) identifier_result (call (attribute (identifier_ctypes) identifier_ctypes (identifier_sizeof) identifier_sizeof )attribute (argument_list (identifier_t) identifier_t )argument_list )call )assignment )expression_statement (assert_statement (comparison_operator (identifier_result) identifier_result (identifier__IOC_SIZEMASK) identifier__IOC_SIZEMASK )comparison_operator (identifier_result) identifier_result )assert_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Returns the size of given type, and check its suitability for use in an ioctl command number.
(module (function_definition (function_name__options_request) function_name__options_request (parameters (identifier_self) identifier_self (identifier_url) identifier_url (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_request_kwargs) identifier_request_kwargs (dictionary (pair (string_'method') string_'method' (string_'OPTIONS') string_'OPTIONS' )pair (pair (string_'url') string_'url' (identifier_url) identifier_url )pair )dictionary )assignment )expression_statement (for_statement (pattern_list (identifier_key) identifier_key (identifier_value) identifier_value )pattern_list (call (attribute (identifier_kwargs) identifier_kwargs (identifier_items) identifier_items )attribute (argument_list )argument_list )call (block (expression_statement (assignment (subscript (identifier_request_kwargs) identifier_request_kwargs (identifier_key) identifier_key )subscript (identifier_value) identifier_value )assignment )expression_statement )block )for_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier__request) identifier__request )attribute (argument_list (dictionary_splat (identifier_request_kwargs) identifier_request_kwargs )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
a method to catch and report http options request connectivity errors
(module (function_definition (function_name_gc) function_name_gc (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_gc) identifier_gc (call (identifier_len) identifier_len (argument_list (list_comprehension (identifier_base) identifier_base (for_in_clause (identifier_base) identifier_base (attribute (identifier_self) identifier_self (identifier_seq) identifier_seq )attribute )for_in_clause (if_clause (boolean_operator (comparison_operator (identifier_base) identifier_base (string_'C') string_'C' )comparison_operator (comparison_operator (identifier_base) identifier_base (string_'G') string_'G' )comparison_operator )boolean_operator )if_clause )list_comprehension )argument_list )call )assignment )expression_statement (return_statement (binary_operator (call (identifier_float) identifier_float (argument_list (identifier_gc) identifier_gc )argument_list )call (call (identifier_len) identifier_len (argument_list (identifier_self) identifier_self )argument_list )call )binary_operator )return_statement )block )function_definition )module
Find the frequency of G and C in the current sequence.
(module (function_definition (function_name_goal) function_name_goal (parameters (identifier_self) identifier_self (identifier_goal_name) identifier_goal_name (default_parameter (identifier_count) identifier_count (integer_1) integer_1 )default_parameter )parameters (block (for_statement (identifier_enrollment) identifier_enrollment (call (attribute (identifier_self) identifier_self (identifier__get_all_enrollments) identifier__get_all_enrollments )attribute (argument_list )argument_list )call (block (if_statement (call (attribute (attribute (identifier_enrollment) identifier_enrollment (identifier_experiment) identifier_experiment )attribute (identifier_is_displaying_alternatives) identifier_is_displaying_alternatives )attribute (argument_list )argument_list )call (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__experiment_goal) identifier__experiment_goal )attribute (argument_list (attribute (identifier_enrollment) identifier_enrollment (identifier_experiment) identifier_experiment )attribute (attribute (identifier_enrollment) identifier_enrollment (identifier_alternative) identifier_alternative )attribute (identifier_goal_name) identifier_goal_name (identifier_count) identifier_count )argument_list )call )expression_statement )block )if_statement )block )for_statement )block )function_definition )module
Record that this user has performed a particular goal This will update the goal stats for all experiments the user is enrolled in.
(module (function_definition (function_name_rgevolve_leadinglog) function_name_rgevolve_leadinglog (parameters (identifier_self) identifier_self (identifier_scale_out) identifier_scale_out )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__check_initial) identifier__check_initial )attribute (argument_list )argument_list )call )expression_statement (return_statement (call (attribute (identifier_rge) identifier_rge (identifier_smeft_evolve_leadinglog) identifier_smeft_evolve_leadinglog )attribute (argument_list (keyword_argument (identifier_C_in) identifier_C_in (attribute (identifier_self) identifier_self (identifier_C_in) identifier_C_in )attribute )keyword_argument (keyword_argument (identifier_scale_high) identifier_scale_high (attribute (identifier_self) identifier_self (identifier_scale_high) identifier_scale_high )attribute )keyword_argument (keyword_argument (identifier_scale_in) identifier_scale_in (attribute (identifier_self) identifier_self (identifier_scale_in) identifier_scale_in )attribute )keyword_argument (keyword_argument (identifier_scale_out) identifier_scale_out (identifier_scale_out) identifier_scale_out )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Compute the leading logarithmix approximation to the solution of the SMEFT RGEs from the initial scale to `scale_out`. Returns a dictionary with parameters and Wilson coefficients. Much faster but less precise that `rgevolve`.
(module (function_definition (function_name_app_profile) function_name_app_profile (parameters (identifier_self) identifier_self (identifier_app_profile_id) identifier_app_profile_id (default_parameter (identifier_routing_policy_type) identifier_routing_policy_type (None) None )default_parameter (default_parameter (identifier_description) identifier_description (None) None )default_parameter (default_parameter (identifier_cluster_id) identifier_cluster_id (None) None )default_parameter (default_parameter (identifier_allow_transactional_writes) identifier_allow_transactional_writes (None) None )default_parameter )parameters (block (return_statement (call (identifier_AppProfile) identifier_AppProfile (argument_list (identifier_app_profile_id) identifier_app_profile_id (identifier_self) identifier_self (keyword_argument (identifier_routing_policy_type) identifier_routing_policy_type (identifier_routing_policy_type) identifier_routing_policy_type )keyword_argument (keyword_argument (identifier_description) identifier_description (identifier_description) identifier_description )keyword_argument (keyword_argument (identifier_cluster_id) identifier_cluster_id (identifier_cluster_id) identifier_cluster_id )keyword_argument (keyword_argument (identifier_allow_transactional_writes) identifier_allow_transactional_writes (identifier_allow_transactional_writes) identifier_allow_transactional_writes )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Factory to create AppProfile associated with this instance. For example: .. literalinclude:: snippets.py :start-after: [START bigtable_create_app_profile] :end-before: [END bigtable_create_app_profile] :type app_profile_id: str :param app_profile_id: The ID of the AppProfile. Must be of the form ``[_a-zA-Z0-9][-_.a-zA-Z0-9]*``. :type: routing_policy_type: int :param: routing_policy_type: The type of the routing policy. Possible values are represented by the following constants: :data:`google.cloud.bigtable.enums.RoutingPolicyType.ANY` :data:`google.cloud.bigtable.enums.RoutingPolicyType.SINGLE` :type: description: str :param: description: (Optional) Long form description of the use case for this AppProfile. :type: cluster_id: str :param: cluster_id: (Optional) Unique cluster_id which is only required when routing_policy_type is ROUTING_POLICY_TYPE_SINGLE. :type: allow_transactional_writes: bool :param: allow_transactional_writes: (Optional) If true, allow transactional writes for ROUTING_POLICY_TYPE_SINGLE. :rtype: :class:`~google.cloud.bigtable.app_profile.AppProfile>` :returns: AppProfile for this instance.
(module (function_definition (function_name_optimal_parameters) function_name_optimal_parameters (parameters (identifier_reconstruction) identifier_reconstruction (identifier_fom) identifier_fom (identifier_phantoms) identifier_phantoms (identifier_data) identifier_data (default_parameter (identifier_initial) identifier_initial (None) None )default_parameter (default_parameter (identifier_univariate) identifier_univariate (False) False )default_parameter )parameters (block (expression_statement (identifier_r) identifier_r )expression_statement (function_definition (function_name_func) function_name_func (parameters (identifier_lam) identifier_lam )parameters (block (return_statement (call (identifier_sum) identifier_sum (generator_expression (call (identifier_fom) identifier_fom (argument_list (call (identifier_reconstruction) identifier_reconstruction (argument_list (identifier_datai) identifier_datai (identifier_lam) identifier_lam )argument_list )call (identifier_phantomi) identifier_phantomi )argument_list )call (for_in_clause (pattern_list (identifier_phantomi) identifier_phantomi (identifier_datai) identifier_datai )pattern_list (call (identifier_zip) identifier_zip (argument_list (identifier_phantoms) identifier_phantoms (identifier_data) identifier_data )argument_list )call )for_in_clause )generator_expression )call )return_statement )block )function_definition (expression_statement (assignment (identifier_tol) identifier_tol (binary_operator (attribute (call (attribute (identifier_np) identifier_np (identifier_finfo) identifier_finfo )attribute (argument_list (attribute (attribute (subscript (identifier_phantoms) identifier_phantoms (integer_0) integer_0 )subscript (identifier_space) identifier_space )attribute (identifier_dtype) identifier_dtype )attribute )argument_list )call (identifier_resolution) identifier_resolution )attribute (integer_10) integer_10 )binary_operator )assignment )expression_statement (if_statement (identifier_univariate) identifier_univariate (block (expression_statement (assignment (identifier_result) identifier_result (call (attribute (attribute (identifier_scipy) identifier_scipy (identifier_optimize) identifier_optimize )attribute (identifier_minimize_scalar) identifier_minimize_scalar )attribute (argument_list (identifier_func) identifier_func (keyword_argument (identifier_bracket) identifier_bracket (identifier_initial) identifier_initial )keyword_argument (keyword_argument (identifier_tol) identifier_tol (identifier_tol) identifier_tol )keyword_argument (keyword_argument (identifier_bounds) identifier_bounds (None) None )keyword_argument (keyword_argument (identifier_options) identifier_options (dictionary (pair (string_'disp') string_'disp' (False) False )pair )dictionary )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (attribute (identifier_result) identifier_result (identifier_x) identifier_x )attribute )return_statement )block (else_clause (block (expression_statement (assignment (identifier_initial) identifier_initial (call (attribute (identifier_np) identifier_np (identifier_asarray) identifier_asarray )attribute (argument_list (identifier_initial) identifier_initial )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_parameters) identifier_parameters (call (attribute (attribute (identifier_scipy) identifier_scipy (identifier_optimize) identifier_optimize )attribute (identifier_fmin_powell) identifier_fmin_powell )attribute (argument_list (identifier_func) identifier_func (identifier_initial) identifier_initial (keyword_argument (identifier_xtol) identifier_xtol (identifier_tol) identifier_tol )keyword_argument (keyword_argument (identifier_ftol) identifier_ftol (identifier_tol) identifier_tol )keyword_argument (keyword_argument (identifier_disp) identifier_disp (False) False )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (identifier_parameters) identifier_parameters )return_statement )block )else_clause )if_statement )block )function_definition )module
r"""Find the optimal parameters for a reconstruction method. Notes ----- For a forward operator :math:`A : X \to Y`, a reconstruction operator parametrized by :math:`\theta` is some operator :math:`R_\theta : Y \to X` such that .. math:: R_\theta(A(x)) \approx x. The optimal choice of :math:`\theta` is given by .. math:: \theta = \arg\min_\theta fom(R(A(x) + noise), x) where :math:`fom : X \times X \to \mathbb{R}` is a figure of merit. Parameters ---------- reconstruction : callable Function that takes two parameters: * data : The data to be reconstructed * parameters : Parameters of the reconstruction method The function should return the reconstructed image. fom : callable Function that takes two parameters: * reconstructed_image * true_image and returns a scalar figure of merit. phantoms : sequence True images. data : sequence The data to reconstruct from. initial : array-like or pair Initial guess for the parameters. It is - a required array in the multivariate case - an optional pair in the univariate case. univariate : bool, optional Whether to use a univariate solver Returns ------- parameters : 'numpy.ndarray' The optimal parameters for the reconstruction problem.
(module (function_definition (function_name_identify) function_name_identify (parameters (identifier_fn) identifier_fn )parameters (block (return_statement (tuple (subscript (attribute (identifier_fn) identifier_fn (identifier___globals__) identifier___globals__ )attribute (string_'__name__') string_'__name__' )subscript (call (identifier_getattr) identifier_getattr (argument_list (identifier_fn) identifier_fn (string_'__qualname__') string_'__qualname__' (call (identifier_getattr) identifier_getattr (argument_list (identifier_fn) identifier_fn (string_'__name__') string_'__name__' (string_'') string_'' )argument_list )call )argument_list )call )tuple )return_statement (function_definition (function_name___init__) function_name___init__ (parameters (identifier_self) identifier_self (identifier_fn) identifier_fn )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_validate_function) identifier_validate_function )attribute (argument_list (identifier_fn) identifier_fn )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_configured) identifier_configured )attribute (False) False )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_has_backup_plan) identifier_has_backup_plan )attribute (False) False )assignment )expression_statement (if_statement (call (attribute (identifier_self) identifier_self (identifier_has_args) identifier_has_args )attribute (argument_list )argument_list )call (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_backup_plan) identifier_backup_plan )attribute (identifier_fn) identifier_fn )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_id) identifier_id )attribute (call (attribute (identifier_self) identifier_self (identifier_identify) identifier_identify )attribute (argument_list (identifier_fn) identifier_fn )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_backup_plan) identifier_backup_plan )attribute (call (attribute (attribute (attribute (identifier_big) identifier_big (identifier_overload) identifier_overload )attribute (identifier__cache) identifier__cache )attribute (identifier_get) identifier_get )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_id) identifier_id )attribute (None) None )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_configure_with) identifier_configure_with )attribute (argument_list (identifier_fn) identifier_fn )argument_list )call )expression_statement )block )else_clause )if_statement )block )function_definition (function_definition (function_name___call__) function_name___call__ (parameters (identifier_self) identifier_self (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (try_statement (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_fn) identifier_fn )attribute (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_ex) identifier_ex )as_pattern_target )as_pattern (block (if_statement (attribute (identifier_self) identifier_self (identifier_has_backup_plan) identifier_has_backup_plan )attribute (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_backup_plan) identifier_backup_plan )attribute (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block (elif_clause (attribute (identifier_self) identifier_self (identifier_configured) identifier_configured )attribute (block (raise_statement (identifier_ex) identifier_ex )raise_statement )block )elif_clause (else_clause (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_configure_with) identifier_configure_with )attribute (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )expression_statement (return_statement (identifier_self) identifier_self )return_statement )block )else_clause )if_statement )block )except_clause )try_statement )block )function_definition )block )function_definition )module
returns a tuple that is used to match functions to their neighbors in their resident namespaces
(module (function_definition (function_name_ln_growth) function_name_ln_growth (parameters (identifier_eqdata) identifier_eqdata (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (if_statement (comparison_operator (string_'outputcol') string_'outputcol' (identifier_kwargs) identifier_kwargs )comparison_operator (block (expression_statement (assignment (subscript (identifier_kwargs) identifier_kwargs (string_'outputcol') string_'outputcol' )subscript (string_'LnGrowth') string_'LnGrowth' )assignment )expression_statement )block )if_statement (return_statement (call (attribute (identifier_np) identifier_np (identifier_log) identifier_log )attribute (argument_list (call (identifier_growth) identifier_growth (argument_list (identifier_eqdata) identifier_eqdata (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )argument_list )call )return_statement )block )function_definition )module
Return the natural log of growth. See also -------- :func:`growth`
(module (function_definition (function_name_stop) function_name_stop (parameters (identifier_self) identifier_self (identifier_id) identifier_id )parameters (block (expression_statement (assignment (identifier_path) identifier_path (call (identifier_partial) identifier_partial (argument_list (identifier__path) identifier__path (attribute (identifier_self) identifier_self (identifier_adapter) identifier_adapter )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_path) identifier_path (call (identifier_path) identifier_path (argument_list (identifier_id) identifier_id )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier__delete) identifier__delete )attribute (argument_list (identifier_path) identifier_path )argument_list )call )return_statement )block )function_definition )module
stop the tracker.
(module (function_definition (function_name_get_content_models) function_name_get_content_models (parameters (identifier_cls) identifier_cls )parameters (block (expression_statement (assignment (identifier_concrete_model) identifier_concrete_model (call (identifier_base_concrete_model) identifier_base_concrete_model (argument_list (identifier_ContentTyped) identifier_ContentTyped (identifier_cls) identifier_cls )argument_list )call )assignment )expression_statement (return_statement (list_comprehension (identifier_m) identifier_m (for_in_clause (identifier_m) identifier_m (call (attribute (identifier_apps) identifier_apps (identifier_get_models) identifier_get_models )attribute (argument_list )argument_list )call )for_in_clause (if_clause (boolean_operator (comparison_operator (identifier_m) identifier_m (identifier_concrete_model) identifier_concrete_model )comparison_operator (call (identifier_issubclass) identifier_issubclass (argument_list (identifier_m) identifier_m (identifier_concrete_model) identifier_concrete_model )argument_list )call )boolean_operator )if_clause )list_comprehension )return_statement )block )function_definition )module
Return all subclasses of the concrete model.
(module (function_definition (function_name_space_acl) function_name_space_acl (parameters (identifier_args) identifier_args )parameters (block (expression_statement (assignment (identifier_r) identifier_r (call (attribute (identifier_fapi) identifier_fapi (identifier_get_workspace_acl) identifier_get_workspace_acl )attribute (argument_list (attribute (identifier_args) identifier_args (identifier_project) identifier_project )attribute (attribute (identifier_args) identifier_args (identifier_workspace) identifier_workspace )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_fapi) identifier_fapi (identifier__check_response_code) identifier__check_response_code )attribute (argument_list (identifier_r) identifier_r (integer_200) integer_200 )argument_list )call )expression_statement (expression_statement (assignment (identifier_result) identifier_result (call (identifier_dict) identifier_dict (argument_list )argument_list )call )assignment )expression_statement (for_statement (pattern_list (identifier_user) identifier_user (identifier_info) identifier_info )pattern_list (call (identifier_sorted) identifier_sorted (argument_list (call (attribute (subscript (call (attribute (identifier_r) identifier_r (identifier_json) identifier_json )attribute (argument_list )argument_list )call (string_'acl') string_'acl' )subscript (identifier_items) identifier_items )attribute (argument_list )argument_list )call )argument_list )call (block (expression_statement (assignment (subscript (identifier_result) identifier_result (identifier_user) identifier_user )subscript (subscript (identifier_info) identifier_info (string_'accessLevel') string_'accessLevel' )subscript )assignment )expression_statement )block )for_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Retrieve access control list for a workspace
(module (function_definition (function_name__safe_name) function_name__safe_name (parameters (identifier_file_name) identifier_file_name (identifier_sep) identifier_sep )parameters (block (expression_statement (assignment (identifier_file_name) identifier_file_name (call (identifier_stringify) identifier_stringify (argument_list (identifier_file_name) identifier_file_name )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_file_name) identifier_file_name (None) None )comparison_operator (block (return_statement )return_statement )block )if_statement (expression_statement (assignment (identifier_file_name) identifier_file_name (call (identifier_ascii_text) identifier_ascii_text (argument_list (identifier_file_name) identifier_file_name )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_file_name) identifier_file_name (call (identifier_category_replace) identifier_category_replace (argument_list (identifier_file_name) identifier_file_name (identifier_UNICODE_CATEGORIES) identifier_UNICODE_CATEGORIES )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_file_name) identifier_file_name (call (identifier_collapse_spaces) identifier_collapse_spaces (argument_list (identifier_file_name) identifier_file_name )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_file_name) identifier_file_name (None) None )comparison_operator (not_operator (call (identifier_len) identifier_len (argument_list (identifier_file_name) identifier_file_name )argument_list )call )not_operator )boolean_operator (block (return_statement )return_statement )block )if_statement (return_statement (call (attribute (identifier_file_name) identifier_file_name (identifier_replace) identifier_replace )attribute (argument_list (identifier_WS) identifier_WS (identifier_sep) identifier_sep )argument_list )call )return_statement )block )function_definition )module
Convert the file name to ASCII and normalize the string.
(module (function_definition (function_name_get) function_name_get (parameters (identifier_self) identifier_self (identifier_label) identifier_label (default_parameter (identifier_default) identifier_default (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_label) identifier_label (attribute (identifier_self) identifier_self (identifier_index) identifier_index )attribute )comparison_operator (block (expression_statement (assignment (identifier_loc) identifier_loc (call (attribute (attribute (identifier_self) identifier_self (identifier_index) identifier_index )attribute (identifier_get_loc) identifier_get_loc )attribute (argument_list (identifier_label) identifier_label )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier__get_val_at) identifier__get_val_at )attribute (argument_list (identifier_loc) identifier_loc )argument_list )call )return_statement )block (else_clause (block (return_statement (identifier_default) identifier_default )return_statement )block )else_clause )if_statement )block )function_definition )module
Returns value occupying requested label, default to specified missing value if not present. Analogous to dict.get Parameters ---------- label : object Label value looking for default : object, optional Value to return if label not in index Returns ------- y : scalar
(module (function_definition (function_name_actions) function_name_actions (parameters (identifier_obj) identifier_obj (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (if_statement (comparison_operator (string_'exclude') string_'exclude' (identifier_kwargs) identifier_kwargs )comparison_operator (block (expression_statement (assignment (subscript (identifier_kwargs) identifier_kwargs (string_'exclude') string_'exclude' )subscript (call (attribute (subscript (identifier_kwargs) identifier_kwargs (string_'exclude') string_'exclude' )subscript (identifier_split) identifier_split )attribute (argument_list (string_',') string_',' )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_actions) identifier_actions (call (attribute (identifier_obj) identifier_obj (identifier_get_actions) identifier_get_actions )attribute (argument_list (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_actions) identifier_actions (identifier_dict) identifier_dict )argument_list )call (block (expression_statement (assignment (identifier_actions) identifier_actions (call (attribute (identifier_actions) identifier_actions (identifier_values) identifier_values )attribute (argument_list )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_buttons) identifier_buttons (call (attribute (string_"") string_"" (identifier_join) identifier_join )attribute (generator_expression (binary_operator (string_"%s") string_"%s" (call (attribute (identifier_action) identifier_action (identifier_render) identifier_render )attribute (argument_list )argument_list )call )binary_operator (for_in_clause (identifier_action) identifier_action (identifier_actions) identifier_actions )for_in_clause )generator_expression )call )assignment )expression_statement (return_statement (binary_operator (string_'<div class="actions">%s</div>') string_'<div class="actions">%s</div>' (identifier_buttons) identifier_buttons )binary_operator )return_statement )block )function_definition )module
Return actions available for an object
(module (function_definition (function_name_action_draft) function_name_action_draft (parameters (identifier_self) identifier_self )parameters (block (for_statement (identifier_rec) identifier_rec (identifier_self) identifier_self (block (if_statement (not_operator (comparison_operator (attribute (identifier_rec) identifier_rec (identifier_state) identifier_state )attribute (string_'cancelled') string_'cancelled' )comparison_operator )not_operator (block (raise_statement (call (identifier_UserError) identifier_UserError (argument_list (call (identifier__) identifier__ (argument_list (string_'You need to cancel it before reopening.') string_'You need to cancel it before reopening.' )argument_list )call )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (parenthesized_expression (boolean_operator (attribute (identifier_rec) identifier_rec (identifier_am_i_owner) identifier_am_i_owner )attribute (attribute (identifier_rec) identifier_rec (identifier_am_i_approver) identifier_am_i_approver )attribute )boolean_operator )parenthesized_expression )not_operator (block (raise_statement (call (identifier_UserError) identifier_UserError (argument_list (call (identifier__) identifier__ (argument_list (concatenated_string (string_'You are not authorized to do this.\r\n') string_'You are not authorized to do this.\r\n' (string_'Only owners or approvers can reopen Change Requests.') string_'Only owners or approvers can reopen Change Requests.' )concatenated_string )argument_list )call )argument_list )call )raise_statement )block )if_statement (expression_statement (call (attribute (identifier_rec) identifier_rec (identifier_write) identifier_write )attribute (argument_list (dictionary (pair (string_'state') string_'state' (string_'draft') string_'draft' )pair )dictionary )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Set a change request as draft
(module (function_definition (function_name__prepare_corerelation_data) function_name__prepare_corerelation_data (parameters (identifier_self) identifier_self (identifier_X1) identifier_X1 (identifier_X2) identifier_X2 (default_parameter (identifier_start_voxel) identifier_start_voxel (integer_0) integer_0 )default_parameter (default_parameter (identifier_num_processed_voxels) identifier_num_processed_voxels (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_num_samples) identifier_num_samples (call (identifier_len) identifier_len (argument_list (identifier_X1) identifier_X1 )argument_list )call )assignment )expression_statement (assert_statement (comparison_operator (identifier_num_samples) identifier_num_samples (integer_0) integer_0 )comparison_operator (string_'at least one sample is needed for correlation computation') string_'at least one sample is needed for correlation computation' )assert_statement (expression_statement (assignment (identifier_num_voxels1) identifier_num_voxels1 (subscript (attribute (subscript (identifier_X1) identifier_X1 (integer_0) integer_0 )subscript (identifier_shape) identifier_shape )attribute (integer_1) integer_1 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_num_voxels2) identifier_num_voxels2 (subscript (attribute (subscript (identifier_X2) identifier_X2 (integer_0) integer_0 )subscript (identifier_shape) identifier_shape )attribute (integer_1) integer_1 )subscript )assignment )expression_statement (assert_statement (comparison_operator (binary_operator (identifier_num_voxels1) identifier_num_voxels1 (identifier_num_voxels2) identifier_num_voxels2 )binary_operator (attribute (identifier_self) identifier_self (identifier_num_features_) identifier_num_features_ )attribute )comparison_operator (concatenated_string (string_'the number of features provided by the input data ') string_'the number of features provided by the input data ' (string_'does not match the number of features defined in the model') string_'does not match the number of features defined in the model' )concatenated_string )assert_statement (assert_statement (comparison_operator (subscript (attribute (subscript (identifier_X1) identifier_X1 (integer_0) integer_0 )subscript (identifier_shape) identifier_shape )attribute (integer_0) integer_0 )subscript (subscript (attribute (subscript (identifier_X2) identifier_X2 (integer_0) integer_0 )subscript (identifier_shape) identifier_shape )attribute (integer_0) integer_0 )subscript )comparison_operator (string_'the numbers of TRs of X1 and X2 are not identical') string_'the numbers of TRs of X1 and X2 are not identical' )assert_statement (if_statement (comparison_operator (identifier_num_processed_voxels) identifier_num_processed_voxels (None) None )comparison_operator (block (expression_statement (assignment (identifier_num_processed_voxels) identifier_num_processed_voxels (identifier_num_voxels1) identifier_num_voxels1 )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_corr_data) identifier_corr_data (call (attribute (identifier_np) identifier_np (identifier_zeros) identifier_zeros )attribute (argument_list (tuple (identifier_num_samples) identifier_num_samples (identifier_num_processed_voxels) identifier_num_processed_voxels (identifier_num_voxels2) identifier_num_voxels2 )tuple (attribute (identifier_np) identifier_np (identifier_float32) identifier_float32 )attribute (keyword_argument (identifier_order) identifier_order (string_'C') string_'C' )keyword_argument )argument_list )call )assignment )expression_statement (for_statement (pattern_list (identifier_idx) identifier_idx (identifier_data) identifier_data )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_X1) identifier_X1 )argument_list )call (block (expression_statement (assignment (identifier_data2) identifier_data2 (subscript (identifier_X2) identifier_X2 (identifier_idx) identifier_idx )subscript )assignment )expression_statement (expression_statement (assignment (identifier_num_TRs) identifier_num_TRs (subscript (attribute (identifier_data) identifier_data (identifier_shape) identifier_shape )attribute (integer_0) integer_0 )subscript )assignment )expression_statement (expression_statement (call (attribute (identifier_blas) identifier_blas (identifier_compute_corr_vectors) identifier_compute_corr_vectors )attribute (argument_list (string_'N') string_'N' (string_'T') string_'T' (identifier_num_voxels2) identifier_num_voxels2 (identifier_num_processed_voxels) identifier_num_processed_voxels (identifier_num_TRs) identifier_num_TRs (float_1.0) float_1.0 (identifier_data2) identifier_data2 (identifier_num_voxels2) identifier_num_voxels2 (identifier_data) identifier_data (identifier_num_voxels1) identifier_num_voxels1 (float_0.0) float_0.0 (identifier_corr_data) identifier_corr_data (identifier_num_voxels2) identifier_num_voxels2 (identifier_start_voxel) identifier_start_voxel (identifier_idx) identifier_idx )argument_list )call )expression_statement )block )for_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (string_'correlation computation done') string_'correlation computation done' )argument_list )call )expression_statement (return_statement (identifier_corr_data) identifier_corr_data )return_statement )block )function_definition )module
Compute auto-correlation for the input data X1 and X2. it will generate the correlation between some voxels and all voxels Parameters ---------- X1: a list of numpy array in shape [num_TRs, num_voxels1] X1 contains the activity data filtered by ROIs and prepared for correlation computation. All elements of X1 must have the same num_voxels value. X2: a list of numpy array in shape [num_TRs, num_voxels2] len(X1) equals len(X2). All elements of X2 must have the same num_voxels value. X2 can be identical to X1; if not, X1 must have more voxels than X2 (guaranteed by self.fit and/or self.predict). start_voxel: int, default 0 the starting voxel id for correlation computation num_processed_voxels: int, default None the number of voxels it computes for correlation computation if it is None, it is set to self.num_voxels Returns ------- corr_data: the correlation data in shape [len(X), num_processed_voxels, num_voxels2]
(module (function_definition (function_name_render) function_name_render (parameters (identifier_self) identifier_self )parameters (block (if_statement (not_operator (call (attribute (identifier_self) identifier_self (identifier_available) identifier_available )attribute (argument_list )argument_list )call )not_operator (block (return_statement (string_"") string_"" )return_statement )block )if_statement (expression_statement (assignment (identifier_mtool) identifier_mtool (call (attribute (identifier_api) identifier_api (identifier_get_tool) identifier_get_tool )attribute (argument_list (string_"portal_membership") string_"portal_membership" )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_member) identifier_member (call (attribute (identifier_mtool) identifier_mtool (identifier_getAuthenticatedMember) identifier_getAuthenticatedMember )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_roles) identifier_roles (call (attribute (identifier_member) identifier_member (identifier_getRoles) identifier_getRoles )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_allowed) identifier_allowed (boolean_operator (comparison_operator (string_"LabManager") string_"LabManager" (identifier_roles) identifier_roles )comparison_operator (comparison_operator (string_"Manager") string_"Manager" (identifier_roles) identifier_roles )comparison_operator )boolean_operator )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_get_failed_instruments) identifier_get_failed_instruments )attribute (argument_list )argument_list )call )expression_statement (if_statement (boolean_operator (identifier_allowed) identifier_allowed (attribute (identifier_self) identifier_self (identifier_nr_failed) identifier_nr_failed )attribute )boolean_operator (block (return_statement (call (attribute (identifier_self) identifier_self (identifier_index) identifier_index )attribute (argument_list )argument_list )call )return_statement )block (else_clause (block (return_statement (string_"") string_"" )return_statement )block )else_clause )if_statement )block )function_definition )module
Render the viewlet
(module (function_definition (function_name_get_owner_ids_value) function_name_get_owner_ids_value (parameters (identifier_self) identifier_self (identifier_obj) identifier_obj )parameters (block (return_statement (list_comprehension (attribute (identifier_user) identifier_user (identifier_pk) identifier_pk )attribute (for_in_clause (identifier_user) identifier_user (call (identifier_get_users_with_permission) identifier_get_users_with_permission (argument_list (identifier_obj) identifier_obj (call (identifier_get_full_perm) identifier_get_full_perm (argument_list (string_'owner') string_'owner' (identifier_obj) identifier_obj )argument_list )call )argument_list )call )for_in_clause )list_comprehension )return_statement )block )function_definition )module
Extract owners' ids.
(module (function_definition (function_name_gray2bin) function_name_gray2bin (parameters (identifier_G) identifier_G )parameters (block (return_statement (call (identifier_farray) identifier_farray (argument_list (list_comprehension (call (attribute (subscript (identifier_G) identifier_G (slice (identifier_i) identifier_i (colon) colon )slice )subscript (identifier_uxor) identifier_uxor )attribute (argument_list )argument_list )call (for_in_clause (pattern_list (identifier_i) identifier_i (identifier__) identifier__ )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_G) identifier_G )argument_list )call )for_in_clause )list_comprehension )argument_list )call )return_statement )block )function_definition )module
Convert a gray-coded vector into a binary-coded vector.
(module (function_definition (function_name_status) function_name_status (parameters (identifier_cls) identifier_cls )parameters (block (return_statement (call (attribute (identifier_cls) identifier_cls (identifier_json_get) identifier_json_get )attribute (argument_list (binary_operator (string_'%s/status') string_'%s/status' (attribute (identifier_cls) identifier_cls (identifier_api_url) identifier_api_url )attribute )binary_operator (keyword_argument (identifier_empty_key) identifier_empty_key (True) True )keyword_argument (keyword_argument (identifier_send_key) identifier_send_key (False) False )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Retrieve global status from status.gandi.net.
(module (function_definition (function_name_dirty) function_name_dirty (parameters (identifier_self) identifier_self )parameters (block (return_statement (boolean_operator (not_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_cachename) identifier_cachename )attribute )argument_list )call )not_operator (line_continuation_\) line_continuation_\ (parenthesized_expression (comparison_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_getmtime) identifier_getmtime )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_filename) identifier_filename )attribute )argument_list )call (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_getmtime) identifier_getmtime )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_cachename) identifier_cachename )attribute )argument_list )call )comparison_operator )parenthesized_expression )boolean_operator )return_statement )block )function_definition )module
True if the cache needs to be updated, False otherwise
(module (function_definition (function_name_get_my_ip) function_name_get_my_ip (parameters )parameters (block (expression_statement (assignment (identifier_ip) identifier_ip (subscript (call (attribute (call (attribute (identifier_subprocess) identifier_subprocess (identifier_check_output) identifier_check_output )attribute (argument_list (identifier_GET_IP_CMD) identifier_GET_IP_CMD (keyword_argument (identifier_shell) identifier_shell (True) True )keyword_argument )argument_list )call (identifier_decode) identifier_decode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call (slice (colon) colon (unary_operator (integer_1) integer_1 )unary_operator )slice )subscript )assignment )expression_statement (return_statement (call (attribute (identifier_ip) identifier_ip (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )return_statement )block )function_definition )module
Returns this computers IP address as a string.
(module (function_definition (function_name_sum) function_name_sum (parameters (identifier_self) identifier_self )parameters (block (return_statement (call (attribute (identifier_self) identifier_self (identifier__constructor) identifier__constructor )attribute (argument_list (call (attribute (attribute (identifier_self) identifier_self (identifier_values) identifier_values )attribute (identifier_sum) identifier_sum )attribute (argument_list (keyword_argument (identifier_axis) identifier_axis (attribute (identifier_self) identifier_self (identifier_baseaxes) identifier_baseaxes )attribute )keyword_argument (keyword_argument (identifier_keepdims) identifier_keepdims (True) True )keyword_argument )argument_list )call )argument_list )call )return_statement )block )function_definition )module
Compute the sum across records.
(module (function_definition (function_name_classify_catalog) function_name_classify_catalog (parameters (identifier_catalog) identifier_catalog )parameters (block (expression_statement (assignment (identifier_components) identifier_components (list )list )assignment )expression_statement (expression_statement (assignment (identifier_islands) identifier_islands (list )list )assignment )expression_statement (expression_statement (assignment (identifier_simples) identifier_simples (list )list )assignment )expression_statement (for_statement (identifier_source) identifier_source (identifier_catalog) identifier_catalog (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_source) identifier_source (identifier_OutputSource) identifier_OutputSource )argument_list )call (block (expression_statement (call (attribute (identifier_components) identifier_components (identifier_append) identifier_append )attribute (argument_list (identifier_source) identifier_source )argument_list )call )expression_statement )block (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_source) identifier_source (identifier_IslandSource) identifier_IslandSource )argument_list )call (block (expression_statement (call (attribute (identifier_islands) identifier_islands (identifier_append) identifier_append )attribute (argument_list (identifier_source) identifier_source )argument_list )call )expression_statement )block )elif_clause (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_source) identifier_source (identifier_SimpleSource) identifier_SimpleSource )argument_list )call (block (expression_statement (call (attribute (identifier_simples) identifier_simples (identifier_append) identifier_append )attribute (argument_list (identifier_source) identifier_source )argument_list )call )expression_statement )block )elif_clause )if_statement )block )for_statement (return_statement (expression_list (identifier_components) identifier_components (identifier_islands) identifier_islands (identifier_simples) identifier_simples )expression_list )return_statement )block )function_definition )module
Look at a list of sources and split them according to their class. Parameters ---------- catalog : iterable A list or iterable object of {SimpleSource, IslandSource, OutputSource} objects, possibly mixed. Any other objects will be silently ignored. Returns ------- components : list List of sources of type OutputSource islands : list List of sources of type IslandSource simples : list List of source of type SimpleSource
(module (function_definition (function_name_wrap_io_os_err) function_name_wrap_io_os_err (parameters (identifier_e) identifier_e )parameters (block (expression_statement (assignment (identifier_msg) identifier_msg (string_'') string_'' )assignment )expression_statement (if_statement (attribute (identifier_e) identifier_e (identifier_strerror) identifier_strerror )attribute (block (expression_statement (assignment (identifier_msg) identifier_msg (attribute (identifier_e) identifier_e (identifier_strerror) identifier_strerror )attribute )assignment )expression_statement )block )if_statement (if_statement (attribute (identifier_e) identifier_e (identifier_message) identifier_message )attribute (block (expression_statement (assignment (identifier_msg) identifier_msg (call (attribute (string_' ') string_' ' (identifier_join) identifier_join )attribute (argument_list (list (attribute (identifier_e) identifier_e (identifier_message) identifier_message )attribute (identifier_msg) identifier_msg )list )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (attribute (identifier_e) identifier_e (identifier_filename) identifier_filename )attribute (block (expression_statement (assignment (identifier_msg) identifier_msg (call (attribute (string_': ') string_': ' (identifier_join) identifier_join )attribute (argument_list (list (identifier_msg) identifier_msg (attribute (identifier_e) identifier_e (identifier_filename) identifier_filename )attribute )list )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (identifier_msg) identifier_msg )return_statement )block )function_definition )module
Formats IO and OS error messages for wrapping in FSQExceptions
(module (function_definition (function_name_get_userinfo) function_name_get_userinfo (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_wanted_fields) identifier_wanted_fields (list (string_"name") string_"name" (string_"mobile") string_"mobile" (string_"orgEmail") string_"orgEmail" (string_"position") string_"position" (string_"avatar") string_"avatar" )list )assignment )expression_statement (expression_statement (assignment (identifier_userinfo) identifier_userinfo (dictionary_comprehension (pair (identifier_k) identifier_k (call (attribute (attribute (identifier_self) identifier_self (identifier_json_response) identifier_json_response )attribute (identifier_get) identifier_get )attribute (argument_list (identifier_k) identifier_k (None) None )argument_list )call )pair (for_in_clause (identifier_k) identifier_k (identifier_wanted_fields) identifier_wanted_fields )for_in_clause )dictionary_comprehension )assignment )expression_statement (return_statement (identifier_userinfo) identifier_userinfo )return_statement )block )function_definition )module
Method to get current user's name, mobile, email and position.
(module (function_definition (function_name__format_postconditions) function_name__format_postconditions (parameters (typed_parameter (identifier_postconditions) identifier_postconditions (type (generic_type (identifier_List) identifier_List (type_parameter (type (attribute (identifier_icontract) identifier_icontract (identifier__Contract) identifier__Contract )attribute )type )type_parameter )generic_type )type )typed_parameter (typed_default_parameter (identifier_prefix) identifier_prefix (type (generic_type (identifier_Optional) identifier_Optional (type_parameter (type (identifier_str) identifier_str )type )type_parameter )generic_type )type (None) None )typed_default_parameter )parameters (type (generic_type (identifier_List) identifier_List (type_parameter (type (identifier_str) identifier_str )type )type_parameter )generic_type )type (block (if_statement (not_operator (identifier_postconditions) identifier_postconditions )not_operator (block (return_statement (list )list )return_statement )block )if_statement (expression_statement (assignment (identifier_result) identifier_result (list )list )assignment )expression_statement (if_statement (comparison_operator (identifier_prefix) identifier_prefix (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_result) identifier_result (identifier_append) identifier_append )attribute (argument_list (call (attribute (string_":{} ensures:") string_":{} ensures:" (identifier_format) identifier_format )attribute (argument_list (identifier_prefix) identifier_prefix )argument_list )call )argument_list )call )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_result) identifier_result (identifier_append) identifier_append )attribute (argument_list (string_":ensures:") string_":ensures:" )argument_list )call )expression_statement )block )else_clause )if_statement (for_statement (identifier_postcondition) identifier_postcondition (identifier_postconditions) identifier_postconditions (block (expression_statement (call (attribute (identifier_result) identifier_result (identifier_append) identifier_append )attribute (argument_list (call (attribute (string_" * {}") string_" * {}" (identifier_format) identifier_format )attribute (argument_list (call (identifier__format_contract) identifier__format_contract (argument_list (keyword_argument (identifier_contract) identifier_contract (identifier_postcondition) identifier_postcondition )keyword_argument )argument_list )call )argument_list )call )argument_list )call )expression_statement )block )for_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Format postconditions as reST. :param postconditions: postconditions of a function :param prefix: prefix to be prepended to ``:ensures:`` directive :return: list of lines describing the postconditions
(module (function_definition (function_name_register_instance) function_name_register_instance (parameters (identifier_self) identifier_self (identifier_instance) identifier_instance (default_parameter (identifier_allow_dotted_names) identifier_allow_dotted_names (False) False )default_parameter )parameters (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_instance) identifier_instance )attribute (identifier_instance) identifier_instance )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_allow_dotted_names) identifier_allow_dotted_names )attribute (identifier_allow_dotted_names) identifier_allow_dotted_names )assignment )expression_statement )block )function_definition )module
Registers an instance to respond to XML-RPC requests. Only one instance can be installed at a time. If the registered instance has a _dispatch method then that method will be called with the name of the XML-RPC method and its parameters as a tuple e.g. instance._dispatch('add',(2,3)) If the registered instance does not have a _dispatch method then the instance will be searched to find a matching method and, if found, will be called. Methods beginning with an '_' are considered private and will not be called by SimpleXMLRPCServer. If a registered function matches a XML-RPC request, then it will be called instead of the registered instance. If the optional allow_dotted_names argument is true and the instance does not have a _dispatch method, method names containing dots are supported and resolved, as long as none of the name segments start with an '_'. *** SECURITY WARNING: *** Enabling the allow_dotted_names options allows intruders to access your module's global variables and may allow intruders to execute arbitrary code on your machine. Only use this option on a secure, closed network.
(module (function_definition (function_name__get_url_hashes) function_name__get_url_hashes (parameters (identifier_path) identifier_path )parameters (block (expression_statement (assignment (identifier_urls) identifier_urls (call (identifier__read_text_file) identifier__read_text_file (argument_list (identifier_path) identifier_path )argument_list )call )assignment )expression_statement (function_definition (function_name_url_hash) function_name_url_hash (parameters (identifier_u) identifier_u )parameters (block (expression_statement (assignment (identifier_h) identifier_h (call (attribute (identifier_hashlib) identifier_hashlib (identifier_sha1) identifier_sha1 )attribute (argument_list )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_u) identifier_u (call (attribute (identifier_u) identifier_u (identifier_encode) identifier_encode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call )assignment )expression_statement )block (except_clause (identifier_UnicodeDecodeError) identifier_UnicodeDecodeError (block (expression_statement (call (attribute (identifier_logging) identifier_logging (identifier_error) identifier_error )attribute (argument_list (string_'Cannot hash url: %s') string_'Cannot hash url: %s' (identifier_u) identifier_u )argument_list )call )expression_statement )block )except_clause )try_statement (expression_statement (call (attribute (identifier_h) identifier_h (identifier_update) identifier_update )attribute (argument_list (identifier_u) identifier_u )argument_list )call )expression_statement (return_statement (call (attribute (identifier_h) identifier_h (identifier_hexdigest) identifier_hexdigest )attribute (argument_list )argument_list )call )return_statement )block )function_definition (return_statement (dictionary_comprehension (pair (call (identifier_url_hash) identifier_url_hash (argument_list (identifier_u) identifier_u )argument_list )call (True) True )pair (for_in_clause (identifier_u) identifier_u (identifier_urls) identifier_urls )for_in_clause )dictionary_comprehension )return_statement )block )function_definition )module
Get hashes of urls in file.
(module (function_definition (function_name_merge_paths) function_name_merge_paths (parameters (identifier_paths) identifier_paths (default_parameter (identifier_weights) identifier_weights (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_G) identifier_G (call (identifier_make_paths) identifier_make_paths (argument_list (identifier_paths) identifier_paths (keyword_argument (identifier_weights) identifier_weights (identifier_weights) identifier_weights )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_G) identifier_G (call (identifier_reduce_paths) identifier_reduce_paths (argument_list (identifier_G) identifier_G )argument_list )call )assignment )expression_statement (return_statement (identifier_G) identifier_G )return_statement )block )function_definition )module
Zip together sorted lists. >>> paths = [[1, 2, 3], [1, 3, 4], [2, 4, 5]] >>> G = merge_paths(paths) >>> nx.topological_sort(G) [1, 2, 3, 4, 5] >>> paths = [[1, 2, 3, 4], [1, 2, 3, 2, 4]] >>> G = merge_paths(paths, weights=(1, 2)) >>> nx.topological_sort(G) [1, 2, 3, 4]
(module (function_definition (function_name__calc_new_threshold) function_name__calc_new_threshold (parameters (identifier_self) identifier_self (identifier_score) identifier_score )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_threshold_mode) identifier_threshold_mode )attribute (string_'rel') string_'rel' )comparison_operator (block (expression_statement (assignment (identifier_abs_threshold_change) identifier_abs_threshold_change (binary_operator (attribute (identifier_self) identifier_self (identifier_threshold) identifier_threshold )attribute (identifier_score) identifier_score )binary_operator )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_abs_threshold_change) identifier_abs_threshold_change (attribute (identifier_self) identifier_self (identifier_threshold) identifier_threshold )attribute )assignment )expression_statement )block )else_clause )if_statement (if_statement (attribute (identifier_self) identifier_self (identifier_lower_is_better) identifier_lower_is_better )attribute (block (expression_statement (assignment (identifier_new_threshold) identifier_new_threshold (binary_operator (identifier_score) identifier_score (identifier_abs_threshold_change) identifier_abs_threshold_change )binary_operator )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_new_threshold) identifier_new_threshold (binary_operator (identifier_score) identifier_score (identifier_abs_threshold_change) identifier_abs_threshold_change )binary_operator )assignment )expression_statement )block )else_clause )if_statement (return_statement (identifier_new_threshold) identifier_new_threshold )return_statement )block )function_definition )module
Determine threshold based on score.
(module (function_definition (function_name_locked) function_name_locked (parameters (identifier_path) identifier_path (default_parameter (identifier_timeout) identifier_timeout (None) None )default_parameter )parameters (block (function_definition (function_name_decor) function_name_decor (parameters (identifier_func) identifier_func )parameters (block (decorated_definition (decorator (call (attribute (identifier_functools) identifier_functools (identifier_wraps) identifier_wraps )attribute (argument_list (identifier_func) identifier_func )argument_list )call )decorator (function_definition (function_name_wrapper) function_name_wrapper (parameters (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_lock) identifier_lock (call (identifier_FileLock) identifier_FileLock (argument_list (identifier_path) identifier_path (keyword_argument (identifier_timeout) identifier_timeout (identifier_timeout) identifier_timeout )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_lock) identifier_lock (identifier_acquire) identifier_acquire )attribute (argument_list )argument_list )call )expression_statement (try_statement (block (return_statement (call (identifier_func) identifier_func (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block (finally_clause (block (expression_statement (call (attribute (identifier_lock) identifier_lock (identifier_release) identifier_release )attribute (argument_list )argument_list )call )expression_statement )block )finally_clause )try_statement )block )function_definition )decorated_definition (return_statement (identifier_wrapper) identifier_wrapper )return_statement )block )function_definition (return_statement (identifier_decor) identifier_decor )return_statement )block )function_definition )module
Decorator which enables locks for decorated function. Arguments: - path: path for lockfile. - timeout (optional): Timeout for acquiring lock. Usage: @locked('/var/run/myname', timeout=0) def myname(...): ...
(module (function_definition (function_name_atlasdb_reset_zonefile_tried_storage) function_name_atlasdb_reset_zonefile_tried_storage (parameters (default_parameter (identifier_con) identifier_con (None) None )default_parameter (default_parameter (identifier_path) identifier_path (None) None )default_parameter )parameters (block (with_statement (with_clause (with_item (as_pattern (call (identifier_AtlasDBOpen) identifier_AtlasDBOpen (argument_list (keyword_argument (identifier_con) identifier_con (identifier_con) identifier_con )keyword_argument (keyword_argument (identifier_path) identifier_path (identifier_path) identifier_path )keyword_argument )argument_list )call (as_pattern_target (identifier_dbcon) identifier_dbcon )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (identifier_sql) identifier_sql (string_"UPDATE zonefiles SET tried_storage = ? WHERE present = ?;") string_"UPDATE zonefiles SET tried_storage = ? WHERE present = ?;" )assignment )expression_statement (expression_statement (assignment (identifier_args) identifier_args (tuple (integer_0) integer_0 (integer_0) integer_0 )tuple )assignment )expression_statement (expression_statement (assignment (identifier_cur) identifier_cur (call (attribute (identifier_dbcon) identifier_dbcon (identifier_cursor) identifier_cursor )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_res) identifier_res (call (identifier_atlasdb_query_execute) identifier_atlasdb_query_execute (argument_list (identifier_cur) identifier_cur (identifier_sql) identifier_sql (identifier_args) identifier_args )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_dbcon) identifier_dbcon (identifier_commit) identifier_commit )attribute (argument_list )argument_list )call )expression_statement )block )with_statement (return_statement (True) True )return_statement )block )function_definition )module
For zonefiles that we don't have, re-attempt to fetch them from storage.
(module (function_definition (function_name_Terminate) function_name_Terminate (parameters (identifier_self) identifier_self )parameters (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_lock) identifier_lock )attribute (identifier_acquire) identifier_acquire )attribute (argument_list )argument_list )call )expression_statement (try_statement (block (for_statement (identifier_bucket) identifier_bucket (call (attribute (attribute (identifier_self) identifier_self (identifier_connections) identifier_connections )attribute (identifier_values) identifier_values )attribute (argument_list )argument_list )call (block (try_statement (block (for_statement (identifier_conn) identifier_conn (identifier_bucket) identifier_bucket (block (expression_statement (call (attribute (identifier_conn) identifier_conn (identifier_lock) identifier_lock )attribute (argument_list )argument_list )call )expression_statement (try_statement (block (expression_statement (call (attribute (identifier_conn) identifier_conn (identifier_Close) identifier_Close )attribute (argument_list )argument_list )call )expression_statement )block (except_clause (identifier_Exception) identifier_Exception (block (pass_statement )pass_statement )block )except_clause )try_statement (expression_statement (call (attribute (identifier_conn) identifier_conn (identifier_release) identifier_release )attribute (argument_list )argument_list )call )expression_statement )block )for_statement )block (except_clause (identifier_Exception) identifier_Exception (block (pass_statement )pass_statement )block )except_clause )try_statement )block )for_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_connections) identifier_connections )attribute (dictionary )dictionary )assignment )expression_statement )block (finally_clause (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_lock) identifier_lock )attribute (identifier_release) identifier_release )attribute (argument_list )argument_list )call )expression_statement )block )finally_clause )try_statement )block )function_definition )module
Close all open connections Loop though all the connections and commit all queries and close all the connections. This should be called at the end of your application. @author: Nick Verbeck @since: 5/12/2008
(module (function_definition (function_name_end_namespace) function_name_end_namespace (parameters (identifier_self) identifier_self (identifier_prefix) identifier_prefix )parameters (block (delete_statement (subscript (attribute (identifier_self) identifier_self (identifier__ns) identifier__ns )attribute (identifier_prefix) identifier_prefix )subscript )delete_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__g) identifier__g )attribute (identifier_endPrefixMapping) identifier_endPrefixMapping )attribute (argument_list (identifier_prefix) identifier_prefix )argument_list )call )expression_statement )block )function_definition )module
Undeclare a namespace prefix.
(module (function_definition (function_name_place) function_name_place (parameters (identifier_self) identifier_self (identifier_value) identifier_value )parameters (block (if_statement (boolean_operator (parenthesized_expression (comparison_operator (identifier_value) identifier_value (None) None )comparison_operator )parenthesized_expression (parenthesized_expression (not_operator (comparison_operator (identifier_value) identifier_value (identifier_DG_C_PLACE) identifier_DG_C_PLACE )comparison_operator )not_operator )parenthesized_expression )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_"Unrecognized value for place: '%s'") string_"Unrecognized value for place: '%s'" (identifier_value) identifier_value )binary_operator )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier___place) identifier___place )attribute (identifier_value) identifier_value )assignment )expression_statement )block )function_definition )module
Set the place of articulation of the consonant. :param str value: the value to be set
(module (function_definition (function_name_set_handler) function_name_set_handler (parameters (identifier_self) identifier_self (identifier_language) identifier_language (identifier_obj) identifier_obj )parameters (block (if_statement (comparison_operator (identifier_obj) identifier_obj (None) None )comparison_operator (block (if_statement (comparison_operator (identifier_language) identifier_language (attribute (identifier_self) identifier_self (identifier__handlers) identifier__handlers )attribute )comparison_operator (block (delete_statement (subscript (attribute (identifier_self) identifier_self (identifier__handlers) identifier__handlers )attribute (identifier_language) identifier_language )subscript )delete_statement )block )if_statement )block (else_clause (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__handlers) identifier__handlers )attribute (identifier_language) identifier_language )subscript (identifier_obj) identifier_obj )assignment )expression_statement )block )else_clause )if_statement )block )function_definition )module
Define a custom language handler for RiveScript objects. Pass in a ``None`` value for the object to delete an existing handler (for example, to prevent Python code from being able to be run by default). Look in the ``eg`` folder of the rivescript-python distribution for an example script that sets up a JavaScript language handler. :param str language: The lowercased name of the programming language. Examples: python, javascript, perl :param class obj: An instance of an implementation class object. It should provide the following interface:: class MyObjectHandler: def __init__(self): pass def load(self, name, code): # name = the name of the object from the RiveScript code # code = the source code of the object def call(self, rs, name, fields): # rs = the current RiveScript interpreter object # name = the name of the object being called # fields = array of arguments passed to the object return reply
(module (function_definition (function_name_logged_command) function_name_logged_command (parameters (identifier_cmds) identifier_cmds )parameters (block (expression_statement (string_"helper function to log a command and then run it") string_"helper function to log a command and then run it" )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_info) identifier_info )attribute (argument_list (call (attribute (string_' ') string_' ' (identifier_join) identifier_join )attribute (argument_list (identifier_cmds) identifier_cmds )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_os) identifier_os (identifier_system) identifier_system )attribute (argument_list (call (attribute (string_' ') string_' ' (identifier_join) identifier_join )attribute (argument_list (identifier_cmds) identifier_cmds )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
helper function to log a command and then run it
(module (function_definition (function_name_extras_msg) function_name_extras_msg (parameters (identifier_extras) identifier_extras )parameters (block (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_extras) identifier_extras )argument_list )call (integer_1) integer_1 )comparison_operator (block (expression_statement (assignment (identifier_verb) identifier_verb (string_"was") string_"was" )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_verb) identifier_verb (string_"were") string_"were" )assignment )expression_statement )block )else_clause )if_statement (return_statement (expression_list (call (attribute (string_", ") string_", " (identifier_join) identifier_join )attribute (generator_expression (call (identifier_repr) identifier_repr (argument_list (identifier_extra) identifier_extra )argument_list )call (for_in_clause (identifier_extra) identifier_extra (identifier_extras) identifier_extras )for_in_clause )generator_expression )call (identifier_verb) identifier_verb )expression_list )return_statement )block )function_definition )module
Create an error message for extra items or properties.
(module (function_definition (function_name_accept_key) function_name_accept_key (parameters (identifier_pki_dir) identifier_pki_dir (identifier_pub) identifier_pub (identifier_id_) identifier_id_ )parameters (block (for_statement (identifier_key_dir) identifier_key_dir (expression_list (string_'minions') string_'minions' (string_'minions_pre') string_'minions_pre' (string_'minions_rejected') string_'minions_rejected' )expression_list (block (expression_statement (assignment (identifier_key_path) identifier_key_path (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_pki_dir) identifier_pki_dir (identifier_key_dir) identifier_key_dir )argument_list )call )assignment )expression_statement (if_statement (not_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_key_path) identifier_key_path )argument_list )call )not_operator (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_makedirs) identifier_makedirs )attribute (argument_list (identifier_key_path) identifier_key_path )argument_list )call )expression_statement )block )if_statement )block )for_statement (expression_statement (assignment (identifier_key) identifier_key (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_pki_dir) identifier_pki_dir (string_'minions') string_'minions' (identifier_id_) identifier_id_ )argument_list )call )assignment )expression_statement (with_statement (with_clause (with_item (as_pattern (call (attribute (attribute (attribute (identifier_salt) identifier_salt (identifier_utils) identifier_utils )attribute (identifier_files) identifier_files )attribute (identifier_fopen) identifier_fopen )attribute (argument_list (identifier_key) identifier_key (string_'w+') string_'w+' )argument_list )call (as_pattern_target (identifier_fp_) identifier_fp_ )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_fp_) identifier_fp_ (identifier_write) identifier_write )attribute (argument_list (call (attribute (attribute (attribute (identifier_salt) identifier_salt (identifier_utils) identifier_utils )attribute (identifier_stringutils) identifier_stringutils )attribute (identifier_to_str) identifier_to_str )attribute (argument_list (identifier_pub) identifier_pub )argument_list )call )argument_list )call )expression_statement )block )with_statement (expression_statement (assignment (identifier_oldkey) identifier_oldkey (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_pki_dir) identifier_pki_dir (string_'minions_pre') string_'minions_pre' (identifier_id_) identifier_id_ )argument_list )call )assignment )expression_statement (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isfile) identifier_isfile )attribute (argument_list (identifier_oldkey) identifier_oldkey )argument_list )call (block (with_statement (with_clause (with_item (as_pattern (call (attribute (attribute (attribute (identifier_salt) identifier_salt (identifier_utils) identifier_utils )attribute (identifier_files) identifier_files )attribute (identifier_fopen) identifier_fopen )attribute (argument_list (identifier_oldkey) identifier_oldkey )argument_list )call (as_pattern_target (identifier_fp_) identifier_fp_ )as_pattern_target )as_pattern )with_item )with_clause (block (if_statement (comparison_operator (call (attribute (identifier_fp_) identifier_fp_ (identifier_read) identifier_read )attribute (argument_list )argument_list )call (identifier_pub) identifier_pub )comparison_operator (block (expression_statement (call (attribute (identifier_os) identifier_os (identifier_remove) identifier_remove )attribute (argument_list (identifier_oldkey) identifier_oldkey )argument_list )call )expression_statement )block )if_statement )block )with_statement )block )if_statement )block )function_definition )module
If the master config was available then we will have a pki_dir key in the opts directory, this method places the pub key in the accepted keys dir and removes it from the unaccepted keys dir if that is the case.
(module (function_definition (function_name_save) function_name_save (parameters (identifier_self) identifier_self (identifier_session_file) identifier_session_file (default_parameter (identifier_verbose) identifier_verbose (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_PARAMS) identifier_PARAMS (dictionary (pair (string_"file") string_"file" (identifier_session_file) identifier_session_file )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_response) identifier_response (call (identifier_api) identifier_api (argument_list (keyword_argument (identifier_url) identifier_url (binary_operator (attribute (identifier_self) identifier_self (identifier___url) identifier___url )attribute (string_"/save") string_"/save" )binary_operator )keyword_argument (keyword_argument (identifier_PARAMS) identifier_PARAMS (identifier_PARAMS) identifier_PARAMS )keyword_argument (keyword_argument (identifier_verbose) identifier_verbose (identifier_verbose) identifier_verbose )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (identifier_response) identifier_response )return_statement )block )function_definition )module
Saves the current session to an existing file, which will be replaced. If this is a new session that has not been saved yet, use 'save as' instead. :param session_file: The path to the file where the current session must be saved to. :param verbose: print more
(module (function_definition (function_name_list_sku_versions) function_name_list_sku_versions (parameters (identifier_access_token) identifier_access_token (identifier_subscription_id) identifier_subscription_id (identifier_location) identifier_location (identifier_publisher) identifier_publisher (identifier_offer) identifier_offer (identifier_sku) identifier_sku )parameters (block (expression_statement (assignment (identifier_endpoint) identifier_endpoint (call (attribute (string_'') string_'' (identifier_join) identifier_join )attribute (argument_list (list (call (identifier_get_rm_endpoint) identifier_get_rm_endpoint (argument_list )argument_list )call (string_'/subscriptions/') string_'/subscriptions/' (identifier_subscription_id) identifier_subscription_id (string_'/providers/Microsoft.Compute/') string_'/providers/Microsoft.Compute/' (string_'locations/') string_'locations/' (identifier_location) identifier_location (string_'/publishers/') string_'/publishers/' (identifier_publisher) identifier_publisher (string_'/artifacttypes/vmimage/offers/') string_'/artifacttypes/vmimage/offers/' (identifier_offer) identifier_offer (string_'/skus/') string_'/skus/' (identifier_sku) identifier_sku (string_'/versions?api-version=') string_'/versions?api-version=' (identifier_COMP_API) identifier_COMP_API )list )argument_list )call )assignment )expression_statement (return_statement (call (identifier_do_get) identifier_do_get (argument_list (identifier_endpoint) identifier_endpoint (identifier_access_token) identifier_access_token )argument_list )call )return_statement )block )function_definition )module
List available versions for a given publisher's sku. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. location (str): Azure data center location. E.g. westus. publisher (str): VM image publisher. E.g. MicrosoftWindowsServer. offer (str): VM image offer. E.g. WindowsServer. sku (str): VM image sku. E.g. 2016-Datacenter. Returns: HTTP response with JSON list of versions.
(module (function_definition (function_name_namespace_to_dict) function_name_namespace_to_dict (parameters (identifier_obj) identifier_obj )parameters (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_obj) identifier_obj (tuple (attribute (identifier_argparse) identifier_argparse (identifier_Namespace) identifier_Namespace )attribute (attribute (identifier_optparse) identifier_optparse (identifier_Values) identifier_Values )attribute )tuple )argument_list )call (block (return_statement (call (identifier_vars) identifier_vars (argument_list (identifier_obj) identifier_obj )argument_list )call )return_statement )block )if_statement (return_statement (identifier_obj) identifier_obj )return_statement )block )function_definition )module
If obj is argparse.Namespace or optparse.Values we'll return a dict representation of it, else return the original object. Redefine this method if using other parsers. :param obj: * :return: :rtype: dict or *
(module (function_definition (function_name_add_barplot) function_name_add_barplot (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_cats) identifier_cats (call (identifier_OrderedDict) identifier_OrderedDict (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_cats) identifier_cats (string_'n_nondups') string_'n_nondups' )subscript (dictionary (pair (string_'name') string_'name' (string_'Non-duplicates') string_'Non-duplicates' )pair )dictionary )assignment )expression_statement (expression_statement (assignment (subscript (identifier_cats) identifier_cats (string_'n_dups') string_'n_dups' )subscript (dictionary (pair (string_'name') string_'name' (string_'Duplicates') string_'Duplicates' )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_pconfig) identifier_pconfig (dictionary (pair (string_'id') string_'id' (string_'samblaster_duplicates') string_'samblaster_duplicates' )pair (pair (string_'title') string_'title' (string_'Samblaster: Number of duplicate reads') string_'Samblaster: Number of duplicate reads' )pair (pair (string_'ylab') string_'ylab' (string_'Number of reads') string_'Number of reads' )pair )dictionary )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_add_section) identifier_add_section )attribute (argument_list (keyword_argument (identifier_plot) identifier_plot (call (attribute (identifier_bargraph) identifier_bargraph (identifier_plot) identifier_plot )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_samblaster_data) identifier_samblaster_data )attribute (identifier_cats) identifier_cats (identifier_pconfig) identifier_pconfig )argument_list )call )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
Generate the Samblaster bar plot.
(module (function_definition (function_name_space_labels) function_name_space_labels (parameters (identifier_document) identifier_document )parameters (block (for_statement (identifier_label) identifier_label (call (attribute (identifier_document) identifier_document (identifier_xpath) identifier_xpath )attribute (argument_list (string_'.//bold') string_'.//bold' )argument_list )call (block (if_statement (boolean_operator (not_operator (attribute (identifier_label) identifier_label (identifier_text) identifier_text )attribute )not_operator (not_operator (call (attribute (identifier_re) identifier_re (identifier_match) identifier_match )attribute (argument_list (string_'^\(L?\d\d?[a-z]?\):?$') string_'^\(L?\d\d?[a-z]?\):?$' (attribute (identifier_label) identifier_label (identifier_text) identifier_text )attribute (attribute (identifier_re) identifier_re (identifier_I) identifier_I )attribute )argument_list )call )not_operator )boolean_operator (block (continue_statement )continue_statement )block )if_statement (expression_statement (assignment (identifier_parent) identifier_parent (call (attribute (identifier_label) identifier_label (identifier_getparent) identifier_getparent )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_previous) identifier_previous (call (attribute (identifier_label) identifier_label (identifier_getprevious) identifier_getprevious )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_previous) identifier_previous (None) None )comparison_operator (block (expression_statement (assignment (identifier_text) identifier_text (boolean_operator (attribute (identifier_parent) identifier_parent (identifier_text) identifier_text )attribute (string_'') string_'' )boolean_operator )assignment )expression_statement (if_statement (not_operator (call (attribute (identifier_text) identifier_text (identifier_endswith) identifier_endswith )attribute (argument_list (string_' ') string_' ' )argument_list )call )not_operator (block (expression_statement (assignment (attribute (identifier_parent) identifier_parent (identifier_text) identifier_text )attribute (binary_operator (identifier_text) identifier_text (string_' ') string_' ' )binary_operator )assignment )expression_statement )block )if_statement )block (else_clause (block (expression_statement (assignment (identifier_text) identifier_text (boolean_operator (attribute (identifier_previous) identifier_previous (identifier_tail) identifier_tail )attribute (string_'') string_'' )boolean_operator )assignment )expression_statement (if_statement (not_operator (call (attribute (identifier_text) identifier_text (identifier_endswith) identifier_endswith )attribute (argument_list (string_' ') string_' ' )argument_list )call )not_operator (block (expression_statement (assignment (attribute (identifier_previous) identifier_previous (identifier_tail) identifier_tail )attribute (binary_operator (identifier_text) identifier_text (string_' ') string_' ' )binary_operator )assignment )expression_statement )block )if_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_text) identifier_text (boolean_operator (attribute (identifier_label) identifier_label (identifier_tail) identifier_tail )attribute (string_'') string_'' )boolean_operator )assignment )expression_statement (if_statement (not_operator (call (attribute (identifier_text) identifier_text (identifier_endswith) identifier_endswith )attribute (argument_list (string_' ') string_' ' )argument_list )call )not_operator (block (expression_statement (assignment (attribute (identifier_label) identifier_label (identifier_tail) identifier_tail )attribute (binary_operator (identifier_text) identifier_text (string_' ') string_' ' )binary_operator )assignment )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_document) identifier_document )return_statement )block )function_definition )module
Ensure space around bold compound labels.
(module (function_definition (function_name_field_types) function_name_field_types (parameters (identifier_self) identifier_self )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier__field_types) identifier__field_types )attribute (None) None )comparison_operator (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__field_types) identifier__field_types )attribute (call (identifier_FieldTypeList) identifier_FieldTypeList (argument_list (attribute (identifier_self) identifier_self (identifier__version) identifier__version )attribute (keyword_argument (identifier_assistant_sid) identifier_assistant_sid (subscript (attribute (identifier_self) identifier_self (identifier__solution) identifier__solution )attribute (string_'sid') string_'sid' )subscript )keyword_argument )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (attribute (identifier_self) identifier_self (identifier__field_types) identifier__field_types )attribute )return_statement )block )function_definition )module
Access the field_types :returns: twilio.rest.autopilot.v1.assistant.field_type.FieldTypeList :rtype: twilio.rest.autopilot.v1.assistant.field_type.FieldTypeList
(module (function_definition (function_name_get_fields) function_name_get_fields (parameters (identifier_model_class) identifier_model_class )parameters (block (return_statement (list_comprehension (identifier_attr) identifier_attr (for_in_clause (pattern_list (identifier_attr) identifier_attr (identifier_value) identifier_value )pattern_list (call (attribute (attribute (identifier_model_class) identifier_model_class (identifier___dict__) identifier___dict__ )attribute (identifier_items) identifier_items )attribute (argument_list )argument_list )call )for_in_clause (if_clause (call (identifier_issubclass) identifier_issubclass (argument_list (call (identifier_type) identifier_type (argument_list (identifier_value) identifier_value )argument_list )call (tuple (attribute (attribute (identifier_mongo) identifier_mongo (identifier_base) identifier_base )attribute (identifier_BaseField) identifier_BaseField )attribute (attribute (identifier_mongo) identifier_mongo (identifier_EmbeddedDocumentField) identifier_EmbeddedDocumentField )attribute )tuple )argument_list )call )if_clause )list_comprehension )return_statement )block )function_definition )module
Pass in a mongo model class and extract all the attributes which are mongoengine fields Returns: list of strings of field attributes
(module (function_definition (function_name_visit) function_name_visit (parameters (identifier_self) identifier_self (identifier_node) identifier_node )parameters (block (expression_statement (assignment (identifier_method) identifier_method (call (identifier_getattr) identifier_getattr (argument_list (identifier_self) identifier_self (binary_operator (string_'visit_') string_'visit_' (attribute (identifier_node) identifier_node (identifier_expr_name) identifier_expr_name )attribute )binary_operator (attribute (identifier_self) identifier_self (identifier_generic_visit) identifier_generic_visit )attribute )argument_list )call )assignment )expression_statement (try_statement (block (return_statement (call (identifier_method) identifier_method (argument_list (identifier_node) identifier_node (list_comprehension (call (attribute (identifier_self) identifier_self (identifier_visit) identifier_visit )attribute (argument_list (identifier_child) identifier_child )argument_list )call (for_in_clause (identifier_child) identifier_child (call (identifier_reversed) identifier_reversed (argument_list (call (identifier_list) identifier_list (argument_list (identifier_node) identifier_node )argument_list )call )argument_list )call )for_in_clause )list_comprehension )argument_list )call )return_statement )block (except_clause (tuple (identifier_VisitationError) identifier_VisitationError (identifier_UndefinedLabel) identifier_UndefinedLabel )tuple (block (raise_statement )raise_statement )block )except_clause (except_clause (attribute (identifier_self) identifier_self (identifier_unwrapped_exceptions) identifier_unwrapped_exceptions )attribute (block (raise_statement )raise_statement )block )except_clause (except_clause (identifier_Exception) identifier_Exception (block (expression_statement (assignment (pattern_list (identifier_exc_class) identifier_exc_class (identifier_exc) identifier_exc (identifier_traceback) identifier_traceback )pattern_list (call (identifier_exc_info) identifier_exc_info (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_reraise) identifier_reraise (argument_list (identifier_VisitationError) identifier_VisitationError (call (identifier_VisitationError) identifier_VisitationError (argument_list (identifier_exc) identifier_exc (identifier_exc_class) identifier_exc_class (identifier_node) identifier_node )argument_list )call (identifier_traceback) identifier_traceback )argument_list )call )expression_statement )block )except_clause )try_statement )block )function_definition )module
See the ``NodeVisitor`` visit method. This just changes the order in which we visit nonterminals from right to left to left to right.
(module (function_definition (function_name_on_ok) function_name_on_ok (parameters (identifier_self) identifier_self (identifier_sender) identifier_sender )parameters (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (binary_operator (string_"in on_ok with sender %s") string_"in on_ok with sender %s" (identifier_sender) identifier_sender )binary_operator )argument_list )call )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_sender) identifier_sender (attribute (identifier_self) identifier_self (identifier_ion_task) identifier_ion_task )attribute )comparison_operator (not_operator (attribute (identifier_self) identifier_self (identifier_transfer_done) identifier_transfer_done )attribute )not_operator )boolean_operator (block (expression_statement (assignment (identifier_ion_structure) identifier_ion_structure (call (attribute (attribute (identifier_self) identifier_self (identifier_ion_task) identifier_ion_task )attribute (identifier_get_final_structure) identifier_get_final_structure )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_ioncell_task) identifier_ioncell_task )attribute (identifier__change_structure) identifier__change_structure )attribute (argument_list (identifier_ion_structure) identifier_ion_structure )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_transfer_done) identifier_transfer_done )attribute (True) True )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_ioncell_task) identifier_ioncell_task )attribute (identifier_unlock) identifier_unlock )attribute (argument_list (keyword_argument (identifier_source_node) identifier_source_node (identifier_self) identifier_self )keyword_argument )argument_list )call )expression_statement )block (elif_clause (boolean_operator (comparison_operator (identifier_sender) identifier_sender (attribute (identifier_self) identifier_self (identifier_ioncell_task) identifier_ioncell_task )attribute )comparison_operator (attribute (identifier_self) identifier_self (identifier_target_dilatmx) identifier_target_dilatmx )attribute )boolean_operator (block (expression_statement (assignment (identifier_actual_dilatmx) identifier_actual_dilatmx (call (attribute (attribute (identifier_self) identifier_self (identifier_ioncell_task) identifier_ioncell_task )attribute (identifier_get_inpvar) identifier_get_inpvar )attribute (argument_list (string_'dilatmx') string_'dilatmx' (float_1.) float_1. )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_target_dilatmx) identifier_target_dilatmx )attribute (identifier_actual_dilatmx) identifier_actual_dilatmx )comparison_operator (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_ioncell_task) identifier_ioncell_task )attribute (identifier_reduce_dilatmx) identifier_reduce_dilatmx )attribute (argument_list (keyword_argument (identifier_target) identifier_target (attribute (identifier_self) identifier_self (identifier_target_dilatmx) identifier_target_dilatmx )attribute )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_history) identifier_history )attribute (identifier_info) identifier_info )attribute (argument_list (call (attribute (string_'Converging dilatmx. Value reduce from {} to {}.') string_'Converging dilatmx. Value reduce from {} to {}.' (identifier_format) identifier_format )attribute (argument_list (identifier_actual_dilatmx) identifier_actual_dilatmx (call (attribute (attribute (identifier_self) identifier_self (identifier_ioncell_task) identifier_ioncell_task )attribute (identifier_get_inpvar) identifier_get_inpvar )attribute (argument_list (string_'dilatmx') string_'dilatmx' )argument_list )call )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_ioncell_task) identifier_ioncell_task )attribute (identifier_reset_from_scratch) identifier_reset_from_scratch )attribute (argument_list )argument_list )call )expression_statement )block )if_statement )block )elif_clause )if_statement (return_statement (call (attribute (call (identifier_super) identifier_super (argument_list )argument_list )call (identifier_on_ok) identifier_on_ok )attribute (argument_list (identifier_sender) identifier_sender )argument_list )call )return_statement )block )function_definition )module
This callback is called when one task reaches status S_OK. If sender == self.ion_task, we update the initial structure used by self.ioncell_task and we unlock it so that the job can be submitted.
(module (function_definition (function_name_compile_delete) function_name_compile_delete (parameters (identifier_self) identifier_self (identifier_query) identifier_query )parameters (block (expression_statement (assignment (identifier_table) identifier_table (call (attribute (identifier_self) identifier_self (identifier_wrap_table) identifier_wrap_table )attribute (argument_list (attribute (identifier_query) identifier_query (identifier_from__) identifier_from__ )attribute )argument_list )call )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (identifier_query) identifier_query (identifier_wheres) identifier_wheres )attribute (identifier_list) identifier_list )argument_list )call (block (expression_statement (assignment (identifier_wheres) identifier_wheres (call (attribute (identifier_self) identifier_self (identifier__compile_wheres) identifier__compile_wheres )attribute (argument_list (identifier_query) identifier_query )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_wheres) identifier_wheres (string_"") string_"" )assignment )expression_statement )block )else_clause )if_statement (if_statement (attribute (identifier_query) identifier_query (identifier_joins) identifier_joins )attribute (block (expression_statement (assignment (identifier_joins) identifier_joins (binary_operator (string_" %s") string_" %s" (call (attribute (identifier_self) identifier_self (identifier__compile_joins) identifier__compile_joins )attribute (argument_list (identifier_query) identifier_query (attribute (identifier_query) identifier_query (identifier_joins) identifier_joins )attribute )argument_list )call )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_sql) identifier_sql (binary_operator (string_"DELETE %s FROM %s%s %s") string_"DELETE %s FROM %s%s %s" (tuple (identifier_table) identifier_table (identifier_table) identifier_table (identifier_joins) identifier_joins (identifier_wheres) identifier_wheres )tuple )binary_operator )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_sql) identifier_sql (binary_operator (string_"DELETE FROM %s %s") string_"DELETE FROM %s %s" (tuple (identifier_table) identifier_table (identifier_wheres) identifier_wheres )tuple )binary_operator )assignment )expression_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_sql) identifier_sql (call (attribute (identifier_sql) identifier_sql (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (attribute (identifier_query) identifier_query (identifier_orders) identifier_orders )attribute (block (expression_statement (augmented_assignment (identifier_sql) identifier_sql (binary_operator (string_" %s") string_" %s" (call (attribute (identifier_self) identifier_self (identifier__compile_orders) identifier__compile_orders )attribute (argument_list (identifier_query) identifier_query (attribute (identifier_query) identifier_query (identifier_orders) identifier_orders )attribute )argument_list )call )binary_operator )augmented_assignment )expression_statement )block )if_statement (if_statement (attribute (identifier_query) identifier_query (identifier_limit_) identifier_limit_ )attribute (block (expression_statement (augmented_assignment (identifier_sql) identifier_sql (binary_operator (string_" %s") string_" %s" (call (attribute (identifier_self) identifier_self (identifier__compile_limit) identifier__compile_limit )attribute (argument_list (identifier_query) identifier_query (attribute (identifier_query) identifier_query (identifier_limit_) identifier_limit_ )attribute )argument_list )call )binary_operator )augmented_assignment )expression_statement )block )if_statement (return_statement (identifier_sql) identifier_sql )return_statement )block )function_definition )module
Compile a delete statement into SQL :param query: A QueryBuilder instance :type query: QueryBuilder :return: The compiled update :rtype: str
(module (function_definition (function_name_dir_import_table) function_name_dir_import_table (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_import_header) identifier_import_header (subscript (call (identifier_list) identifier_list (argument_list (attribute (identifier_self) identifier_self (identifier_optional_data_directories) identifier_optional_data_directories )attribute )argument_list )call (integer_1) integer_1 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_import_offset) identifier_import_offset (call (attribute (identifier_self) identifier_self (identifier_resolve_rva) identifier_resolve_rva )attribute (argument_list (attribute (identifier_import_header) identifier_import_header (identifier_VirtualAddress) identifier_VirtualAddress )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_i) identifier_i (integer_0) integer_0 )assignment )expression_statement (while_statement (True) True (block (expression_statement (assignment (identifier_offset) identifier_offset (binary_operator (identifier_import_offset) identifier_import_offset (binary_operator (identifier_i) identifier_i (call (attribute (identifier_Import_DirectoryTable) identifier_Import_DirectoryTable (identifier_get_size) identifier_get_size )attribute (argument_list )argument_list )call )binary_operator )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_idt) identifier_idt (call (identifier_Import_DirectoryTable) identifier_Import_DirectoryTable (argument_list (attribute (identifier_self) identifier_self (identifier_stream) identifier_stream )attribute (identifier_offset) identifier_offset (identifier_self) identifier_self )argument_list )call )assignment )expression_statement (if_statement (call (attribute (identifier_idt) identifier_idt (identifier_is_empty) identifier_is_empty )attribute (argument_list )argument_list )call (block (break_statement )break_statement )block (else_clause (block (expression_statement (yield (identifier_idt) identifier_idt )yield )expression_statement )block )else_clause )if_statement (expression_statement (augmented_assignment (identifier_i) identifier_i (integer_1) integer_1 )augmented_assignment )expression_statement )block )while_statement )block )function_definition )module
import table is terminated by a all-null entry, so we have to check for that
(module (function_definition (function_name_set_contents_from_filename) function_name_set_contents_from_filename (parameters (identifier_self) identifier_self (identifier_filename) identifier_filename (default_parameter (identifier_headers) identifier_headers (None) None )default_parameter (default_parameter (identifier_replace) identifier_replace (True) True )default_parameter (default_parameter (identifier_cb) identifier_cb (None) None )default_parameter (default_parameter (identifier_num_cb) identifier_num_cb (integer_10) integer_10 )default_parameter (default_parameter (identifier_policy) identifier_policy (None) None )default_parameter (default_parameter (identifier_md5) identifier_md5 (None) None )default_parameter (default_parameter (identifier_reduced_redundancy) identifier_reduced_redundancy (False) False )default_parameter (default_parameter (identifier_encrypt_key) identifier_encrypt_key (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_fp) identifier_fp (call (identifier_open) identifier_open (argument_list (identifier_filename) identifier_filename (string_'rb') string_'rb' )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_set_contents_from_file) identifier_set_contents_from_file )attribute (argument_list (identifier_fp) identifier_fp (identifier_headers) identifier_headers (identifier_replace) identifier_replace (identifier_cb) identifier_cb (identifier_num_cb) identifier_num_cb (identifier_policy) identifier_policy (identifier_md5) identifier_md5 (identifier_reduced_redundancy) identifier_reduced_redundancy (keyword_argument (identifier_encrypt_key) identifier_encrypt_key (identifier_encrypt_key) identifier_encrypt_key )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_fp) identifier_fp (identifier_close) identifier_close )attribute (argument_list )argument_list )call )expression_statement )block )function_definition )module
Store an object in S3 using the name of the Key object as the key in S3 and the contents of the file named by 'filename'. See set_contents_from_file method for details about the parameters. :type filename: string :param filename: The name of the file that you want to put onto S3 :type headers: dict :param headers: Additional headers to pass along with the request to AWS. :type replace: bool :param replace: If True, replaces the contents of the file if it already exists. :type cb: function :param cb: a callback function that will be called to report progress on the upload. The callback should accept two integer parameters, the first representing the number of bytes that have been successfully transmitted to S3 and the second representing the size of the to be transmitted object. :type cb: int :param num_cb: (optional) If a callback is specified with the cb parameter this parameter determines the granularity of the callback by defining the maximum number of times the callback will be called during the file transfer. :type policy: :class:`boto.s3.acl.CannedACLStrings` :param policy: A canned ACL policy that will be applied to the new key in S3. :type md5: A tuple containing the hexdigest version of the MD5 checksum of the file as the first element and the Base64-encoded version of the plain checksum as the second element. This is the same format returned by the compute_md5 method. :param md5: If you need to compute the MD5 for any reason prior to upload, it's silly to have to do it twice so this param, if present, will be used as the MD5 values of the file. Otherwise, the checksum will be computed. :type reduced_redundancy: bool :param reduced_redundancy: If True, this will set the storage class of the new Key to be REDUCED_REDUNDANCY. The Reduced Redundancy Storage (RRS) feature of S3, provides lower redundancy at lower storage cost. :type encrypt_key: bool :param encrypt_key: If True, the new copy of the object will be encrypted on the server-side by S3 and will be stored in an encrypted form while at rest in S3.
(module (function_definition (function_name_link_href) function_name_link_href (parameters (identifier_self) identifier_self (identifier_rel) identifier_rel )parameters (block (expression_statement (assignment (identifier_link) identifier_link (call (attribute (identifier_self) identifier_self (identifier_link) identifier_link )attribute (argument_list (identifier_rel) identifier_rel )argument_list )call )assignment )expression_statement (if_statement (parenthesized_expression (comparison_operator (identifier_link) identifier_link (None) None )comparison_operator )parenthesized_expression (block (expression_statement (assignment (identifier_link) identifier_link (subscript (identifier_link) identifier_link (string_'href') string_'href' )subscript )assignment )expression_statement )block )if_statement (return_statement (parenthesized_expression (identifier_link) identifier_link )parenthesized_expression )return_statement )block )function_definition )module
Look for link with specified rel, return href from it or None.
(module (function_definition (function_name_to_frequencyseries) function_name_to_frequencyseries (parameters (identifier_self) identifier_self (default_parameter (identifier_delta_f) identifier_delta_f (None) None )default_parameter )parameters (block (import_from_statement (dotted_name (identifier_pycbc) identifier_pycbc (identifier_fft) identifier_fft )dotted_name (dotted_name (identifier_fft) identifier_fft )dotted_name )import_from_statement (if_statement (not_operator (identifier_delta_f) identifier_delta_f )not_operator (block (expression_statement (assignment (identifier_delta_f) identifier_delta_f (binary_operator (float_1.0) float_1.0 (attribute (identifier_self) identifier_self (identifier_duration) identifier_duration )attribute )binary_operator )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_tlen) identifier_tlen (call (identifier_int) identifier_int (argument_list (binary_operator (binary_operator (binary_operator (float_1.0) float_1.0 (identifier_delta_f) identifier_delta_f )binary_operator (attribute (identifier_self) identifier_self (identifier_delta_t) identifier_delta_t )attribute )binary_operator (float_0.5) float_0.5 )binary_operator )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_flen) identifier_flen (call (identifier_int) identifier_int (argument_list (binary_operator (binary_operator (identifier_tlen) identifier_tlen (integer_2) integer_2 )binary_operator (integer_1) integer_1 )binary_operator )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_tlen) identifier_tlen (call (identifier_len) identifier_len (argument_list (identifier_self) identifier_self )argument_list )call )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (concatenated_string (string_"The value of delta_f (%s) would be ") string_"The value of delta_f (%s) would be " (string_"undersampled. Maximum delta_f ") string_"undersampled. Maximum delta_f " (string_"is %s.") string_"is %s." )concatenated_string (tuple (identifier_delta_f) identifier_delta_f (binary_operator (float_1.0) float_1.0 (attribute (identifier_self) identifier_self (identifier_duration) identifier_duration )attribute )binary_operator )tuple )binary_operator )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (identifier_delta_f) identifier_delta_f )not_operator (block (expression_statement (assignment (identifier_tmp) identifier_tmp (identifier_self) identifier_self )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_tmp) identifier_tmp (call (identifier_TimeSeries) identifier_TimeSeries (argument_list (call (identifier_zeros) identifier_zeros (argument_list (identifier_tlen) identifier_tlen (keyword_argument (identifier_dtype) identifier_dtype (attribute (identifier_self) identifier_self (identifier_dtype) identifier_dtype )attribute )keyword_argument )argument_list )call (keyword_argument (identifier_delta_t) identifier_delta_t (attribute (identifier_self) identifier_self (identifier_delta_t) identifier_delta_t )attribute )keyword_argument (keyword_argument (identifier_epoch) identifier_epoch (attribute (identifier_self) identifier_self (identifier_start_time) identifier_start_time )attribute )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_tmp) identifier_tmp (slice (colon) colon (call (identifier_len) identifier_len (argument_list (identifier_self) identifier_self )argument_list )call )slice )subscript (subscript (identifier_self) identifier_self (slice (colon) colon )slice )subscript )assignment )expression_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_f) identifier_f (call (identifier_FrequencySeries) identifier_FrequencySeries (argument_list (call (identifier_zeros) identifier_zeros (argument_list (identifier_flen) identifier_flen (keyword_argument (identifier_dtype) identifier_dtype (call (identifier_complex_same_precision_as) identifier_complex_same_precision_as (argument_list (identifier_self) identifier_self )argument_list )call )keyword_argument )argument_list )call (keyword_argument (identifier_delta_f) identifier_delta_f (identifier_delta_f) identifier_delta_f )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_fft) identifier_fft (argument_list (identifier_tmp) identifier_tmp (identifier_f) identifier_f )argument_list )call )expression_statement (return_statement (identifier_f) identifier_f )return_statement )block )function_definition )module
Return the Fourier transform of this time series Parameters ---------- delta_f : {None, float}, optional The frequency resolution of the returned frequency series. By default the resolution is determined by the duration of the timeseries. Returns ------- FrequencySeries: The fourier transform of this time series.
(module (function_definition (function_name_fw_retry_failures_delete) function_name_fw_retry_failures_delete (parameters (identifier_self) identifier_self )parameters (block (for_statement (identifier_tenant_id) identifier_tenant_id (attribute (identifier_self) identifier_self (identifier_fwid_attr) identifier_fwid_attr )attribute (block (try_statement (block (with_statement (with_clause (with_item (attribute (subscript (attribute (identifier_self) identifier_self (identifier_fwid_attr) identifier_fwid_attr )attribute (identifier_tenant_id) identifier_tenant_id )subscript (identifier_mutex_lock) identifier_mutex_lock )attribute )with_item )with_clause (block (expression_statement (assignment (identifier_fw_data) identifier_fw_data (call (attribute (identifier_self) identifier_self (identifier_get_fw_by_tenant_id) identifier_get_fw_by_tenant_id )attribute (argument_list (identifier_tenant_id) identifier_tenant_id )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_fw_data) identifier_fw_data (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_LOG) identifier_LOG (identifier_info) identifier_info )attribute (argument_list (string_"No FW for tenant %s") string_"No FW for tenant %s" (identifier_tenant_id) identifier_tenant_id )argument_list )call )expression_statement (continue_statement )continue_statement )block )if_statement (expression_statement (assignment (identifier_result) identifier_result (subscript (call (attribute (call (attribute (identifier_fw_data) identifier_fw_data (identifier_get) identifier_get )attribute (argument_list (string_'result') string_'result' )argument_list )call (identifier_split) identifier_split )attribute (argument_list (string_'(') string_'(' )argument_list )call (integer_0) integer_0 )subscript )assignment )expression_statement (if_statement (comparison_operator (identifier_result) identifier_result (attribute (identifier_fw_constants) identifier_fw_constants (identifier_RESULT_FW_DELETE_INIT) identifier_RESULT_FW_DELETE_INIT )attribute )comparison_operator (block (expression_statement (assignment (identifier_fw_dict) identifier_fw_dict (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier_fwid_attr) identifier_fwid_attr )attribute (identifier_tenant_id) identifier_tenant_id )subscript (identifier_get_fw_dict) identifier_get_fw_dict )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_fw_dict) identifier_fw_dict )not_operator (block (expression_statement (assignment (identifier_fw_dict) identifier_fw_dict (call (attribute (identifier_self) identifier_self (identifier_fill_fw_dict_from_db) identifier_fill_fw_dict_from_db )attribute (argument_list (identifier_fw_data) identifier_fw_data )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_retry_failure_fab_dev_delete) identifier_retry_failure_fab_dev_delete )attribute (argument_list (identifier_tenant_id) identifier_tenant_id (identifier_fw_data) identifier_fw_data (identifier_fw_dict) identifier_fw_dict )argument_list )call )expression_statement )block )if_statement )block )with_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_exc) identifier_exc )as_pattern_target )as_pattern (block (expression_statement (call (attribute (identifier_LOG) identifier_LOG (identifier_error) identifier_error )attribute (argument_list (string_"Exception in retry failure delete %s") string_"Exception in retry failure delete %s" (call (identifier_str) identifier_str (argument_list (identifier_exc) identifier_exc )argument_list )call )argument_list )call )expression_statement )block )except_clause )try_statement )block )for_statement )block )function_definition )module
This routine is called for retrying the delete cases.
(module (function_definition (function_name__find_plugin_dir) function_name__find_plugin_dir (parameters (identifier_module_type) identifier_module_type )parameters (block (for_statement (identifier_install_dir) identifier_install_dir (call (identifier__get_plugin_install_dirs) identifier__get_plugin_install_dirs (argument_list )argument_list )call (block (expression_statement (assignment (identifier_candidate) identifier_candidate (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_install_dir) identifier_install_dir (identifier_module_type) identifier_module_type )argument_list )call )assignment )expression_statement (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isdir) identifier_isdir )attribute (argument_list (identifier_candidate) identifier_candidate )argument_list )call (block (return_statement (identifier_candidate) identifier_candidate )return_statement )block )if_statement )block (else_clause (block (raise_statement (call (identifier_PluginCandidateError) identifier_PluginCandidateError (argument_list (call (attribute (string_'No plugin found for `{}` module in paths:\n{}') string_'No plugin found for `{}` module in paths:\n{}' (identifier_format) identifier_format )attribute (argument_list (identifier_module_type) identifier_module_type (call (attribute (string_'\n') string_'\n' (identifier_join) identifier_join )attribute (argument_list (call (identifier__get_plugin_install_dirs) identifier__get_plugin_install_dirs (argument_list )argument_list )call )argument_list )call )argument_list )call )argument_list )call )raise_statement )block )else_clause )for_statement )block )function_definition )module
Find the directory containing the plugin definition for the given type. Do this by searching all the paths where plugins can live for a dir that matches the type name.
(module (function_definition (function_name_subs2seqs) function_name_subs2seqs (parameters (identifier_self) identifier_self )parameters (type (generic_type (identifier_Dict) identifier_Dict (type_parameter (type (identifier_str) identifier_str )type (type (generic_type (identifier_List) identifier_List (type_parameter (type (identifier_str) identifier_str )type )type_parameter )generic_type )type )type_parameter )generic_type )type (block (expression_statement (assignment (identifier_subs2seqs) identifier_subs2seqs (call (attribute (identifier_collections) identifier_collections (identifier_defaultdict) identifier_defaultdict )attribute (argument_list (identifier_list) identifier_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_nodes) identifier_nodes (call (identifier_find) identifier_find (argument_list (call (attribute (identifier_self) identifier_self (identifier_find) identifier_find )attribute (argument_list (string_'sequences') string_'sequences' )argument_list )call (string_'node') string_'node' )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_nodes) identifier_nodes (None) None )comparison_operator (block (for_statement (identifier_seq) identifier_seq (identifier_nodes) identifier_nodes (block (expression_statement (call (attribute (subscript (identifier_subs2seqs) identifier_subs2seqs (string_'node') string_'node' )subscript (identifier_append) identifier_append )attribute (argument_list (call (identifier_strip) identifier_strip (argument_list (attribute (identifier_seq) identifier_seq (identifier_tag) identifier_tag )attribute )argument_list )call )argument_list )call )expression_statement )block )for_statement )block )if_statement (return_statement (identifier_subs2seqs) identifier_subs2seqs )return_statement )block )function_definition )module
A |collections.defaultdict| containing the node-specific information provided by XML `sequences` element. >>> from hydpy.auxs.xmltools import XMLInterface >>> from hydpy import data >>> interface = XMLInterface('single_run.xml', data.get_path('LahnH')) >>> series_io = interface.series_io >>> subs2seqs = series_io.writers[2].subs2seqs >>> for subs, seq in sorted(subs2seqs.items()): ... print(subs, seq) node ['sim', 'obs']
(module (function_definition (function_name_main) function_name_main (parameters (identifier_reactor) identifier_reactor )parameters (block (expression_statement (assignment (identifier_control_ep) identifier_control_ep (call (identifier_UNIXClientEndpoint) identifier_UNIXClientEndpoint (argument_list (identifier_reactor) identifier_reactor (string_'/var/run/tor/control') string_'/var/run/tor/control' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_tor) identifier_tor (yield (call (attribute (identifier_txtorcon) identifier_txtorcon (identifier_connect) identifier_connect )attribute (argument_list (identifier_reactor) identifier_reactor (identifier_control_ep) identifier_control_ep )argument_list )call )yield )assignment )expression_statement (expression_statement (assignment (identifier_state) identifier_state (yield (call (attribute (identifier_tor) identifier_tor (identifier_create_state) identifier_create_state )attribute (argument_list )argument_list )call )yield )assignment )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (string_"Closing all circuits:") string_"Closing all circuits:" )argument_list )call )expression_statement (for_statement (identifier_circuit) identifier_circuit (call (identifier_list) identifier_list (argument_list (call (attribute (attribute (identifier_state) identifier_state (identifier_circuits) identifier_circuits )attribute (identifier_values) identifier_values )attribute (argument_list )argument_list )call )argument_list )call (block (expression_statement (assignment (identifier_path) identifier_path (call (attribute (string_'->') string_'->' (identifier_join) identifier_join )attribute (argument_list (call (identifier_map) identifier_map (argument_list (lambda (lambda_parameters (identifier_r) identifier_r )lambda_parameters (attribute (identifier_r) identifier_r (identifier_id_hex) identifier_id_hex )attribute )lambda (attribute (identifier_circuit) identifier_circuit (identifier_path) identifier_path )attribute )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (string_"Circuit {} through {}") string_"Circuit {} through {}" (identifier_format) identifier_format )attribute (argument_list (attribute (identifier_circuit) identifier_circuit (identifier_id) identifier_id )attribute (identifier_path) identifier_path )argument_list )call )argument_list )call )expression_statement (for_statement (identifier_stream) identifier_stream (attribute (identifier_circuit) identifier_circuit (identifier_streams) identifier_streams )attribute (block (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (string_" Stream {} to {}") string_" Stream {} to {}" (identifier_format) identifier_format )attribute (argument_list (attribute (identifier_stream) identifier_stream (identifier_id) identifier_id )attribute (attribute (identifier_stream) identifier_stream (identifier_target_host) identifier_target_host )attribute )argument_list )call )argument_list )call )expression_statement (expression_statement (yield (call (attribute (identifier_stream) identifier_stream (identifier_close) identifier_close )attribute (argument_list )argument_list )call )yield )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (string_" closed") string_" closed" )argument_list )call )expression_statement )block )for_statement (expression_statement (yield (call (attribute (identifier_circuit) identifier_circuit (identifier_close) identifier_close )attribute (argument_list )argument_list )call )yield )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (string_"closed") string_"closed" )argument_list )call )expression_statement )block )for_statement (expression_statement (yield (call (attribute (identifier_tor) identifier_tor (identifier_quit) identifier_quit )attribute (argument_list )argument_list )call )yield )expression_statement )block )function_definition )module
Close all open streams and circuits in the Tor we connect to
(module (function_definition (function_name_result_type) function_name_result_type (parameters (list_splat_pattern (identifier_arrays_and_dtypes) identifier_arrays_and_dtypes )list_splat_pattern )parameters (block (expression_statement (assignment (identifier_types) identifier_types (set_comprehension (attribute (call (attribute (identifier_np) identifier_np (identifier_result_type) identifier_result_type )attribute (argument_list (identifier_t) identifier_t )argument_list )call (identifier_type) identifier_type )attribute (for_in_clause (identifier_t) identifier_t (identifier_arrays_and_dtypes) identifier_arrays_and_dtypes )for_in_clause )set_comprehension )assignment )expression_statement (for_statement (pattern_list (identifier_left) identifier_left (identifier_right) identifier_right )pattern_list (identifier_PROMOTE_TO_OBJECT) identifier_PROMOTE_TO_OBJECT (block (if_statement (parenthesized_expression (boolean_operator (call (identifier_any) identifier_any (generator_expression (call (identifier_issubclass) identifier_issubclass (argument_list (identifier_t) identifier_t (identifier_left) identifier_left )argument_list )call (for_in_clause (identifier_t) identifier_t (identifier_types) identifier_types )for_in_clause )generator_expression )call (call (identifier_any) identifier_any (generator_expression (call (identifier_issubclass) identifier_issubclass (argument_list (identifier_t) identifier_t (identifier_right) identifier_right )argument_list )call (for_in_clause (identifier_t) identifier_t (identifier_types) identifier_types )for_in_clause )generator_expression )call )boolean_operator )parenthesized_expression (block (return_statement (call (attribute (identifier_np) identifier_np (identifier_dtype) identifier_dtype )attribute (argument_list (identifier_object) identifier_object )argument_list )call )return_statement )block )if_statement )block )for_statement (return_statement (call (attribute (identifier_np) identifier_np (identifier_result_type) identifier_result_type )attribute (argument_list (list_splat (identifier_arrays_and_dtypes) identifier_arrays_and_dtypes )list_splat )argument_list )call )return_statement )block )function_definition )module
Like np.result_type, but with type promotion rules matching pandas. Examples of changed behavior: number + string -> object (not string) bytes + unicode -> object (not unicode) Parameters ---------- *arrays_and_dtypes : list of arrays and dtypes The dtype is extracted from both numpy and dask arrays. Returns ------- numpy.dtype for the result.
(module (function_definition (function_name_mouseDown) function_name_mouseDown (parameters (identifier_self) identifier_self (identifier_button) identifier_button )parameters (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_debug) identifier_debug )attribute (argument_list (string_'mouseDown %s') string_'mouseDown %s' (identifier_button) identifier_button )argument_list )call )expression_statement (expression_statement (augmented_assignment (attribute (identifier_self) identifier_self (identifier_buttons) identifier_buttons )attribute (binary_operator (integer_1) integer_1 (parenthesized_expression (binary_operator (identifier_button) identifier_button (integer_1) integer_1 )binary_operator )parenthesized_expression )binary_operator )augmented_assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_pointerEvent) identifier_pointerEvent )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_x) identifier_x )attribute (attribute (identifier_self) identifier_self (identifier_y) identifier_y )attribute (keyword_argument (identifier_buttonmask) identifier_buttonmask (attribute (identifier_self) identifier_self (identifier_buttons) identifier_buttons )attribute )keyword_argument )argument_list )call )expression_statement (return_statement (identifier_self) identifier_self )return_statement )block )function_definition )module
Send a mouse button down at the last set position button: int: [1-n]
(module (function_definition (function_name_backward) function_name_backward (parameters (identifier_self) identifier_self (identifier_loss) identifier_loss )parameters (block (with_statement (with_clause (with_item (call (attribute (attribute (identifier_mx) identifier_mx (identifier_autograd) identifier_autograd )attribute (identifier_record) identifier_record )attribute (argument_list )argument_list )call )with_item )with_clause (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_loss) identifier_loss (tuple (identifier_tuple) identifier_tuple (identifier_list) identifier_list )tuple )argument_list )call (block (expression_statement (assignment (identifier_ls) identifier_ls (list_comprehension (binary_operator (identifier_l) identifier_l (attribute (attribute (identifier_self) identifier_self (identifier__scaler) identifier__scaler )attribute (identifier_loss_scale) identifier_loss_scale )attribute )binary_operator (for_in_clause (identifier_l) identifier_l (identifier_loss) identifier_loss )for_in_clause )list_comprehension )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_ls) identifier_ls (binary_operator (identifier_loss) identifier_loss (attribute (attribute (identifier_self) identifier_self (identifier__scaler) identifier__scaler )attribute (identifier_loss_scale) identifier_loss_scale )attribute )binary_operator )assignment )expression_statement )block )else_clause )if_statement )block )with_statement (expression_statement (call (attribute (attribute (identifier_mx) identifier_mx (identifier_autograd) identifier_autograd )attribute (identifier_backward) identifier_backward )attribute (argument_list (identifier_ls) identifier_ls )argument_list )call )expression_statement )block )function_definition )module
backward propagation with loss
(module (function_definition (function_name_isSquare) function_name_isSquare (parameters (identifier_matrix) identifier_matrix )parameters (block (try_statement (block (try_statement (block (expression_statement (assignment (pattern_list (identifier_dim1) identifier_dim1 (identifier_dim2) identifier_dim2 )pattern_list (attribute (identifier_matrix) identifier_matrix (identifier_shape) identifier_shape )attribute )assignment )expression_statement )block (except_clause (identifier_AttributeError) identifier_AttributeError (block (expression_statement (assignment (pattern_list (identifier_dim1) identifier_dim1 (identifier_dim2) identifier_dim2 )pattern_list (attribute (call (attribute (identifier__np) identifier__np (identifier_array) identifier_array )attribute (argument_list (identifier_matrix) identifier_matrix )argument_list )call (identifier_shape) identifier_shape )attribute )assignment )expression_statement )block )except_clause )try_statement )block (except_clause (identifier_ValueError) identifier_ValueError (block (return_statement (False) False )return_statement )block )except_clause )try_statement (if_statement (comparison_operator (identifier_dim1) identifier_dim1 (identifier_dim2) identifier_dim2 )comparison_operator (block (return_statement (True) True )return_statement )block )if_statement (return_statement (False) False )return_statement )block )function_definition )module
Check that ``matrix`` is square. Returns ======= is_square : bool ``True`` if ``matrix`` is square, ``False`` otherwise.
(module (function_definition (function_name_write) function_name_write (parameters (identifier_self) identifier_self (identifier_data) identifier_data (default_parameter (identifier_params) identifier_params (None) None )default_parameter (default_parameter (identifier_expected_response_code) identifier_expected_response_code (integer_204) integer_204 )default_parameter (default_parameter (identifier_protocol) identifier_protocol (string_'json') string_'json' )default_parameter )parameters (block (expression_statement (assignment (identifier_headers) identifier_headers (attribute (identifier_self) identifier_self (identifier__headers) identifier__headers )attribute )assignment )expression_statement (expression_statement (assignment (subscript (identifier_headers) identifier_headers (string_'Content-Type') string_'Content-Type' )subscript (string_'application/octet-stream') string_'application/octet-stream' )assignment )expression_statement (if_statement (identifier_params) identifier_params (block (expression_statement (assignment (identifier_precision) identifier_precision (call (attribute (identifier_params) identifier_params (identifier_get) identifier_get )attribute (argument_list (string_'precision') string_'precision' )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_precision) identifier_precision (None) None )assignment )expression_statement )block )else_clause )if_statement (if_statement (comparison_operator (identifier_protocol) identifier_protocol (string_'json') string_'json' )comparison_operator (block (expression_statement (assignment (identifier_data) identifier_data (call (attribute (call (identifier_make_lines) identifier_make_lines (argument_list (identifier_data) identifier_data (identifier_precision) identifier_precision )argument_list )call (identifier_encode) identifier_encode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call )assignment )expression_statement )block (elif_clause (comparison_operator (identifier_protocol) identifier_protocol (string_'line') string_'line' )comparison_operator (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_data) identifier_data (identifier_str) identifier_str )argument_list )call (block (expression_statement (assignment (identifier_data) identifier_data (list (identifier_data) identifier_data )list )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_data) identifier_data (call (attribute (parenthesized_expression (binary_operator (call (attribute (string_'\n') string_'\n' (identifier_join) identifier_join )attribute (argument_list (identifier_data) identifier_data )argument_list )call (string_'\n') string_'\n' )binary_operator )parenthesized_expression (identifier_encode) identifier_encode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call )assignment )expression_statement )block )elif_clause )if_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_request) identifier_request )attribute (argument_list (keyword_argument (identifier_url) identifier_url (string_"write") string_"write" )keyword_argument (keyword_argument (identifier_method) identifier_method (string_'POST') string_'POST' )keyword_argument (keyword_argument (identifier_params) identifier_params (identifier_params) identifier_params )keyword_argument (keyword_argument (identifier_data) identifier_data (identifier_data) identifier_data )keyword_argument (keyword_argument (identifier_expected_response_code) identifier_expected_response_code (identifier_expected_response_code) identifier_expected_response_code )keyword_argument (keyword_argument (identifier_headers) identifier_headers (identifier_headers) identifier_headers )keyword_argument )argument_list )call )expression_statement (return_statement (True) True )return_statement )block )function_definition )module
Write data to InfluxDB. :param data: the data to be written :type data: (if protocol is 'json') dict (if protocol is 'line') sequence of line protocol strings or single string :param params: additional parameters for the request, defaults to None :type params: dict :param expected_response_code: the expected response code of the write operation, defaults to 204 :type expected_response_code: int :param protocol: protocol of input data, either 'json' or 'line' :type protocol: str :returns: True, if the write operation is successful :rtype: bool
(module (function_definition (function_name_GetUnscannedSubNode) function_name_GetUnscannedSubNode (parameters (identifier_self) identifier_self )parameters (block (if_statement (boolean_operator (not_operator (attribute (identifier_self) identifier_self (identifier_sub_nodes) identifier_sub_nodes )attribute )not_operator (not_operator (attribute (identifier_self) identifier_self (identifier_scanned) identifier_scanned )attribute )not_operator )boolean_operator (block (return_statement (identifier_self) identifier_self )return_statement )block )if_statement (for_statement (identifier_sub_node) identifier_sub_node (attribute (identifier_self) identifier_self (identifier_sub_nodes) identifier_sub_nodes )attribute (block (expression_statement (assignment (identifier_result) identifier_result (call (attribute (identifier_sub_node) identifier_sub_node (identifier_GetUnscannedSubNode) identifier_GetUnscannedSubNode )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (identifier_result) identifier_result (block (return_statement (identifier_result) identifier_result )return_statement )block )if_statement )block )for_statement (return_statement (None) None )return_statement )block )function_definition )module
Retrieves the first unscanned sub node. Returns: SourceScanNode: sub scan node or None if not available.
(module (function_definition (function_name_addAnnotationsSearchOptions) function_name_addAnnotationsSearchOptions (parameters (identifier_parser) identifier_parser )parameters (block (expression_statement (call (identifier_addAnnotationSetIdArgument) identifier_addAnnotationSetIdArgument (argument_list (identifier_parser) identifier_parser )argument_list )call )expression_statement (expression_statement (call (identifier_addReferenceNameArgument) identifier_addReferenceNameArgument (argument_list (identifier_parser) identifier_parser )argument_list )call )expression_statement (expression_statement (call (identifier_addReferenceIdArgument) identifier_addReferenceIdArgument (argument_list (identifier_parser) identifier_parser )argument_list )call )expression_statement (expression_statement (call (identifier_addStartArgument) identifier_addStartArgument (argument_list (identifier_parser) identifier_parser )argument_list )call )expression_statement (expression_statement (call (identifier_addEndArgument) identifier_addEndArgument (argument_list (identifier_parser) identifier_parser )argument_list )call )expression_statement (expression_statement (call (identifier_addEffectsArgument) identifier_addEffectsArgument (argument_list (identifier_parser) identifier_parser )argument_list )call )expression_statement (expression_statement (call (identifier_addPageSizeArgument) identifier_addPageSizeArgument (argument_list (identifier_parser) identifier_parser )argument_list )call )expression_statement )block )function_definition )module
Adds common options to a annotation searches command line parser.
(module (function_definition (function_name_guess_pygments_highlighter) function_name_guess_pygments_highlighter (parameters (identifier_filename) identifier_filename )parameters (block (try_statement (block (import_from_statement (dotted_name (identifier_pygments) identifier_pygments (identifier_lexers) identifier_lexers )dotted_name (dotted_name (identifier_get_lexer_for_filename) identifier_get_lexer_for_filename )dotted_name (dotted_name (identifier_get_lexer_by_name) identifier_get_lexer_by_name )dotted_name )import_from_statement )block (except_clause (identifier_Exception) identifier_Exception (block (return_statement (identifier_TextSH) identifier_TextSH )return_statement )block )except_clause )try_statement (expression_statement (assignment (pattern_list (identifier_root) identifier_root (identifier_ext) identifier_ext )pattern_list (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_splitext) identifier_splitext )attribute (argument_list (identifier_filename) identifier_filename )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_ext) identifier_ext (identifier_custom_extension_lexer_mapping) identifier_custom_extension_lexer_mapping )comparison_operator (block (try_statement (block (expression_statement (assignment (identifier_lexer) identifier_lexer (call (identifier_get_lexer_by_name) identifier_get_lexer_by_name (argument_list (subscript (identifier_custom_extension_lexer_mapping) identifier_custom_extension_lexer_mapping (identifier_ext) identifier_ext )subscript )argument_list )call )assignment )expression_statement )block (except_clause (identifier_Exception) identifier_Exception (block (return_statement (identifier_TextSH) identifier_TextSH )return_statement )block )except_clause )try_statement )block (else_clause (block (try_statement (block (expression_statement (assignment (identifier_lexer) identifier_lexer (call (identifier_get_lexer_for_filename) identifier_get_lexer_for_filename (argument_list (identifier_filename) identifier_filename )argument_list )call )assignment )expression_statement )block (except_clause (identifier_Exception) identifier_Exception (block (return_statement (identifier_TextSH) identifier_TextSH )return_statement )block )except_clause )try_statement )block )else_clause )if_statement (class_definition (identifier_GuessedPygmentsSH) identifier_GuessedPygmentsSH (argument_list (identifier_PygmentsSH) identifier_PygmentsSH )argument_list (block (expression_statement (assignment (identifier__lexer) identifier__lexer (identifier_lexer) identifier_lexer )assignment )expression_statement )block )class_definition (return_statement (identifier_GuessedPygmentsSH) identifier_GuessedPygmentsSH )return_statement )block )function_definition )module
Factory to generate syntax highlighter for the given filename. If a syntax highlighter is not available for a particular file, this function will attempt to generate one based on the lexers in Pygments. If Pygments is not available or does not have an appropriate lexer, TextSH will be returned instead.
(module (function_definition (function_name_close_cursor) function_name_close_cursor (parameters (identifier_self) identifier_self (identifier_cursor_id) identifier_cursor_id (default_parameter (identifier_address) identifier_address (None) None )default_parameter )parameters (block (expression_statement (call (attribute (identifier_warnings) identifier_warnings (identifier_warn) identifier_warn )attribute (argument_list (string_"close_cursor is deprecated.") string_"close_cursor is deprecated." (identifier_DeprecationWarning) identifier_DeprecationWarning (keyword_argument (identifier_stacklevel) identifier_stacklevel (integer_2) integer_2 )keyword_argument )argument_list )call )expression_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_cursor_id) identifier_cursor_id (identifier_integer_types) identifier_integer_types )argument_list )call )not_operator (block (raise_statement (call (identifier_TypeError) identifier_TypeError (argument_list (string_"cursor_id must be an instance of (int, long)") string_"cursor_id must be an instance of (int, long)" )argument_list )call )raise_statement )block )if_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__close_cursor) identifier__close_cursor )attribute (argument_list (identifier_cursor_id) identifier_cursor_id (identifier_address) identifier_address )argument_list )call )expression_statement )block )function_definition )module
DEPRECATED - Send a kill cursors message soon with the given id. Raises :class:`TypeError` if `cursor_id` is not an instance of ``(int, long)``. What closing the cursor actually means depends on this client's cursor manager. This method may be called from a :class:`~pymongo.cursor.Cursor` destructor during garbage collection, so it isn't safe to take a lock or do network I/O. Instead, we schedule the cursor to be closed soon on a background thread. :Parameters: - `cursor_id`: id of cursor to close - `address` (optional): (host, port) pair of the cursor's server. If it is not provided, the client attempts to close the cursor on the primary or standalone, or a mongos server. .. versionchanged:: 3.7 Deprecated. .. versionchanged:: 3.0 Added ``address`` parameter.
(module (function_definition (function_name_analyse) function_name_analyse (parameters (identifier_self) identifier_self (identifier_path_and_filename) identifier_path_and_filename (identifier_pattern) identifier_pattern )parameters (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_path_and_filename) identifier_path_and_filename )argument_list )call (as_pattern_target (identifier_handle) identifier_handle )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (identifier_content) identifier_content (call (attribute (identifier_handle) identifier_handle (identifier_read) identifier_read )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_loc) identifier_loc (binary_operator (call (attribute (identifier_content) identifier_content (identifier_count) identifier_count )attribute (argument_list (string_'\n') string_'\n' )argument_list )call (integer_1) integer_1 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_com) identifier_com (integer_0) integer_0 )assignment )expression_statement (for_statement (identifier_match) identifier_match (call (attribute (identifier_re) identifier_re (identifier_findall) identifier_findall )attribute (argument_list (identifier_pattern) identifier_pattern (identifier_content) identifier_content (attribute (identifier_re) identifier_re (identifier_DOTALL) identifier_DOTALL )attribute )argument_list )call (block (expression_statement (augmented_assignment (identifier_com) identifier_com (binary_operator (call (attribute (identifier_match) identifier_match (identifier_count) identifier_count )attribute (argument_list (string_'\n') string_'\n' )argument_list )call (integer_1) integer_1 )binary_operator )augmented_assignment )expression_statement )block )for_statement (return_statement (expression_list (call (identifier_max) identifier_max (argument_list (integer_0) integer_0 (binary_operator (identifier_loc) identifier_loc (identifier_com) identifier_com )binary_operator )argument_list )call (identifier_com) identifier_com )expression_list )return_statement )block )with_statement )block )function_definition )module
Find out lines of code and lines of comments. Args: path_and_filename (str): path and filename to parse for loc and com. pattern (str): regex to search for line commens and block comments Returns: int, int: loc and com for given file.
(module (function_definition (function_name_fist) function_name_fist (parameters )parameters (type (identifier_Histogram1D) identifier_Histogram1D )type (block (import_statement (aliased_import (dotted_name (identifier_numpy) identifier_numpy )dotted_name (identifier_np) identifier_np )aliased_import )import_statement (import_from_statement (relative_import (import_prefix )import_prefix (dotted_name (identifier_histogram1d) identifier_histogram1d )dotted_name )relative_import (dotted_name (identifier_Histogram1D) identifier_Histogram1D )dotted_name )import_from_statement (expression_statement (assignment (identifier_widths) identifier_widths (list (integer_0) integer_0 (float_1.2) float_1.2 (float_0.2) float_0.2 (integer_1) integer_1 (float_0.1) float_0.1 (integer_1) integer_1 (float_0.1) float_0.1 (float_0.9) float_0.9 (float_0.1) float_0.1 (float_0.8) float_0.8 )list )assignment )expression_statement (expression_statement (assignment (identifier_edges) identifier_edges (call (attribute (identifier_np) identifier_np (identifier_cumsum) identifier_cumsum )attribute (argument_list (identifier_widths) identifier_widths )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_heights) identifier_heights (binary_operator (call (attribute (identifier_np) identifier_np (identifier_asarray) identifier_asarray )attribute (argument_list (list (integer_4) integer_4 (integer_1) integer_1 (float_7.5) float_7.5 (integer_6) integer_6 (float_7.6) float_7.6 (integer_6) integer_6 (float_7.5) float_7.5 (integer_6) integer_6 (float_7.2) float_7.2 )list )argument_list )call (integer_5) integer_5 )binary_operator )assignment )expression_statement (return_statement (call (identifier_Histogram1D) identifier_Histogram1D (argument_list (identifier_edges) identifier_edges (identifier_heights) identifier_heights (keyword_argument (identifier_axis_name) identifier_axis_name (string_"Is this a fist?") string_"Is this a fist?" )keyword_argument (keyword_argument (identifier_title) identifier_title (string_"Physt \"logo\"") string_"Physt \"logo\"" )keyword_argument )argument_list )call )return_statement )block )function_definition )module
A simple histogram in the shape of a fist.
(module (function_definition (function_name_get_prefix) function_name_get_prefix (parameters (identifier_self) identifier_self (identifier_form) identifier_form (identifier_name) identifier_name )parameters (block (return_statement (call (attribute (string_'{form_prefix}{prefix_name}-{field_name}') string_'{form_prefix}{prefix_name}-{field_name}' (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_form_prefix) identifier_form_prefix (conditional_expression (binary_operator (attribute (identifier_form) identifier_form (identifier_prefix) identifier_prefix )attribute (string_'-') string_'-' )binary_operator (attribute (identifier_form) identifier_form (identifier_prefix) identifier_prefix )attribute (string_'') string_'' )conditional_expression )keyword_argument (keyword_argument (identifier_prefix_name) identifier_prefix_name (attribute (identifier_self) identifier_self (identifier_prefix_name) identifier_prefix_name )attribute )keyword_argument (keyword_argument (identifier_field_name) identifier_field_name (identifier_name) identifier_name )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Return the prefix that is used for the formset.
(module (function_definition (function_name_connection) function_name_connection (parameters (identifier_self) identifier_self (identifier_connection) identifier_connection )parameters (block (if_statement (comparison_operator (identifier_connection) identifier_connection (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_connection) identifier_connection (identifier_subscribe) identifier_subscribe )attribute (argument_list (string_"capacity") string_"capacity" (attribute (identifier_self) identifier_self (identifier__on_capacity_data) identifier__on_capacity_data )attribute )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_connection) identifier_connection (identifier_default_return_capacity) identifier_default_return_capacity )attribute (True) True )assignment )expression_statement )block )if_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier__connection) identifier__connection )attribute (None) None )comparison_operator (block (expression_statement (call (attribute (identifier_connection) identifier_connection (identifier_unsubscribe) identifier_unsubscribe )attribute (argument_list (string_"capacity") string_"capacity" (attribute (identifier_self) identifier_self (identifier__on_capacity_data) identifier__on_capacity_data )attribute )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__connection) identifier__connection )attribute (identifier_connection) identifier_connection )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__cloudwatch_connection) identifier__cloudwatch_connection )attribute (None) None )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_cached_descriptions) identifier_cached_descriptions )attribute (dictionary )dictionary )assignment )expression_statement )block )function_definition )module
Change the dynamo connection
(module (function_definition (function_name_parse) function_name_parse (parameters (typed_parameter (identifier_input_) identifier_input_ (type (generic_type (identifier_Union) identifier_Union (type_parameter (type (identifier_str) identifier_str )type (type (identifier_FileStream) identifier_FileStream )type )type_parameter )generic_type )type )typed_parameter (typed_parameter (identifier_source) identifier_source (type (identifier_str) identifier_str )type )typed_parameter )parameters (type (generic_type (identifier_Optional) identifier_Optional (type_parameter (type (identifier_str) identifier_str )type )type_parameter )generic_type )type (block (expression_statement (assignment (identifier_error_listener) identifier_error_listener (call (identifier_ParseErrorListener) identifier_ParseErrorListener (argument_list )argument_list )call )assignment )expression_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_input_) identifier_input_ (identifier_FileStream) identifier_FileStream )argument_list )call )not_operator (block (expression_statement (assignment (identifier_input_) identifier_input_ (call (identifier_InputStream) identifier_InputStream (argument_list (identifier_input_) identifier_input_ )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_lexer) identifier_lexer (call (identifier_jsgLexer) identifier_jsgLexer (argument_list (identifier_input_) identifier_input_ )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_lexer) identifier_lexer (identifier_addErrorListener) identifier_addErrorListener )attribute (argument_list (identifier_error_listener) identifier_error_listener )argument_list )call )expression_statement (expression_statement (assignment (identifier_tokens) identifier_tokens (call (identifier_CommonTokenStream) identifier_CommonTokenStream (argument_list (identifier_lexer) identifier_lexer )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_tokens) identifier_tokens (identifier_fill) identifier_fill )attribute (argument_list )argument_list )call )expression_statement (if_statement (attribute (identifier_error_listener) identifier_error_listener (identifier_n_errors) identifier_n_errors )attribute (block (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_parser) identifier_parser (call (identifier_jsgParser) identifier_jsgParser (argument_list (identifier_tokens) identifier_tokens )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_parser) identifier_parser (identifier_addErrorListener) identifier_addErrorListener )attribute (argument_list (identifier_error_listener) identifier_error_listener )argument_list )call )expression_statement (expression_statement (assignment (identifier_parse_tree) identifier_parse_tree (call (attribute (identifier_parser) identifier_parser (identifier_doc) identifier_doc )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (attribute (identifier_error_listener) identifier_error_listener (identifier_n_errors) identifier_n_errors )attribute (block (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_parser) identifier_parser (call (identifier_JSGDocParser) identifier_JSGDocParser (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_parser) identifier_parser (identifier_visit) identifier_visit )attribute (argument_list (identifier_parse_tree) identifier_parse_tree )argument_list )call )expression_statement (if_statement (call (attribute (identifier_parser) identifier_parser (identifier_undefined_tokens) identifier_undefined_tokens )attribute (argument_list )argument_list )call (block (for_statement (identifier_tkn) identifier_tkn (call (attribute (identifier_parser) identifier_parser (identifier_undefined_tokens) identifier_undefined_tokens )attribute (argument_list )argument_list )call (block (expression_statement (call (identifier_print) identifier_print (argument_list (binary_operator (string_"Undefined token: ") string_"Undefined token: " (identifier_tkn) identifier_tkn )binary_operator )argument_list )call )expression_statement )block )for_statement (return_statement (None) None )return_statement )block )if_statement (return_statement (call (attribute (identifier_parser) identifier_parser (identifier_as_python) identifier_as_python )attribute (argument_list (identifier_source) identifier_source )argument_list )call )return_statement )block )function_definition )module
Parse the text in infile and save the results in outfile :param input_: string or stream to parse :param source: source name for python file header :return: python text if successful
(module (function_definition (function_name_parse) function_name_parse (parameters (identifier_self) identifier_self (identifier_data) identifier_data )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_validate_packet) identifier_validate_packet )attribute (argument_list (identifier_data) identifier_data )argument_list )call )expression_statement (expression_statement (assignment (identifier_packet_length) identifier_packet_length (subscript (identifier_data) identifier_data (integer_0) integer_0 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_packet_type) identifier_packet_type (subscript (identifier_data) identifier_data (integer_1) integer_1 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_sub_type) identifier_sub_type (subscript (identifier_data) identifier_data (integer_2) integer_2 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_sequence_number) identifier_sequence_number (subscript (identifier_data) identifier_data (integer_3) integer_3 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_command_type) identifier_command_type (subscript (identifier_data) identifier_data (integer_4) integer_4 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_transceiver_type) identifier_transceiver_type (subscript (identifier_data) identifier_data (integer_5) integer_5 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_transceiver_type_text) identifier_transceiver_type_text (call (attribute (identifier__MSG1_RECEIVER_TYPE) identifier__MSG1_RECEIVER_TYPE (identifier_get) identifier_get )attribute (argument_list (subscript (identifier_data) identifier_data (integer_5) integer_5 )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_firmware_version) identifier_firmware_version (subscript (identifier_data) identifier_data (integer_6) integer_6 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_flags) identifier_flags (call (attribute (identifier_self) identifier_self (identifier__int_to_binary_list) identifier__int_to_binary_list )attribute (argument_list (subscript (identifier_data) identifier_data (integer_7) integer_7 )subscript )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_flags) identifier_flags (identifier_extend) identifier_extend )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier__int_to_binary_list) identifier__int_to_binary_list )attribute (argument_list (subscript (identifier_data) identifier_data (integer_8) integer_8 )subscript )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_flags) identifier_flags (identifier_extend) identifier_extend )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier__int_to_binary_list) identifier__int_to_binary_list )attribute (argument_list (subscript (identifier_data) identifier_data (integer_9) integer_9 )subscript )argument_list )call )argument_list )call )expression_statement (expression_statement (assignment (pattern_list (identifier_enabled) identifier_enabled (identifier_disabled) identifier_disabled )pattern_list (call (attribute (identifier_self) identifier_self (identifier__log_enabled_protocols) identifier__log_enabled_protocols )attribute (argument_list (identifier_flags) identifier_flags (identifier_PROTOCOLS) identifier_PROTOCOLS )argument_list )call )assignment )expression_statement (return_statement (dictionary (pair (string_'packet_length') string_'packet_length' (identifier_packet_length) identifier_packet_length )pair (pair (string_'packet_type') string_'packet_type' (identifier_packet_type) identifier_packet_type )pair (pair (string_'packet_type_name') string_'packet_type_name' (call (attribute (attribute (identifier_self) identifier_self (identifier_PACKET_TYPES) identifier_PACKET_TYPES )attribute (identifier_get) identifier_get )attribute (argument_list (identifier_packet_type) identifier_packet_type )argument_list )call )pair (pair (string_'sequence_number') string_'sequence_number' (identifier_sequence_number) identifier_sequence_number )pair (pair (string_'sub_type') string_'sub_type' (identifier_sub_type) identifier_sub_type )pair (pair (string_'sub_type_name') string_'sub_type_name' (call (attribute (attribute (identifier_self) identifier_self (identifier_PACKET_SUBTYPES) identifier_PACKET_SUBTYPES )attribute (identifier_get) identifier_get )attribute (argument_list (identifier_sub_type) identifier_sub_type )argument_list )call )pair (pair (string_'command_type') string_'command_type' (identifier_command_type) identifier_command_type )pair (pair (string_'transceiver_type') string_'transceiver_type' (identifier_transceiver_type) identifier_transceiver_type )pair (pair (string_'transceiver_type_text') string_'transceiver_type_text' (identifier_transceiver_type_text) identifier_transceiver_type_text )pair (pair (string_'firmware_version') string_'firmware_version' (identifier_firmware_version) identifier_firmware_version )pair (pair (string_'enabled_protocols') string_'enabled_protocols' (identifier_enabled) identifier_enabled )pair (pair (string_'disabled_protocols') string_'disabled_protocols' (identifier_disabled) identifier_disabled )pair )dictionary )return_statement )block )function_definition )module
Parse a 13 byte packet in the Status format. :param data: bytearray to be parsed :type data: bytearray :return: Data dictionary containing the parsed values :rtype: dict
(module (function_definition (function_name_setup_app) function_name_setup_app (parameters (identifier_app) identifier_app (identifier_api) identifier_api )parameters (block (expression_statement (call (attribute (identifier_api) identifier_api (identifier_add_resource) identifier_add_resource )attribute (argument_list (identifier_KnwKBAllResource) identifier_KnwKBAllResource (string_'/api/knowledge') string_'/api/knowledge' )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_api) identifier_api (identifier_add_resource) identifier_add_resource )attribute (argument_list (identifier_KnwKBResource) identifier_KnwKBResource (string_'/api/knowledge/<string:slug>') string_'/api/knowledge/<string:slug>' )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_api) identifier_api (identifier_add_resource) identifier_add_resource )attribute (argument_list (identifier_KnwKBMappingsResource) identifier_KnwKBMappingsResource (string_'/api/knowledge/<string:slug>/mappings') string_'/api/knowledge/<string:slug>/mappings' )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_api) identifier_api (identifier_add_resource) identifier_add_resource )attribute (argument_list (identifier_KnwKBMappingsToResource) identifier_KnwKBMappingsToResource (string_'/api/knowledge/<string:slug>/mappings/to') string_'/api/knowledge/<string:slug>/mappings/to' )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_api) identifier_api (identifier_add_resource) identifier_add_resource )attribute (argument_list (identifier_KnwKBMappingsFromResource) identifier_KnwKBMappingsFromResource (string_'/api/knowledge/<string:slug>/mappings/from') string_'/api/knowledge/<string:slug>/mappings/from' )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_api) identifier_api (identifier_add_resource) identifier_add_resource )attribute (argument_list (identifier_NotImplementedKnowledegeResource) identifier_NotImplementedKnowledegeResource (string_'/api/knowledge/<string:slug>/<path:foo>') string_'/api/knowledge/<string:slug>/<path:foo>' )argument_list )call )expression_statement )block )function_definition )module
setup the resources urls.
(module (function_definition (function_name_handlePosition) function_name_handlePosition (parameters (identifier_self) identifier_self (identifier_msg) identifier_msg )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log_msg) identifier_log_msg )attribute (argument_list (string_"position") string_"position" (identifier_msg) identifier_msg )argument_list )call )expression_statement (expression_statement (assignment (identifier_contract_tuple) identifier_contract_tuple (call (attribute (identifier_self) identifier_self (identifier_contract_to_tuple) identifier_contract_to_tuple )attribute (argument_list (attribute (identifier_msg) identifier_msg (identifier_contract) identifier_contract )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_contractString) identifier_contractString (call (attribute (identifier_self) identifier_self (identifier_contractString) identifier_contractString )attribute (argument_list (identifier_contract_tuple) identifier_contract_tuple )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_registerContract) identifier_registerContract )attribute (argument_list (attribute (identifier_msg) identifier_msg (identifier_contract) identifier_contract )attribute )argument_list )call )expression_statement (if_statement (comparison_operator (attribute (identifier_msg) identifier_msg (identifier_account) identifier_account )attribute (call (attribute (attribute (identifier_self) identifier_self (identifier__positions) identifier__positions )attribute (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call )comparison_operator (block (expression_statement (assignment (subscript (attribute (identifier_self) identifier_self (identifier__positions) identifier__positions )attribute (attribute (identifier_msg) identifier_msg (identifier_account) identifier_account )attribute )subscript (dictionary )dictionary )assignment )expression_statement )block )if_statement (expression_statement (assignment (subscript (subscript (attribute (identifier_self) identifier_self (identifier__positions) identifier__positions )attribute (attribute (identifier_msg) identifier_msg (identifier_account) identifier_account )attribute )subscript (identifier_contractString) identifier_contractString )subscript (dictionary (pair (string_"symbol") string_"symbol" (identifier_contractString) identifier_contractString )pair (pair (string_"position") string_"position" (call (identifier_int) identifier_int (argument_list (attribute (identifier_msg) identifier_msg (identifier_pos) identifier_pos )attribute )argument_list )call )pair (pair (string_"avgCost") string_"avgCost" (call (identifier_float) identifier_float (argument_list (attribute (identifier_msg) identifier_msg (identifier_avgCost) identifier_avgCost )attribute )argument_list )call )pair (pair (string_"account") string_"account" (attribute (identifier_msg) identifier_msg (identifier_account) identifier_account )attribute )pair )dictionary )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_ibCallback) identifier_ibCallback )attribute (argument_list (keyword_argument (identifier_caller) identifier_caller (string_"handlePosition") string_"handlePosition" )keyword_argument (keyword_argument (identifier_msg) identifier_msg (identifier_msg) identifier_msg )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
handle positions changes
(module (function_definition (function_name__update) function_name__update (parameters (identifier_self) identifier_self (typed_parameter (identifier_rules) identifier_rules (type (identifier_list) identifier_list )type )typed_parameter )parameters (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__rules) identifier__rules )attribute (identifier_rules) identifier_rules )assignment )expression_statement (expression_statement (assignment (identifier_to_store) identifier_to_store (call (attribute (string_'\n') string_'\n' (identifier_join) identifier_join )attribute (generator_expression (attribute (identifier_rule) identifier_rule (identifier_config_string) identifier_config_string )attribute (for_in_clause (identifier_rule) identifier_rule (identifier_rules) identifier_rules )for_in_clause )generator_expression )call )assignment )expression_statement (expression_statement (assignment (identifier_sftp_connection) identifier_sftp_connection (attribute (identifier_self) identifier_self (identifier__sftp_connection) identifier__sftp_connection )attribute )assignment )expression_statement (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_sftp_connection) identifier_sftp_connection (identifier_open) identifier_open )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_RULE_PATH) identifier_RULE_PATH )attribute (keyword_argument (identifier_mode) identifier_mode (string_'w') string_'w' )keyword_argument )argument_list )call (as_pattern_target (identifier_file_handle) identifier_file_handle )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_file_handle) identifier_file_handle (identifier_write) identifier_write )attribute (argument_list (identifier_to_store) identifier_to_store )argument_list )call )expression_statement )block )with_statement )block )function_definition )module
Updates the given rules and stores them on the router.
(module (function_definition (function_name_update_pulled_fields) function_name_update_pulled_fields (parameters (identifier_instance) identifier_instance (identifier_imported_instance) identifier_imported_instance (identifier_fields) identifier_fields )parameters (block (expression_statement (assignment (identifier_modified) identifier_modified (False) False )assignment )expression_statement (for_statement (identifier_field) identifier_field (identifier_fields) identifier_fields (block (expression_statement (assignment (identifier_pulled_value) identifier_pulled_value (call (identifier_getattr) identifier_getattr (argument_list (identifier_imported_instance) identifier_imported_instance (identifier_field) identifier_field )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_current_value) identifier_current_value (call (identifier_getattr) identifier_getattr (argument_list (identifier_instance) identifier_instance (identifier_field) identifier_field )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_current_value) identifier_current_value (identifier_pulled_value) identifier_pulled_value )comparison_operator (block (expression_statement (call (identifier_setattr) identifier_setattr (argument_list (identifier_instance) identifier_instance (identifier_field) identifier_field (identifier_pulled_value) identifier_pulled_value )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_info) identifier_info )attribute (argument_list (string_"%s's with PK %s %s field updated from value '%s' to value '%s'") string_"%s's with PK %s %s field updated from value '%s' to value '%s'" (attribute (attribute (identifier_instance) identifier_instance (identifier___class__) identifier___class__ )attribute (identifier___name__) identifier___name__ )attribute (attribute (identifier_instance) identifier_instance (identifier_pk) identifier_pk )attribute (identifier_field) identifier_field (identifier_current_value) identifier_current_value (identifier_pulled_value) identifier_pulled_value )argument_list )call )expression_statement (expression_statement (assignment (identifier_modified) identifier_modified (True) True )assignment )expression_statement )block )if_statement )block )for_statement (expression_statement (assignment (identifier_error_message) identifier_error_message (boolean_operator (call (identifier_getattr) identifier_getattr (argument_list (identifier_imported_instance) identifier_imported_instance (string_'error_message') string_'error_message' (string_'') string_'' )argument_list )call (call (identifier_getattr) identifier_getattr (argument_list (identifier_instance) identifier_instance (string_'error_message') string_'error_message' (string_'') string_'' )argument_list )call )boolean_operator )assignment )expression_statement (if_statement (boolean_operator (identifier_error_message) identifier_error_message (comparison_operator (attribute (identifier_instance) identifier_instance (identifier_error_message) identifier_error_message )attribute (identifier_error_message) identifier_error_message )comparison_operator )boolean_operator (block (expression_statement (assignment (attribute (identifier_instance) identifier_instance (identifier_error_message) identifier_error_message )attribute (attribute (identifier_imported_instance) identifier_imported_instance (identifier_error_message) identifier_error_message )attribute )assignment )expression_statement (expression_statement (assignment (identifier_modified) identifier_modified (True) True )assignment )expression_statement )block )if_statement (if_statement (identifier_modified) identifier_modified (block (expression_statement (call (attribute (identifier_instance) identifier_instance (identifier_save) identifier_save )attribute (argument_list )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Update instance fields based on imported from backend data. Save changes to DB only one or more fields were changed.
(module (function_definition (function_name_prepare_soap_body) function_name_prepare_soap_body (parameters (identifier_self) identifier_self (identifier_method) identifier_method (identifier_parameters) identifier_parameters (identifier_namespace) identifier_namespace )parameters (block (expression_statement (assignment (identifier_tags) identifier_tags (list )list )assignment )expression_statement (for_statement (pattern_list (identifier_name) identifier_name (identifier_value) identifier_value )pattern_list (identifier_parameters) identifier_parameters (block (expression_statement (assignment (identifier_tag) identifier_tag (call (attribute (string_"<{name}>{value}</{name}>") string_"<{name}>{value}</{name}>" (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_name) identifier_name (identifier_name) identifier_name )keyword_argument (keyword_argument (identifier_value) identifier_value (call (identifier_escape) identifier_escape (argument_list (binary_operator (string_"%s") string_"%s" (identifier_value) identifier_value )binary_operator (dictionary (pair (string_'"') string_'"' (string_"&quot;") string_"&quot;" )pair )dictionary )argument_list )call )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_tags) identifier_tags (identifier_append) identifier_append )attribute (argument_list (identifier_tag) identifier_tag )argument_list )call )expression_statement )block )for_statement (expression_statement (assignment (identifier_wrapped_params) identifier_wrapped_params (call (attribute (string_"") string_"" (identifier_join) identifier_join )attribute (argument_list (identifier_tags) identifier_tags )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_namespace) identifier_namespace (None) None )comparison_operator (block (expression_statement (assignment (identifier_soap_body) identifier_soap_body (parenthesized_expression (call (attribute (concatenated_string (string_'<{method} xmlns="{namespace}">') string_'<{method} xmlns="{namespace}">' (string_'{params}') string_'{params}' (string_'</{method}>') string_'</{method}>' )concatenated_string (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_method) identifier_method (identifier_method) identifier_method )keyword_argument (keyword_argument (identifier_params) identifier_params (identifier_wrapped_params) identifier_wrapped_params )keyword_argument (keyword_argument (identifier_namespace) identifier_namespace (identifier_namespace) identifier_namespace )keyword_argument )argument_list )call )parenthesized_expression )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_soap_body) identifier_soap_body (parenthesized_expression (call (attribute (concatenated_string (string_'<{method}>') string_'<{method}>' (string_'{params}') string_'{params}' (string_'</{method}>') string_'</{method}>' )concatenated_string (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_method) identifier_method (identifier_method) identifier_method )keyword_argument (keyword_argument (identifier_params) identifier_params (identifier_wrapped_params) identifier_wrapped_params )keyword_argument )argument_list )call )parenthesized_expression )assignment )expression_statement )block )else_clause )if_statement (return_statement (identifier_soap_body) identifier_soap_body )return_statement )block )function_definition )module
Prepare the SOAP message body for sending. Args: method (str): The name of the method to call. parameters (list): A list of (name, value) tuples containing the parameters to pass to the method. namespace (str): tThe XML namespace to use for the method. Returns: str: A properly formatted SOAP Body.
(module (function_definition (function_name_during) function_name_during (parameters (identifier_f) identifier_f )parameters (block (function_definition (function_name_decorator) function_name_decorator (parameters (identifier_g) identifier_g )parameters (block (decorated_definition (decorator (call (identifier_wraps) identifier_wraps (argument_list (identifier_g) identifier_g )argument_list )call )decorator (function_definition (function_name_h) function_name_h (parameters (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kargs) identifier_kargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_tf) identifier_tf (call (identifier_Thread) identifier_Thread (argument_list (keyword_argument (identifier_target) identifier_target (identifier_f) identifier_f )keyword_argument (keyword_argument (identifier_args) identifier_args (identifier_args) identifier_args )keyword_argument (keyword_argument (identifier_kwargs) identifier_kwargs (identifier_kargs) identifier_kargs )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_tf) identifier_tf (identifier_start) identifier_start )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_r) identifier_r (call (identifier_g) identifier_g (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kargs) identifier_kargs )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_tf) identifier_tf (identifier_join) identifier_join )attribute (argument_list )argument_list )call )expression_statement (return_statement (identifier_r) identifier_r )return_statement )block )function_definition )decorated_definition (return_statement (identifier_h) identifier_h )return_statement )block )function_definition (return_statement (identifier_decorator) identifier_decorator )return_statement )block )function_definition )module
Runs f during the decorated function's execution in a separate thread.
(module (function_definition (function_name_render) function_name_render (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_f1) identifier_f1 (call (attribute (identifier_self) identifier_self (identifier__format_alignment) identifier__format_alignment )attribute (argument_list (subscript (attribute (identifier_self) identifier_self (identifier__alignment) identifier__alignment )attribute (integer_0) integer_0 )subscript (subscript (attribute (identifier_self) identifier_self (identifier__alignment) identifier__alignment )attribute (integer_1) integer_1 )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_f2) identifier_f2 (call (attribute (identifier_self) identifier_self (identifier__format_alignment) identifier__format_alignment )attribute (argument_list (subscript (attribute (identifier_self) identifier_self (identifier__alignment) identifier__alignment )attribute (integer_1) integer_1 )subscript (subscript (attribute (identifier_self) identifier_self (identifier__alignment) identifier__alignment )attribute (integer_0) integer_0 )subscript )argument_list )call )assignment )expression_statement (return_statement (expression_list (identifier_f1) identifier_f1 (identifier_f2) identifier_f2 )expression_list )return_statement )block )function_definition )module
Returns a tuple of HTML fragments rendering each element of the sequence.
(module (function_definition (function_name_send) function_name_send (parameters (identifier_self) identifier_self (identifier_url) identifier_url (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (if_statement (attribute (attribute (identifier_self) identifier_self (identifier_config) identifier_config )attribute (identifier_server_url) identifier_server_url )attribute (block (return_statement (call (attribute (call (identifier_super) identifier_super (argument_list (identifier_DjangoClient) identifier_DjangoClient (identifier_self) identifier_self )argument_list )call (identifier_send) identifier_send )attribute (argument_list (identifier_url) identifier_url (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block (else_clause (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_error_logger) identifier_error_logger )attribute (identifier_error) identifier_error )attribute (argument_list (string_"No server configured, and elasticapm not installed. Cannot send message") string_"No server configured, and elasticapm not installed. Cannot send message" )argument_list )call )expression_statement (return_statement (None) None )return_statement )block )else_clause )if_statement )block )function_definition )module
Serializes and signs ``data`` and passes the payload off to ``send_remote`` If ``server`` was passed into the constructor, this will serialize the data and pipe it to the server using ``send_remote()``.