sequence
stringlengths
557
12.7k
docstring
stringlengths
4
15.2k
(module (function_definition (function_name_token) function_name_token (parameters (identifier_name) identifier_name )parameters (block (function_definition (function_name_wrap) function_name_wrap (parameters (identifier_f) identifier_f )parameters (block (expression_statement (call (attribute (identifier_tokenizers) identifier_tokenizers (identifier_append) identifier_append )attribute (argument_list (tuple (identifier_name) identifier_name (identifier_f) identifier_f )tuple )argument_list )call )expression_statement (return_statement (identifier_f) identifier_f )return_statement )block )function_definition (return_statement (identifier_wrap) identifier_wrap )return_statement )block )function_definition )module
Marker for a token :param str name: Name of tokenizer
(module (function_definition (function_name_complement) function_name_complement (parameters (identifier_color) identifier_color )parameters (block (expression_statement (identifier_r) identifier_r )expression_statement (expression_statement (assignment (tuple_pattern (identifier_r) identifier_r (identifier_g) identifier_g (identifier_b) identifier_b )tuple_pattern (call (identifier_parse_color) identifier_parse_color (argument_list (identifier_color) identifier_color )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_gcolor) identifier_gcolor (call (attribute (identifier_grapefruit) identifier_grapefruit (identifier_Color) identifier_Color )attribute (argument_list (tuple (binary_operator (identifier_r) identifier_r (float_255.0) float_255.0 )binary_operator (binary_operator (identifier_g) identifier_g (float_255.0) float_255.0 )binary_operator (binary_operator (identifier_b) identifier_b (float_255.0) float_255.0 )binary_operator )tuple )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_complement) identifier_complement (call (attribute (identifier_gcolor) identifier_gcolor (identifier_ComplementaryColor) identifier_ComplementaryColor )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (tuple_pattern (identifier_r) identifier_r (identifier_g) identifier_g (identifier_b) identifier_b )tuple_pattern (list_comprehension (call (identifier_int) identifier_int (argument_list (binary_operator (identifier_c) identifier_c (float_255.0) float_255.0 )binary_operator )argument_list )call (for_in_clause (identifier_c) identifier_c (attribute (identifier_complement) identifier_complement (identifier_rgb) identifier_rgb )attribute )for_in_clause )list_comprehension )assignment )expression_statement (return_statement (tuple (identifier_r) identifier_r (identifier_g) identifier_g (identifier_b) identifier_b )tuple )return_statement )block )function_definition )module
r"""Calculates polar opposite of color This isn't guaranteed to look good >_> (especially with brighter, higher intensity colors.) This will be replaced with a formula that produces better looking colors in the future. >>> complement('red') (0, 255, 76) >>> complement((0, 100, 175)) (175, 101, 0)
(module (function_definition (function_name_all) function_name_all (parameters (identifier_self) identifier_self (identifier_value) identifier_value (default_parameter (identifier_pos) identifier_pos (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_value) identifier_value (call (identifier_bool) identifier_bool (argument_list (identifier_value) identifier_value )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_length) identifier_length (attribute (identifier_self) identifier_self (identifier_len) identifier_len )attribute )assignment )expression_statement (if_statement (comparison_operator (identifier_pos) identifier_pos (None) None )comparison_operator (block (expression_statement (assignment (identifier_pos) identifier_pos (call (identifier_xrange) identifier_xrange (argument_list (attribute (identifier_self) identifier_self (identifier_len) identifier_len )attribute )argument_list )call )assignment )expression_statement )block )if_statement (for_statement (identifier_p) identifier_p (identifier_pos) identifier_pos (block (if_statement (comparison_operator (identifier_p) identifier_p (integer_0) integer_0 )comparison_operator (block (expression_statement (augmented_assignment (identifier_p) identifier_p (identifier_length) identifier_length )augmented_assignment )expression_statement )block )if_statement (if_statement (not_operator (comparison_operator (integer_0) integer_0 (identifier_p) identifier_p (identifier_length) identifier_length )comparison_operator )not_operator (block (raise_statement (call (identifier_IndexError) identifier_IndexError (argument_list (call (attribute (string_"Bit position {0} out of range.") string_"Bit position {0} out of range." (identifier_format) identifier_format )attribute (argument_list (identifier_p) identifier_p )argument_list )call )argument_list )call )raise_statement )block )if_statement (if_statement (not_operator (comparison_operator (call (attribute (attribute (identifier_self) identifier_self (identifier__datastore) identifier__datastore )attribute (identifier_getbit) identifier_getbit )attribute (argument_list (identifier_p) identifier_p )argument_list )call (identifier_value) identifier_value )comparison_operator )not_operator (block (return_statement (False) False )return_statement )block )if_statement )block )for_statement (return_statement (True) True )return_statement )block )function_definition )module
Return True if one or many bits are all set to value. value -- If value is True then checks for bits set to 1, otherwise checks for bits set to 0. pos -- An iterable of bit positions. Negative numbers are treated in the same way as slice indices. Defaults to the whole bitstring.
(module (function_definition (function_name_toggle_bit) function_name_toggle_bit (parameters (identifier_self) identifier_self (typed_parameter (identifier_position) identifier_position (type (identifier_int) identifier_int )type )typed_parameter )parameters (block (if_statement (comparison_operator (identifier_position) identifier_position (parenthesized_expression (binary_operator (attribute (identifier_self) identifier_self (identifier__bit_width) identifier__bit_width )attribute (integer_1) integer_1 )binary_operator )parenthesized_expression )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_'position greater than the bit width') string_'position greater than the bit width' )argument_list )call )raise_statement )block )if_statement (expression_statement (augmented_assignment (attribute (identifier_self) identifier_self (identifier__value) identifier__value )attribute (parenthesized_expression (binary_operator (integer_1) integer_1 (identifier_position) identifier_position )binary_operator )parenthesized_expression )augmented_assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__text_update) identifier__text_update )attribute (argument_list )argument_list )call )expression_statement )block )function_definition )module
Toggles the value at position :param position: integer between 0 and 7, inclusive :return: None
(module (function_definition (function_name_get_tmp_file) function_name_get_tmp_file (parameters (default_parameter (identifier_dir) identifier_dir (None) None )default_parameter )parameters (block (expression_statement (string_"Create and return a tmp filename, optionally at a specific path. `os.remove` when done with it.") string_"Create and return a tmp filename, optionally at a specific path. `os.remove` when done with it." )expression_statement (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_tempfile) identifier_tempfile (identifier_NamedTemporaryFile) identifier_NamedTemporaryFile )attribute (argument_list (keyword_argument (identifier_delete) identifier_delete (False) False )keyword_argument (keyword_argument (identifier_dir) identifier_dir (identifier_dir) identifier_dir )keyword_argument )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (return_statement (attribute (identifier_f) identifier_f (identifier_name) identifier_name )attribute )return_statement )block )with_statement )block )function_definition )module
Create and return a tmp filename, optionally at a specific path. `os.remove` when done with it.
(module (function_definition (function_name_create) function_name_create (parameters (identifier_cls) identifier_cls (identifier_zmq_context) identifier_zmq_context (identifier_endpoint) identifier_endpoint )parameters (block (expression_statement (assignment (identifier_socket) identifier_socket (call (attribute (identifier_zmq_context) identifier_zmq_context (identifier_socket) identifier_socket )attribute (argument_list (attribute (identifier_zmq) identifier_zmq (identifier_REQ) identifier_REQ )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_socket) identifier_socket (identifier_connect) identifier_connect )attribute (argument_list (identifier_endpoint) identifier_endpoint )argument_list )call )expression_statement (return_statement (call (identifier_cls) identifier_cls (argument_list (identifier_socket) identifier_socket )argument_list )call )return_statement )block )function_definition )module
Create new client transport. Instead of creating the socket yourself, you can call this function and merely pass the :py:class:`zmq.core.context.Context` instance. By passing a context imported from :py:mod:`zmq.green`, you can use green (gevent) 0mq sockets as well. :param zmq_context: A 0mq context. :param endpoint: The endpoint the server is bound to.
(module (function_definition (function_name_wait_all) function_name_wait_all (parameters (identifier_jobs) identifier_jobs (default_parameter (identifier_timeout) identifier_timeout (None) None )default_parameter )parameters (block (return_statement (call (attribute (identifier_Job) identifier_Job (identifier__wait) identifier__wait )attribute (argument_list (identifier_jobs) identifier_jobs (identifier_timeout) identifier_timeout (attribute (attribute (identifier_concurrent) identifier_concurrent (identifier_futures) identifier_futures )attribute (identifier_ALL_COMPLETED) identifier_ALL_COMPLETED )attribute )argument_list )call )return_statement )block )function_definition )module
Return when at all of the specified jobs have completed or timeout expires. Args: jobs: a Job or list of Jobs to wait on. timeout: a timeout in seconds to wait for. None (the default) means no timeout. Returns: A list of the jobs that have now completed or None if there were no jobs.
(module (function_definition (function_name_cursor_async) function_name_cursor_async (parameters (identifier_self) identifier_self )parameters (block (expression_statement (await (call (attribute (identifier_self) identifier_self (identifier_connect_async) identifier_connect_async )attribute (argument_list (keyword_argument (identifier_loop) identifier_loop (attribute (identifier_self) identifier_self (identifier__loop) identifier__loop )attribute )keyword_argument )argument_list )call )await )expression_statement (if_statement (comparison_operator (call (attribute (identifier_self) identifier_self (identifier_transaction_depth_async) identifier_transaction_depth_async )attribute (argument_list )argument_list )call (integer_0) integer_0 )comparison_operator (block (expression_statement (assignment (identifier_conn) identifier_conn (call (attribute (identifier_self) identifier_self (identifier_transaction_conn_async) identifier_transaction_conn_async )attribute (argument_list )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_conn) identifier_conn (None) None )assignment )expression_statement )block )else_clause )if_statement (try_statement (block (return_statement (parenthesized_expression (await (call (attribute (attribute (identifier_self) identifier_self (identifier__async_conn) identifier__async_conn )attribute (identifier_cursor) identifier_cursor )attribute (argument_list (keyword_argument (identifier_conn) identifier_conn (identifier_conn) identifier_conn )keyword_argument )argument_list )call )await )parenthesized_expression )return_statement )block (except_clause (block (expression_statement (await (call (attribute (identifier_self) identifier_self (identifier_close_async) identifier_close_async )attribute (argument_list )argument_list )call )await )expression_statement (raise_statement )raise_statement )block )except_clause )try_statement )block )function_definition )module
Acquire async cursor.
(module (function_definition (function_name_on_excepthandler) function_name_on_excepthandler (parameters (identifier_self) identifier_self (identifier_node) identifier_node )parameters (block (return_statement (tuple (call (attribute (identifier_self) identifier_self (identifier_run) identifier_run )attribute (argument_list (attribute (identifier_node) identifier_node (identifier_type) identifier_type )attribute )argument_list )call (attribute (identifier_node) identifier_node (identifier_name) identifier_name )attribute (attribute (identifier_node) identifier_node (identifier_body) identifier_body )attribute )tuple )return_statement )block )function_definition )module
Exception handler...
(module (function_definition (function_name_rename) function_name_rename (parameters (identifier_self) identifier_self (identifier_new_name) identifier_new_name (default_parameter (identifier_range) identifier_range (None) None )default_parameter )parameters (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (identifier_debug) identifier_debug )attribute (argument_list (string_'rename: in') string_'rename: in' )argument_list )call )expression_statement (if_statement (not_operator (identifier_new_name) identifier_new_name )not_operator (block (expression_statement (assignment (identifier_new_name) identifier_new_name (call (attribute (attribute (identifier_self) identifier_self (identifier_editor) identifier_editor )attribute (identifier_ask_input) identifier_ask_input )attribute (argument_list (string_"Rename to:") string_"Rename to:" )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_editor) identifier_editor )attribute (identifier_write) identifier_write )attribute (argument_list (keyword_argument (identifier_noautocmd) identifier_noautocmd (True) True )keyword_argument )argument_list )call )expression_statement (expression_statement (assignment (pattern_list (identifier_b) identifier_b (identifier_e) identifier_e )pattern_list (call (attribute (attribute (identifier_self) identifier_self (identifier_editor) identifier_editor )attribute (identifier_word_under_cursor_pos) identifier_word_under_cursor_pos )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_current_file) identifier_current_file (call (attribute (attribute (identifier_self) identifier_self (identifier_editor) identifier_editor )attribute (identifier_path) identifier_path )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_editor) identifier_editor )attribute (identifier_raw_message) identifier_raw_message )attribute (argument_list (identifier_current_file) identifier_current_file )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_send_refactor_request) identifier_send_refactor_request )attribute (argument_list (string_"RefactorReq") string_"RefactorReq" (dictionary (pair (string_"typehint") string_"typehint" (string_"RenameRefactorDesc") string_"RenameRefactorDesc" )pair (pair (string_"newName") string_"newName" (identifier_new_name) identifier_new_name )pair (pair (string_"start") string_"start" (call (attribute (identifier_self) identifier_self (identifier_get_position) identifier_get_position )attribute (argument_list (subscript (identifier_b) identifier_b (integer_0) integer_0 )subscript (subscript (identifier_b) identifier_b (integer_1) integer_1 )subscript )argument_list )call )pair (pair (string_"end") string_"end" (binary_operator (call (attribute (identifier_self) identifier_self (identifier_get_position) identifier_get_position )attribute (argument_list (subscript (identifier_e) identifier_e (integer_0) integer_0 )subscript (subscript (identifier_e) identifier_e (integer_1) integer_1 )subscript )argument_list )call (integer_1) integer_1 )binary_operator )pair (pair (string_"file") string_"file" (identifier_current_file) identifier_current_file )pair )dictionary (dictionary (pair (string_"interactive") string_"interactive" (False) False )pair )dictionary )argument_list )call )expression_statement )block )function_definition )module
Request a rename to the server.
(module (function_definition (function_name__get_upserts_distinct) function_name__get_upserts_distinct (parameters (identifier_queryset) identifier_queryset (identifier_model_objs_updated) identifier_model_objs_updated (identifier_model_objs_created) identifier_model_objs_created (identifier_unique_fields) identifier_unique_fields )parameters (block (expression_statement (assignment (identifier_created_models) identifier_created_models (list )list )assignment )expression_statement (if_statement (identifier_model_objs_created) identifier_model_objs_created (block (expression_statement (call (attribute (identifier_created_models) identifier_created_models (identifier_extend) identifier_extend )attribute (argument_list (call (attribute (identifier_queryset) identifier_queryset (identifier_extra) identifier_extra )attribute (argument_list (keyword_argument (identifier_where) identifier_where (list (call (attribute (string_'({unique_fields_sql}) in %s') string_'({unique_fields_sql}) in %s' (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_unique_fields_sql) identifier_unique_fields_sql (call (attribute (string_', ') string_', ' (identifier_join) identifier_join )attribute (argument_list (identifier_unique_fields) identifier_unique_fields )argument_list )call )keyword_argument )argument_list )call )list )keyword_argument (keyword_argument (identifier_params) identifier_params (list (call (identifier_tuple) identifier_tuple (argument_list (list_comprehension (call (identifier_tuple) identifier_tuple (argument_list (list_comprehension (call (identifier_getattr) identifier_getattr (argument_list (identifier_model_obj) identifier_model_obj (identifier_field) identifier_field )argument_list )call (for_in_clause (identifier_field) identifier_field (identifier_unique_fields) identifier_unique_fields )for_in_clause )list_comprehension )argument_list )call (for_in_clause (identifier_model_obj) identifier_model_obj (identifier_model_objs_created) identifier_model_objs_created )for_in_clause )list_comprehension )argument_list )call )list )keyword_argument )argument_list )call )argument_list )call )expression_statement )block )if_statement (return_statement (expression_list (identifier_model_objs_updated) identifier_model_objs_updated (identifier_created_models) identifier_created_models )expression_list )return_statement )block )function_definition )module
Given a list of model objects that were updated and model objects that were created, fetch the pks of the newly created models and return the two lists in a tuple
(module (function_definition (function_name__initialize_application) function_name__initialize_application (parameters )parameters (block (expression_statement (assignment (attribute (identifier_RuntimeGlobals) identifier_RuntimeGlobals (identifier_application) identifier_application )attribute (call (attribute (attribute (attribute (identifier_umbra) identifier_umbra (identifier_ui) identifier_ui )attribute (identifier_common) identifier_common )attribute (identifier_get_application_instance) identifier_get_application_instance )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (attribute (identifier_umbra) identifier_umbra (identifier_ui) identifier_ui )attribute (identifier_common) identifier_common )attribute (identifier_set_window_default_icon) identifier_set_window_default_icon )attribute (argument_list (attribute (identifier_RuntimeGlobals) identifier_RuntimeGlobals (identifier_application) identifier_application )attribute )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_RuntimeGlobals) identifier_RuntimeGlobals (identifier_reporter) identifier_reporter )attribute (call (attribute (attribute (identifier_umbra) identifier_umbra (identifier_reporter) identifier_reporter )attribute (identifier_install_exception_reporter) identifier_install_exception_reporter )attribute (argument_list )argument_list )call )assignment )expression_statement )block )function_definition )module
Initializes the Application.
(module (function_definition (function_name_delete) function_name_delete (parameters (identifier_self) identifier_self (identifier_port) identifier_port (default_parameter (identifier_qos_policy) identifier_qos_policy (None) None )default_parameter )parameters (block (expression_statement (call (attribute (identifier_LOG) identifier_LOG (identifier_info) identifier_info )attribute (argument_list (string_"Deleting QoS policy %(qos_policy)s on port %(port)s") string_"Deleting QoS policy %(qos_policy)s on port %(port)s" (call (identifier_dict) identifier_dict (argument_list (keyword_argument (identifier_qos_policy) identifier_qos_policy (identifier_qos_policy) identifier_qos_policy )keyword_argument (keyword_argument (identifier_port) identifier_port (identifier_port) identifier_port )keyword_argument )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__utils) identifier__utils )attribute (identifier_remove_port_qos_rule) identifier_remove_port_qos_rule )attribute (argument_list (subscript (identifier_port) identifier_port (string_"port_id") string_"port_id" )subscript )argument_list )call )expression_statement )block )function_definition )module
Remove QoS rules from port. :param port: port object. :param qos_policy: the QoS policy to be removed from port.
(module (function_definition (function_name_get_attention) function_name_get_attention (parameters (typed_parameter (identifier_config) identifier_config (type (identifier_AttentionConfig) identifier_AttentionConfig )type )typed_parameter (typed_parameter (identifier_max_seq_len) identifier_max_seq_len (type (identifier_int) identifier_int )type )typed_parameter (typed_default_parameter (identifier_prefix) identifier_prefix (type (identifier_str) identifier_str )type (attribute (identifier_C) identifier_C (identifier_ATTENTION_PREFIX) identifier_ATTENTION_PREFIX )attribute )typed_default_parameter )parameters (type (string_'Attention') string_'Attention' )type (block (expression_statement (assignment (identifier_att_cls) identifier_att_cls (call (attribute (identifier_Attention) identifier_Attention (identifier_get_attention_cls) identifier_get_attention_cls )attribute (argument_list (attribute (identifier_config) identifier_config (identifier_type) identifier_type )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_params) identifier_params (call (attribute (attribute (identifier_config) identifier_config (identifier___dict__) identifier___dict__ )attribute (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_params) identifier_params (identifier_pop) identifier_pop )attribute (argument_list (string_'_frozen') string_'_frozen' )argument_list )call )expression_statement (expression_statement (assignment (subscript (identifier_params) identifier_params (string_'max_seq_len') string_'max_seq_len' )subscript (identifier_max_seq_len) identifier_max_seq_len )assignment )expression_statement (expression_statement (assignment (subscript (identifier_params) identifier_params (string_'prefix') string_'prefix' )subscript (identifier_prefix) identifier_prefix )assignment )expression_statement (return_statement (call (identifier__instantiate) identifier__instantiate (argument_list (identifier_att_cls) identifier_att_cls (identifier_params) identifier_params )argument_list )call )return_statement )block )function_definition )module
Returns an Attention instance based on attention_type. :param config: Attention configuration. :param max_seq_len: Maximum length of source sequences. :param prefix: Name prefix. :return: Instance of Attention.
(module (function_definition (function_name_imagedatadict_to_ndarray) function_name_imagedatadict_to_ndarray (parameters (identifier_imdict) identifier_imdict )parameters (block (expression_statement (assignment (identifier_arr) identifier_arr (subscript (identifier_imdict) identifier_imdict (string_'Data') string_'Data' )subscript )assignment )expression_statement (expression_statement (assignment (identifier_im) identifier_im (None) None )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_arr) identifier_arr (attribute (attribute (identifier_parse_dm3) identifier_parse_dm3 (identifier_array) identifier_array )attribute (identifier_array) identifier_array )attribute )argument_list )call (block (expression_statement (assignment (identifier_im) identifier_im (call (attribute (identifier_numpy) identifier_numpy (identifier_asarray) identifier_asarray )attribute (argument_list (identifier_arr) identifier_arr (keyword_argument (identifier_dtype) identifier_dtype (attribute (identifier_arr) identifier_arr (identifier_typecode) identifier_typecode )attribute )keyword_argument )argument_list )call )assignment )expression_statement )block (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_arr) identifier_arr (attribute (identifier_parse_dm3) identifier_parse_dm3 (identifier_structarray) identifier_structarray )attribute )argument_list )call (block (expression_statement (assignment (identifier_t) identifier_t (call (identifier_tuple) identifier_tuple (argument_list (attribute (identifier_arr) identifier_arr (identifier_typecodes) identifier_typecodes )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_im) identifier_im (call (attribute (identifier_numpy) identifier_numpy (identifier_frombuffer) identifier_frombuffer )attribute (argument_list (attribute (identifier_arr) identifier_arr (identifier_raw_data) identifier_raw_data )attribute (keyword_argument (identifier_dtype) identifier_dtype (subscript (identifier_structarray_to_np_map) identifier_structarray_to_np_map (identifier_t) identifier_t )subscript )keyword_argument )argument_list )call )assignment )expression_statement )block )elif_clause )if_statement (assert_statement (comparison_operator (subscript (subscript (identifier_dm_image_dtypes) identifier_dm_image_dtypes (subscript (identifier_imdict) identifier_imdict (string_"DataType") string_"DataType" )subscript )subscript (integer_1) integer_1 )subscript (attribute (identifier_im) identifier_im (identifier_dtype) identifier_dtype )attribute )comparison_operator )assert_statement (assert_statement (comparison_operator (subscript (identifier_imdict) identifier_imdict (string_'PixelDepth') string_'PixelDepth' )subscript (attribute (attribute (identifier_im) identifier_im (identifier_dtype) identifier_dtype )attribute (identifier_itemsize) identifier_itemsize )attribute )comparison_operator )assert_statement (expression_statement (assignment (identifier_im) identifier_im (call (attribute (identifier_im) identifier_im (identifier_reshape) identifier_reshape )attribute (argument_list (subscript (subscript (identifier_imdict) identifier_imdict (string_'Dimensions') string_'Dimensions' )subscript (slice (colon) colon (colon) colon (unary_operator (integer_1) integer_1 )unary_operator )slice )subscript )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (subscript (identifier_imdict) identifier_imdict (string_"DataType") string_"DataType" )subscript (integer_23) integer_23 )comparison_operator (block (expression_statement (assignment (identifier_im) identifier_im (subscript (call (attribute (call (attribute (identifier_im) identifier_im (identifier_view) identifier_view )attribute (argument_list (attribute (identifier_numpy) identifier_numpy (identifier_uint8) identifier_uint8 )attribute )argument_list )call (identifier_reshape) identifier_reshape )attribute (argument_list (binary_operator (attribute (identifier_im) identifier_im (identifier_shape) identifier_shape )attribute (tuple (unary_operator (integer_1) integer_1 )unary_operator )tuple )binary_operator )argument_list )call (ellipsis_...) ellipsis_... (slice (colon) colon (unary_operator (integer_1) integer_1 )unary_operator )slice )subscript )assignment )expression_statement )block )if_statement (return_statement (identifier_im) identifier_im )return_statement )block )function_definition )module
Converts the ImageData dictionary, imdict, to an nd image.
(module (function_definition (function_name_read_feather) function_name_read_feather (parameters (identifier_path) identifier_path (default_parameter (identifier_columns) identifier_columns (None) None )default_parameter (default_parameter (identifier_use_threads) identifier_use_threads (True) True )default_parameter )parameters (block (expression_statement (assignment (pattern_list (identifier_feather) identifier_feather (identifier_pyarrow) identifier_pyarrow )pattern_list (call (identifier__try_import) identifier__try_import (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_path) identifier_path (call (identifier__stringify_path) identifier__stringify_path (argument_list (identifier_path) identifier_path )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (call (identifier_LooseVersion) identifier_LooseVersion (argument_list (attribute (identifier_pyarrow) identifier_pyarrow (identifier___version__) identifier___version__ )attribute )argument_list )call (call (identifier_LooseVersion) identifier_LooseVersion (argument_list (string_'0.11.0') string_'0.11.0' )argument_list )call )comparison_operator (block (expression_statement (assignment (identifier_int_use_threads) identifier_int_use_threads (call (identifier_int) identifier_int (argument_list (identifier_use_threads) identifier_use_threads )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_int_use_threads) identifier_int_use_threads (integer_1) integer_1 )comparison_operator (block (expression_statement (assignment (identifier_int_use_threads) identifier_int_use_threads (integer_1) integer_1 )assignment )expression_statement )block )if_statement (return_statement (call (attribute (identifier_feather) identifier_feather (identifier_read_feather) identifier_read_feather )attribute (argument_list (identifier_path) identifier_path (keyword_argument (identifier_columns) identifier_columns (identifier_columns) identifier_columns )keyword_argument (keyword_argument (identifier_nthreads) identifier_nthreads (identifier_int_use_threads) identifier_int_use_threads )keyword_argument )argument_list )call )return_statement )block )if_statement (return_statement (call (attribute (identifier_feather) identifier_feather (identifier_read_feather) identifier_read_feather )attribute (argument_list (identifier_path) identifier_path (keyword_argument (identifier_columns) identifier_columns (identifier_columns) identifier_columns )keyword_argument (keyword_argument (identifier_use_threads) identifier_use_threads (call (identifier_bool) identifier_bool (argument_list (identifier_use_threads) identifier_use_threads )argument_list )call )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Load a feather-format object from the file path .. versionadded 0.20.0 Parameters ---------- path : string file path, or file-like object columns : sequence, default None If not provided, all columns are read .. versionadded 0.24.0 nthreads : int, default 1 Number of CPU threads to use when reading to pandas.DataFrame .. versionadded 0.21.0 .. deprecated 0.24.0 use_threads : bool, default True Whether to parallelize reading using multiple threads .. versionadded 0.24.0 Returns ------- type of object stored in file
(module (function_definition (function_name__remove_data_dir_path) function_name__remove_data_dir_path (parameters (identifier_self) identifier_self (default_parameter (identifier_inp) identifier_inp (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_inp) identifier_inp (None) None )comparison_operator (block (expression_statement (assignment (identifier_split_str) identifier_split_str (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_join) identifier_join )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_data_path) identifier_data_path )attribute (string_'') string_'' )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_inp) identifier_inp (identifier_apply) identifier_apply )attribute (argument_list (lambda (lambda_parameters (identifier_x) identifier_x )lambda_parameters (subscript (call (attribute (identifier_x) identifier_x (identifier_split) identifier_split )attribute (argument_list (identifier_split_str) identifier_split_str )argument_list )call (unary_operator (integer_1) integer_1 )unary_operator )subscript )lambda )argument_list )call )return_statement )block )if_statement )block )function_definition )module
Remove the data directory path from filenames
(module (function_definition (function_name_rand_block) function_name_rand_block (parameters (identifier_minimum) identifier_minimum (identifier_scale) identifier_scale (default_parameter (identifier_maximum) identifier_maximum (integer_1) integer_1 )default_parameter )parameters (block (expression_statement (assignment (identifier_t) identifier_t (call (identifier_min) identifier_min (argument_list (call (identifier_rand_pareto_float) identifier_rand_pareto_float (argument_list (identifier_minimum) identifier_minimum (identifier_scale) identifier_scale )argument_list )call (identifier_maximum) identifier_maximum )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_time) identifier_time (identifier_sleep) identifier_sleep )attribute (argument_list (identifier_t) identifier_t )argument_list )call )expression_statement (return_statement (identifier_t) identifier_t )return_statement )block )function_definition )module
block current thread at random pareto time ``minimum < block < 15`` and return the sleep time ``seconds`` :param minimum: :type minimum: :param scale: :type scale: :param slow_mode: a tuple e.g.(2, 5) :type slow_mode: tuple :return:
(module (function_definition (function_name_has_chosen) function_name_has_chosen (parameters (identifier_state) identifier_state (identifier_correct) identifier_correct (identifier_msgs) identifier_msgs )parameters (block (expression_statement (assignment (identifier_ctxt) identifier_ctxt (dictionary )dictionary )assignment )expression_statement (expression_statement (call (identifier_exec) identifier_exec (argument_list (attribute (identifier_state) identifier_state (identifier_student_code) identifier_student_code )attribute (call (identifier_globals) identifier_globals (argument_list )argument_list )call (identifier_ctxt) identifier_ctxt )argument_list )call )expression_statement (expression_statement (assignment (identifier_sel_indx) identifier_sel_indx (subscript (identifier_ctxt) identifier_ctxt (string_"selected_option") string_"selected_option" )subscript )assignment )expression_statement (if_statement (comparison_operator (identifier_sel_indx) identifier_sel_indx (identifier_correct) identifier_correct )comparison_operator (block (expression_statement (call (attribute (identifier_state) identifier_state (identifier_report) identifier_report )attribute (argument_list (call (identifier_Feedback) identifier_Feedback (argument_list (subscript (identifier_msgs) identifier_msgs (binary_operator (identifier_sel_indx) identifier_sel_indx (integer_1) integer_1 )binary_operator )subscript )argument_list )call )argument_list )call )expression_statement )block (else_clause (block (expression_statement (assignment (attribute (attribute (identifier_state) identifier_state (identifier_reporter) identifier_reporter )attribute (identifier_success_msg) identifier_success_msg )attribute (subscript (identifier_msgs) identifier_msgs (binary_operator (identifier_correct) identifier_correct (integer_1) integer_1 )binary_operator )subscript )assignment )expression_statement )block )else_clause )if_statement (return_statement (identifier_state) identifier_state )return_statement )block )function_definition )module
Verify exercises of the type MultipleChoiceExercise Args: state: State instance describing student and solution code. Can be omitted if used with Ex(). correct: index of correct option, where 1 is the first option. msgs : list of feedback messages corresponding to each option. :Example: The following SCT is for a multiple choice exercise with 2 options, the first of which is correct.:: Ex().has_chosen(1, ['Correct!', 'Incorrect. Try again!'])
(module (function_definition (function_name_main) function_name_main (parameters )parameters (block (if_statement (boolean_operator (boolean_operator (comparison_operator (string_"--help") string_"--help" (attribute (identifier_sys) identifier_sys (identifier_argv) identifier_argv )attribute )comparison_operator (comparison_operator (string_"-h") string_"-h" (attribute (identifier_sys) identifier_sys (identifier_argv) identifier_argv )attribute )comparison_operator )boolean_operator (comparison_operator (call (identifier_len) identifier_len (argument_list (attribute (identifier_sys) identifier_sys (identifier_argv) identifier_argv )attribute )argument_list )call (integer_3) integer_3 )comparison_operator )boolean_operator (block (raise_statement (call (identifier_SystemExit) identifier_SystemExit (argument_list (identifier___doc__) identifier___doc__ )argument_list )call )raise_statement )block )if_statement (try_statement (block (expression_statement (call (identifier_discordian_calendar) identifier_discordian_calendar (argument_list (list_splat (subscript (attribute (identifier_sys) identifier_sys (identifier_argv) identifier_argv )attribute (slice (integer_1) integer_1 (colon) colon )slice )subscript )list_splat )argument_list )call )expression_statement )block (except_clause (as_pattern (identifier_ValueError) identifier_ValueError (as_pattern_target (identifier_error) identifier_error )as_pattern_target )as_pattern (block (raise_statement (call (identifier_SystemExit) identifier_SystemExit (argument_list (call (attribute (string_"Error: {}") string_"Error: {}" (identifier_format) identifier_format )attribute (argument_list (call (attribute (string_"\n") string_"\n" (identifier_join) identifier_join )attribute (argument_list (attribute (identifier_error) identifier_error (identifier_args) identifier_args )attribute )argument_list )call )argument_list )call )argument_list )call )raise_statement )block )except_clause )try_statement )block )function_definition )module
Command line entry point for dcal.
(module (function_definition (function_name_from_taxtable) function_name_from_taxtable (parameters (identifier_cls) identifier_cls (identifier_taxtable_fp) identifier_taxtable_fp )parameters (block (expression_statement (assignment (identifier_r) identifier_r (call (attribute (identifier_csv) identifier_csv (identifier_reader) identifier_reader )attribute (argument_list (identifier_taxtable_fp) identifier_taxtable_fp )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_headers) identifier_headers (call (identifier_next) identifier_next (argument_list (identifier_r) identifier_r )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_rows) identifier_rows (generator_expression (call (attribute (identifier_collections) identifier_collections (identifier_OrderedDict) identifier_OrderedDict )attribute (argument_list (call (identifier_list) identifier_list (argument_list (call (identifier_zip) identifier_zip (argument_list (identifier_headers) identifier_headers (identifier_i) identifier_i )argument_list )call )argument_list )call )argument_list )call (for_in_clause (identifier_i) identifier_i (identifier_r) identifier_r )for_in_clause )generator_expression )assignment )expression_statement (expression_statement (assignment (identifier_row) identifier_row (call (identifier_next) identifier_next (argument_list (identifier_rows) identifier_rows )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_root) identifier_root (call (identifier_cls) identifier_cls (argument_list (keyword_argument (identifier_rank) identifier_rank (subscript (identifier_row) identifier_row (string_'rank') string_'rank' )subscript )keyword_argument (keyword_argument (identifier_tax_id) identifier_tax_id (subscript (identifier_row) identifier_row (string_'tax_id') string_'tax_id' )subscript )keyword_argument (keyword_argument (identifier_name) identifier_name (subscript (identifier_row) identifier_row (string_'tax_name') string_'tax_name' )subscript )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_path_root) identifier_path_root (call (attribute (identifier_headers) identifier_headers (identifier_index) identifier_index )attribute (argument_list (string_'root') string_'root' )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_root) identifier_root (identifier_ranks) identifier_ranks )attribute (subscript (identifier_headers) identifier_headers (slice (identifier_path_root) identifier_path_root (colon) colon )slice )subscript )assignment )expression_statement (for_statement (identifier_row) identifier_row (identifier_rows) identifier_rows (block (expression_statement (assignment (pattern_list (identifier_rank) identifier_rank (identifier_tax_id) identifier_tax_id (identifier_name) identifier_name )pattern_list (list_comprehension (subscript (identifier_row) identifier_row (identifier_i) identifier_i )subscript (for_in_clause (identifier_i) identifier_i (tuple (string_'rank') string_'rank' (string_'tax_id') string_'tax_id' (string_'tax_name') string_'tax_name' )tuple )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_path) identifier_path (list_comprehension (identifier__f) identifier__f (for_in_clause (identifier__f) identifier__f (subscript (call (identifier_list) identifier_list (argument_list (call (attribute (identifier_row) identifier_row (identifier_values) identifier_values )attribute (argument_list )argument_list )call )argument_list )call (slice (identifier_path_root) identifier_path_root (colon) colon )slice )subscript )for_in_clause (if_clause (identifier__f) identifier__f )if_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_parent) identifier_parent (call (attribute (identifier_root) identifier_root (identifier_path) identifier_path )attribute (argument_list (subscript (identifier_path) identifier_path (slice (colon) colon (unary_operator (integer_1) integer_1 )unary_operator )slice )subscript )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_parent) identifier_parent (identifier_add_child) identifier_add_child )attribute (argument_list (call (identifier_cls) identifier_cls (argument_list (identifier_rank) identifier_rank (identifier_tax_id) identifier_tax_id (keyword_argument (identifier_name) identifier_name (identifier_name) identifier_name )keyword_argument )argument_list )call )argument_list )call )expression_statement )block )for_statement (return_statement (identifier_root) identifier_root )return_statement )block )function_definition )module
Generate a node from an open handle to a taxtable, as generated by ``taxit taxtable``
(module (function_definition (function_name_save) function_name_save (parameters (identifier_self) identifier_self (default_parameter (identifier_db) identifier_db (None) None )default_parameter )parameters (block (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__db) identifier__db )attribute (boolean_operator (identifier_db) identifier_db (attribute (identifier_self) identifier_self (identifier_db) identifier_db )attribute )boolean_operator )assignment )expression_statement (expression_statement (assignment (identifier_data) identifier_data (call (attribute (identifier_self) identifier_self (identifier_prepare_data) identifier_prepare_data )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_validate) identifier_validate )attribute (argument_list )argument_list )call )expression_statement (for_statement (identifier_i) identifier_i (call (attribute (identifier_self) identifier_self (identifier_connection_retries) identifier_connection_retries )attribute (argument_list )argument_list )call (block (try_statement (block (expression_statement (assignment (identifier_created) identifier_created (conditional_expression (False) False (comparison_operator (string_'_id') string_'_id' (identifier_data) identifier_data )comparison_operator (True) True )conditional_expression )assignment )expression_statement (expression_statement (assignment (identifier_result) identifier_result (await (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier_db) identifier_db )attribute (call (attribute (identifier_self) identifier_self (identifier_get_collection_name) identifier_get_collection_name )attribute (argument_list )argument_list )call )subscript (identifier_insert_one) identifier_insert_one )attribute (argument_list (identifier_data) identifier_data )argument_list )call )await )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier__id) identifier__id )attribute (attribute (identifier_result) identifier_result (identifier_inserted_id) identifier_inserted_id )attribute )assignment )expression_statement (expression_statement (call (attribute (identifier_asyncio) identifier_asyncio (identifier_ensure_future) identifier_ensure_future )attribute (argument_list (call (attribute (identifier_post_save) identifier_post_save (identifier_send) identifier_send )attribute (argument_list (keyword_argument (identifier_sender) identifier_sender (attribute (identifier_self) identifier_self (identifier___class__) identifier___class__ )attribute )keyword_argument (keyword_argument (identifier_db) identifier_db (attribute (identifier_self) identifier_self (identifier_db) identifier_db )attribute )keyword_argument (keyword_argument (identifier_instance) identifier_instance (identifier_self) identifier_self )keyword_argument (keyword_argument (identifier_created) identifier_created (identifier_created) identifier_created )keyword_argument )argument_list )call )argument_list )call )expression_statement (break_statement )break_statement )block (except_clause (as_pattern (identifier_ConnectionFailure) identifier_ConnectionFailure (as_pattern_target (identifier_ex) identifier_ex )as_pattern_target )as_pattern (block (expression_statement (assignment (identifier_exceed) identifier_exceed (await (call (attribute (identifier_self) identifier_self (identifier_check_reconnect_tries_and_wait) identifier_check_reconnect_tries_and_wait )attribute (argument_list (identifier_i) identifier_i (string_'save') string_'save' )argument_list )call )await )assignment )expression_statement (if_statement (identifier_exceed) identifier_exceed (block (raise_statement (identifier_ex) identifier_ex )raise_statement )block )if_statement )block )except_clause )try_statement )block )for_statement )block )function_definition )module
If object has _id, then object will be created or fully rewritten. If not, object will be inserted and _id will be assigned.
(module (function_definition (function_name__do_help) function_name__do_help (parameters (identifier_self) identifier_self (identifier_cmd) identifier_cmd (identifier_args) identifier_args )parameters (block (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (identifier_self) identifier_self (identifier_doc_string) identifier_doc_string )attribute (argument_list )argument_list )call )argument_list )call )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_data_unsorted) identifier_data_unsorted (list )list )assignment )expression_statement (expression_statement (assignment (identifier_cls) identifier_cls (attribute (identifier_self) identifier_self (identifier___class__) identifier___class__ )attribute )assignment )expression_statement (for_statement (identifier_name) identifier_name (call (identifier_dir) identifier_dir (argument_list (identifier_cls) identifier_cls )argument_list )call (block (expression_statement (assignment (identifier_obj) identifier_obj (call (identifier_getattr) identifier_getattr (argument_list (identifier_cls) identifier_cls (identifier_name) identifier_name )argument_list )call )assignment )expression_statement (if_statement (call (identifier_iscommand) identifier_iscommand (argument_list (identifier_obj) identifier_obj )argument_list )call (block (expression_statement (assignment (identifier_cmds) identifier_cmds (list )list )assignment )expression_statement (for_statement (identifier_cmd) identifier_cmd (call (identifier_getcommands) identifier_getcommands (argument_list (identifier_obj) identifier_obj )argument_list )call (block (expression_statement (call (attribute (identifier_cmds) identifier_cmds (identifier_append) identifier_append )attribute (argument_list (identifier_cmd) identifier_cmd )argument_list )call )expression_statement )block )for_statement (expression_statement (assignment (identifier_cmd_str) identifier_cmd_str (call (attribute (string_',') string_',' (identifier_join) identifier_join )attribute (argument_list (call (identifier_sorted) identifier_sorted (argument_list (identifier_cmds) identifier_cmds )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_doc_str) identifier_doc_str (conditional_expression (call (attribute (call (attribute (identifier_textwrap) identifier_textwrap (identifier_dedent) identifier_dedent )attribute (argument_list (attribute (identifier_obj) identifier_obj (identifier___doc__) identifier___doc__ )attribute )argument_list )call (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call (attribute (identifier_obj) identifier_obj (identifier___doc__) identifier___doc__ )attribute (string_'(no doc string available)') string_'(no doc string available)' )conditional_expression )assignment )expression_statement (expression_statement (call (attribute (identifier_data_unsorted) identifier_data_unsorted (identifier_append) identifier_append )attribute (argument_list (list (identifier_cmd_str) identifier_cmd_str (identifier_doc_str) identifier_doc_str )list )argument_list )call )expression_statement )block )if_statement )block )for_statement (expression_statement (assignment (identifier_data_sorted) identifier_data_sorted (call (identifier_sorted) identifier_sorted (argument_list (identifier_data_unsorted) identifier_data_unsorted (keyword_argument (identifier_key) identifier_key (lambda (lambda_parameters (identifier_x) identifier_x )lambda_parameters (subscript (identifier_x) identifier_x (integer_0) integer_0 )subscript )lambda )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_data) identifier_data (binary_operator (list (list (string_'COMMANDS') string_'COMMANDS' (string_'DOC STRING') string_'DOC STRING' )list )list (identifier_data_sorted) identifier_data_sorted )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_table_banner) identifier_table_banner (string_'List of Available Commands') string_'List of Available Commands' )assignment )expression_statement (expression_statement (assignment (identifier_table) identifier_table (call (attribute (identifier_terminaltables) identifier_terminaltables (identifier_SingleTable) identifier_SingleTable )attribute (argument_list (identifier_data) identifier_data (identifier_table_banner) identifier_table_banner )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_table) identifier_table (identifier_inner_row_border) identifier_inner_row_border )attribute (True) True )assignment )expression_statement (expression_statement (assignment (attribute (identifier_table) identifier_table (identifier_inner_heading_row_border) identifier_inner_heading_row_border )attribute (True) True )assignment )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (attribute (identifier_table) identifier_table (identifier_table) identifier_table )attribute )argument_list )call )expression_statement )block )function_definition )module
Display doc strings of the shell and its commands.
(module (function_definition (function_name_order_target_value) function_name_order_target_value (parameters (identifier_self) identifier_self (identifier_asset) identifier_asset (identifier_target) identifier_target (default_parameter (identifier_limit_price) identifier_limit_price (None) None )default_parameter (default_parameter (identifier_stop_price) identifier_stop_price (None) None )default_parameter (default_parameter (identifier_style) identifier_style (None) None )default_parameter )parameters (block (if_statement (not_operator (call (attribute (identifier_self) identifier_self (identifier__can_order_asset) identifier__can_order_asset )attribute (argument_list (identifier_asset) identifier_asset )argument_list )call )not_operator (block (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_target_amount) identifier_target_amount (call (attribute (identifier_self) identifier_self (identifier__calculate_order_value_amount) identifier__calculate_order_value_amount )attribute (argument_list (identifier_asset) identifier_asset (identifier_target) identifier_target )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_amount) identifier_amount (call (attribute (identifier_self) identifier_self (identifier__calculate_order_target_amount) identifier__calculate_order_target_amount )attribute (argument_list (identifier_asset) identifier_asset (identifier_target_amount) identifier_target_amount )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier_order) identifier_order )attribute (argument_list (identifier_asset) identifier_asset (identifier_amount) identifier_amount (keyword_argument (identifier_limit_price) identifier_limit_price (identifier_limit_price) identifier_limit_price )keyword_argument (keyword_argument (identifier_stop_price) identifier_stop_price (identifier_stop_price) identifier_stop_price )keyword_argument (keyword_argument (identifier_style) identifier_style (identifier_style) identifier_style )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Place an order to adjust a position to a target value. If the position doesn't already exist, this is equivalent to placing a new order. If the position does exist, this is equivalent to placing an order for the difference between the target value and the current value. If the Asset being ordered is a Future, the 'target value' calculated is actually the target exposure, as Futures have no 'value'. Parameters ---------- asset : Asset The asset that this order is for. target : float The desired total value of ``asset``. limit_price : float, optional The limit price for the order. stop_price : float, optional The stop price for the order. style : ExecutionStyle The execution style for the order. Returns ------- order_id : str The unique identifier for this order. Notes ----- ``order_target_value`` does not take into account any open orders. For example: .. code-block:: python order_target_value(sid(0), 10) order_target_value(sid(0), 10) This code will result in 20 dollars of ``sid(0)`` because the first call to ``order_target_value`` will not have been filled when the second ``order_target_value`` call is made. See :func:`zipline.api.order` for more information about ``limit_price``, ``stop_price``, and ``style`` See Also -------- :class:`zipline.finance.execution.ExecutionStyle` :func:`zipline.api.order` :func:`zipline.api.order_target` :func:`zipline.api.order_target_percent`
(module (function_definition (function_name_export_xlsx) function_name_export_xlsx (parameters (identifier_self) identifier_self (identifier_key) identifier_key )parameters (block (expression_statement (assignment (identifier_spreadsheet_file) identifier_spreadsheet_file (call (attribute (call (attribute (call (attribute (attribute (identifier_self) identifier_self (identifier_client) identifier_client )attribute (identifier_files) identifier_files )attribute (argument_list )argument_list )call (identifier_get) identifier_get )attribute (argument_list (keyword_argument (identifier_fileId) identifier_fileId (identifier_key) identifier_key )keyword_argument )argument_list )call (identifier_execute) identifier_execute )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_links) identifier_links (call (attribute (identifier_spreadsheet_file) identifier_spreadsheet_file (identifier_get) identifier_get )attribute (argument_list (string_'exportLinks') string_'exportLinks' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_downloadurl) identifier_downloadurl (call (attribute (identifier_links) identifier_links (identifier_get) identifier_get )attribute (argument_list (string_'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') string_'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' )argument_list )call )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_resp) identifier_resp (identifier_content) identifier_content )pattern_list (call (attribute (attribute (attribute (identifier_self) identifier_self (identifier_client) identifier_client )attribute (identifier__http) identifier__http )attribute (identifier_request) identifier_request )attribute (argument_list (identifier_downloadurl) identifier_downloadurl )argument_list )call )assignment )expression_statement (return_statement (identifier_content) identifier_content )return_statement )block )function_definition )module
Download xlsx version of spreadsheet.
(module (function_definition (function_name__get_ssh_config) function_name__get_ssh_config (parameters (default_parameter (identifier_config_path) identifier_config_path (string_'~/.ssh/config') string_'~/.ssh/config' )default_parameter )parameters (block (expression_statement (assignment (identifier_ssh_config) identifier_ssh_config (call (attribute (identifier_paramiko) identifier_paramiko (identifier_SSHConfig) identifier_SSHConfig )attribute (argument_list )argument_list )call )assignment )expression_statement (try_statement (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_realpath) identifier_realpath )attribute (argument_list (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_expanduser) identifier_expanduser )attribute (argument_list (identifier_config_path) identifier_config_path )argument_list )call )argument_list )call )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_ssh_config) identifier_ssh_config (identifier_parse) identifier_parse )attribute (argument_list (identifier_f) identifier_f )argument_list )call )expression_statement )block )with_statement )block (except_clause (identifier_IOError) identifier_IOError (block (pass_statement )pass_statement )block )except_clause )try_statement (return_statement (identifier_ssh_config) identifier_ssh_config )return_statement )block )function_definition )module
Extract the configuration located at ``config_path``. Returns: paramiko.SSHConfig: the configuration instance.
(module (function_definition (function_name_load_gffutils_db) function_name_load_gffutils_db (parameters (identifier_f) identifier_f )parameters (block (import_statement (dotted_name (identifier_gffutils) identifier_gffutils )dotted_name )import_statement (expression_statement (assignment (identifier_db) identifier_db (call (attribute (identifier_gffutils) identifier_gffutils (identifier_FeatureDB) identifier_FeatureDB )attribute (argument_list (identifier_f) identifier_f (keyword_argument (identifier_keep_order) identifier_keep_order (True) True )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (identifier_db) identifier_db )return_statement )block )function_definition )module
Load database for gffutils. Parameters ---------- f : str Path to database. Returns ------- db : gffutils.FeatureDB gffutils feature database.
(module (function_definition (function_name_write) function_name_write (parameters (identifier_self) identifier_self (identifier_data) identifier_data )parameters (block (if_statement (comparison_operator (call (identifier_type) identifier_type (argument_list (identifier_data) identifier_data )argument_list )call (identifier_bytes) identifier_bytes )comparison_operator (block (expression_statement (assignment (identifier_data) identifier_data (call (attribute (identifier_self) identifier_self (identifier__encode_body) identifier__encode_body )attribute (argument_list (identifier_data) identifier_data )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_protocol) identifier_protocol )attribute (identifier_push_data) identifier_push_data )attribute (argument_list (binary_operator (string_b"%x\r\n%b\r\n") string_b"%x\r\n%b\r\n" (tuple (call (identifier_len) identifier_len (argument_list (identifier_data) identifier_data )argument_list )call (identifier_data) identifier_data )tuple )binary_operator )argument_list )call )expression_statement (expression_statement (await (call (attribute (attribute (identifier_self) identifier_self (identifier_protocol) identifier_protocol )attribute (identifier_drain) identifier_drain )attribute (argument_list )argument_list )call )await )expression_statement )block )function_definition )module
Writes a chunk of data to the streaming response. :param data: bytes-ish data to be written.
(module (function_definition (function_name_sanitize_html) function_name_sanitize_html (parameters (identifier_value) identifier_value (default_parameter (identifier_valid_tags) identifier_valid_tags (identifier_VALID_TAGS) identifier_VALID_TAGS )default_parameter (default_parameter (identifier_strip) identifier_strip (True) True )default_parameter )parameters (block (return_statement (call (attribute (identifier_bleach) identifier_bleach (identifier_clean) identifier_clean )attribute (argument_list (identifier_value) identifier_value (keyword_argument (identifier_tags) identifier_tags (call (identifier_list) identifier_list (argument_list (call (attribute (identifier_VALID_TAGS) identifier_VALID_TAGS (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call )argument_list )call )keyword_argument (keyword_argument (identifier_attributes) identifier_attributes (identifier_VALID_TAGS) identifier_VALID_TAGS )keyword_argument (keyword_argument (identifier_strip) identifier_strip (identifier_strip) identifier_strip )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Strips unwanted markup out of HTML.
(module (function_definition (function_name_escape) function_name_escape (parameters (identifier_text) identifier_text (default_parameter (identifier_newline) identifier_newline (False) False )default_parameter )parameters (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_text) identifier_text (identifier_basestring) identifier_basestring )argument_list )call (block (if_statement (comparison_operator (string_'&') string_'&' (identifier_text) identifier_text )comparison_operator (block (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_text) identifier_text (identifier_replace) identifier_replace )attribute (argument_list (string_'&') string_'&' (string_'&amp;') string_'&amp;' )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (comparison_operator (string_'>') string_'>' (identifier_text) identifier_text )comparison_operator (block (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_text) identifier_text (identifier_replace) identifier_replace )attribute (argument_list (string_'>') string_'>' (string_'&gt;') string_'&gt;' )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (comparison_operator (string_'<') string_'<' (identifier_text) identifier_text )comparison_operator (block (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_text) identifier_text (identifier_replace) identifier_replace )attribute (argument_list (string_'<') string_'<' (string_'&lt;') string_'&lt;' )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (comparison_operator (string_'\"') string_'\"' (identifier_text) identifier_text )comparison_operator (block (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_text) identifier_text (identifier_replace) identifier_replace )attribute (argument_list (string_'\"') string_'\"' (string_'&quot;') string_'&quot;' )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (comparison_operator (string_'\'') string_'\'' (identifier_text) identifier_text )comparison_operator (block (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_text) identifier_text (identifier_replace) identifier_replace )attribute (argument_list (string_'\'') string_'\'' (string_'&quot;') string_'&quot;' )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (identifier_newline) identifier_newline (block (if_statement (comparison_operator (string_'\n') string_'\n' (identifier_text) identifier_text )comparison_operator (block (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_text) identifier_text (identifier_replace) identifier_replace )attribute (argument_list (string_'\n') string_'\n' (string_'<br>') string_'<br>' )argument_list )call )assignment )expression_statement )block )if_statement )block )if_statement )block )if_statement (return_statement (identifier_text) identifier_text )return_statement )block )function_definition )module
Escape special html characters.
(module (function_definition (function_name_cancelled) function_name_cancelled (parameters (identifier_self) identifier_self )parameters (block (return_statement (boolean_operator (comparison_operator (attribute (identifier_self) identifier_self (identifier__state) identifier__state )attribute (attribute (identifier_self) identifier_self (identifier_S_EXCEPTION) identifier_S_EXCEPTION )attribute )comparison_operator (call (identifier_isinstance) identifier_isinstance (argument_list (attribute (identifier_self) identifier_self (identifier__result) identifier__result )attribute (identifier_Cancelled) identifier_Cancelled )argument_list )call )boolean_operator )return_statement )block )function_definition )module
Return whether this future was successfully cancelled.
(module (function_definition (function_name__padding) function_name__padding (parameters (identifier_self) identifier_self (identifier_image) identifier_image (identifier_geometry) identifier_geometry (identifier_options) identifier_options )parameters (block (expression_statement (assignment (subscript (subscript (identifier_image) identifier_image (string_'options') string_'options' )subscript (string_'background') string_'background' )subscript (call (attribute (identifier_options) identifier_options (identifier_get) identifier_get )attribute (argument_list (string_'padding_color') string_'padding_color' )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (subscript (identifier_image) identifier_image (string_'options') string_'options' )subscript (string_'gravity') string_'gravity' )subscript (string_'center') string_'center' )assignment )expression_statement (expression_statement (assignment (subscript (subscript (identifier_image) identifier_image (string_'options') string_'options' )subscript (string_'extent') string_'extent' )subscript (binary_operator (string_'%sx%s') string_'%sx%s' (tuple (subscript (identifier_geometry) identifier_geometry (integer_0) integer_0 )subscript (subscript (identifier_geometry) identifier_geometry (integer_1) integer_1 )subscript )tuple )binary_operator )assignment )expression_statement (return_statement (identifier_image) identifier_image )return_statement )block )function_definition )module
Pads the image
(module (function_definition (function_name___execute_bisz) function_name___execute_bisz (parameters (identifier_self) identifier_self (identifier_instr) identifier_instr )parameters (block (expression_statement (assignment (identifier_op0_val) identifier_op0_val (call (attribute (identifier_self) identifier_self (identifier_read_operand) identifier_read_operand )attribute (argument_list (subscript (attribute (identifier_instr) identifier_instr (identifier_operands) identifier_operands )attribute (integer_0) integer_0 )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_op2_val) identifier_op2_val (conditional_expression (integer_1) integer_1 (comparison_operator (identifier_op0_val) identifier_op0_val (integer_0) integer_0 )comparison_operator (integer_0) integer_0 )conditional_expression )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_write_operand) identifier_write_operand )attribute (argument_list (subscript (attribute (identifier_instr) identifier_instr (identifier_operands) identifier_operands )attribute (integer_2) integer_2 )subscript (identifier_op2_val) identifier_op2_val )argument_list )call )expression_statement (return_statement (None) None )return_statement )block )function_definition )module
Execute BISZ instruction.
(module (function_definition (function_name_getJson) function_name_getJson (parameters (identifier_cls) identifier_cls (identifier_url) identifier_url (default_parameter (identifier_method) identifier_method (string_'GET') string_'GET' )default_parameter (default_parameter (identifier_headers) identifier_headers (dictionary )dictionary )default_parameter (default_parameter (identifier_data) identifier_data (None) None )default_parameter (default_parameter (identifier_socket) identifier_socket (None) None )default_parameter (default_parameter (identifier_timeout) identifier_timeout (integer_120) integer_120 )default_parameter )parameters (block (if_statement (not_operator (comparison_operator (string_'Content-Type') string_'Content-Type' (identifier_headers) identifier_headers )comparison_operator )not_operator (block (expression_statement (assignment (subscript (identifier_headers) identifier_headers (string_'Content-Type') string_'Content-Type' )subscript (list (string_'application/json') string_'application/json' )list )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_body) identifier_body (yield (call (attribute (call (identifier_cls) identifier_cls (argument_list )argument_list )call (identifier_getBody) identifier_getBody )attribute (argument_list (identifier_url) identifier_url (identifier_method) identifier_method (identifier_headers) identifier_headers (identifier_data) identifier_data (identifier_socket) identifier_socket (identifier_timeout) identifier_timeout )argument_list )call )yield )assignment )expression_statement (expression_statement (call (attribute (identifier_defer) identifier_defer (identifier_returnValue) identifier_returnValue )attribute (argument_list (call (attribute (identifier_json) identifier_json (identifier_loads) identifier_loads )attribute (argument_list (identifier_body) identifier_body )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
Fetch a JSON result via HTTP
(module (function_definition (function_name_set_PLOS_2column_fig_style) function_name_set_PLOS_2column_fig_style (parameters (identifier_self) identifier_self (default_parameter (identifier_ratio) identifier_ratio (integer_1) integer_1 )default_parameter )parameters (block (expression_statement (call (attribute (attribute (identifier_plt) identifier_plt (identifier_rcParams) identifier_rcParams )attribute (identifier_update) identifier_update )attribute (argument_list (dictionary (pair (string_'figure.figsize') string_'figure.figsize' (list (attribute (identifier_self) identifier_self (identifier_PLOSwidth2Col) identifier_PLOSwidth2Col )attribute (binary_operator (attribute (identifier_self) identifier_self (identifier_PLOSwidth2Col) identifier_PLOSwidth2Col )attribute (identifier_ratio) identifier_ratio )binary_operator )list )pair )dictionary )argument_list )call )expression_statement )block )function_definition )module
figure size corresponding to Plos 2 columns
(module (function_definition (function_name_queue) function_name_queue (parameters (identifier_p_queue) identifier_p_queue (default_parameter (identifier_host) identifier_host (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_host) identifier_host (None) None )comparison_operator (block (return_statement (call (identifier__path) identifier__path (argument_list (attribute (identifier__c) identifier__c (identifier_FSQ_QUEUE) identifier_FSQ_QUEUE )attribute (keyword_argument (identifier_root) identifier_root (call (identifier__path) identifier__path (argument_list (identifier_host) identifier_host (keyword_argument (identifier_root) identifier_root (call (identifier_hosts) identifier_hosts (argument_list (identifier_p_queue) identifier_p_queue )argument_list )call )keyword_argument )argument_list )call )keyword_argument )argument_list )call )return_statement )block )if_statement (return_statement (call (identifier__path) identifier__path (argument_list (identifier_p_queue) identifier_p_queue (attribute (identifier__c) identifier__c (identifier_FSQ_QUEUE) identifier_FSQ_QUEUE )attribute )argument_list )call )return_statement )block )function_definition )module
Construct a path to the queue dir for a queue
(module (function_definition (function_name___expr_str) function_name___expr_str (parameters (identifier_cls) identifier_cls (identifier_expr) identifier_expr (identifier_level) identifier_level )parameters (block (expression_statement (assignment (identifier_ident) identifier_ident (binary_operator (binary_operator (string_' ') string_' ' (identifier_level) identifier_level )binary_operator (integer_4) integer_4 )binary_operator )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_expr) identifier_expr (identifier_tuple) identifier_tuple )argument_list )call (block (return_statement (call (attribute (string_'{}{}') string_'{}{}' (identifier_format) identifier_format )attribute (argument_list (identifier_ident) identifier_ident (call (identifier_str) identifier_str (argument_list (identifier_expr) identifier_expr )argument_list )call )argument_list )call )return_statement )block )if_statement (if_statement (comparison_operator (subscript (attribute (identifier_expr) identifier_expr (identifier_etype) identifier_etype )attribute (integer_0) integer_0 )subscript (list (string_'pvar') string_'pvar' (string_'constant') string_'constant' )list )comparison_operator (block (return_statement (call (attribute (string_'{}Expression(etype={}, args={})') string_'{}Expression(etype={}, args={})' (identifier_format) identifier_format )attribute (argument_list (identifier_ident) identifier_ident (attribute (identifier_expr) identifier_expr (identifier_etype) identifier_etype )attribute (attribute (identifier_expr) identifier_expr (identifier_args) identifier_args )attribute )argument_list )call )return_statement )block )if_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_expr) identifier_expr (identifier_Expression) identifier_Expression )argument_list )call )not_operator (block (return_statement (call (attribute (string_'{}{}') string_'{}{}' (identifier_format) identifier_format )attribute (argument_list (identifier_ident) identifier_ident (call (identifier_str) identifier_str (argument_list (identifier_expr) identifier_expr )argument_list )call )argument_list )call )return_statement )block )if_statement (expression_statement (assignment (identifier_args) identifier_args (call (identifier_list) identifier_list (generator_expression (call (attribute (identifier_cls) identifier_cls (identifier___expr_str) identifier___expr_str )attribute (argument_list (identifier_arg) identifier_arg (binary_operator (identifier_level) identifier_level (integer_1) integer_1 )binary_operator )argument_list )call (for_in_clause (identifier_arg) identifier_arg (attribute (identifier_expr) identifier_expr (identifier_args) identifier_args )attribute )for_in_clause )generator_expression )call )assignment )expression_statement (expression_statement (assignment (identifier_args) identifier_args (call (attribute (string_'\n') string_'\n' (identifier_join) identifier_join )attribute (argument_list (identifier_args) identifier_args )argument_list )call )assignment )expression_statement (return_statement (call (attribute (string_'{}Expression(etype={}, args=\n{})') string_'{}Expression(etype={}, args=\n{})' (identifier_format) identifier_format )attribute (argument_list (identifier_ident) identifier_ident (attribute (identifier_expr) identifier_expr (identifier_etype) identifier_etype )attribute (identifier_args) identifier_args )argument_list )call )return_statement )block )function_definition )module
Returns string representing the expression.
(module (function_definition (function_name_next_frame_l2) function_name_next_frame_l2 (parameters )parameters (block (expression_statement (assignment (identifier_hparams) identifier_hparams (call (identifier_next_frame_basic_deterministic) identifier_next_frame_basic_deterministic (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_hparams) identifier_hparams (identifier_loss) identifier_loss )attribute (string_"targets") string_"targets" )subscript (attribute (identifier_modalities) identifier_modalities (identifier_video_l2_loss) identifier_video_l2_loss )attribute )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_hparams) identifier_hparams (identifier_top) identifier_top )attribute (string_"targets") string_"targets" )subscript (attribute (identifier_modalities) identifier_modalities (identifier_video_l1_top) identifier_video_l1_top )attribute )assignment )expression_statement (expression_statement (assignment (attribute (identifier_hparams) identifier_hparams (identifier_video_modality_loss_cutoff) identifier_video_modality_loss_cutoff )attribute (float_2.4) float_2.4 )assignment )expression_statement (return_statement (identifier_hparams) identifier_hparams )return_statement )block )function_definition )module
Basic conv model with L2 modality.
(module (function_definition (function_name__dedup_index) function_name__dedup_index (parameters (identifier_self) identifier_self (identifier_df_a) identifier_df_a )parameters (block (expression_statement (assignment (identifier_pairs) identifier_pairs (call (attribute (identifier_self) identifier_self (identifier__link_index) identifier__link_index )attribute (argument_list (identifier_df_a) identifier_df_a (identifier_df_a) identifier_df_a )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_pairs) identifier_pairs (subscript (identifier_pairs) identifier_pairs (comparison_operator (subscript (attribute (identifier_pairs) identifier_pairs (identifier_labels) identifier_labels )attribute (integer_0) integer_0 )subscript (subscript (attribute (identifier_pairs) identifier_pairs (identifier_labels) identifier_labels )attribute (integer_1) integer_1 )subscript )comparison_operator )subscript )assignment )expression_statement (return_statement (identifier_pairs) identifier_pairs )return_statement )block )function_definition )module
Build an index for deduplicating a dataset. Parameters ---------- df_a : (tuple of) pandas.Series The data of the DataFrame to build the index with. Returns ------- pandas.MultiIndex A pandas.MultiIndex with record pairs. Each record pair contains the index values of two records. The records are sampled from the lower triangular part of the matrix.
(module (function_definition (function_name_join_sources) function_name_join_sources (parameters (typed_parameter (identifier_source_module) identifier_source_module (type (identifier_DeploymentModule) identifier_DeploymentModule )type )typed_parameter (typed_parameter (identifier_contract_name) identifier_contract_name (type (identifier_str) identifier_str )type )typed_parameter )parameters (block (expression_statement (assignment (identifier_joined_file) identifier_joined_file (call (attribute (attribute (call (identifier_Path) identifier_Path (argument_list (identifier___file__) identifier___file__ )argument_list )call (identifier_parent) identifier_parent )attribute (identifier_joinpath) identifier_joinpath )attribute (argument_list (string_'joined.sol') string_'joined.sol' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_remapping) identifier_remapping (dictionary_comprehension (pair (identifier_module) identifier_module (call (identifier_str) identifier_str (argument_list (identifier_path) identifier_path )argument_list )call )pair (for_in_clause (pattern_list (identifier_module) identifier_module (identifier_path) identifier_path )pattern_list (call (attribute (call (identifier_contracts_source_path) identifier_contracts_source_path (argument_list )argument_list )call (identifier_items) identifier_items )attribute (argument_list )argument_list )call )for_in_clause )dictionary_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_command) identifier_command (list (string_'./utils/join-contracts.py') string_'./utils/join-contracts.py' (string_'--import-map') string_'--import-map' (call (attribute (identifier_json) identifier_json (identifier_dumps) identifier_dumps )attribute (argument_list (identifier_remapping) identifier_remapping )argument_list )call (call (identifier_str) identifier_str (argument_list (call (attribute (call (identifier_contracts_source_path_of_deployment_module) identifier_contracts_source_path_of_deployment_module (argument_list (identifier_source_module) identifier_source_module )argument_list )call (identifier_joinpath) identifier_joinpath )attribute (argument_list (binary_operator (identifier_contract_name) identifier_contract_name (string_'.sol') string_'.sol' )binary_operator )argument_list )call )argument_list )call (call (identifier_str) identifier_str (argument_list (identifier_joined_file) identifier_joined_file )argument_list )call )list )assignment )expression_statement (expression_statement (assignment (identifier_working_dir) identifier_working_dir (attribute (attribute (call (identifier_Path) identifier_Path (argument_list (identifier___file__) identifier___file__ )argument_list )call (identifier_parent) identifier_parent )attribute (identifier_parent) identifier_parent )attribute )assignment )expression_statement (try_statement (block (expression_statement (call (attribute (identifier_subprocess) identifier_subprocess (identifier_check_call) identifier_check_call )attribute (argument_list (identifier_command) identifier_command (keyword_argument (identifier_cwd) identifier_cwd (identifier_working_dir) identifier_working_dir )keyword_argument )argument_list )call )expression_statement )block (except_clause (as_pattern (attribute (identifier_subprocess) identifier_subprocess (identifier_CalledProcessError) identifier_CalledProcessError )attribute (as_pattern_target (identifier_ex) identifier_ex )as_pattern_target )as_pattern (block (expression_statement (call (identifier_print) identifier_print (argument_list (string_f'cd {str(working_dir)}; {subprocess.list2cmdline(command)} failed.') string_f'cd {str(working_dir)}; {subprocess.list2cmdline(command)} failed.' )argument_list )call )expression_statement (raise_statement (identifier_ex) identifier_ex )raise_statement )block )except_clause )try_statement (return_statement (call (attribute (identifier_joined_file) identifier_joined_file (identifier_read_text) identifier_read_text )attribute (argument_list )argument_list )call )return_statement )block )function_definition )module
Use join-contracts.py to concatenate all imported Solidity files. Args: source_module: a module name to look up contracts_source_path() contract_name: 'TokenNetworkRegistry', 'SecretRegistry' etc.
(module (function_definition (function_name_debug) function_name_debug (parameters (identifier_method) identifier_method )parameters (block (function_definition (function_name_new_method) function_name_new_method (parameters (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (import_statement (dotted_name (identifier_pdb) identifier_pdb )dotted_name )import_statement (try_statement (block (import_statement (dotted_name (identifier_pudb) identifier_pudb )dotted_name )import_statement )block (except_clause (identifier_ImportError) identifier_ImportError (block (expression_statement (assignment (identifier_pudb) identifier_pudb (identifier_pdb) identifier_pdb )assignment )expression_statement )block )except_clause )try_statement (try_statement (block (expression_statement (call (attribute (identifier_pudb) identifier_pudb (identifier_runcall) identifier_runcall )attribute (argument_list (identifier_method) identifier_method (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )expression_statement )block (except_clause (attribute (attribute (identifier_pdb) identifier_pdb (identifier_bdb) identifier_bdb )attribute (identifier_BdbQuit) identifier_BdbQuit )attribute (block (expression_statement (call (attribute (identifier_sys) identifier_sys (identifier_exit) identifier_exit )attribute (argument_list (string_'Normal quit from debugger') string_'Normal quit from debugger' )argument_list )call )expression_statement )block )except_clause )try_statement )block )function_definition (expression_statement (assignment (attribute (identifier_new_method) identifier_new_method (identifier___doc__) identifier___doc__ )attribute (attribute (identifier_method) identifier_method (identifier___doc__) identifier___doc__ )attribute )assignment )expression_statement (expression_statement (assignment (attribute (identifier_new_method) identifier_new_method (identifier___name__) identifier___name__ )attribute (binary_operator (string_'debug(%s)') string_'debug(%s)' (attribute (identifier_method) identifier_method (identifier___name__) identifier___name__ )attribute )binary_operator )assignment )expression_statement (return_statement (identifier_new_method) identifier_new_method )return_statement )block )function_definition )module
Decorator to debug the given method
(module (function_definition (function_name_memoize) function_name_memoize (parameters (identifier_fun) identifier_fun )parameters (block (expression_statement (assignment (identifier_argspec) identifier_argspec (call (attribute (identifier_inspect2) identifier_inspect2 (identifier_getfullargspec) identifier_getfullargspec )attribute (argument_list (identifier_fun) identifier_fun )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_arg_names) identifier_arg_names (binary_operator (attribute (identifier_argspec) identifier_argspec (identifier_args) identifier_args )attribute (attribute (identifier_argspec) identifier_argspec (identifier_kwonlyargs) identifier_kwonlyargs )attribute )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_kwargs_defaults) identifier_kwargs_defaults (call (identifier_get_kwargs_defaults) identifier_get_kwargs_defaults (argument_list (identifier_argspec) identifier_argspec )argument_list )call )assignment )expression_statement (function_definition (function_name_cache_key) function_name_cache_key (parameters (identifier_args) identifier_args (identifier_kwargs) identifier_kwargs )parameters (block (return_statement (call (identifier_get_args_tuple) identifier_get_args_tuple (argument_list (identifier_args) identifier_args (identifier_kwargs) identifier_kwargs (identifier_arg_names) identifier_arg_names (identifier_kwargs_defaults) identifier_kwargs_defaults )argument_list )call )return_statement )block )function_definition (decorated_definition (decorator (call (attribute (identifier_functools) identifier_functools (identifier_wraps) identifier_wraps )attribute (argument_list (identifier_fun) identifier_fun )argument_list )call )decorator (function_definition (function_name_new_fun) function_name_new_fun (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_k) identifier_k (call (identifier_cache_key) identifier_cache_key (argument_list (identifier_args) identifier_args (identifier_kwargs) identifier_kwargs )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_k) identifier_k (attribute (identifier_new_fun) identifier_new_fun (identifier___cache) identifier___cache )attribute )comparison_operator (block (expression_statement (assignment (subscript (attribute (identifier_new_fun) identifier_new_fun (identifier___cache) identifier___cache )attribute (identifier_k) identifier_k )subscript (call (identifier_fun) identifier_fun (argument_list (list_splat (identifier_args) identifier_args )list_splat (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (subscript (attribute (identifier_new_fun) identifier_new_fun (identifier___cache) identifier___cache )attribute (identifier_k) identifier_k )subscript )return_statement )block )function_definition )decorated_definition (function_definition (function_name_clear_cache) function_name_clear_cache (parameters )parameters (block (expression_statement (call (attribute (attribute (identifier_new_fun) identifier_new_fun (identifier___cache) identifier___cache )attribute (identifier_clear) identifier_clear )attribute (argument_list )argument_list )call )expression_statement )block )function_definition (expression_statement (assignment (attribute (identifier_new_fun) identifier_new_fun (identifier___cache) identifier___cache )attribute (dictionary )dictionary )assignment )expression_statement (expression_statement (assignment (attribute (identifier_new_fun) identifier_new_fun (identifier_clear_cache) identifier_clear_cache )attribute (identifier_clear_cache) identifier_clear_cache )assignment )expression_statement (return_statement (identifier_new_fun) identifier_new_fun )return_statement )block )function_definition )module
Memoizes return values of the decorated function. Similar to l0cache, but the cache persists for the duration of the process, unless clear_cache() is called on the function.
(module (function_definition (function_name_delete) function_name_delete (parameters (identifier_ids) identifier_ids (identifier_yes) identifier_yes )parameters (block (expression_statement (assignment (identifier_failures) identifier_failures (False) False )assignment )expression_statement (for_statement (identifier_id) identifier_id (identifier_ids) identifier_ids (block (expression_statement (assignment (identifier_data_source) identifier_data_source (call (identifier_get_data_object) identifier_get_data_object (argument_list (identifier_id) identifier_id (keyword_argument (identifier_use_data_config) identifier_use_data_config (True) True )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (not_operator (identifier_data_source) identifier_data_source )not_operator (block (expression_statement (assignment (identifier_failures) identifier_failures (True) True )assignment )expression_statement (continue_statement )continue_statement )block )if_statement (expression_statement (assignment (identifier_data_name) identifier_data_name (call (identifier_normalize_data_name) identifier_normalize_data_name (argument_list (attribute (identifier_data_source) identifier_data_source (identifier_name) identifier_name )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_suffix) identifier_suffix (subscript (call (attribute (identifier_data_name) identifier_data_name (identifier_split) identifier_split )attribute (argument_list (string_'/') string_'/' )argument_list )call (unary_operator (integer_1) integer_1 )unary_operator )subscript )assignment )expression_statement (if_statement (not_operator (call (attribute (identifier_suffix) identifier_suffix (identifier_isdigit) identifier_isdigit )attribute (argument_list )argument_list )call )not_operator (block (expression_statement (assignment (identifier_failures) identifier_failures (True) True )assignment )expression_statement (expression_statement (call (attribute (identifier_floyd_logger) identifier_floyd_logger (identifier_error) identifier_error )attribute (argument_list (string_'%s is not a dataset, skipped.') string_'%s is not a dataset, skipped.' (identifier_id) identifier_id )argument_list )call )expression_statement (if_statement (comparison_operator (identifier_suffix) identifier_suffix (string_'output') string_'output' )comparison_operator (block (expression_statement (call (attribute (identifier_floyd_logger) identifier_floyd_logger (identifier_error) identifier_error )attribute (argument_list (string_'To delete job output, please delete the job itself.') string_'To delete job output, please delete the job itself.' )argument_list )call )expression_statement )block )if_statement (continue_statement )continue_statement )block )if_statement (if_statement (boolean_operator (not_operator (identifier_yes) identifier_yes )not_operator (not_operator (call (attribute (identifier_click) identifier_click (identifier_confirm) identifier_confirm )attribute (argument_list (call (attribute (string_"Delete Data: {}?") string_"Delete Data: {}?" (identifier_format) identifier_format )attribute (argument_list (identifier_data_name) identifier_data_name )argument_list )call (keyword_argument (identifier_abort) identifier_abort (False) False )keyword_argument (keyword_argument (identifier_default) identifier_default (False) False )keyword_argument )argument_list )call )not_operator )boolean_operator (block (expression_statement (call (attribute (identifier_floyd_logger) identifier_floyd_logger (identifier_info) identifier_info )attribute (argument_list (string_"Data %s: Skipped") string_"Data %s: Skipped" (identifier_data_name) identifier_data_name )argument_list )call )expression_statement (continue_statement )continue_statement )block )if_statement (if_statement (not_operator (call (attribute (call (identifier_DataClient) identifier_DataClient (argument_list )argument_list )call (identifier_delete) identifier_delete )attribute (argument_list (attribute (identifier_data_source) identifier_data_source (identifier_id) identifier_id )attribute )argument_list )call )not_operator (block (expression_statement (assignment (identifier_failures) identifier_failures (True) True )assignment )expression_statement )block (else_clause (block (expression_statement (call (attribute (identifier_floyd_logger) identifier_floyd_logger (identifier_info) identifier_info )attribute (argument_list (string_"Data %s: Deleted") string_"Data %s: Deleted" (identifier_data_name) identifier_data_name )argument_list )call )expression_statement )block )else_clause )if_statement )block )for_statement (if_statement (identifier_failures) identifier_failures (block (expression_statement (call (attribute (identifier_sys) identifier_sys (identifier_exit) identifier_exit )attribute (argument_list (integer_1) integer_1 )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
Delete datasets.
(module (function_definition (function_name_extract_formats) function_name_extract_formats (parameters (identifier_config_handle) identifier_config_handle )parameters (block (expression_statement (assignment (identifier_configurations) identifier_configurations (call (identifier_dict) identifier_dict (argument_list (identifier_config_handle) identifier_config_handle )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_formats) identifier_formats (call (identifier_dict) identifier_dict (argument_list (call (attribute (identifier_configurations) identifier_configurations (identifier_get) identifier_get )attribute (argument_list (string_'formats') string_'formats' (dictionary )dictionary )argument_list )call )argument_list )call )assignment )expression_statement (return_statement (identifier_formats) identifier_formats )return_statement )block )function_definition )module
Get application formats. See :class:`gogoutils.Formats` for available options. Args: config_handle (configparser.ConfigParser): Instance of configurations. Returns: dict: Formats in ``{$format_type: $format_pattern}``.
(module (function_definition (function_name_get) function_name_get (parameters (identifier_self) identifier_self (identifier_slug) identifier_slug )parameters (block (expression_statement (assignment (identifier_kb) identifier_kb (call (attribute (identifier_api) identifier_api (identifier_get_kb_by_slug) identifier_get_kb_by_slug )attribute (argument_list (identifier_slug) identifier_slug )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_check_knowledge_access) identifier_check_knowledge_access (argument_list (identifier_kb) identifier_kb )argument_list )call )expression_statement (expression_statement (assignment (identifier_parser) identifier_parser (call (attribute (identifier_reqparse) identifier_reqparse (identifier_RequestParser) identifier_RequestParser )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_parser) identifier_parser (identifier_add_argument) identifier_add_argument )attribute (argument_list (string_'from') string_'from' (keyword_argument (identifier_type) identifier_type (identifier_str) identifier_str )keyword_argument (keyword_argument (identifier_help) identifier_help (string_"Return only entries where key matches this.") string_"Return only entries where key matches this." )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_parser) identifier_parser (identifier_add_argument) identifier_add_argument )attribute (argument_list (string_'to') string_'to' (keyword_argument (identifier_type) identifier_type (identifier_str) identifier_str )keyword_argument (keyword_argument (identifier_help) identifier_help (string_"Return only entries where value matches this.") string_"Return only entries where value matches this." )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_parser) identifier_parser (identifier_add_argument) identifier_add_argument )attribute (argument_list (string_'page') string_'page' (keyword_argument (identifier_type) identifier_type (identifier_int) identifier_int )keyword_argument (keyword_argument (identifier_help) identifier_help (string_"Require a specific page") string_"Require a specific page" )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_parser) identifier_parser (identifier_add_argument) identifier_add_argument )attribute (argument_list (string_'per_page') string_'per_page' (keyword_argument (identifier_type) identifier_type (identifier_int) identifier_int )keyword_argument (keyword_argument (identifier_help) identifier_help (string_"Set how much result per page") string_"Set how much result per page" )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_parser) identifier_parser (identifier_add_argument) identifier_add_argument )attribute (argument_list (string_'match_type') string_'match_type' (keyword_argument (identifier_type) identifier_type (identifier_str) identifier_str )keyword_argument (keyword_argument (identifier_help) identifier_help (string_"s=substring, e=exact, sw=startswith") string_"s=substring, e=exact, sw=startswith" )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_parser) identifier_parser (identifier_add_argument) identifier_add_argument )attribute (argument_list (string_'sortby') string_'sortby' (keyword_argument (identifier_type) identifier_type (identifier_str) identifier_str )keyword_argument (keyword_argument (identifier_help) identifier_help (string_"the sorting criteria ('from' or 'to')") string_"the sorting criteria ('from' or 'to')" )keyword_argument )argument_list )call )expression_statement (expression_statement (assignment (identifier_args) identifier_args (call (attribute (identifier_parser) identifier_parser (identifier_parse_args) identifier_parse_args )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_kb_dict) identifier_kb_dict (call (attribute (identifier_kb) identifier_kb (identifier_to_dict) identifier_to_dict )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_kb_dict) identifier_kb_dict (string_'mappings') string_'mappings' )subscript (call (attribute (identifier_KnwKBMappingsResource) identifier_KnwKBMappingsResource (line_continuation_\) line_continuation_\ (identifier_search_mappings) identifier_search_mappings )attribute (argument_list (keyword_argument (identifier_kb) identifier_kb (identifier_kb) identifier_kb )keyword_argument (keyword_argument (identifier_key) identifier_key (subscript (identifier_args) identifier_args (string_'from') string_'from' )subscript )keyword_argument (keyword_argument (identifier_value) identifier_value (subscript (identifier_args) identifier_args (string_'to') string_'to' )subscript )keyword_argument (keyword_argument (identifier_match_type) identifier_match_type (subscript (identifier_args) identifier_args (string_'match_type') string_'match_type' )subscript )keyword_argument (keyword_argument (identifier_sortby) identifier_sortby (subscript (identifier_args) identifier_args (string_'sortby') string_'sortby' )subscript )keyword_argument (keyword_argument (identifier_page) identifier_page (subscript (identifier_args) identifier_args (string_'page') string_'page' )subscript )keyword_argument (keyword_argument (identifier_per_page) identifier_per_page (subscript (identifier_args) identifier_args (string_'per_page') string_'per_page' )subscript )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (identifier_kb_dict) identifier_kb_dict )return_statement )block )function_definition )module
Get KnwKB. Url parameters: - from: filter "mappings from" - to: filter "mappings to" - page - per_page - match_type: s=substring, e=exact, sw=startswith - sortby: 'from' or 'to'
(module (function_definition (function_name_create_shot) function_name_create_shot (parameters (identifier_self) identifier_self (identifier_sequence) identifier_sequence )parameters (block (expression_statement (assignment (identifier_dialog) identifier_dialog (call (identifier_ShotCreatorDialog) identifier_ShotCreatorDialog (argument_list (keyword_argument (identifier_sequence) identifier_sequence (identifier_sequence) identifier_sequence )keyword_argument (keyword_argument (identifier_parent) identifier_parent (identifier_self) identifier_self )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_dialog) identifier_dialog (identifier_exec_) identifier_exec_ )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_shot) identifier_shot (attribute (identifier_dialog) identifier_dialog (identifier_shot) identifier_shot )attribute )assignment )expression_statement (return_statement (identifier_shot) identifier_shot )return_statement )block )function_definition )module
Create and return a new shot :param sequence: the sequence for the shot :type sequence: :class:`jukeboxcore.djadapter.models.Sequence` :returns: The created shot or None :rtype: None | :class:`jukeboxcore.djadapter.models.Shot` :raises: None
(module (function_definition (function_name_from_charmm) function_name_from_charmm (parameters (identifier_cls) identifier_cls (identifier_path) identifier_path (default_parameter (identifier_positions) identifier_positions (None) None )default_parameter (default_parameter (identifier_forcefield) identifier_forcefield (None) None )default_parameter (default_parameter (identifier_strict) identifier_strict (True) True )default_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_psf) identifier_psf (call (identifier_CharmmPsfFile) identifier_CharmmPsfFile (argument_list (identifier_path) identifier_path )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (identifier_strict) identifier_strict (comparison_operator (identifier_forcefield) identifier_forcefield (None) None )comparison_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_'PSF files require key `forcefield`.') string_'PSF files require key `forcefield`.' )argument_list )call )raise_statement )block )if_statement (if_statement (boolean_operator (identifier_strict) identifier_strict (comparison_operator (identifier_positions) identifier_positions (None) None )comparison_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_'PSF files require key `positions`.') string_'PSF files require key `positions`.' )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (attribute (identifier_psf) identifier_psf (identifier_parmset) identifier_parmset )attribute (call (identifier_CharmmParameterSet) identifier_CharmmParameterSet (argument_list (list_splat (identifier_forcefield) identifier_forcefield )list_splat )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_psf) identifier_psf (identifier_loadParameters) identifier_loadParameters )attribute (argument_list (attribute (identifier_psf) identifier_psf (identifier_parmset) identifier_parmset )attribute )argument_list )call )expression_statement (return_statement (call (identifier_cls) identifier_cls (argument_list (keyword_argument (identifier_master) identifier_master (identifier_psf) identifier_psf )keyword_argument (keyword_argument (identifier_topology) identifier_topology (attribute (identifier_psf) identifier_psf (identifier_topology) identifier_topology )attribute )keyword_argument (keyword_argument (identifier_positions) identifier_positions (identifier_positions) identifier_positions )keyword_argument (keyword_argument (identifier_path) identifier_path (identifier_path) identifier_path )keyword_argument (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
Loads PSF Charmm structure from `path`. Requires `charmm_parameters`. Parameters ---------- path : str Path to PSF file forcefield : list of str Paths to Charmm parameters files, such as *.par or *.str. REQUIRED Returns ------- psf : SystemHandler SystemHandler with topology. Charmm parameters are embedded in the `master` attribute.
(module (function_definition (function_name_rawselect) function_name_rawselect (parameters (typed_parameter (identifier_message) identifier_message (type (identifier_Text) identifier_Text )type )typed_parameter (typed_parameter (identifier_choices) identifier_choices (type (generic_type (identifier_List) identifier_List (type_parameter (type (generic_type (identifier_Union) identifier_Union (type_parameter (type (identifier_Text) identifier_Text )type (type (identifier_Choice) identifier_Choice )type (type (generic_type (identifier_Dict) identifier_Dict (type_parameter (type (identifier_Text) identifier_Text )type (type (identifier_Any) identifier_Any )type )type_parameter )generic_type )type )type_parameter )generic_type )type )type_parameter )generic_type )type )typed_parameter (typed_default_parameter (identifier_default) identifier_default (type (generic_type (identifier_Optional) identifier_Optional (type_parameter (type (identifier_Text) identifier_Text )type )type_parameter )generic_type )type (None) None )typed_default_parameter (typed_default_parameter (identifier_qmark) identifier_qmark (type (identifier_Text) identifier_Text )type (identifier_DEFAULT_QUESTION_PREFIX) identifier_DEFAULT_QUESTION_PREFIX )typed_default_parameter (typed_default_parameter (identifier_style) identifier_style (type (generic_type (identifier_Optional) identifier_Optional (type_parameter (type (identifier_Style) identifier_Style )type )type_parameter )generic_type )type (None) None )typed_default_parameter (typed_parameter (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern (type (identifier_Any) identifier_Any )type )typed_parameter )parameters (type (identifier_Question) identifier_Question )type (block (return_statement (call (attribute (identifier_select) identifier_select (identifier_select) identifier_select )attribute (argument_list (identifier_message) identifier_message (identifier_choices) identifier_choices (identifier_default) identifier_default (identifier_qmark) identifier_qmark (identifier_style) identifier_style (keyword_argument (identifier_use_shortcuts) identifier_use_shortcuts (True) True )keyword_argument (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )return_statement )block )function_definition )module
Ask the user to select one item from a list of choices using shortcuts. The user can only select one option. Args: message: Question text choices: Items shown in the selection, this can contain `Choice` or or `Separator` objects or simple items as strings. Passing `Choice` objects, allows you to configure the item more (e.g. preselecting it or disabeling it). default: Default return value (single value). qmark: Question prefix displayed in front of the question. By default this is a `?` style: A custom color and style for the question parts. You can configure colors as well as font types for different elements. Returns: Question: Question instance, ready to be prompted (using `.ask()`).
(module (function_definition (function_name_parse_date) function_name_parse_date (parameters (identifier_value) identifier_value )parameters (block (if_statement (not_operator (identifier_value) identifier_value )not_operator (block (return_statement (None) None )return_statement )block )if_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_value) identifier_value (attribute (identifier_datetime) identifier_datetime (identifier_date) identifier_date )attribute )argument_list )call (block (return_statement (identifier_value) identifier_value )return_statement )block )if_statement (return_statement (call (attribute (call (identifier_parse_datetime) identifier_parse_datetime (argument_list (identifier_value) identifier_value )argument_list )call (identifier_date) identifier_date )attribute (argument_list )argument_list )call )return_statement )block )function_definition )module
Attempts to parse `value` into an instance of ``datetime.date``. If `value` is ``None``, this function will return ``None``. Args: value: A timestamp. This can be a string, datetime.date, or datetime.datetime value.
(module (function_definition (function_name_configure_error_handlers) function_name_configure_error_handlers (parameters (identifier_app) identifier_app )parameters (block (function_definition (function_name_render_error) function_name_render_error (parameters (identifier_error) identifier_error )parameters (block (return_statement (tuple (call (identifier_render_template) identifier_render_template (argument_list (binary_operator (string_'errors/%s.html') string_'errors/%s.html' (attribute (identifier_error) identifier_error (identifier_code) identifier_code )attribute )binary_operator (keyword_argument (identifier_title) identifier_title (subscript (identifier_error_messages) identifier_error_messages (attribute (identifier_error) identifier_error (identifier_code) identifier_code )attribute )subscript )keyword_argument (keyword_argument (identifier_code) identifier_code (attribute (identifier_error) identifier_error (identifier_code) identifier_code )attribute )keyword_argument )argument_list )call (attribute (identifier_error) identifier_error (identifier_code) identifier_code )attribute )tuple )return_statement )block )function_definition (for_statement (tuple_pattern (identifier_errcode) identifier_errcode (identifier_title) identifier_title )tuple_pattern (call (attribute (identifier_error_messages) identifier_error_messages (identifier_iteritems) identifier_iteritems )attribute (argument_list )argument_list )call (block (expression_statement (call (call (attribute (identifier_app) identifier_app (identifier_errorhandler) identifier_errorhandler )attribute (argument_list (identifier_errcode) identifier_errcode )argument_list )call (argument_list (identifier_render_error) identifier_render_error )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Configure application error handlers
(module (function_definition (function_name_get_renderers) function_name_get_renderers (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_renderers) identifier_renderers (call (attribute (call (identifier_super) identifier_super (argument_list (identifier_WithDynamicViewSetMixin) identifier_WithDynamicViewSetMixin (identifier_self) identifier_self )argument_list )call (identifier_get_renderers) identifier_get_renderers )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_settings) identifier_settings (identifier_ENABLE_BROWSABLE_API) identifier_ENABLE_BROWSABLE_API )attribute (False) False )comparison_operator (block (return_statement (list_comprehension (identifier_r) identifier_r (for_in_clause (identifier_r) identifier_r (identifier_renderers) identifier_renderers )for_in_clause (if_clause (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_r) identifier_r (identifier_BrowsableAPIRenderer) identifier_BrowsableAPIRenderer )argument_list )call )not_operator )if_clause )list_comprehension )return_statement )block (else_clause (block (return_statement (identifier_renderers) identifier_renderers )return_statement )block )else_clause )if_statement )block )function_definition )module
Optionally block Browsable API rendering.
(module (function_definition (function_name_create_account) function_name_create_account (parameters (identifier_self) identifier_self (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_response) identifier_response (call (attribute (attribute (identifier_self) identifier_self (identifier___requester) identifier___requester )attribute (identifier_request) identifier_request )attribute (argument_list (string_'POST') string_'POST' (string_'accounts') string_'accounts' (keyword_argument (identifier__kwargs) identifier__kwargs (call (identifier_combine_kwargs) identifier_combine_kwargs (argument_list (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (call (identifier_Account) identifier_Account (argument_list (attribute (identifier_self) identifier_self (identifier___requester) identifier___requester )attribute (call (attribute (identifier_response) identifier_response (identifier_json) identifier_json )attribute (argument_list )argument_list )call )argument_list )call )return_statement )block )function_definition )module
Create a new root account. :calls: `POST /api/v1/accounts \ <https://canvas.instructure.com/doc/api/accounts.html#method.accounts.create>`_ :rtype: :class:`canvasapi.account.Account`
(module (function_definition (function_name_pull) function_name_pull (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_repo_root) identifier_repo_root (attribute (identifier_settings) identifier_settings (identifier_REPO_ROOT) identifier_REPO_ROOT )attribute )assignment )expression_statement (expression_statement (call (identifier_pull_from_origin) identifier_pull_from_origin (argument_list (call (identifier_join) identifier_join (argument_list (identifier_repo_root) identifier_repo_root (attribute (identifier_self) identifier_self (identifier_name) identifier_name )attribute )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
Pull from the origin.
(module (function_definition (function_name_check_smart_storage_config_ids) function_name_check_smart_storage_config_ids (parameters (identifier_self) identifier_self )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_smart_storage_config_identities) identifier_smart_storage_config_identities )attribute (None) None )comparison_operator (block (expression_statement (assignment (identifier_msg) identifier_msg (parenthesized_expression (concatenated_string (string_'The Redfish controller failed to get the ') string_'The Redfish controller failed to get the ' (string_'SmartStorageConfig controller configurations.') string_'SmartStorageConfig controller configurations.' )concatenated_string )parenthesized_expression )assignment )expression_statement (expression_statement (call (attribute (identifier_LOG) identifier_LOG (identifier_debug) identifier_debug )attribute (argument_list (identifier_msg) identifier_msg )argument_list )call )expression_statement (raise_statement (call (attribute (identifier_exception) identifier_exception (identifier_IloError) identifier_IloError )attribute (argument_list (identifier_msg) identifier_msg )argument_list )call )raise_statement )block )if_statement )block )function_definition )module
Check SmartStorageConfig controllers is there in hardware. :raises: IloError, on an error from iLO.
(module (function_definition (function_name_detect_interval) function_name_detect_interval (parameters (identifier_self) identifier_self (default_parameter (identifier_min_head_length) identifier_min_head_length (None) None )default_parameter (default_parameter (identifier_max_head_length) identifier_max_head_length (None) None )default_parameter (default_parameter (identifier_min_tail_length) identifier_min_tail_length (None) None )default_parameter (default_parameter (identifier_max_tail_length) identifier_max_tail_length (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_head) identifier_head (call (attribute (identifier_self) identifier_self (identifier_detect_head) identifier_detect_head )attribute (argument_list (identifier_min_head_length) identifier_min_head_length (identifier_max_head_length) identifier_max_head_length )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_tail) identifier_tail (call (attribute (identifier_self) identifier_self (identifier_detect_tail) identifier_detect_tail )attribute (argument_list (identifier_min_tail_length) identifier_min_tail_length (identifier_max_tail_length) identifier_max_tail_length )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_begin) identifier_begin (identifier_head) identifier_head )assignment )expression_statement (expression_statement (assignment (identifier_end) identifier_end (binary_operator (attribute (attribute (identifier_self) identifier_self (identifier_real_wave_mfcc) identifier_real_wave_mfcc )attribute (identifier_audio_length) identifier_audio_length )attribute (identifier_tail) identifier_tail )binary_operator )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (list (string_u"Audio length: %.3f") string_u"Audio length: %.3f" (attribute (attribute (identifier_self) identifier_self (identifier_real_wave_mfcc) identifier_real_wave_mfcc )attribute (identifier_audio_length) identifier_audio_length )attribute )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (list (string_u"Head length: %.3f") string_u"Head length: %.3f" (identifier_head) identifier_head )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (list (string_u"Tail length: %.3f") string_u"Tail length: %.3f" (identifier_tail) identifier_tail )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (list (string_u"Begin: %.3f") string_u"Begin: %.3f" (identifier_begin) identifier_begin )list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (list (string_u"End: %.3f") string_u"End: %.3f" (identifier_end) identifier_end )list )argument_list )call )expression_statement (if_statement (boolean_operator (parenthesized_expression (comparison_operator (identifier_begin) identifier_begin (call (identifier_TimeValue) identifier_TimeValue (argument_list (string_"0.000") string_"0.000" )argument_list )call )comparison_operator )parenthesized_expression (parenthesized_expression (comparison_operator (identifier_end) identifier_end (identifier_begin) identifier_begin )comparison_operator )parenthesized_expression )boolean_operator (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (list (string_u"Returning %.3f %.3f") string_u"Returning %.3f %.3f" (identifier_begin) identifier_begin (identifier_end) identifier_end )list )argument_list )call )expression_statement (return_statement (tuple (identifier_begin) identifier_begin (identifier_end) identifier_end )tuple )return_statement )block )if_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_log) identifier_log )attribute (argument_list (string_u"Returning (0.000, 0.000)") string_u"Returning (0.000, 0.000)" )argument_list )call )expression_statement (return_statement (tuple (call (identifier_TimeValue) identifier_TimeValue (argument_list (string_"0.000") string_"0.000" )argument_list )call (call (identifier_TimeValue) identifier_TimeValue (argument_list (string_"0.000") string_"0.000" )argument_list )call )tuple )return_statement )block )function_definition )module
Detect the interval of the audio file containing the fragments in the text file. Return the audio interval as a tuple of two :class:`~aeneas.exacttiming.TimeValue` objects, representing the begin and end time, in seconds, with respect to the full wave duration. If one of the parameters is ``None``, the default value (``0.0`` for min, ``10.0`` for max) will be used. :param min_head_length: estimated minimum head length :type min_head_length: :class:`~aeneas.exacttiming.TimeValue` :param max_head_length: estimated maximum head length :type max_head_length: :class:`~aeneas.exacttiming.TimeValue` :param min_tail_length: estimated minimum tail length :type min_tail_length: :class:`~aeneas.exacttiming.TimeValue` :param max_tail_length: estimated maximum tail length :type max_tail_length: :class:`~aeneas.exacttiming.TimeValue` :rtype: (:class:`~aeneas.exacttiming.TimeValue`, :class:`~aeneas.exacttiming.TimeValue`) :raises: TypeError: if one of the parameters is not ``None`` or a number :raises: ValueError: if one of the parameters is negative
(module (function_definition (function_name_login_required) function_name_login_required (parameters (identifier_func) identifier_func )parameters (block (decorated_definition (decorator (call (identifier_wraps) identifier_wraps (argument_list (identifier_func) identifier_func )argument_list )call )decorator (function_definition (function_name_wrapped) function_name_wrapped (parameters (list_splat_pattern (identifier_args) identifier_args )list_splat_pattern (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (if_statement (comparison_operator (attribute (identifier_g) identifier_g (identifier_user) identifier_user )attribute (None) None )comparison_operator (block (return_statement (call (identifier_redirect) identifier_redirect (argument_list (call (identifier_url_for) identifier_url_for (argument_list (subscript (attribute (identifier_current_app) identifier_current_app (identifier_config) identifier_config )attribute (string_'LDAP_LOGIN_VIEW') string_'LDAP_LOGIN_VIEW' )subscript (keyword_argument (identifier_next) identifier_next (attribute (identifier_request) identifier_request (identifier_path) identifier_path )attribute )keyword_argument )argument_list )call )argument_list )call )return_statement )block )if_statement (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 )function_definition )decorated_definition (return_statement (identifier_wrapped) identifier_wrapped )return_statement )block )function_definition )module
When applied to a view function, any unauthenticated requests will be redirected to the view named in LDAP_LOGIN_VIEW. Authenticated requests do NOT require membership from a specific group. The login view is responsible for asking for credentials, checking them, and setting ``flask.g.user`` to the name of the authenticated user if the credentials are acceptable. :param func: The view function to decorate.
(module (function_definition (function_name_rsync_git) function_name_rsync_git (parameters (identifier_local_path) identifier_local_path (identifier_remote_path) identifier_remote_path (default_parameter (identifier_exclude) identifier_exclude (None) None )default_parameter (default_parameter (identifier_extra_opts) identifier_extra_opts (None) None )default_parameter (default_parameter (identifier_version_file) identifier_version_file (string_'version.txt') string_'version.txt' )default_parameter )parameters (block (with_statement (with_clause (with_item (call (identifier_settings) identifier_settings (argument_list (call (identifier_hide) identifier_hide (argument_list (string_'output') string_'output' (string_'running') string_'running' )argument_list )call (keyword_argument (identifier_warn_only) identifier_warn_only (True) True )keyword_argument )argument_list )call )with_item )with_clause (block (expression_statement (call (identifier_print) identifier_print (argument_list (call (identifier_green) identifier_green (argument_list (binary_operator (string_'Version On Server: ') string_'Version On Server: ' (call (attribute (call (identifier_run) identifier_run (argument_list (binary_operator (string_'cat ') string_'cat ' (call (attribute (string_'{}/{}') string_'{}/{}' (identifier_format) identifier_format )attribute (argument_list (identifier_remote_path) identifier_remote_path (identifier_version_file) identifier_version_file )argument_list )call )binary_operator )argument_list )call (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )binary_operator )argument_list )call )argument_list )call )expression_statement )block )with_statement (expression_statement (call (identifier_print) identifier_print (argument_list (call (identifier_green) identifier_green (argument_list (binary_operator (string_'Now Deploying Version ') string_'Now Deploying Version ' (call (identifier_write_version) identifier_write_version (argument_list (call (identifier_join) identifier_join (argument_list (identifier_local_path) identifier_local_path (identifier_version_file) identifier_version_file )argument_list )call )argument_list )call )binary_operator )argument_list )call )argument_list )call )expression_statement (expression_statement (call (identifier_rsync) identifier_rsync (argument_list (identifier_local_path) identifier_local_path (identifier_remote_path) identifier_remote_path (identifier_exclude) identifier_exclude (identifier_extra_opts) identifier_extra_opts )argument_list )call )expression_statement )block )function_definition )module
Rsync deploy a git repo. Write and compare version.txt
(module (function_definition (function_name_wrap) function_name_wrap (parameters (identifier_tensor) identifier_tensor (default_parameter (identifier_books) identifier_books (None) None )default_parameter (default_parameter (identifier_tensor_shape) identifier_tensor_shape (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_books) identifier_books (None) None )comparison_operator (block (expression_statement (assignment (identifier_books) identifier_books (call (attribute (identifier_bookkeeper) identifier_bookkeeper (identifier_for_default_graph) identifier_for_default_graph )attribute (argument_list )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_tensor) identifier_tensor (identifier_PrettyTensor) identifier_PrettyTensor )argument_list )call (block (return_statement (call (attribute (identifier_tensor) identifier_tensor (identifier_as_layer) identifier_as_layer )attribute (argument_list )argument_list )call )return_statement )block (elif_clause (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_tensor) identifier_tensor (identifier_UnboundVariable) identifier_UnboundVariable )argument_list )call (block (function_definition (function_name_set_input_from_unbound_var) function_name_set_input_from_unbound_var (parameters (identifier_data) identifier_data )parameters (block (if_statement (comparison_operator (identifier_data) identifier_data (None) None )comparison_operator (block (return_statement (call (identifier_wrap) identifier_wrap (argument_list (identifier_data) identifier_data (identifier_books) identifier_books )argument_list )call )return_statement )block (else_clause (block (return_statement (None) None )return_statement )block )else_clause )if_statement )block )function_definition (return_statement (call (identifier__DeferredLayer) identifier__DeferredLayer (argument_list (identifier_books) identifier_books (identifier_set_input_from_unbound_var) identifier_set_input_from_unbound_var (list (identifier_tensor) identifier_tensor )list (dictionary )dictionary )argument_list )call )return_statement )block )elif_clause (else_clause (block (expression_statement (assignment (identifier_tensor) identifier_tensor (call (attribute (identifier_tf) identifier_tf (identifier_convert_to_tensor) identifier_convert_to_tensor )attribute (argument_list (identifier_tensor) identifier_tensor (keyword_argument (identifier_name) identifier_name (string_'input') string_'input' )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (identifier_tensor_shape) identifier_tensor_shape (block (expression_statement (call (identifier__set_shape_on_tensor) identifier__set_shape_on_tensor (argument_list (identifier_tensor) identifier_tensor (identifier_tensor_shape) identifier_tensor_shape )argument_list )call )expression_statement )block )if_statement (return_statement (call (identifier_Layer) identifier_Layer (argument_list (identifier_books) identifier_books (keyword_argument (identifier_tensor) identifier_tensor (identifier_tensor) identifier_tensor )keyword_argument (keyword_argument (identifier_name) identifier_name (attribute (identifier_tensor) identifier_tensor (identifier_name) identifier_name )attribute )keyword_argument )argument_list )call )return_statement )block )else_clause )if_statement )block )function_definition )module
Creates an input layer representing the given tensor. Args: tensor: The tensor. books: The bookkeeper; this is usually not required unless you are building multiple `tf.Graphs.` tensor_shape: An optional shape that will be set on the Tensor or verified to match the tensor. Returns: A layer.
(module (function_definition (function_name__build_schema) function_name__build_schema (parameters (identifier_self) identifier_self (identifier_s) identifier_s )parameters (block (expression_statement (assignment (identifier_w) identifier_w (call (attribute (identifier_self) identifier_self (identifier__whatis) identifier__whatis )attribute (argument_list (identifier_s) identifier_s )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_w) identifier_w (attribute (identifier_self) identifier_self (identifier_IS_LIST) identifier_IS_LIST )attribute )comparison_operator (block (expression_statement (assignment (identifier_w0) identifier_w0 (call (attribute (identifier_self) identifier_self (identifier__whatis) identifier__whatis )attribute (argument_list (subscript (identifier_s) identifier_s (integer_0) integer_0 )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_js) identifier_js (dictionary (pair (string_"type") string_"type" (string_"array") string_"array" )pair (pair (string_"items") string_"items" (dictionary (pair (string_"type") string_"type" (call (attribute (identifier_self) identifier_self (identifier__jstype) identifier__jstype )attribute (argument_list (identifier_w0) identifier_w0 (subscript (identifier_s) identifier_s (integer_0) integer_0 )subscript )argument_list )call )pair )dictionary )pair )dictionary )assignment )expression_statement )block (elif_clause (comparison_operator (identifier_w) identifier_w (attribute (identifier_self) identifier_self (identifier_IS_DICT) identifier_IS_DICT )attribute )comparison_operator (block (expression_statement (assignment (identifier_js) identifier_js (dictionary (pair (string_"type") string_"type" (string_"object") string_"object" )pair (pair (string_"properties") string_"properties" (dictionary_comprehension (pair (identifier_key) identifier_key (call (attribute (identifier_self) identifier_self (identifier__build_schema) identifier__build_schema )attribute (argument_list (identifier_val) identifier_val )argument_list )call )pair (for_in_clause (pattern_list (identifier_key) identifier_key (identifier_val) identifier_val )pattern_list (call (attribute (identifier_s) identifier_s (identifier_items) identifier_items )attribute (argument_list )argument_list )call )for_in_clause )dictionary_comprehension )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_req) identifier_req (list_comprehension (identifier_key) identifier_key (for_in_clause (pattern_list (identifier_key) identifier_key (identifier_val) identifier_val )pattern_list (call (attribute (identifier_s) identifier_s (identifier_items) identifier_items )attribute (argument_list )argument_list )call )for_in_clause (if_clause (not_operator (attribute (identifier_val) identifier_val (identifier_is_optional) identifier_is_optional )attribute )not_operator )if_clause )list_comprehension )assignment )expression_statement (if_statement (identifier_req) identifier_req (block (expression_statement (assignment (subscript (identifier_js) identifier_js (string_"required") string_"required" )subscript (identifier_req) identifier_req )assignment )expression_statement )block )if_statement )block )elif_clause (else_clause (block (expression_statement (assignment (identifier_js) identifier_js (dictionary (pair (string_"type") string_"type" (call (attribute (identifier_self) identifier_self (identifier__jstype) identifier__jstype )attribute (argument_list (identifier_w) identifier_w (identifier_s) identifier_s )argument_list )call )pair )dictionary )assignment )expression_statement )block )else_clause )if_statement (for_statement (pattern_list (identifier_k) identifier_k (identifier_v) identifier_v )pattern_list (call (attribute (attribute (identifier_self) identifier_self (identifier__json_schema_keys) identifier__json_schema_keys )attribute (identifier_items) identifier_items )attribute (argument_list )argument_list )call (block (if_statement (comparison_operator (identifier_k) identifier_k (identifier_js) identifier_js )comparison_operator (block (expression_statement (assignment (subscript (identifier_js) identifier_js (identifier_k) identifier_k )subscript (identifier_v) identifier_v )assignment )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_js) identifier_js )return_statement )block )function_definition )module
Recursive schema builder, called by `json_schema`.
(module (function_definition (function_name_make_python_name) function_name_make_python_name (parameters (identifier_self) identifier_self (identifier_name) identifier_name )parameters (block (for_statement (pattern_list (identifier_k) identifier_k (identifier_v) identifier_v )pattern_list (list (tuple (string_'<') string_'<' (string_'_') string_'_' )tuple (tuple (string_'>') string_'>' (string_'_') string_'_' )tuple (tuple (string_'::') string_'::' (string_'__') string_'__' )tuple (tuple (string_',') string_',' (string_'') string_'' )tuple (tuple (string_' ') string_' ' (string_'') string_'' )tuple (tuple (string_"$") string_"$" (string_"DOLLAR") string_"DOLLAR" )tuple (tuple (string_".") string_"." (string_"DOT") string_"DOT" )tuple (tuple (string_"@") string_"@" (string_"_") string_"_" )tuple (tuple (string_":") string_":" (string_"_") string_"_" )tuple (tuple (string_'-') string_'-' (string_'_') string_'_' )tuple )list (block (if_statement (comparison_operator (identifier_k) identifier_k (identifier_name) identifier_name )comparison_operator (block (expression_statement (assignment (identifier_name) identifier_name (call (attribute (identifier_name) identifier_name (identifier_replace) identifier_replace )attribute (argument_list (identifier_k) identifier_k (identifier_v) identifier_v )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (call (attribute (identifier_name) identifier_name (identifier_startswith) identifier_startswith )attribute (argument_list (string_"__") string_"__" )argument_list )call (block (return_statement (binary_operator (string_"_X") string_"_X" (identifier_name) identifier_name )binary_operator )return_statement )block )if_statement )block )for_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_name) identifier_name )argument_list )call (integer_0) integer_0 )comparison_operator (block (pass_statement )pass_statement )block (elif_clause (comparison_operator (subscript (identifier_name) identifier_name (integer_0) integer_0 )subscript (string_"01234567879") string_"01234567879" )comparison_operator (block (return_statement (binary_operator (string_"_") string_"_" (identifier_name) identifier_name )binary_operator )return_statement )block )elif_clause )if_statement (return_statement (identifier_name) identifier_name )return_statement )block )function_definition )module
Transforms an USR into a valid python name.
(module (function_definition (function_name_zip_currentdir) function_name_zip_currentdir (parameters (identifier_self) identifier_self )parameters (type (None) None )type (block (with_statement (with_clause (with_item (as_pattern (call (attribute (identifier_zipfile) identifier_zipfile (identifier_ZipFile) identifier_ZipFile )attribute (argument_list (string_f'{self.currentpath}.zip') string_f'{self.currentpath}.zip' (string_'w') string_'w' )argument_list )call (as_pattern_target (identifier_zipfile_) identifier_zipfile_ )as_pattern_target )as_pattern )with_item )with_clause (block (for_statement (pattern_list (identifier_filepath) identifier_filepath (identifier_filename) identifier_filename )pattern_list (call (identifier_zip) identifier_zip (argument_list (attribute (identifier_self) identifier_self (identifier_filepaths) identifier_filepaths )attribute (attribute (identifier_self) identifier_self (identifier_filenames) identifier_filenames )attribute )argument_list )call (block (expression_statement (call (attribute (identifier_zipfile_) identifier_zipfile_ (identifier_write) identifier_write )attribute (argument_list (keyword_argument (identifier_filename) identifier_filename (identifier_filepath) identifier_filepath )keyword_argument (keyword_argument (identifier_arcname) identifier_arcname (identifier_filename) identifier_filename )keyword_argument )argument_list )call )expression_statement )block )for_statement )block )with_statement (delete_statement (attribute (identifier_self) identifier_self (identifier_currentdir) identifier_currentdir )attribute )delete_statement )block )function_definition )module
Pack the current working directory in a `zip` file. |FileManager| subclasses allow for manual packing and automatic unpacking of working directories. The only supported format is `zip`. To avoid possible inconsistencies, origin directories and zip files are removed after packing or unpacking, respectively. As an example scenario, we prepare a |FileManager| object with the current working directory `folder` containing the files `test1.txt` and `text2.txt`: >>> from hydpy.core.filetools import FileManager >>> filemanager = FileManager() >>> filemanager.BASEDIR = 'basename' >>> filemanager.projectdir = 'projectname' >>> import os >>> from hydpy import repr_, TestIO >>> TestIO.clear() >>> basepath = 'projectname/basename' >>> with TestIO(): ... os.makedirs(basepath) ... filemanager.currentdir = 'folder' ... open(f'{basepath}/folder/file1.txt', 'w').close() ... open(f'{basepath}/folder/file2.txt', 'w').close() ... filemanager.filenames ['file1.txt', 'file2.txt'] The directories existing under the base path are identical with the ones returned by property |FileManager.availabledirs|: >>> with TestIO(): ... sorted(os.listdir(basepath)) ... filemanager.availabledirs # doctest: +ELLIPSIS ['folder'] Folder2Path(folder=.../projectname/basename/folder) After packing the current working directory manually, it is still counted as a available directory: >>> with TestIO(): ... filemanager.zip_currentdir() ... sorted(os.listdir(basepath)) ... filemanager.availabledirs # doctest: +ELLIPSIS ['folder.zip'] Folder2Path(folder=.../projectname/basename/folder.zip) Instead of the complete directory, only the contained files are packed: >>> from zipfile import ZipFile >>> with TestIO(): ... with ZipFile('projectname/basename/folder.zip', 'r') as zp: ... sorted(zp.namelist()) ['file1.txt', 'file2.txt'] The zip file is unpacked again, as soon as `folder` becomes the current working directory: >>> with TestIO(): ... filemanager.currentdir = 'folder' ... sorted(os.listdir(basepath)) ... filemanager.availabledirs ... filemanager.filenames # doctest: +ELLIPSIS ['folder'] Folder2Path(folder=.../projectname/basename/folder) ['file1.txt', 'file2.txt']
(module (function_definition (function_name_parse_year_days) function_name_parse_year_days (parameters (identifier_year_info) identifier_year_info )parameters (block (expression_statement (assignment (pattern_list (identifier_leap_month) identifier_leap_month (identifier_leap_days) identifier_leap_days )pattern_list (call (identifier__parse_leap) identifier__parse_leap (argument_list (identifier_year_info) identifier_year_info )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_res) identifier_res (identifier_leap_days) identifier_leap_days )assignment )expression_statement (for_statement (identifier_month) identifier_month (call (identifier_range) identifier_range (argument_list (integer_1) integer_1 (integer_13) integer_13 )argument_list )call (block (expression_statement (augmented_assignment (identifier_res) identifier_res (binary_operator (binary_operator (parenthesized_expression (binary_operator (identifier_year_info) identifier_year_info (parenthesized_expression (binary_operator (integer_16) integer_16 (identifier_month) identifier_month )binary_operator )parenthesized_expression )binary_operator )parenthesized_expression (integer_2) integer_2 )binary_operator (integer_29) integer_29 )binary_operator )augmented_assignment )expression_statement )block )for_statement (return_statement (identifier_res) identifier_res )return_statement )block )function_definition )module
Parse year days from a year info.
(module (function_definition (function_name_interactive_server) function_name_interactive_server (parameters (default_parameter (identifier_port) identifier_port (integer_27017) integer_27017 )default_parameter (default_parameter (identifier_verbose) identifier_verbose (True) True )default_parameter (default_parameter (identifier_all_ok) identifier_all_ok (False) False )default_parameter (default_parameter (identifier_name) identifier_name (string_'MockupDB') string_'MockupDB' )default_parameter (default_parameter (identifier_ssl) identifier_ssl (False) False )default_parameter (default_parameter (identifier_uds_path) identifier_uds_path (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_uds_path) identifier_uds_path (None) None )comparison_operator (block (expression_statement (assignment (identifier_port) identifier_port (None) None )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_server) identifier_server (call (identifier_MockupDB) identifier_MockupDB (argument_list (keyword_argument (identifier_port) identifier_port (identifier_port) identifier_port )keyword_argument (keyword_argument (identifier_verbose) identifier_verbose (identifier_verbose) identifier_verbose )keyword_argument (keyword_argument (identifier_request_timeout) identifier_request_timeout (call (identifier_int) identifier_int (argument_list (float_1e6) float_1e6 )argument_list )call )keyword_argument (keyword_argument (identifier_ssl) identifier_ssl (identifier_ssl) identifier_ssl )keyword_argument (keyword_argument (identifier_auto_ismaster) identifier_auto_ismaster (True) True )keyword_argument (keyword_argument (identifier_uds_path) identifier_uds_path (identifier_uds_path) identifier_uds_path )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (identifier_all_ok) identifier_all_ok (block (expression_statement (call (attribute (identifier_server) identifier_server (identifier_append_responder) identifier_append_responder )attribute (argument_list (dictionary )dictionary )argument_list )call )expression_statement )block )if_statement (expression_statement (call (attribute (identifier_server) identifier_server (identifier_autoresponds) identifier_autoresponds )attribute (argument_list (string_'whatsmyuri') string_'whatsmyuri' (keyword_argument (identifier_you) identifier_you (string_'localhost:12345') string_'localhost:12345' )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_server) identifier_server (identifier_autoresponds) identifier_autoresponds )attribute (argument_list (dictionary (pair (string_'getLog') string_'getLog' (string_'startupWarnings') string_'startupWarnings' )pair )dictionary (keyword_argument (identifier_log) identifier_log (list (binary_operator (string_'hello from %s!') string_'hello from %s!' (identifier_name) identifier_name )binary_operator )list )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_server) identifier_server (identifier_autoresponds) identifier_autoresponds )attribute (argument_list (call (identifier_OpMsg) identifier_OpMsg (argument_list (string_'buildInfo') string_'buildInfo' )argument_list )call (keyword_argument (identifier_version) identifier_version (binary_operator (string_'MockupDB ') string_'MockupDB ' (identifier___version__) identifier___version__ )binary_operator )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_server) identifier_server (identifier_autoresponds) identifier_autoresponds )attribute (argument_list (call (identifier_OpMsg) identifier_OpMsg (argument_list (string_'listCollections') string_'listCollections' )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_server) identifier_server (identifier_autoresponds) identifier_autoresponds )attribute (argument_list (string_'replSetGetStatus') string_'replSetGetStatus' (keyword_argument (identifier_ok) identifier_ok (integer_0) integer_0 )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_server) identifier_server (identifier_autoresponds) identifier_autoresponds )attribute (argument_list (string_'getFreeMonitoringStatus') string_'getFreeMonitoringStatus' (keyword_argument (identifier_ok) identifier_ok (integer_0) integer_0 )keyword_argument )argument_list )call )expression_statement (return_statement (identifier_server) identifier_server )return_statement )block )function_definition )module
A `MockupDB` that the mongo shell can connect to. Call `~.MockupDB.run` on the returned server, and clean it up with `~.MockupDB.stop`. If ``all_ok`` is True, replies {ok: 1} to anything unmatched by a specific responder.
(module (function_definition (function_name_to_shcoeffs) function_name_to_shcoeffs (parameters (identifier_self) identifier_self (identifier_itaper) identifier_itaper (default_parameter (identifier_normalization) identifier_normalization (string_'4pi') string_'4pi' )default_parameter (default_parameter (identifier_csphase) identifier_csphase (integer_1) integer_1 )default_parameter )parameters (block (if_statement (comparison_operator (call (identifier_type) identifier_type (argument_list (identifier_normalization) identifier_normalization )argument_list )call (identifier_str) identifier_str )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_'normalization must be a string. ') string_'normalization must be a string. ' (call (attribute (string_'Input type was {:s}') string_'Input type was {:s}' (identifier_format) identifier_format )attribute (argument_list (call (identifier_str) identifier_str (argument_list (call (identifier_type) identifier_type (argument_list (identifier_normalization) identifier_normalization )argument_list )call )argument_list )call )argument_list )call )binary_operator )argument_list )call )raise_statement )block )if_statement (if_statement (comparison_operator (call (attribute (identifier_normalization) identifier_normalization (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call (call (identifier_set) identifier_set (argument_list (list (string_'4pi') string_'4pi' (string_'ortho') string_'ortho' (string_'schmidt') string_'schmidt' )list )argument_list )call )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_"normalization must be '4pi', 'ortho' ") string_"normalization must be '4pi', 'ortho' " (call (attribute (string_"or 'schmidt'. Provided value was {:s}") string_"or 'schmidt'. Provided value was {:s}" (identifier_format) identifier_format )attribute (argument_list (call (identifier_repr) identifier_repr (argument_list (identifier_normalization) identifier_normalization )argument_list )call )argument_list )call )binary_operator )argument_list )call )raise_statement )block )if_statement (if_statement (boolean_operator (comparison_operator (identifier_csphase) identifier_csphase (integer_1) integer_1 )comparison_operator (comparison_operator (identifier_csphase) identifier_csphase (unary_operator (integer_1) integer_1 )unary_operator )comparison_operator )boolean_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (call (attribute (string_"csphase must be 1 or -1. Input value was {:s}") string_"csphase must be 1 or -1. Input value was {:s}" (identifier_format) identifier_format )attribute (argument_list (call (identifier_repr) identifier_repr (argument_list (identifier_csphase) identifier_csphase )argument_list )call )argument_list )call )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_coeffs) identifier_coeffs (call (attribute (identifier_self) identifier_self (identifier_to_array) identifier_to_array )attribute (argument_list (identifier_itaper) identifier_itaper (keyword_argument (identifier_normalization) identifier_normalization (call (attribute (identifier_normalization) identifier_normalization (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call )keyword_argument (keyword_argument (identifier_csphase) identifier_csphase (identifier_csphase) identifier_csphase )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_SHCoeffs) identifier_SHCoeffs (identifier_from_array) identifier_from_array )attribute (argument_list (identifier_coeffs) identifier_coeffs (keyword_argument (identifier_normalization) identifier_normalization (call (attribute (identifier_normalization) identifier_normalization (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call )keyword_argument (keyword_argument (identifier_csphase) identifier_csphase (identifier_csphase) identifier_csphase )keyword_argument (keyword_argument (identifier_copy) identifier_copy (False) False )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Return the spherical harmonic coefficients of taper i as a SHCoeffs class instance. Usage ----- clm = x.to_shcoeffs(itaper, [normalization, csphase]) Returns ------- clm : SHCoeffs class instance Parameters ---------- itaper : int Taper number, where itaper=0 is the best concentrated. normalization : str, optional, default = '4pi' Normalization of the output class: '4pi', 'ortho' or 'schmidt' for geodesy 4pi-normalized, orthonormalized, or Schmidt semi-normalized coefficients, respectively. csphase : int, optional, default = 1 Condon-Shortley phase convention: 1 to exclude the phase factor, or -1 to include it.
(module (function_definition (function_name_finish) function_name_finish (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_stylesheet) identifier_stylesheet (call (attribute (string_'') string_'' (identifier_join) identifier_join )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__buffer) identifier__buffer )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_parser) identifier_parser (call (identifier_CSSParser) identifier_CSSParser (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_css) identifier_css (call (attribute (identifier_parser) identifier_parser (identifier_parseString) identifier_parseString )attribute (argument_list (identifier_stylesheet) identifier_stylesheet )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_replaceUrls) identifier_replaceUrls (argument_list (identifier_css) identifier_css (attribute (identifier_self) identifier_self (identifier__replace) identifier__replace )attribute )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_request) identifier_request )attribute (identifier_write) identifier_write )attribute (argument_list (attribute (identifier_css) identifier_css (identifier_cssText) identifier_cssText )attribute )argument_list )call )expression_statement (return_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_request) identifier_request )attribute (identifier_finish) identifier_finish )attribute (argument_list )argument_list )call )return_statement )block )function_definition )module
Parse the buffered response body, rewrite its URLs, write the result to the wrapped request, and finish the wrapped request.
(module (function_definition (function_name_send_confirmation_email) function_name_send_confirmation_email (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_context) identifier_context (dictionary (pair (string_'user') string_'user' (identifier_self) identifier_self )pair (pair (string_'new_email') string_'new_email' (attribute (identifier_self) identifier_self (identifier_email_unconfirmed) identifier_email_unconfirmed )attribute )pair (pair (string_'protocol') string_'protocol' (call (identifier_get_protocol) identifier_get_protocol (argument_list )argument_list )call )pair (pair (string_'confirmation_key') string_'confirmation_key' (attribute (identifier_self) identifier_self (identifier_email_confirmation_key) identifier_email_confirmation_key )attribute )pair (pair (string_'site') string_'site' (call (attribute (attribute (identifier_Site) identifier_Site (identifier_objects) identifier_objects )attribute (identifier_get_current) identifier_get_current )attribute (argument_list )argument_list )call )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_subject_old) identifier_subject_old (call (attribute (string_'') string_'' (identifier_join) identifier_join )attribute (argument_list (call (attribute (call (identifier_render_to_string) identifier_render_to_string (argument_list (string_'accounts/emails/confirmation_email_subject_old.txt') string_'accounts/emails/confirmation_email_subject_old.txt' (identifier_context) identifier_context )argument_list )call (identifier_splitlines) identifier_splitlines )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_message_old) identifier_message_old (call (identifier_render_to_string) identifier_render_to_string (argument_list (string_'accounts/emails/confirmation_email_message_old.txt') string_'accounts/emails/confirmation_email_message_old.txt' (identifier_context) identifier_context )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_send_mail) identifier_send_mail (argument_list (identifier_subject_old) identifier_subject_old (identifier_message_old) identifier_message_old (attribute (identifier_settings) identifier_settings (identifier_DEFAULT_FROM_EMAIL) identifier_DEFAULT_FROM_EMAIL )attribute (list (attribute (identifier_self) identifier_self (identifier_email) identifier_email )attribute )list )argument_list )call )expression_statement (expression_statement (assignment (identifier_subject_new) identifier_subject_new (call (attribute (string_'') string_'' (identifier_join) identifier_join )attribute (argument_list (call (attribute (call (identifier_render_to_string) identifier_render_to_string (argument_list (string_'accounts/emails/confirmation_email_subject_new.txt') string_'accounts/emails/confirmation_email_subject_new.txt' (identifier_context) identifier_context )argument_list )call (identifier_splitlines) identifier_splitlines )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_message_new) identifier_message_new (call (identifier_render_to_string) identifier_render_to_string (argument_list (string_'accounts/emails/confirmation_email_message_new.txt') string_'accounts/emails/confirmation_email_message_new.txt' (identifier_context) identifier_context )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_send_mail) identifier_send_mail (argument_list (identifier_subject_new) identifier_subject_new (identifier_message_new) identifier_message_new (attribute (identifier_settings) identifier_settings (identifier_DEFAULT_FROM_EMAIL) identifier_DEFAULT_FROM_EMAIL )attribute (list (attribute (identifier_self) identifier_self (identifier_email_unconfirmed) identifier_email_unconfirmed )attribute )list )argument_list )call )expression_statement )block )function_definition )module
Sends an email to confirm the new email address. This method sends out two emails. One to the new email address that contains the ``email_confirmation_key`` which is used to verify this this email address with :func:`User.objects.confirm_email`. The other email is to the old email address to let the user know that a request is made to change this email address.
(module (function_definition (function_name_from_moment_relative_to_crystal_axes) function_name_from_moment_relative_to_crystal_axes (parameters (identifier_cls) identifier_cls (identifier_moment) identifier_moment (identifier_lattice) identifier_lattice )parameters (block (expression_statement (assignment (identifier_unit_m) identifier_unit_m (binary_operator (attribute (identifier_lattice) identifier_lattice (identifier_matrix) identifier_matrix )attribute (subscript (call (attribute (attribute (identifier_np) identifier_np (identifier_linalg) identifier_linalg )attribute (identifier_norm) identifier_norm )attribute (argument_list (attribute (identifier_lattice) identifier_lattice (identifier_matrix) identifier_matrix )attribute (keyword_argument (identifier_axis) identifier_axis (integer_1) integer_1 )keyword_argument )argument_list )call (slice (colon) colon )slice (None) None )subscript )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_moment) identifier_moment (call (attribute (identifier_np) identifier_np (identifier_matmul) identifier_matmul )attribute (argument_list (call (identifier_list) identifier_list (argument_list (identifier_moment) identifier_moment )argument_list )call (identifier_unit_m) identifier_unit_m )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_moment) identifier_moment (comparison_operator (call (attribute (identifier_np) identifier_np (identifier_abs) identifier_abs )attribute (argument_list (identifier_moment) identifier_moment )argument_list )call (float_1e-8) float_1e-8 )comparison_operator )subscript (integer_0) integer_0 )assignment )expression_statement (return_statement (call (identifier_cls) identifier_cls (argument_list (identifier_moment) identifier_moment )argument_list )call )return_statement )block )function_definition )module
Obtaining a Magmom object from a magnetic moment provided relative to crystal axes. Used for obtaining moments from magCIF file. :param magmom: list of floats specifying vector magmom :param lattice: Lattice :return: Magmom
(module (function_definition (function_name_data_to_imagesurface) function_name_data_to_imagesurface (parameters (identifier_data) identifier_data (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (import_statement (dotted_name (identifier_cairo) identifier_cairo )dotted_name )import_statement (expression_statement (assignment (identifier_data) identifier_data (call (attribute (identifier_np) identifier_np (identifier_atleast_2d) identifier_atleast_2d )attribute (argument_list (identifier_data) identifier_data )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_data) identifier_data (identifier_ndim) identifier_ndim )attribute (integer_2) integer_2 )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_'input array may not have more than 2 dimensions') string_'input array may not have more than 2 dimensions' )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_argb32) identifier_argb32 (call (identifier_data_to_argb32) identifier_data_to_argb32 (argument_list (identifier_data) identifier_data (dictionary_splat (identifier_kwargs) identifier_kwargs )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_format) identifier_format (attribute (identifier_cairo) identifier_cairo (identifier_FORMAT_ARGB32) identifier_FORMAT_ARGB32 )attribute )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_height) identifier_height (identifier_width) identifier_width )pattern_list (attribute (identifier_argb32) identifier_argb32 (identifier_shape) identifier_shape )attribute )assignment )expression_statement (expression_statement (assignment (identifier_stride) identifier_stride (call (attribute (attribute (identifier_cairo) identifier_cairo (identifier_ImageSurface) identifier_ImageSurface )attribute (identifier_format_stride_for_width) identifier_format_stride_for_width )attribute (argument_list (identifier_format) identifier_format (identifier_width) identifier_width )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (subscript (attribute (identifier_argb32) identifier_argb32 (identifier_strides) identifier_strides )attribute (integer_0) integer_0 )subscript (identifier_stride) identifier_stride )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_'stride of data array not compatible with ARGB32') string_'stride of data array not compatible with ARGB32' )argument_list )call )raise_statement )block )if_statement (return_statement (call (attribute (attribute (identifier_cairo) identifier_cairo (identifier_ImageSurface) identifier_ImageSurface )attribute (identifier_create_for_data) identifier_create_for_data )attribute (argument_list (identifier_argb32) identifier_argb32 (identifier_format) identifier_format (identifier_width) identifier_width (identifier_height) identifier_height (identifier_stride) identifier_stride )argument_list )call )return_statement )block )function_definition )module
Turn arbitrary data values into a Cairo ImageSurface. The method and arguments are the same as data_to_argb32, except that the data array will be treated as 2D, and higher dimensionalities are not allowed. The return value is a Cairo ImageSurface object. Combined with the write_to_png() method on ImageSurfaces, this is an easy way to quickly visualize 2D data.
(module (function_definition (function_name_blueprint) function_name_blueprint (parameters (identifier_self) identifier_self )parameters (type (generic_type (identifier_Optional) identifier_Optional (type_parameter (type (identifier_str) identifier_str )type )type_parameter )generic_type )type (block (if_statement (boolean_operator (comparison_operator (attribute (identifier_self) identifier_self (identifier_endpoint) identifier_endpoint )attribute (None) None )comparison_operator (comparison_operator (string_'.') string_'.' (attribute (identifier_self) identifier_self (identifier_endpoint) identifier_endpoint )attribute )comparison_operator )boolean_operator (block (return_statement (subscript (call (attribute (attribute (identifier_self) identifier_self (identifier_endpoint) identifier_endpoint )attribute (identifier_rsplit) identifier_rsplit )attribute (argument_list (string_'.') string_'.' (integer_1) integer_1 )argument_list )call (integer_0) integer_0 )subscript )return_statement )block (else_clause (block (return_statement (None) None )return_statement )block )else_clause )if_statement )block )function_definition )module
Returns the blueprint the matched endpoint belongs to. This can be None if the request has not been matched or the endpoint is not in a blueprint.
(module (function_definition (function_name_is_third_friday) function_name_is_third_friday (parameters (default_parameter (identifier_day) identifier_day (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_day) identifier_day (conditional_expression (identifier_day) identifier_day (comparison_operator (identifier_day) identifier_day (None) None )comparison_operator (call (attribute (attribute (identifier_datetime) identifier_datetime (identifier_datetime) identifier_datetime )attribute (identifier_now) identifier_now )attribute (argument_list )argument_list )call )conditional_expression )assignment )expression_statement (expression_statement (assignment (identifier_defacto_friday) identifier_defacto_friday (boolean_operator (parenthesized_expression (comparison_operator (call (attribute (identifier_day) identifier_day (identifier_weekday) identifier_weekday )attribute (argument_list )argument_list )call (integer_4) integer_4 )comparison_operator )parenthesized_expression (parenthesized_expression (boolean_operator (comparison_operator (call (attribute (identifier_day) identifier_day (identifier_weekday) identifier_weekday )attribute (argument_list )argument_list )call (integer_3) integer_3 )comparison_operator (comparison_operator (call (attribute (identifier_day) identifier_day (identifier_hour) identifier_hour )attribute (argument_list )argument_list )call (integer_17) integer_17 )comparison_operator )boolean_operator )parenthesized_expression )boolean_operator )assignment )expression_statement (return_statement (boolean_operator (identifier_defacto_friday) identifier_defacto_friday (comparison_operator (integer_14) integer_14 (attribute (identifier_day) identifier_day (identifier_day) identifier_day )attribute (integer_22) integer_22 )comparison_operator )boolean_operator )return_statement )block )function_definition )module
check if day is month's 3rd friday
(module (function_definition (function_name_get_zorder) function_name_get_zorder (parameters (identifier_self) identifier_self (identifier_overlay) identifier_overlay (identifier_key) identifier_key (identifier_el) identifier_el )parameters (block (expression_statement (assignment (identifier_spec) identifier_spec (call (attribute (identifier_util) identifier_util (identifier_get_overlay_spec) identifier_get_overlay_spec )attribute (argument_list (identifier_overlay) identifier_overlay (identifier_key) identifier_key (identifier_el) identifier_el )argument_list )call )assignment )expression_statement (return_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_ordering) identifier_ordering )attribute (identifier_index) identifier_index )attribute (argument_list (identifier_spec) identifier_spec )argument_list )call )return_statement )block )function_definition )module
Computes the z-order of element in the NdOverlay taking into account possible batching of elements.
(module (function_definition (function_name_parseLines) function_name_parseLines (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_inAst) identifier_inAst (call (identifier_parse) identifier_parse (argument_list (call (attribute (string_'') string_'' (identifier_join) identifier_join )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_lines) identifier_lines )attribute )argument_list )call (attribute (identifier_self) identifier_self (identifier_inFilename) identifier_inFilename )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_visit) identifier_visit )attribute (argument_list (identifier_inAst) identifier_inAst )argument_list )call )expression_statement )block )function_definition )module
Form an AST for the code and produce a new version of the source.
(module (function_definition (function_name_truncated_normal_log_likelihood) function_name_truncated_normal_log_likelihood (parameters (identifier_params) identifier_params (identifier_low) identifier_low (identifier_high) identifier_high (identifier_data) identifier_data )parameters (block (expression_statement (assignment (identifier_mu) identifier_mu (subscript (identifier_params) identifier_params (integer_0) integer_0 )subscript )assignment )expression_statement (expression_statement (assignment (identifier_sigma) identifier_sigma (subscript (identifier_params) identifier_params (integer_1) integer_1 )subscript )assignment )expression_statement (if_statement (comparison_operator (identifier_sigma) identifier_sigma (integer_0) integer_0 )comparison_operator (block (return_statement (attribute (identifier_np) identifier_np (identifier_inf) identifier_inf )attribute )return_statement )block )if_statement (expression_statement (assignment (identifier_ll) identifier_ll (call (attribute (identifier_np) identifier_np (identifier_sum) identifier_sum )attribute (argument_list (call (attribute (identifier_norm) identifier_norm (identifier_logpdf) identifier_logpdf )attribute (argument_list (identifier_data) identifier_data (identifier_mu) identifier_mu (identifier_sigma) identifier_sigma )argument_list )call )argument_list )call )assignment )expression_statement (expression_statement (augmented_assignment (identifier_ll) identifier_ll (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_data) identifier_data )argument_list )call (call (attribute (identifier_np) identifier_np (identifier_log) identifier_log )attribute (argument_list (parenthesized_expression (binary_operator (call (attribute (identifier_norm) identifier_norm (identifier_cdf) identifier_cdf )attribute (argument_list (identifier_high) identifier_high (identifier_mu) identifier_mu (identifier_sigma) identifier_sigma )argument_list )call (call (attribute (identifier_norm) identifier_norm (identifier_cdf) identifier_cdf )attribute (argument_list (identifier_low) identifier_low (identifier_mu) identifier_mu (identifier_sigma) identifier_sigma )argument_list )call )binary_operator )parenthesized_expression )argument_list )call )binary_operator )augmented_assignment )expression_statement (return_statement (unary_operator (identifier_ll) identifier_ll )unary_operator )return_statement )block )function_definition )module
Calculate the log likelihood of the truncated normal distribution. Args: params: tuple with (mean, std), the parameters under which we evaluate the model low (float): the lower truncation bound high (float): the upper truncation bound data (ndarray): the one dimension list of data points for which we want to calculate the likelihood Returns: float: the negative log likelihood of observing the given data under the given parameters. This is meant to be used in minimization routines.
(module (function_definition (function_name__heartbeat_loop) function_name__heartbeat_loop (parameters (identifier_self) identifier_self )parameters (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_logger) identifier_logger )attribute (identifier_debug) identifier_debug )attribute (argument_list (string_"running main heartbeat thread") string_"running main heartbeat thread" )argument_list )call )expression_statement (while_statement (not_operator (attribute (identifier_self) identifier_self (identifier_closed) identifier_closed )attribute )not_operator (block (expression_statement (call (attribute (identifier_time) identifier_time (identifier_sleep) identifier_sleep )attribute (argument_list (subscript (attribute (identifier_self) identifier_self (identifier_settings) identifier_settings )attribute (string_'SLEEP_TIME') string_'SLEEP_TIME' )subscript )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__report_self) identifier__report_self )attribute (argument_list )argument_list )call )expression_statement )block )while_statement )block )function_definition )module
A main run loop thread to do work
(module (function_definition (function_name__get_atomsection) function_name__get_atomsection (parameters (identifier_mol2_lst) identifier_mol2_lst )parameters (block (expression_statement (assignment (identifier_started) identifier_started (False) False )assignment )expression_statement (for_statement (pattern_list (identifier_idx) identifier_idx (identifier_s) identifier_s )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_mol2_lst) identifier_mol2_lst )argument_list )call (block (if_statement (call (attribute (identifier_s) identifier_s (identifier_startswith) identifier_startswith )attribute (argument_list (string_'@<TRIPOS>ATOM') string_'@<TRIPOS>ATOM' )argument_list )call (block (expression_statement (assignment (identifier_first_idx) identifier_first_idx (binary_operator (identifier_idx) identifier_idx (integer_1) integer_1 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_started) identifier_started (True) True )assignment )expression_statement )block (elif_clause (boolean_operator (identifier_started) identifier_started (call (attribute (identifier_s) identifier_s (identifier_startswith) identifier_startswith )attribute (argument_list (string_'@<TRIPOS>') string_'@<TRIPOS>' )argument_list )call )boolean_operator (block (expression_statement (assignment (identifier_last_idx_plus1) identifier_last_idx_plus1 (identifier_idx) identifier_idx )assignment )expression_statement (break_statement )break_statement )block )elif_clause )if_statement )block )for_statement (return_statement (subscript (identifier_mol2_lst) identifier_mol2_lst (slice (identifier_first_idx) identifier_first_idx (colon) colon (identifier_last_idx_plus1) identifier_last_idx_plus1 )slice )subscript )return_statement )block )function_definition )module
Returns atom section from mol2 provided as list of strings
(module (function_definition (function_name_partition_list) function_name_partition_list (parameters (identifier_pred) identifier_pred (identifier_iterable) identifier_iterable )parameters (block (expression_statement (assignment (pattern_list (identifier_left) identifier_left (identifier_right) identifier_right )pattern_list (call (identifier_partition_iter) identifier_partition_iter (argument_list (identifier_pred) identifier_pred (identifier_iterable) identifier_iterable )argument_list )call )assignment )expression_statement (return_statement (expression_list (call (identifier_list) identifier_list (argument_list (identifier_left) identifier_left )argument_list )call (call (identifier_list) identifier_list (argument_list (identifier_right) identifier_right )argument_list )call )expression_list )return_statement )block )function_definition )module
Partitions an iterable with a predicate into two lists, one with elements satisfying the predicate and one with elements that do not satisfy it. .. note: this just converts the results of partition_iter to a list for you so that you don't have to in most cases using `partition_iter` is a better option. :returns: a tuple (satisfiers, unsatisfiers).
(module (function_definition (function_name_upload_file_and_send_file_offer) function_name_upload_file_and_send_file_offer (parameters (identifier_self) identifier_self (identifier_file_name) identifier_file_name (identifier_user_id) identifier_user_id (default_parameter (identifier_data) identifier_data (None) None )default_parameter (default_parameter (identifier_input_file_path) identifier_input_file_path (None) None )default_parameter (default_parameter (identifier_content_type) identifier_content_type (string_'application/octet-stream') string_'application/octet-stream' )default_parameter (default_parameter (identifier_auto_open) identifier_auto_open (False) False )default_parameter (default_parameter (identifier_prevent_share) identifier_prevent_share (False) False )default_parameter (default_parameter (identifier_scope) identifier_scope (string_'content/send') string_'content/send' )default_parameter )parameters (block (if_statement (identifier_input_file_path) identifier_input_file_path (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_input_file_path) identifier_input_file_path (string_'rb') string_'rb' )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (identifier_data) identifier_data (call (attribute (identifier_f) identifier_f (identifier_read) identifier_read )attribute (argument_list )argument_list )call )assignment )expression_statement )block )with_statement )block )if_statement (if_statement (not_operator (identifier_data) identifier_data )not_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_'Either the data of a file or the path to a file must be provided') string_'Either the data of a file or the path to a file must be provided' )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_params) identifier_params (dictionary (pair (string_'fileName') string_'fileName' (identifier_file_name) identifier_file_name )pair (pair (string_'userId') string_'userId' (identifier_user_id) identifier_user_id )pair (pair (string_'autoOpen') string_'autoOpen' (conditional_expression (string_'true') string_'true' (identifier_auto_open) identifier_auto_open (string_'false') string_'false' )conditional_expression )pair (pair (string_'preventShare') string_'preventShare' (conditional_expression (string_'true') string_'true' (identifier_prevent_share) identifier_prevent_share (string_'false') string_'false' )conditional_expression )pair )dictionary )assignment )expression_statement (return_statement (call (identifier__post) identifier__post (argument_list (keyword_argument (identifier_token) identifier_token (call (attribute (attribute (identifier_self) identifier_self (identifier_oauth) identifier_oauth )attribute (identifier_get_app_token) identifier_get_app_token )attribute (argument_list (identifier_scope) identifier_scope )argument_list )call )keyword_argument (keyword_argument (identifier_uri) identifier_uri (binary_operator (string_'/user/media/file/send?') string_'/user/media/file/send?' (call (attribute (identifier_urllib) identifier_urllib (identifier_urlencode) identifier_urlencode )attribute (argument_list (identifier_params) identifier_params )argument_list )call )binary_operator )keyword_argument (keyword_argument (identifier_data) identifier_data (identifier_data) identifier_data )keyword_argument (keyword_argument (identifier_content_type) identifier_content_type (identifier_content_type) identifier_content_type )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Upload a file of any type to store and return a FileId once file offer has been sent. No user authentication required
(module (function_definition (function_name_task_annotate) function_name_task_annotate (parameters (identifier_self) identifier_self (identifier_task) identifier_task (identifier_annotation) identifier_annotation )parameters (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__execute) identifier__execute )attribute (argument_list (subscript (identifier_task) identifier_task (string_'uuid') string_'uuid' )subscript (string_'annotate') string_'annotate' (string_'--') string_'--' (identifier_annotation) identifier_annotation )argument_list )call )expression_statement (expression_statement (assignment (pattern_list (identifier_id) identifier_id (identifier_annotated_task) identifier_annotated_task )pattern_list (call (attribute (identifier_self) identifier_self (identifier_get_task) identifier_get_task )attribute (argument_list (keyword_argument (identifier_uuid) identifier_uuid (subscript (identifier_task) identifier_task (call (attribute (identifier_six) identifier_six (identifier_u) identifier_u )attribute (argument_list (string_'uuid') string_'uuid' )argument_list )call )subscript )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (identifier_annotated_task) identifier_annotated_task )return_statement )block )function_definition )module
Annotates a task.
(module (function_definition (function_name_colors) function_name_colors (parameters (identifier_self) identifier_self (identifier_color_code) identifier_color_code )parameters (block (if_statement (comparison_operator (identifier_color_code) identifier_color_code (None) None )comparison_operator (block (expression_statement (assignment (identifier_color_code) identifier_color_code (subscript (identifier_WINDOWS_CODES) identifier_WINDOWS_CODES (string_'/all') string_'/all' )subscript )assignment )expression_statement )block )if_statement (expression_statement (assignment (pattern_list (identifier_current_fg) identifier_current_fg (identifier_current_bg) identifier_current_bg )pattern_list (attribute (identifier_self) identifier_self (identifier_colors) identifier_colors )attribute )assignment )expression_statement (if_statement (comparison_operator (identifier_color_code) identifier_color_code (subscript (identifier_WINDOWS_CODES) identifier_WINDOWS_CODES (string_'/fg') string_'/fg' )subscript )comparison_operator (block (expression_statement (assignment (identifier_final_color_code) identifier_final_color_code (binary_operator (attribute (identifier_self) identifier_self (identifier_default_fg) identifier_default_fg )attribute (identifier_current_bg) identifier_current_bg )binary_operator )assignment )expression_statement )block (elif_clause (comparison_operator (identifier_color_code) identifier_color_code (subscript (identifier_WINDOWS_CODES) identifier_WINDOWS_CODES (string_'/bg') string_'/bg' )subscript )comparison_operator (block (expression_statement (assignment (identifier_final_color_code) identifier_final_color_code (binary_operator (identifier_current_fg) identifier_current_fg (attribute (identifier_self) identifier_self (identifier_default_bg) identifier_default_bg )attribute )binary_operator )assignment )expression_statement )block )elif_clause (elif_clause (comparison_operator (identifier_color_code) identifier_color_code (subscript (identifier_WINDOWS_CODES) identifier_WINDOWS_CODES (string_'/all') string_'/all' )subscript )comparison_operator (block (expression_statement (assignment (identifier_final_color_code) identifier_final_color_code (binary_operator (attribute (identifier_self) identifier_self (identifier_default_fg) identifier_default_fg )attribute (attribute (identifier_self) identifier_self (identifier_default_bg) identifier_default_bg )attribute )binary_operator )assignment )expression_statement )block )elif_clause (elif_clause (comparison_operator (identifier_color_code) identifier_color_code (subscript (identifier_WINDOWS_CODES) identifier_WINDOWS_CODES (string_'bgblack') string_'bgblack' )subscript )comparison_operator (block (expression_statement (assignment (identifier_final_color_code) identifier_final_color_code (identifier_current_fg) identifier_current_fg )assignment )expression_statement )block )elif_clause (else_clause (block (expression_statement (assignment (identifier_new_is_bg) identifier_new_is_bg (comparison_operator (identifier_color_code) identifier_color_code (attribute (identifier_self) identifier_self (identifier_ALL_BG_CODES) identifier_ALL_BG_CODES )attribute )comparison_operator )assignment )expression_statement (expression_statement (assignment (identifier_final_color_code) identifier_final_color_code (binary_operator (identifier_color_code) identifier_color_code (parenthesized_expression (conditional_expression (identifier_current_fg) identifier_current_fg (identifier_new_is_bg) identifier_new_is_bg (identifier_current_bg) identifier_current_bg )conditional_expression )parenthesized_expression )binary_operator )assignment )expression_statement )block )else_clause )if_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__kernel32) identifier__kernel32 )attribute (identifier_SetConsoleTextAttribute) identifier_SetConsoleTextAttribute )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__stream_handle) identifier__stream_handle )attribute (identifier_final_color_code) identifier_final_color_code )argument_list )call )expression_statement )block )function_definition )module
Change the foreground and background colors for subsequently printed characters. None resets colors to their original values (when class was instantiated). Since setting a color requires including both foreground and background codes (merged), setting just the foreground color resets the background color to black, and vice versa. This function first gets the current background and foreground colors, merges in the requested color code, and sets the result. However if we need to remove just the foreground color but leave the background color the same (or vice versa) such as when {/red} is used, we must merge the default foreground color with the current background color. This is the reason for those negative values. :param int color_code: Color code from WINDOWS_CODES.
(module (function_definition (function_name_process_nxml_file) function_name_process_nxml_file (parameters (identifier_file_name) identifier_file_name (default_parameter (identifier_citation) identifier_citation (None) None )default_parameter (default_parameter (identifier_offline) identifier_offline (False) False )default_parameter (default_parameter (identifier_output_fname) identifier_output_fname (identifier_default_output_fname) identifier_default_output_fname )default_parameter )parameters (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_file_name) identifier_file_name (string_'rb') string_'rb' )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (identifier_nxml_str) identifier_nxml_str (call (attribute (call (attribute (identifier_f) identifier_f (identifier_read) identifier_read )attribute (argument_list )argument_list )call (identifier_decode) identifier_decode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call )assignment )expression_statement (return_statement (call (identifier_process_nxml_str) identifier_process_nxml_str (argument_list (identifier_nxml_str) identifier_nxml_str (identifier_citation) identifier_citation (False) False (identifier_output_fname) identifier_output_fname )argument_list )call )return_statement )block )with_statement )block )function_definition )module
Return a ReachProcessor by processing the given NXML file. NXML is the format used by PubmedCentral for papers in the open access subset. Parameters ---------- file_name : str The name of the NXML file to be processed. citation : Optional[str] A PubMed ID passed to be used in the evidence for the extracted INDRA Statements. Default: None offline : Optional[bool] If set to True, the REACH system is ran offline. Otherwise (by default) the web service is called. Default: False output_fname : Optional[str] The file to output the REACH JSON output to. Defaults to reach_output.json in current working directory. Returns ------- rp : ReachProcessor A ReachProcessor containing the extracted INDRA Statements in rp.statements.
(module (function_definition (function_name_f1_score) function_name_f1_score (parameters (identifier_df) identifier_df (default_parameter (identifier_col_true) identifier_col_true (None) None )default_parameter (default_parameter (identifier_col_pred) identifier_col_pred (string_'precision_result') string_'precision_result' )default_parameter (default_parameter (identifier_pos_label) identifier_pos_label (integer_1) integer_1 )default_parameter (default_parameter (identifier_average) identifier_average (None) None )default_parameter )parameters (block (expression_statement (identifier_r) identifier_r )expression_statement (if_statement (not_operator (identifier_col_pred) identifier_col_pred )not_operator (block (expression_statement (assignment (identifier_col_pred) identifier_col_pred (call (identifier_get_field_name_by_role) identifier_get_field_name_by_role (argument_list (identifier_df) identifier_df (attribute (identifier_FieldRole) identifier_FieldRole (identifier_PREDICTED_CLASS) identifier_PREDICTED_CLASS )attribute )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (call (identifier_fbeta_score) identifier_fbeta_score (argument_list (identifier_df) identifier_df (identifier_col_true) identifier_col_true (identifier_col_pred) identifier_col_pred (keyword_argument (identifier_pos_label) identifier_pos_label (identifier_pos_label) identifier_pos_label )keyword_argument (keyword_argument (identifier_average) identifier_average (identifier_average) identifier_average )keyword_argument )argument_list )call )return_statement )block )function_definition )module
r""" Compute f-1 score of a predicted DataFrame. f-1 is defined as .. math:: \frac{2 \cdot precision \cdot recall}{precision + recall} :Parameters: - **df** - predicted data frame - **col_true** - column name of true label - **col_pred** - column name of predicted label, 'prediction_result' by default. - **pos_label** - denote the desired class label when ``average`` == `binary` - **average** - denote the method to compute average. :Returns: Recall score :Return type: float | numpy.array[float] The parameter ``average`` controls the behavior of the function. * When ``average`` == None (by default), f-1 of every class is given as a list. * When ``average`` == 'binary', f-1 of class specified in ``pos_label`` is given. * When ``average`` == 'micro', f-1 of overall precision and recall is given, where overall precision and recall are computed in micro-average mode. * When ``average`` == 'macro', average f-1 of all the class is given. * When ``average`` == `weighted`, average f-1 of all the class weighted by support of every true classes is given. :Example: Assume we have a table named 'predicted' as follows: ======== =================== label prediction_result ======== =================== 0 1 1 2 2 1 1 1 1 0 2 2 ======== =================== Different options of ``average`` parameter outputs different values: .. code-block:: python >>> f1_score(predicted, 'label', average=None) array([ 0. , 0.33333333, 0.5 ]) >>> f1_score(predicted, 'label', average='macro') 0.27 >>> f1_score(predicted, 'label', average='micro') 0.33 >>> f1_score(predicted, 'label', average='weighted') 0.33
(module (function_definition (function_name_pasa) function_name_pasa (parameters (identifier_args) identifier_args )parameters (block (expression_statement (assignment (identifier_p) identifier_p (call (identifier_OptionParser) identifier_OptionParser (argument_list (attribute (identifier_pasa) identifier_pasa (identifier___doc__) identifier___doc__ )attribute )argument_list )call )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_opts) identifier_opts (identifier_args) identifier_args )pattern_list (call (attribute (identifier_p) identifier_p (identifier_parse_args) identifier_parse_args )attribute (argument_list (identifier_args) identifier_args )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_args) identifier_args )argument_list )call (integer_2) integer_2 )comparison_operator (block (expression_statement (call (attribute (identifier_sys) identifier_sys (identifier_exit) identifier_exit )attribute (argument_list (not_operator (call (attribute (identifier_p) identifier_p (identifier_print_help) identifier_print_help )attribute (argument_list )argument_list )call )not_operator )argument_list )call )expression_statement )block )if_statement (expression_statement (assignment (pattern_list (identifier_pasa_db) identifier_pasa_db (identifier_fastafile) identifier_fastafile )pattern_list (identifier_args) identifier_args )assignment )expression_statement (expression_statement (assignment (identifier_termexons) identifier_termexons (string_"pasa.terminal_exons.gff3") string_"pasa.terminal_exons.gff3" )assignment )expression_statement (if_statement (call (identifier_need_update) identifier_need_update (argument_list (identifier_fastafile) identifier_fastafile (identifier_termexons) identifier_termexons )argument_list )call (block (expression_statement (assignment (identifier_cmd) identifier_cmd (string_"$ANNOT_DEVEL/PASA2/scripts/pasa_asmbls_to_training_set.dbi") string_"$ANNOT_DEVEL/PASA2/scripts/pasa_asmbls_to_training_set.dbi" )assignment )expression_statement (expression_statement (augmented_assignment (identifier_cmd) identifier_cmd (call (attribute (string_' -M "{0}:mysql.tigr.org" -p "access:access"') string_' -M "{0}:mysql.tigr.org" -p "access:access"' (identifier_format) identifier_format )attribute (argument_list (identifier_pasa_db) identifier_pasa_db )argument_list )call )augmented_assignment )expression_statement (expression_statement (augmented_assignment (identifier_cmd) identifier_cmd (call (attribute (string_' -g {0}') string_' -g {0}' (identifier_format) identifier_format )attribute (argument_list (identifier_fastafile) identifier_fastafile )argument_list )call )augmented_assignment )expression_statement (expression_statement (call (identifier_sh) identifier_sh (argument_list (identifier_cmd) identifier_cmd )argument_list )call )expression_statement (expression_statement (assignment (identifier_cmd) identifier_cmd (string_"$EVM/PasaUtils/retrieve_terminal_CDS_exons.pl") string_"$EVM/PasaUtils/retrieve_terminal_CDS_exons.pl" )assignment )expression_statement (expression_statement (augmented_assignment (identifier_cmd) identifier_cmd (string_" trainingSetCandidates.fasta trainingSetCandidates.gff") string_" trainingSetCandidates.fasta trainingSetCandidates.gff" )augmented_assignment )expression_statement (expression_statement (call (identifier_sh) identifier_sh (argument_list (identifier_cmd) identifier_cmd (keyword_argument (identifier_outfile) identifier_outfile (identifier_termexons) identifier_termexons )keyword_argument )argument_list )call )expression_statement )block )if_statement (return_statement (identifier_termexons) identifier_termexons )return_statement )block )function_definition )module
%prog pasa pasa_db fastafile Run EVM in TIGR-only mode.
(module (function_definition (function_name__show_stat) function_name__show_stat (parameters (identifier_self) identifier_self )parameters (block (expression_statement (call (identifier__show_stat_wrapper_multi_Progress) identifier__show_stat_wrapper_multi_Progress (argument_list (attribute (identifier_self) identifier_self (identifier_count) identifier_count )attribute (attribute (identifier_self) identifier_self (identifier_last_count) identifier_last_count )attribute (attribute (identifier_self) identifier_self (identifier_start_time) identifier_start_time )attribute (attribute (identifier_self) identifier_self (identifier_max_count) identifier_max_count )attribute (attribute (identifier_self) identifier_self (identifier_speed_calc_cycles) identifier_speed_calc_cycles )attribute (attribute (identifier_self) identifier_self (identifier_width) identifier_width )attribute (attribute (identifier_self) identifier_self (identifier_q) identifier_q )attribute (attribute (identifier_self) identifier_self (identifier_last_speed) identifier_last_speed )attribute (attribute (identifier_self) identifier_self (identifier_prepend) identifier_prepend )attribute (attribute (identifier_self) identifier_self (identifier_show_stat) identifier_show_stat )attribute (attribute (identifier_self) identifier_self (identifier_len) identifier_len )attribute (attribute (identifier_self) identifier_self (identifier_add_args) identifier_add_args )attribute (attribute (identifier_self) identifier_self (identifier_lock) identifier_lock )attribute (attribute (identifier_self) identifier_self (identifier_info_line) identifier_info_line )attribute (keyword_argument (identifier_no_move_up) identifier_no_move_up (True) True )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
convenient functions to call the static show_stat_wrapper_multi with the given class members
(module (function_definition (function_name_check_script) function_name_check_script (parameters (identifier_vouts) identifier_vouts )parameters (block (for_statement (identifier_vout) identifier_vout (list_comprehension (identifier_v) identifier_v (for_in_clause (identifier_v) identifier_v (subscript (identifier_vouts) identifier_vouts (slice (colon) colon (colon) colon (unary_operator (integer_1) integer_1 )unary_operator )slice )subscript )for_in_clause (if_clause (call (attribute (subscript (identifier_v) identifier_v (string_'hex') string_'hex' )subscript (identifier_startswith) identifier_startswith )attribute (argument_list (string_'6a') string_'6a' )argument_list )call )if_clause )list_comprehension (block (expression_statement (assignment (identifier_verb) identifier_verb (call (attribute (identifier_BlockchainSpider) identifier_BlockchainSpider (identifier_decode_op_return) identifier_decode_op_return )attribute (argument_list (subscript (identifier_vout) identifier_vout (string_'hex') string_'hex' )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_action) identifier_action (attribute (call (attribute (identifier_Spoolverb) identifier_Spoolverb (identifier_from_verb) identifier_from_verb )attribute (argument_list (identifier_verb) identifier_verb )argument_list )call (identifier_action) identifier_action )attribute )assignment )expression_statement (if_statement (comparison_operator (identifier_action) identifier_action (attribute (identifier_Spoolverb) identifier_Spoolverb (identifier_supported_actions) identifier_supported_actions )attribute )comparison_operator (block (return_statement (identifier_verb) identifier_verb )return_statement )block )if_statement )block )for_statement (raise_statement (call (identifier_Exception) identifier_Exception (argument_list (string_"Invalid ascribe transaction") string_"Invalid ascribe transaction" )argument_list )call )raise_statement )block )function_definition )module
Looks into the vouts list of a transaction and returns the ``op_return`` if one exists. Args; vouts (list): List of outputs of a transaction. Returns: str: String representation of the ``op_return``. Raises: Exception: If no ``vout`` having a supported verb (:attr:`supported_actions`) is found.
(module (function_definition (function_name_if_sqlserver_disable_constraints_triggers) function_name_if_sqlserver_disable_constraints_triggers (parameters (typed_parameter (identifier_session) identifier_session (type (identifier_SqlASession) identifier_SqlASession )type )typed_parameter (typed_parameter (identifier_tablename) identifier_tablename (type (identifier_str) identifier_str )type )typed_parameter )parameters (type (None) None )type (block (with_statement (with_clause (with_item (call (identifier_if_sqlserver_disable_constraints) identifier_if_sqlserver_disable_constraints (argument_list (identifier_session) identifier_session (identifier_tablename) identifier_tablename )argument_list )call )with_item )with_clause (block (with_statement (with_clause (with_item (call (identifier_if_sqlserver_disable_triggers) identifier_if_sqlserver_disable_triggers (argument_list (identifier_session) identifier_session (identifier_tablename) identifier_tablename )argument_list )call )with_item )with_clause (block (expression_statement (yield )yield )expression_statement )block )with_statement )block )with_statement )block )function_definition )module
If we're running under SQL Server, disable triggers AND constraints for the specified table while the resource is held. Args: session: SQLAlchemy :class:`Session` tablename: table name
(module (function_definition (function_name_set) function_name_set (parameters (identifier_self) identifier_self (identifier_key) identifier_key (identifier_val) identifier_val (default_parameter (identifier_time) identifier_time (integer_0) integer_0 )default_parameter (default_parameter (identifier_min_compress_len) identifier_min_compress_len (integer_0) integer_0 )default_parameter )parameters (block (return_statement (call (attribute (identifier_self) identifier_self (identifier__set) identifier__set )attribute (argument_list (string_"set") string_"set" (identifier_key) identifier_key (identifier_val) identifier_val (identifier_time) identifier_time (identifier_min_compress_len) identifier_min_compress_len )argument_list )call )return_statement )block )function_definition )module
Unconditionally sets a key to a given value in the memcache. The C{key} can optionally be an tuple, with the first element being the server hash value and the second being the key. If you want to avoid making this module calculate a hash value. You may prefer, for example, to keep all of a given user's objects on the same memcache server, so you could use the user's unique id as the hash value. @return: Nonzero on success. @rtype: int @param time: Tells memcached the time which this value should expire, either as a delta number of seconds, or an absolute unix time-since-the-epoch value. See the memcached protocol docs section "Storage Commands" for more info on <exptime>. We default to 0 == cache forever. @param min_compress_len: The threshold length to kick in auto-compression of the value using the zlib.compress() routine. If the value being cached is a string, then the length of the string is measured, else if the value is an object, then the length of the pickle result is measured. If the resulting attempt at compression yeilds a larger string than the input, then it is discarded. For backwards compatability, this parameter defaults to 0, indicating don't ever try to compress.
(module (function_definition (function_name__restore_backup) function_name__restore_backup (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (pattern_list (identifier_input_filename) identifier_input_filename (identifier_input_file) identifier_input_file )pattern_list (call (attribute (identifier_self) identifier_self (identifier__get_backup_file) identifier__get_backup_file )attribute (argument_list (keyword_argument (identifier_database) identifier_database (attribute (identifier_self) identifier_self (identifier_database_name) identifier_database_name )attribute )keyword_argument (keyword_argument (identifier_servername) identifier_servername (attribute (identifier_self) identifier_self (identifier_servername) identifier_servername )attribute )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_logger) identifier_logger )attribute (identifier_info) identifier_info )attribute (argument_list (string_"Restoring backup for database '%s' and server '%s'") string_"Restoring backup for database '%s' and server '%s'" (attribute (identifier_self) identifier_self (identifier_database_name) identifier_database_name )attribute (attribute (identifier_self) identifier_self (identifier_servername) identifier_servername )attribute )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_logger) identifier_logger )attribute (identifier_info) identifier_info )attribute (argument_list (binary_operator (string_"Restoring: %s") string_"Restoring: %s" (identifier_input_filename) identifier_input_filename )binary_operator )argument_list )call )expression_statement (if_statement (attribute (identifier_self) identifier_self (identifier_decrypt) identifier_decrypt )attribute (block (expression_statement (assignment (pattern_list (identifier_unencrypted_file) identifier_unencrypted_file (identifier_input_filename) identifier_input_filename )pattern_list (call (attribute (identifier_utils) identifier_utils (identifier_unencrypt_file) identifier_unencrypt_file )attribute (argument_list (identifier_input_file) identifier_input_file (identifier_input_filename) identifier_input_filename (attribute (identifier_self) identifier_self (identifier_passphrase) identifier_passphrase )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_input_file) identifier_input_file (identifier_close) identifier_close )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_input_file) identifier_input_file (identifier_unencrypted_file) identifier_unencrypted_file )assignment )expression_statement )block )if_statement (if_statement (attribute (identifier_self) identifier_self (identifier_uncompress) identifier_uncompress )attribute (block (expression_statement (assignment (pattern_list (identifier_uncompressed_file) identifier_uncompressed_file (identifier_input_filename) identifier_input_filename )pattern_list (call (attribute (identifier_utils) identifier_utils (identifier_uncompress_file) identifier_uncompress_file )attribute (argument_list (identifier_input_file) identifier_input_file (identifier_input_filename) identifier_input_filename )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_input_file) identifier_input_file (identifier_close) identifier_close )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_input_file) identifier_input_file (identifier_uncompressed_file) identifier_uncompressed_file )assignment )expression_statement )block )if_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_logger) identifier_logger )attribute (identifier_info) identifier_info )attribute (argument_list (string_"Restore tempfile created: %s") string_"Restore tempfile created: %s" (call (attribute (identifier_utils) identifier_utils (identifier_handle_size) identifier_handle_size )attribute (argument_list (identifier_input_file) identifier_input_file )argument_list )call )argument_list )call )expression_statement (if_statement (attribute (identifier_self) identifier_self (identifier_interactive) identifier_interactive )attribute (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier__ask_confirmation) identifier__ask_confirmation )attribute (argument_list )argument_list )call )expression_statement )block )if_statement (expression_statement (call (attribute (identifier_input_file) identifier_input_file (identifier_seek) identifier_seek )attribute (argument_list (integer_0) integer_0 )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_connector) identifier_connector )attribute (call (identifier_get_connector) identifier_get_connector (argument_list (attribute (identifier_self) identifier_self (identifier_database_name) identifier_database_name )attribute )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_connector) identifier_connector )attribute (identifier_restore_dump) identifier_restore_dump )attribute (argument_list (identifier_input_file) identifier_input_file )argument_list )call )expression_statement )block )function_definition )module
Restore the specified database.
(module (function_definition (function_name_email) function_name_email (parameters (identifier_anon) identifier_anon (identifier_obj) identifier_obj (identifier_field) identifier_field (identifier_val) identifier_val )parameters (block (return_statement (call (attribute (attribute (identifier_anon) identifier_anon (identifier_faker) identifier_faker )attribute (identifier_email) identifier_email )attribute (argument_list (keyword_argument (identifier_field) identifier_field (identifier_field) identifier_field )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Generates a random email address.
(module (function_definition (function_name__parse_dav_element) function_name__parse_dav_element (parameters (identifier_self) identifier_self (identifier_dav_response) identifier_dav_response )parameters (block (expression_statement (assignment (identifier_href) identifier_href (call (attribute (identifier_parse) identifier_parse (identifier_unquote) identifier_unquote )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier__strip_dav_path) identifier__strip_dav_path )attribute (argument_list (attribute (call (attribute (identifier_dav_response) identifier_dav_response (identifier_find) identifier_find )attribute (argument_list (string_'{DAV:}href') string_'{DAV:}href' )argument_list )call (identifier_text) identifier_text )attribute )argument_list )call )argument_list )call )assignment )expression_statement (if_statement (attribute (identifier_six) identifier_six (identifier_PY2) identifier_PY2 )attribute (block (expression_statement (assignment (identifier_href) identifier_href (call (attribute (identifier_href) identifier_href (identifier_decode) identifier_decode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_file_type) identifier_file_type (string_'file') string_'file' )assignment )expression_statement (if_statement (comparison_operator (subscript (identifier_href) identifier_href (unary_operator (integer_1) integer_1 )unary_operator )subscript (string_'/') string_'/' )comparison_operator (block (expression_statement (assignment (identifier_file_type) identifier_file_type (string_'dir') string_'dir' )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_file_attrs) identifier_file_attrs (dictionary )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_attrs) identifier_attrs (call (attribute (identifier_dav_response) identifier_dav_response (identifier_find) identifier_find )attribute (argument_list (string_'{DAV:}propstat') string_'{DAV:}propstat' )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_attrs) identifier_attrs (call (attribute (identifier_attrs) identifier_attrs (identifier_find) identifier_find )attribute (argument_list (string_'{DAV:}prop') string_'{DAV:}prop' )argument_list )call )assignment )expression_statement (for_statement (identifier_attr) identifier_attr (identifier_attrs) identifier_attrs (block (expression_statement (assignment (subscript (identifier_file_attrs) identifier_file_attrs (attribute (identifier_attr) identifier_attr (identifier_tag) identifier_tag )attribute )subscript (attribute (identifier_attr) identifier_attr (identifier_text) identifier_text )attribute )assignment )expression_statement )block )for_statement (return_statement (call (identifier_FileInfo) identifier_FileInfo (argument_list (identifier_href) identifier_href (identifier_file_type) identifier_file_type (identifier_file_attrs) identifier_file_attrs )argument_list )call )return_statement )block )function_definition )module
Parses a single DAV element :param dav_response: DAV response :returns :class:`FileInfo`
(module (function_definition (function_name_pelix_services) function_name_pelix_services (parameters (identifier_self) identifier_self )parameters (block (return_statement (dictionary_comprehension (pair (call (attribute (identifier_svc_ref) identifier_svc_ref (identifier_get_property) identifier_get_property )attribute (argument_list (attribute (attribute (identifier_pelix) identifier_pelix (identifier_constants) identifier_constants )attribute (identifier_SERVICE_ID) identifier_SERVICE_ID )attribute )argument_list )call (dictionary (pair (string_"specifications") string_"specifications" (call (attribute (identifier_svc_ref) identifier_svc_ref (identifier_get_property) identifier_get_property )attribute (argument_list (attribute (attribute (identifier_pelix) identifier_pelix (identifier_constants) identifier_constants )attribute (identifier_OBJECTCLASS) identifier_OBJECTCLASS )attribute )argument_list )call )pair (pair (string_"ranking") string_"ranking" (call (attribute (identifier_svc_ref) identifier_svc_ref (identifier_get_property) identifier_get_property )attribute (argument_list (attribute (attribute (identifier_pelix) identifier_pelix (identifier_constants) identifier_constants )attribute (identifier_SERVICE_RANKING) identifier_SERVICE_RANKING )attribute )argument_list )call )pair (pair (string_"properties") string_"properties" (call (attribute (identifier_svc_ref) identifier_svc_ref (identifier_get_properties) identifier_get_properties )attribute (argument_list )argument_list )call )pair (pair (string_"bundle.id") string_"bundle.id" (call (attribute (call (attribute (identifier_svc_ref) identifier_svc_ref (identifier_get_bundle) identifier_get_bundle )attribute (argument_list )argument_list )call (identifier_get_bundle_id) identifier_get_bundle_id )attribute (argument_list )argument_list )call )pair (pair (string_"bundle.name") string_"bundle.name" (call (attribute (call (attribute (identifier_svc_ref) identifier_svc_ref (identifier_get_bundle) identifier_get_bundle )attribute (argument_list )argument_list )call (identifier_get_symbolic_name) identifier_get_symbolic_name )attribute (argument_list )argument_list )call )pair )dictionary )pair (for_in_clause (identifier_svc_ref) identifier_svc_ref (call (attribute (attribute (identifier_self) identifier_self (identifier___context) identifier___context )attribute (identifier_get_all_service_references) identifier_get_all_service_references )attribute (argument_list (None) None )argument_list )call )for_in_clause )dictionary_comprehension )return_statement )block )function_definition )module
List of registered services
(module (function_definition (function_name_gameloop) function_name_gameloop (parameters (identifier_self) identifier_self )parameters (block (try_statement (block (while_statement (True) True (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_handle_events) identifier_handle_events )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_update) identifier_update )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_render) identifier_render )attribute (argument_list )argument_list )call )expression_statement )block )while_statement )block (except_clause (identifier_KeyboardInterrupt) identifier_KeyboardInterrupt (block (pass_statement )pass_statement )block )except_clause )try_statement )block )function_definition )module
A game loop that circles through the methods.
(module (function_definition (function_name__make_mask) function_name__make_mask (parameters (identifier_self) identifier_self (identifier_data) identifier_data (default_parameter (identifier_lon_str) identifier_lon_str (identifier_LON_STR) identifier_LON_STR )default_parameter (default_parameter (identifier_lat_str) identifier_lat_str (identifier_LAT_STR) identifier_LAT_STR )default_parameter )parameters (block (expression_statement (assignment (identifier_mask) identifier_mask (False) False )assignment )expression_statement (for_statement (pattern_list (identifier_west) identifier_west (identifier_east) identifier_east (identifier_south) identifier_south (identifier_north) identifier_north )pattern_list (attribute (identifier_self) identifier_self (identifier_mask_bounds) identifier_mask_bounds )attribute (block (if_statement (comparison_operator (identifier_west) identifier_west (identifier_east) identifier_east )comparison_operator (block (expression_statement (assignment (identifier_mask_lon) identifier_mask_lon (binary_operator (parenthesized_expression (comparison_operator (subscript (identifier_data) identifier_data (identifier_lon_str) identifier_lon_str )subscript (identifier_west) identifier_west )comparison_operator )parenthesized_expression (parenthesized_expression (comparison_operator (subscript (identifier_data) identifier_data (identifier_lon_str) identifier_lon_str )subscript (identifier_east) identifier_east )comparison_operator )parenthesized_expression )binary_operator )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_mask_lon) identifier_mask_lon (binary_operator (parenthesized_expression (comparison_operator (subscript (identifier_data) identifier_data (identifier_lon_str) identifier_lon_str )subscript (identifier_west) identifier_west )comparison_operator )parenthesized_expression (parenthesized_expression (comparison_operator (subscript (identifier_data) identifier_data (identifier_lon_str) identifier_lon_str )subscript (identifier_east) identifier_east )comparison_operator )parenthesized_expression )binary_operator )assignment )expression_statement )block )else_clause )if_statement (expression_statement (assignment (identifier_mask_lat) identifier_mask_lat (binary_operator (parenthesized_expression (comparison_operator (subscript (identifier_data) identifier_data (identifier_lat_str) identifier_lat_str )subscript (identifier_south) identifier_south )comparison_operator )parenthesized_expression (parenthesized_expression (comparison_operator (subscript (identifier_data) identifier_data (identifier_lat_str) identifier_lat_str )subscript (identifier_north) identifier_north )comparison_operator )parenthesized_expression )binary_operator )assignment )expression_statement (expression_statement (augmented_assignment (identifier_mask) identifier_mask (binary_operator (identifier_mask_lon) identifier_mask_lon (identifier_mask_lat) identifier_mask_lat )binary_operator )augmented_assignment )expression_statement )block )for_statement (return_statement (identifier_mask) identifier_mask )return_statement )block )function_definition )module
Construct the mask that defines a region on a given data's grid.
(module (function_definition (function_name_get_database_configuration) function_name_get_database_configuration (parameters )parameters (block (expression_statement (assignment (identifier_db_config) identifier_db_config (call (identifier_get_database_config_file) identifier_get_database_config_file (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_db_config) identifier_db_config (None) None )comparison_operator (block (return_statement (None) None )return_statement )block )if_statement (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_db_config) identifier_db_config (string_'r') string_'r' )argument_list )call (as_pattern_target (identifier_ymlfile) identifier_ymlfile )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (identifier_cfg) identifier_cfg (call (attribute (identifier_yaml) identifier_yaml (identifier_load) identifier_load )attribute (argument_list (identifier_ymlfile) identifier_ymlfile )argument_list )call )assignment )expression_statement )block )with_statement (return_statement (identifier_cfg) identifier_cfg )return_statement )block )function_definition )module
Get database configuration as dictionary.
(module (function_definition (function_name__construct) function_name__construct (parameters (identifier_self) identifier_self (identifier_context) identifier_context )parameters (block (with_statement (with_clause (with_item (call (attribute (attribute (identifier_self) identifier_self (identifier_g) identifier_g )attribute (identifier_as_default) identifier_as_default )attribute (argument_list )argument_list )call )with_item )with_clause (block (if_statement (attribute (identifier_self) identifier_self (identifier__pass_through) identifier__pass_through )attribute (block (return_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__pass_through) identifier__pass_through )attribute (identifier__construct) identifier__construct )attribute (argument_list (identifier_context) identifier_context )argument_list )call )return_statement )block )if_statement (expression_statement (assignment (identifier_current_value) identifier_current_value (call (attribute (identifier_context) identifier_context (identifier_get) identifier_get )attribute (argument_list (identifier_self) identifier_self (None) None )argument_list )call )assignment )expression_statement (assert_statement (comparison_operator (identifier_current_value) identifier_current_value (identifier__unspecified) identifier__unspecified )comparison_operator (string_'Circular dependency') string_'Circular dependency' )assert_statement (if_statement (comparison_operator (identifier_current_value) identifier_current_value (None) None )comparison_operator (block (return_statement (identifier_current_value) identifier_current_value )return_statement )block )if_statement (expression_statement (assignment (subscript (identifier_context) identifier_context (identifier_self) identifier_self )subscript (identifier__unspecified) identifier__unspecified )assignment )expression_statement (expression_statement (assignment (identifier_method_args) identifier_method_args (call (attribute (identifier_self) identifier_self (identifier__replace_deferred) identifier__replace_deferred )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__method_args) identifier__method_args )attribute (identifier_context) identifier_context )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_method_kwargs) identifier_method_kwargs (call (attribute (identifier_self) identifier_self (identifier__replace_deferred) identifier__replace_deferred )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__method_kwargs) identifier__method_kwargs )attribute (identifier_context) identifier_context )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_result) identifier_result (call (attribute (identifier_self) identifier_self (identifier__method) identifier__method )attribute (argument_list (list_splat (identifier_method_args) identifier_method_args )list_splat (dictionary_splat (identifier_method_kwargs) identifier_method_kwargs )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (call (identifier__strip_unnecessary_contents_from_stack) identifier__strip_unnecessary_contents_from_stack (argument_list (identifier_result) identifier_result (call (identifier_set) identifier_set (argument_list )argument_list )call )argument_list )call )expression_statement (expression_statement (assignment (subscript (identifier_context) identifier_context (identifier_self) identifier_self )subscript (identifier_result) identifier_result )assignment )expression_statement (return_statement (identifier_result) identifier_result )return_statement )block )with_statement )block )function_definition )module
Constructs this by calling the deferred method. This assumes that all unbound_vars have been specified in context and if this layer has already been computed in this context, then the previously constructed value will be returned. Args: context: A dict of UnboundVariables/_DeferredLayers to their values. Returns: The result of calling the given method on this layer.
(module (function_definition (function_name_get_qualification_type_by_name) function_name_get_qualification_type_by_name (parameters (identifier_self) identifier_self (identifier_name) identifier_name )parameters (block (expression_statement (assignment (identifier_max_fuzzy_matches_to_check) identifier_max_fuzzy_matches_to_check (integer_100) integer_100 )assignment )expression_statement (expression_statement (assignment (identifier_query) identifier_query (call (attribute (identifier_name) identifier_name (identifier_upper) identifier_upper )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_start) identifier_start (call (attribute (identifier_time) identifier_time (identifier_time) identifier_time )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_args) identifier_args (dictionary (pair (string_"Query") string_"Query" (identifier_query) identifier_query )pair (pair (string_"MustBeRequestable") string_"MustBeRequestable" (False) False )pair (pair (string_"MustBeOwnedByCaller") string_"MustBeOwnedByCaller" (True) True )pair (pair (string_"MaxResults") string_"MaxResults" (identifier_max_fuzzy_matches_to_check) identifier_max_fuzzy_matches_to_check )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_results) identifier_results (subscript (call (attribute (attribute (identifier_self) identifier_self (identifier_mturk) identifier_mturk )attribute (identifier_list_qualification_types) identifier_list_qualification_types )attribute (argument_list (dictionary_splat (identifier_args) identifier_args )dictionary_splat )argument_list )call (string_"QualificationTypes") string_"QualificationTypes" )subscript )assignment )expression_statement (while_statement (boolean_operator (not_operator (identifier_results) identifier_results )not_operator (comparison_operator (binary_operator (call (attribute (identifier_time) identifier_time (identifier_time) identifier_time )attribute (argument_list )argument_list )call (identifier_start) identifier_start )binary_operator (attribute (identifier_self) identifier_self (identifier_max_wait_secs) identifier_max_wait_secs )attribute )comparison_operator )boolean_operator (block (expression_statement (call (attribute (identifier_time) identifier_time (identifier_sleep) identifier_sleep )attribute (argument_list (integer_1) integer_1 )argument_list )call )expression_statement (expression_statement (assignment (identifier_results) identifier_results (subscript (call (attribute (attribute (identifier_self) identifier_self (identifier_mturk) identifier_mturk )attribute (identifier_list_qualification_types) identifier_list_qualification_types )attribute (argument_list (dictionary_splat (identifier_args) identifier_args )dictionary_splat )argument_list )call (string_"QualificationTypes") string_"QualificationTypes" )subscript )assignment )expression_statement )block )while_statement (if_statement (not_operator (identifier_results) identifier_results )not_operator (block (return_statement (None) None )return_statement )block )if_statement (expression_statement (assignment (identifier_qualifications) identifier_qualifications (list_comprehension (call (attribute (identifier_self) identifier_self (identifier__translate_qtype) identifier__translate_qtype )attribute (argument_list (identifier_r) identifier_r )argument_list )call (for_in_clause (identifier_r) identifier_r (identifier_results) identifier_results )for_in_clause )list_comprehension )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_qualifications) identifier_qualifications )argument_list )call (integer_1) integer_1 )comparison_operator (block (for_statement (identifier_qualification) identifier_qualification (identifier_qualifications) identifier_qualifications (block (if_statement (comparison_operator (call (attribute (subscript (identifier_qualification) identifier_qualification (string_"name") string_"name" )subscript (identifier_upper) identifier_upper )attribute (argument_list )argument_list )call (identifier_query) identifier_query )comparison_operator (block (return_statement (identifier_qualification) identifier_qualification )return_statement )block )if_statement )block )for_statement (raise_statement (call (identifier_MTurkServiceException) identifier_MTurkServiceException (argument_list (call (attribute (string_"{} was not a unique name") string_"{} was not a unique name" (identifier_format) identifier_format )attribute (argument_list (identifier_query) identifier_query )argument_list )call )argument_list )call )raise_statement )block )if_statement (return_statement (subscript (identifier_qualifications) identifier_qualifications (integer_0) integer_0 )subscript )return_statement )block )function_definition )module
Return a Qualification Type by name. If the provided name matches more than one Qualification, check to see if any of the results match the provided name exactly. If there's an exact match, return that Qualification. Otherwise, raise an exception.
(module (function_definition (function_name_get_list_w_id2nts) function_name_get_list_w_id2nts (parameters (identifier_ids) identifier_ids (identifier_id2nts) identifier_id2nts (identifier_flds) identifier_flds (default_parameter (identifier_dflt_null) identifier_dflt_null (string_"") string_"" )default_parameter )parameters (block (expression_statement (assignment (identifier_combined_nt_list) identifier_combined_nt_list (list )list )assignment )expression_statement (expression_statement (assignment (identifier_ntobj) identifier_ntobj (call (attribute (identifier_cx) identifier_cx (identifier_namedtuple) identifier_namedtuple )attribute (argument_list (string_"Nt") string_"Nt" (call (attribute (string_" ") string_" " (identifier_join) identifier_join )attribute (argument_list (identifier_flds) identifier_flds )argument_list )call )argument_list )call )assignment )expression_statement (for_statement (identifier_item_id) identifier_item_id (identifier_ids) identifier_ids (block (expression_statement (assignment (identifier_nts) identifier_nts (list_comprehension (call (attribute (identifier_id2nt) identifier_id2nt (identifier_get) identifier_get )attribute (argument_list (identifier_item_id) identifier_item_id )argument_list )call (for_in_clause (identifier_id2nt) identifier_id2nt (identifier_id2nts) identifier_id2nts )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_vals) identifier_vals (call (identifier__combine_nt_vals) identifier__combine_nt_vals (argument_list (identifier_nts) identifier_nts (identifier_flds) identifier_flds (identifier_dflt_null) identifier_dflt_null )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_combined_nt_list) identifier_combined_nt_list (identifier_append) identifier_append )attribute (argument_list (call (attribute (identifier_ntobj) identifier_ntobj (identifier__make) identifier__make )attribute (argument_list (identifier_vals) identifier_vals )argument_list )call )argument_list )call )expression_statement )block )for_statement (return_statement (identifier_combined_nt_list) identifier_combined_nt_list )return_statement )block )function_definition )module
Return a new list of namedtuples by combining "dicts" of namedtuples or objects.
(module (function_definition (function_name_get_pending_domain_join) function_name_get_pending_domain_join (parameters )parameters (block (expression_statement (assignment (identifier_base_key) identifier_base_key (string_r'SYSTEM\CurrentControlSet\Services\Netlogon') string_r'SYSTEM\CurrentControlSet\Services\Netlogon' )assignment )expression_statement (expression_statement (assignment (identifier_avoid_key) identifier_avoid_key (call (attribute (string_r'{0}\AvoidSpnSet') string_r'{0}\AvoidSpnSet' (identifier_format) identifier_format )attribute (argument_list (identifier_base_key) identifier_base_key )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_join_key) identifier_join_key (call (attribute (string_r'{0}\JoinDomain') string_r'{0}\JoinDomain' (identifier_format) identifier_format )attribute (argument_list (identifier_base_key) identifier_base_key )argument_list )call )assignment )expression_statement (if_statement (call (subscript (identifier___utils__) identifier___utils__ (string_'reg.key_exists') string_'reg.key_exists' )subscript (argument_list (string_'HKLM') string_'HKLM' (identifier_avoid_key) identifier_avoid_key )argument_list )call (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_debug) identifier_debug )attribute (argument_list (string_'Key exists: %s') string_'Key exists: %s' (identifier_avoid_key) identifier_avoid_key )argument_list )call )expression_statement (return_statement (True) True )return_statement )block (else_clause (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_debug) identifier_debug )attribute (argument_list (string_'Key does not exist: %s') string_'Key does not exist: %s' (identifier_avoid_key) identifier_avoid_key )argument_list )call )expression_statement )block )else_clause )if_statement (if_statement (call (subscript (identifier___utils__) identifier___utils__ (string_'reg.key_exists') string_'reg.key_exists' )subscript (argument_list (string_'HKLM') string_'HKLM' (identifier_join_key) identifier_join_key )argument_list )call (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_debug) identifier_debug )attribute (argument_list (string_'Key exists: %s') string_'Key exists: %s' (identifier_join_key) identifier_join_key )argument_list )call )expression_statement (return_statement (True) True )return_statement )block (else_clause (block (expression_statement (call (attribute (identifier_log) identifier_log (identifier_debug) identifier_debug )attribute (argument_list (string_'Key does not exist: %s') string_'Key does not exist: %s' (identifier_join_key) identifier_join_key )argument_list )call )expression_statement )block )else_clause )if_statement (return_statement (False) False )return_statement )block )function_definition )module
Determine whether there is a pending domain join action that requires a reboot. .. versionadded:: 2016.11.0 Returns: bool: ``True`` if there is a pending domain join action, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' system.get_pending_domain_join
(module (function_definition (function_name_check_dupl_sources) function_name_check_dupl_sources (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_dd) identifier_dd (call (attribute (identifier_collections) identifier_collections (identifier_defaultdict) identifier_defaultdict )attribute (argument_list (identifier_list) identifier_list )argument_list )call )assignment )expression_statement (for_statement (identifier_src_group) identifier_src_group (attribute (identifier_self) identifier_self (identifier_src_groups) identifier_src_groups )attribute (block (for_statement (identifier_src) identifier_src (identifier_src_group) identifier_src_group (block (try_statement (block (expression_statement (assignment (identifier_srcid) identifier_srcid (attribute (identifier_src) identifier_src (identifier_source_id) identifier_source_id )attribute )assignment )expression_statement )block (except_clause (identifier_AttributeError) identifier_AttributeError (block (expression_statement (assignment (identifier_srcid) identifier_srcid (subscript (identifier_src) identifier_src (string_'id') string_'id' )subscript )assignment )expression_statement )block )except_clause )try_statement (expression_statement (call (attribute (subscript (identifier_dd) identifier_dd (identifier_srcid) identifier_srcid )subscript (identifier_append) identifier_append )attribute (argument_list (identifier_src) identifier_src )argument_list )call )expression_statement )block )for_statement )block )for_statement (expression_statement (assignment (identifier_dupl) identifier_dupl (list )list )assignment )expression_statement (for_statement (pattern_list (identifier_srcid) identifier_srcid (identifier_srcs) identifier_srcs )pattern_list (call (identifier_sorted) identifier_sorted (argument_list (call (attribute (identifier_dd) identifier_dd (identifier_items) identifier_items )attribute (argument_list )argument_list )call )argument_list )call (block (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_srcs) identifier_srcs )argument_list )call (integer_1) integer_1 )comparison_operator (block (expression_statement (call (identifier__assert_equal_sources) identifier__assert_equal_sources (argument_list (identifier_srcs) identifier_srcs )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_dupl) identifier_dupl (identifier_append) identifier_append )attribute (argument_list (identifier_srcs) identifier_srcs )argument_list )call )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_dupl) identifier_dupl )return_statement )block )function_definition )module
Extracts duplicated sources, i.e. sources with the same source_id in different source groups. Raise an exception if there are sources with the same ID which are not duplicated. :returns: a list of list of sources, ordered by source_id
(module (function_definition (function_name_write) function_name_write (parameters (identifier_self) identifier_self )parameters (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (attribute (identifier_self) identifier_self (identifier_log_path) identifier_log_path )attribute (string_"w") string_"w" )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (call (attribute (identifier_json) identifier_json (identifier_dump) identifier_dump )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_log_dict) identifier_log_dict )attribute (identifier_f) identifier_f (keyword_argument (identifier_indent) identifier_indent (integer_1) integer_1 )keyword_argument )argument_list )call )expression_statement )block )with_statement )block )function_definition )module
Dump JSON to file
(module (function_definition (function_name_has_hlu) function_name_has_hlu (parameters (identifier_self) identifier_self (identifier_lun_or_snap) identifier_lun_or_snap (default_parameter (identifier_cg_member) identifier_cg_member (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_hlu) identifier_hlu (call (attribute (identifier_self) identifier_self (identifier_get_hlu) identifier_get_hlu )attribute (argument_list (identifier_lun_or_snap) identifier_lun_or_snap (keyword_argument (identifier_cg_member) identifier_cg_member (identifier_cg_member) identifier_cg_member )keyword_argument )argument_list )call )assignment )expression_statement (return_statement (comparison_operator (identifier_hlu) identifier_hlu (None) None )comparison_operator )return_statement )block )function_definition )module
Returns True if `lun_or_snap` is attached to the host. :param lun_or_snap: can be lun, lun snap, cg snap or a member snap of cg snap. :param cg_member: the member lun of cg if `lun_or_snap` is cg snap. :return: True - if `lun_or_snap` is attached, otherwise False.