sequence
stringlengths
557
12.7k
docstring
stringlengths
4
15.2k
(module (function_definition (function_name__add_fragment) function_name__add_fragment (parameters (identifier_cls) identifier_cls (identifier_syncmap) identifier_syncmap (identifier_identifier) identifier_identifier (identifier_lines) identifier_lines (identifier_begin) identifier_begin (identifier_end) identifier_end (default_parameter (identifier_language) identifier_language (None) None )default_parameter )parameters (block (expression_statement (call (attribute (identifier_syncmap) identifier_syncmap (identifier_add_fragment) identifier_add_fragment )attribute (argument_list (call (identifier_SyncMapFragment) identifier_SyncMapFragment (argument_list (keyword_argument (identifier_text_fragment) identifier_text_fragment (call (identifier_TextFragment) identifier_TextFragment (argument_list (keyword_argument (identifier_identifier) identifier_identifier (identifier_identifier) identifier_identifier )keyword_argument (keyword_argument (identifier_lines) identifier_lines (identifier_lines) identifier_lines )keyword_argument (keyword_argument (identifier_language) identifier_language (identifier_language) identifier_language )keyword_argument )argument_list )call )keyword_argument (keyword_argument (identifier_begin) identifier_begin (identifier_begin) identifier_begin )keyword_argument (keyword_argument (identifier_end) identifier_end (identifier_end) identifier_end )keyword_argument )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
Add a new fragment to ``syncmap``. :param syncmap: the syncmap to append to :type syncmap: :class:`~aeneas.syncmap.SyncMap` :param identifier: the identifier :type identifier: string :param lines: the lines of the text :type lines: list of string :param begin: the begin time :type begin: :class:`~aeneas.exacttiming.TimeValue` :param end: the end time :type end: :class:`~aeneas.exacttiming.TimeValue` :param language: the language :type language: string
(module (function_definition (function_name_fix_times) function_name_fix_times (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_pointlist) identifier_pointlist (call (attribute (identifier_self) identifier_self (identifier_get_pointlist) identifier_get_pointlist )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_times) identifier_times (list_comprehension (subscript (identifier_point) identifier_point (string_'time') string_'time' )subscript (for_in_clause (identifier_stroke) identifier_stroke (identifier_pointlist) identifier_pointlist )for_in_clause (for_in_clause (identifier_point) identifier_point (identifier_stroke) identifier_stroke )for_in_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_times_min) identifier_times_min (call (identifier_max) identifier_max (argument_list (call (identifier_min) identifier_min (argument_list (identifier_times) identifier_times )argument_list )call (integer_0) integer_0 )argument_list )call )assignment )expression_statement (for_statement (pattern_list (identifier_i) identifier_i (identifier_stroke) identifier_stroke )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_pointlist) identifier_pointlist )argument_list )call (block (for_statement (pattern_list (identifier_j) identifier_j (identifier_point) identifier_point )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_stroke) identifier_stroke )argument_list )call (block (if_statement (comparison_operator (subscript (identifier_point) identifier_point (string_'time') string_'time' )subscript (None) None )comparison_operator (block (expression_statement (assignment (subscript (subscript (subscript (identifier_pointlist) identifier_pointlist (identifier_i) identifier_i )subscript (identifier_j) identifier_j )subscript (string_'time') string_'time' )subscript (identifier_times_min) identifier_times_min )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_times_min) identifier_times_min (subscript (identifier_point) identifier_point (string_'time') string_'time' )subscript )assignment )expression_statement )block )else_clause )if_statement )block )for_statement )block )for_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_raw_data_json) identifier_raw_data_json )attribute (call (attribute (identifier_json) identifier_json (identifier_dumps) identifier_dumps )attribute (argument_list (identifier_pointlist) identifier_pointlist )argument_list )call )assignment )expression_statement )block )function_definition )module
Some recordings have wrong times. Fix them so that nothing after loading a handwritten recording breaks.
(module (function_definition (function_name__restore_vxlan_entries) function_name__restore_vxlan_entries (parameters (identifier_self) identifier_self (identifier_switch_ip) identifier_switch_ip (identifier_vlans) identifier_vlans )parameters (block (expression_statement (assignment (identifier_count) identifier_count (integer_1) integer_1 )assignment )expression_statement (expression_statement (assignment (identifier_conf_str) identifier_conf_str (string_'') string_'' )assignment )expression_statement (expression_statement (assignment (identifier_vnsegment_sent) identifier_vnsegment_sent (integer_0) integer_0 )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_path_str) identifier_path_str (identifier_conf_str) identifier_conf_str )pattern_list (call (attribute (attribute (identifier_self) identifier_self (identifier_driver) identifier_driver )attribute (identifier_start_create_vlan) identifier_start_create_vlan )attribute (argument_list )argument_list )call )assignment )expression_statement (while_statement (boolean_operator (comparison_operator (identifier_vnsegment_sent) identifier_vnsegment_sent (attribute (identifier_const) identifier_const (identifier_CREATE_VLAN_BATCH) identifier_CREATE_VLAN_BATCH )attribute )comparison_operator (identifier_vlans) identifier_vlans )boolean_operator (block (expression_statement (assignment (pattern_list (identifier_vlan_id) identifier_vlan_id (identifier_vni) identifier_vni )pattern_list (call (attribute (identifier_vlans) identifier_vlans (identifier_pop) identifier_pop )attribute (argument_list (integer_0) integer_0 )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_conf_str) identifier_conf_str (call (attribute (attribute (identifier_self) identifier_self (identifier_driver) identifier_driver )attribute (identifier_get_create_vlan) identifier_get_create_vlan )attribute (argument_list (identifier_switch_ip) identifier_switch_ip (identifier_vlan_id) identifier_vlan_id (identifier_vni) identifier_vni (identifier_conf_str) identifier_conf_str )argument_list )call )assignment )expression_statement (if_statement (parenthesized_expression (comparison_operator (identifier_count) identifier_count (attribute (identifier_const) identifier_const (identifier_CREATE_VLAN_SEND_SIZE) identifier_CREATE_VLAN_SEND_SIZE )attribute )comparison_operator )parenthesized_expression (block (expression_statement (assignment (identifier_conf_str) identifier_conf_str (call (attribute (attribute (identifier_self) identifier_self (identifier_driver) identifier_driver )attribute (identifier_end_create_vlan) identifier_end_create_vlan )attribute (argument_list (identifier_conf_str) identifier_conf_str )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_driver) identifier_driver )attribute (identifier_send_edit_string) identifier_send_edit_string )attribute (argument_list (identifier_switch_ip) identifier_switch_ip (identifier_path_str) identifier_path_str (identifier_conf_str) identifier_conf_str )argument_list )call )expression_statement (expression_statement (augmented_assignment (identifier_vnsegment_sent) identifier_vnsegment_sent (identifier_count) identifier_count )augmented_assignment )expression_statement (expression_statement (assignment (identifier_conf_str) identifier_conf_str (string_'') string_'' )assignment )expression_statement (expression_statement (assignment (identifier_count) identifier_count (integer_1) integer_1 )assignment )expression_statement )block (else_clause (block (expression_statement (augmented_assignment (identifier_count) identifier_count (integer_1) integer_1 )augmented_assignment )expression_statement )block )else_clause )if_statement )block )while_statement (if_statement (identifier_conf_str) identifier_conf_str (block (expression_statement (augmented_assignment (identifier_vnsegment_sent) identifier_vnsegment_sent (identifier_count) identifier_count )augmented_assignment )expression_statement (expression_statement (assignment (identifier_conf_str) identifier_conf_str (call (attribute (attribute (identifier_self) identifier_self (identifier_driver) identifier_driver )attribute (identifier_end_create_vlan) identifier_end_create_vlan )attribute (argument_list (identifier_conf_str) identifier_conf_str )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_driver) identifier_driver )attribute (identifier_send_edit_string) identifier_send_edit_string )attribute (argument_list (identifier_switch_ip) identifier_switch_ip (identifier_path_str) identifier_path_str (identifier_conf_str) identifier_conf_str )argument_list )call )expression_statement (expression_statement (assignment (identifier_conf_str) identifier_conf_str (string_'') string_'' )assignment )expression_statement )block )if_statement (expression_statement (call (attribute (identifier_LOG) identifier_LOG (identifier_debug) identifier_debug )attribute (argument_list (string_"Switch %s VLAN vn-segment replay summary: %d") string_"Switch %s VLAN vn-segment replay summary: %d" (identifier_switch_ip) identifier_switch_ip (identifier_vnsegment_sent) identifier_vnsegment_sent )argument_list )call )expression_statement )block )function_definition )module
Restore vxlan entries on a Nexus switch.
(module (function_definition (function_name_status_color) function_name_status_color (parameters (identifier_status) identifier_status )parameters (block (expression_statement (assignment (identifier_status_color) identifier_status_color (attribute (attribute (identifier_c) identifier_c (identifier_Fore) identifier_Fore )attribute (identifier_GREEN) identifier_GREEN )attribute )assignment )expression_statement (if_statement (not_operator (identifier_status) identifier_status )not_operator (block (expression_statement (assignment (identifier_status_color) identifier_status_color (attribute (attribute (identifier_c) identifier_c (identifier_Fore) identifier_Fore )attribute (identifier_RED) identifier_RED )attribute )assignment )expression_statement )block )if_statement (return_statement (identifier_status_color) identifier_status_color )return_statement )block )function_definition )module
Return the appropriate status color.
(module (function_definition (function_name_from_yaml_to_list) function_name_from_yaml_to_list (parameters (identifier_cls) identifier_cls (typed_parameter (identifier_data) identifier_data (type (identifier_str) identifier_str )type )typed_parameter (default_parameter (identifier_force_snake_case) identifier_force_snake_case (True) True )default_parameter (typed_default_parameter (identifier_force_cast) identifier_force_cast (type (identifier_bool) identifier_bool )type (False) False )typed_default_parameter (typed_default_parameter (identifier_restrict) identifier_restrict (type (identifier_bool) identifier_bool )type (True) True )typed_default_parameter )parameters (type (generic_type (identifier_TList) identifier_TList (type_parameter (type (identifier_T) identifier_T )type )type_parameter )generic_type )type (block (return_statement (call (attribute (identifier_cls) identifier_cls (identifier_from_dicts) identifier_from_dicts )attribute (argument_list (call (attribute (identifier_util) identifier_util (identifier_load_yaml) identifier_load_yaml )attribute (argument_list (identifier_data) identifier_data )argument_list )call (keyword_argument (identifier_force_snake_case) identifier_force_snake_case (identifier_force_snake_case) identifier_force_snake_case )keyword_argument (keyword_argument (identifier_force_cast) identifier_force_cast (identifier_force_cast) identifier_force_cast )keyword_argument (keyword_argument (identifier_restrict) identifier_restrict (identifier_restrict) identifier_restrict )keyword_argument )argument_list )call )return_statement )block )function_definition )module
From yaml string to list of instance :param data: Yaml string :param force_snake_case: Keys are transformed to snake case in order to compliant PEP8 if True :param force_cast: Cast forcibly if True :param restrict: Prohibit extra parameters if True :return: List of instance Usage: >>> from owlmixin.samples import Human >>> humans: TList[Human] = Human.from_yaml_to_list(''' ... - id: 1 ... name: Tom ... favorites: ... - name: Apple ... - id: 2 ... name: John ... favorites: ... - name: Orange ... ''') >>> humans[0].name 'Tom' >>> humans[1].name 'John' >>> humans[0].favorites[0].name 'Apple'
(module (function_definition (function_name__str) function_name__str (parameters (identifier_obj) identifier_obj )parameters (block (expression_statement (assignment (identifier_values) identifier_values (list )list )assignment )expression_statement (for_statement (identifier_name) identifier_name (attribute (identifier_obj) identifier_obj (identifier__attribs) identifier__attribs )attribute (block (expression_statement (assignment (identifier_val) identifier_val (call (identifier_getattr) identifier_getattr (argument_list (identifier_obj) identifier_obj (identifier_name) identifier_name )argument_list )call )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_val) identifier_val (identifier_str) identifier_str )argument_list )call (block (expression_statement (assignment (identifier_val) identifier_val (call (identifier_repr) identifier_repr (argument_list (identifier_val) identifier_val )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_val) identifier_val (conditional_expression (call (identifier_str) identifier_str (argument_list (identifier_val) identifier_val )argument_list )call (comparison_operator (call (identifier_len) identifier_len (argument_list (call (identifier_str) identifier_str (argument_list (identifier_val) identifier_val )argument_list )call )argument_list )call (integer_10) integer_10 )comparison_operator (string_"(...)") string_"(...)" )conditional_expression )assignment )expression_statement (expression_statement (call (attribute (identifier_values) identifier_values (identifier_append) identifier_append )attribute (argument_list (tuple (identifier_name) identifier_name (identifier_val) identifier_val )tuple )argument_list )call )expression_statement )block )for_statement (expression_statement (assignment (identifier_values) identifier_values (call (attribute (string_", ") string_", " (identifier_join) identifier_join )attribute (generator_expression (call (attribute (string_"{}={}") string_"{}={}" (identifier_format) identifier_format )attribute (argument_list (identifier_k) identifier_k (identifier_v) identifier_v )argument_list )call (for_in_clause (pattern_list (identifier_k) identifier_k (identifier_v) identifier_v )pattern_list (identifier_values) identifier_values )for_in_clause )generator_expression )call )assignment )expression_statement (return_statement (call (attribute (string_"{}({})") string_"{}({})" (identifier_format) identifier_format )attribute (argument_list (attribute (attribute (identifier_obj) identifier_obj (identifier___class__) identifier___class__ )attribute (identifier___name__) identifier___name__ )attribute (identifier_values) identifier_values )argument_list )call )return_statement )block )function_definition )module
Show nicely the generic object received.
(module (function_definition (function_name_poll) function_name_poll (parameters (identifier_poll) identifier_poll (identifier_msg) identifier_msg (identifier_server) identifier_server )parameters (block (expression_statement (assignment (identifier_poll) identifier_poll (call (identifier_remove_smart_quotes) identifier_remove_smart_quotes (argument_list (call (attribute (identifier_poll) identifier_poll (identifier_replace) identifier_replace )attribute (argument_list (string_u"\u2014") string_u"\u2014" (string_u"--") string_u"--" )argument_list )call )argument_list )call )assignment )expression_statement (try_statement (block (expression_statement (assignment (identifier_args) identifier_args (attribute (call (attribute (identifier_ARGPARSE) identifier_ARGPARSE (identifier_parse_args) identifier_parse_args )attribute (argument_list (call (attribute (identifier_shlex) identifier_shlex (identifier_split) identifier_split )attribute (argument_list (identifier_poll) identifier_poll )argument_list )call )argument_list )call (identifier_poll) identifier_poll )attribute )assignment )expression_statement )block (except_clause (identifier_ValueError) identifier_ValueError (block (return_statement (identifier_ERROR_INVALID_FORMAT) identifier_ERROR_INVALID_FORMAT )return_statement )block )except_clause )try_statement (if_statement (not_operator (comparison_operator (integer_2) integer_2 (call (identifier_len) identifier_len (argument_list (identifier_args) identifier_args )argument_list )call (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_POLL_EMOJIS) identifier_POLL_EMOJIS )argument_list )call (integer_1) integer_1 )binary_operator )comparison_operator )not_operator (block (return_statement (identifier_ERROR_WRONG_NUMBER_OF_ARGUMENTS) identifier_ERROR_WRONG_NUMBER_OF_ARGUMENTS )return_statement )block )if_statement (expression_statement (assignment (identifier_result) identifier_result (list (call (attribute (string_"Poll: {}\n") string_"Poll: {}\n" (identifier_format) identifier_format )attribute (argument_list (subscript (identifier_args) identifier_args (integer_0) integer_0 )subscript )argument_list )call )list )assignment )expression_statement (for_statement (pattern_list (identifier_emoji) identifier_emoji (identifier_answer) identifier_answer )pattern_list (call (identifier_zip) identifier_zip (argument_list (identifier_POLL_EMOJIS) identifier_POLL_EMOJIS (subscript (identifier_args) identifier_args (slice (integer_1) integer_1 (colon) colon )slice )subscript )argument_list )call (block (expression_statement (call (attribute (identifier_result) identifier_result (identifier_append) identifier_append )attribute (argument_list (call (attribute (string_":{}: {}\n") string_":{}: {}\n" (identifier_format) identifier_format )attribute (argument_list (identifier_emoji) identifier_emoji (identifier_answer) identifier_answer )argument_list )call )argument_list )call )expression_statement )block )for_statement (expression_statement (assignment (identifier_msg_posted) identifier_msg_posted (call (attribute (attribute (identifier_server) identifier_server (identifier_slack) identifier_slack )attribute (identifier_post_message) identifier_post_message )attribute (argument_list (subscript (identifier_msg) identifier_msg (string_'channel') string_'channel' )subscript (call (attribute (string_"") string_"" (identifier_join) identifier_join )attribute (argument_list (identifier_result) identifier_result )argument_list )call (keyword_argument (identifier_as_user) identifier_as_user (attribute (attribute (identifier_server) identifier_server (identifier_slack) identifier_slack )attribute (identifier_username) identifier_username )attribute )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_ts) identifier_ts (subscript (call (attribute (identifier_json) identifier_json (identifier_loads) identifier_loads )attribute (argument_list (identifier_msg_posted) identifier_msg_posted )argument_list )call (string_"ts") string_"ts" )subscript )assignment )expression_statement (for_statement (identifier_i) identifier_i (call (identifier_range) identifier_range (argument_list (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_args) identifier_args )argument_list )call (integer_1) integer_1 )binary_operator )argument_list )call (block (expression_statement (call (attribute (attribute (identifier_server) identifier_server (identifier_slack) identifier_slack )attribute (identifier_post_reaction) identifier_post_reaction )attribute (argument_list (subscript (identifier_msg) identifier_msg (string_'channel') string_'channel' )subscript (identifier_ts) identifier_ts (subscript (identifier_POLL_EMOJIS) identifier_POLL_EMOJIS (identifier_i) identifier_i )subscript )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Given a question and answers, present a poll
(module (function_definition (function_name_unpack) function_name_unpack (parameters (identifier_self) identifier_self (identifier_struct) identifier_struct )parameters (block (expression_statement (assignment (identifier_v) identifier_v (call (attribute (identifier_struct) identifier_struct (identifier_unpack) identifier_unpack )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier_read) identifier_read )attribute (argument_list (attribute (identifier_struct) identifier_struct (identifier_size) identifier_size )attribute )argument_list )call )argument_list )call )assignment )expression_statement (return_statement (identifier_v) identifier_v )return_statement )block )function_definition )module
Read as many bytes as are required to extract struct then unpack and return a tuple of the values. Raises ------ UnderflowDecodeError Raised when a read failed to extract enough bytes from the underlying stream to extract the bytes. Parameters ---------- struct: struct.Struct Returns ------- tuple Tuple of extracted values.
(module (function_definition (function_name_find_behind_subscriptions) function_name_find_behind_subscriptions (parameters (identifier_self) identifier_self (identifier_request) identifier_request )parameters (block (expression_statement (assignment (identifier_task_id) identifier_task_id (call (attribute (identifier_find_behind_subscriptions) identifier_find_behind_subscriptions (identifier_delay) identifier_delay )attribute (argument_list )argument_list )call )assignment )expression_statement (return_statement (call (identifier_Response) identifier_Response (argument_list (dictionary (pair (string_"accepted") string_"accepted" (True) True )pair (pair (string_"task_id") string_"task_id" (call (identifier_str) identifier_str (argument_list (identifier_task_id) identifier_task_id )argument_list )call )pair )dictionary (keyword_argument (identifier_status) identifier_status (attribute (identifier_status) identifier_status (identifier_HTTP_202_ACCEPTED) identifier_HTTP_202_ACCEPTED )attribute )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Starts a celery task that looks through active subscriptions to find and subscriptions that are behind where they should be, and adds a BehindSubscription for them.
(module (function_definition (function_name_calculate_length_statistics) function_name_calculate_length_statistics (parameters (typed_parameter (identifier_source_iterables) identifier_source_iterables (type (generic_type (identifier_Sequence) identifier_Sequence (type_parameter (type (generic_type (identifier_Iterable) identifier_Iterable (type_parameter (type (identifier_Any) identifier_Any )type )type_parameter )generic_type )type )type_parameter )generic_type )type )typed_parameter (typed_parameter (identifier_target_iterable) identifier_target_iterable (type (generic_type (identifier_Iterable) identifier_Iterable (type_parameter (type (identifier_Any) identifier_Any )type )type_parameter )generic_type )type )typed_parameter (typed_parameter (identifier_max_seq_len_source) identifier_max_seq_len_source (type (identifier_int) identifier_int )type )typed_parameter (typed_parameter (identifier_max_seq_len_target) identifier_max_seq_len_target (type (identifier_int) identifier_int )type )typed_parameter )parameters (type (string_'LengthStatistics') string_'LengthStatistics' )type (block (expression_statement (assignment (identifier_mean_and_variance) identifier_mean_and_variance (call (identifier_OnlineMeanAndVariance) identifier_OnlineMeanAndVariance (argument_list )argument_list )call )assignment )expression_statement (for_statement (pattern_list (identifier_sources) identifier_sources (identifier_target) identifier_target )pattern_list (call (identifier_parallel_iter) identifier_parallel_iter (argument_list (identifier_source_iterables) identifier_source_iterables (identifier_target_iterable) identifier_target_iterable )argument_list )call (block (expression_statement (assignment (identifier_source_len) identifier_source_len (call (identifier_len) identifier_len (argument_list (subscript (identifier_sources) identifier_sources (integer_0) integer_0 )subscript )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_target_len) identifier_target_len (call (identifier_len) identifier_len (argument_list (identifier_target) identifier_target )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_source_len) identifier_source_len (identifier_max_seq_len_source) identifier_max_seq_len_source )comparison_operator (comparison_operator (identifier_target_len) identifier_target_len (identifier_max_seq_len_target) identifier_max_seq_len_target )comparison_operator )boolean_operator (block (continue_statement )continue_statement )block )if_statement (expression_statement (assignment (identifier_length_ratio) identifier_length_ratio (binary_operator (identifier_target_len) identifier_target_len (identifier_source_len) identifier_source_len )binary_operator )assignment )expression_statement (expression_statement (call (attribute (identifier_mean_and_variance) identifier_mean_and_variance (identifier_update) identifier_update )attribute (argument_list (identifier_length_ratio) identifier_length_ratio )argument_list )call )expression_statement )block )for_statement (return_statement (call (identifier_LengthStatistics) identifier_LengthStatistics (argument_list (attribute (identifier_mean_and_variance) identifier_mean_and_variance (identifier_count) identifier_count )attribute (attribute (identifier_mean_and_variance) identifier_mean_and_variance (identifier_mean) identifier_mean )attribute (attribute (identifier_mean_and_variance) identifier_mean_and_variance (identifier_std) identifier_std )attribute )argument_list )call )return_statement )block )function_definition )module
Returns mean and standard deviation of target-to-source length ratios of parallel corpus. :param source_iterables: Source sequence readers. :param target_iterable: Target sequence reader. :param max_seq_len_source: Maximum source sequence length. :param max_seq_len_target: Maximum target sequence length. :return: The number of sentences as well as the mean and standard deviation of target to source length ratios.
(module (function_definition (function_name_check_error) function_name_check_error (parameters (default_parameter (identifier_when) identifier_when (string_'periodic check') string_'periodic check' )default_parameter )parameters (block (expression_statement (assignment (identifier_errors) identifier_errors (list )list )assignment )expression_statement (while_statement (True) True (block (expression_statement (assignment (identifier_err) identifier_err (call (identifier_glGetError) identifier_glGetError (argument_list )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_err) identifier_err (identifier_GL_NO_ERROR) identifier_GL_NO_ERROR )comparison_operator (parenthesized_expression (boolean_operator (identifier_errors) identifier_errors (comparison_operator (identifier_err) identifier_err (subscript (identifier_errors) identifier_errors (unary_operator (integer_1) integer_1 )unary_operator )subscript )comparison_operator )boolean_operator )parenthesized_expression )boolean_operator (block (break_statement )break_statement )block )if_statement (expression_statement (call (attribute (identifier_errors) identifier_errors (identifier_append) identifier_append )attribute (argument_list (identifier_err) identifier_err )argument_list )call )expression_statement )block )while_statement (if_statement (identifier_errors) identifier_errors (block (expression_statement (assignment (identifier_msg) identifier_msg (call (attribute (string_', ') string_', ' (identifier_join) identifier_join )attribute (argument_list (list_comprehension (call (identifier_repr) identifier_repr (argument_list (call (attribute (identifier_ENUM_MAP) identifier_ENUM_MAP (identifier_get) identifier_get )attribute (argument_list (identifier_e) identifier_e (identifier_e) identifier_e )argument_list )call )argument_list )call (for_in_clause (identifier_e) identifier_e (identifier_errors) identifier_errors )for_in_clause )list_comprehension )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_err) identifier_err (call (identifier_RuntimeError) identifier_RuntimeError (argument_list (binary_operator (string_'OpenGL got errors (%s): %s') string_'OpenGL got errors (%s): %s' (tuple (identifier_when) identifier_when (identifier_msg) identifier_msg )tuple )binary_operator )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_err) identifier_err (identifier_errors) identifier_errors )attribute (identifier_errors) identifier_errors )assignment )expression_statement (expression_statement (assignment (attribute (identifier_err) identifier_err (identifier_err) identifier_err )attribute (subscript (identifier_errors) identifier_errors (unary_operator (integer_1) integer_1 )unary_operator )subscript )assignment )expression_statement (raise_statement (identifier_err) identifier_err )raise_statement )block )if_statement )block )function_definition )module
Check this from time to time to detect GL errors. Parameters ---------- when : str Shown in the exception to help the developer determine when this check was done.
(module (function_definition (function_name_titleize) function_name_titleize (parameters (identifier_text) identifier_text )parameters (block (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_text) identifier_text )argument_list )call (integer_0) integer_0 )comparison_operator (block (return_statement (identifier_text) identifier_text )return_statement )block (else_clause (block (expression_statement (assignment (identifier_text) identifier_text (call (attribute (identifier_text) identifier_text (identifier_lower) identifier_lower )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_chunks) identifier_chunks (list_comprehension (binary_operator (call (attribute (subscript (identifier_chunk) identifier_chunk (integer_0) integer_0 )subscript (identifier_upper) identifier_upper )attribute (argument_list )argument_list )call (subscript (identifier_chunk) identifier_chunk (slice (integer_1) integer_1 (colon) colon )slice )subscript )binary_operator (for_in_clause (identifier_chunk) identifier_chunk (call (attribute (identifier_text) identifier_text (identifier_split) identifier_split )attribute (argument_list (string_" ") string_" " )argument_list )call )for_in_clause (if_clause (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_chunk) identifier_chunk )argument_list )call (integer_1) integer_1 )comparison_operator )if_clause )list_comprehension )assignment )expression_statement (return_statement (call (attribute (string_" ") string_" " (identifier_join) identifier_join )attribute (argument_list (identifier_chunks) identifier_chunks )argument_list )call )return_statement )block )else_clause )if_statement )block )function_definition )module
Capitalizes all the words and replaces some characters in the string to create a nicer looking title.
(module (function_definition (function_name_bind) function_name_bind (parameters (identifier_self) identifier_self (identifier_queue) identifier_queue (identifier_exchange) identifier_exchange (default_parameter (identifier_routing_key) identifier_routing_key (string_'') string_'' )default_parameter (default_parameter (identifier_nowait) identifier_nowait (True) True )default_parameter (default_parameter (identifier_arguments) identifier_arguments (dictionary )dictionary )default_parameter (default_parameter (identifier_ticket) identifier_ticket (None) None )default_parameter (default_parameter (identifier_cb) identifier_cb (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_nowait) identifier_nowait (boolean_operator (boolean_operator (identifier_nowait) identifier_nowait (call (attribute (identifier_self) identifier_self (identifier_allow_nowait) identifier_allow_nowait )attribute (argument_list )argument_list )call )boolean_operator (not_operator (identifier_cb) identifier_cb )not_operator )boolean_operator )assignment )expression_statement (expression_statement (assignment (identifier_args) identifier_args (call (identifier_Writer) identifier_Writer (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (call (attribute (call (attribute (call (attribute (call (attribute (call (attribute (identifier_args) identifier_args (identifier_write_short) identifier_write_short )attribute (argument_list (boolean_operator (identifier_ticket) identifier_ticket (attribute (identifier_self) identifier_self (identifier_default_ticket) identifier_default_ticket )attribute )boolean_operator )argument_list )call (line_continuation_\) line_continuation_\ (identifier_write_shortstr) identifier_write_shortstr )attribute (argument_list (identifier_queue) identifier_queue )argument_list )call (line_continuation_\) line_continuation_\ (identifier_write_shortstr) identifier_write_shortstr )attribute (argument_list (identifier_exchange) identifier_exchange )argument_list )call (line_continuation_\) line_continuation_\ (identifier_write_shortstr) identifier_write_shortstr )attribute (argument_list (identifier_routing_key) identifier_routing_key )argument_list )call (line_continuation_\) line_continuation_\ (identifier_write_bit) identifier_write_bit )attribute (argument_list (identifier_nowait) identifier_nowait )argument_list )call (line_continuation_\) line_continuation_\ (identifier_write_table) identifier_write_table )attribute (argument_list (identifier_arguments) identifier_arguments )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_send_frame) identifier_send_frame )attribute (argument_list (call (identifier_MethodFrame) identifier_MethodFrame (argument_list (attribute (identifier_self) identifier_self (identifier_channel_id) identifier_channel_id )attribute (integer_50) integer_50 (integer_20) integer_20 (identifier_args) identifier_args )argument_list )call )argument_list )call )expression_statement (if_statement (not_operator (identifier_nowait) identifier_nowait )not_operator (block (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__bind_cb) identifier__bind_cb )attribute (identifier_append) identifier_append )attribute (argument_list (identifier_cb) identifier_cb )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_channel) identifier_channel )attribute (identifier_add_synchronous_cb) identifier_add_synchronous_cb )attribute (argument_list (attribute (identifier_self) identifier_self (identifier__recv_bind_ok) identifier__recv_bind_ok )attribute )argument_list )call )expression_statement )block )if_statement )block )function_definition )module
bind to a queue.
(module (function_definition (function_name_set_imap_cb) function_name_set_imap_cb (parameters (identifier_self) identifier_self (identifier_w) identifier_w (identifier_index) identifier_index )parameters (block (expression_statement (assignment (identifier_name) identifier_name (subscript (call (attribute (identifier_imap) identifier_imap (identifier_get_names) identifier_get_names )attribute (argument_list )argument_list )call (identifier_index) identifier_index )subscript )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_t_) identifier_t_ )attribute (identifier_set) identifier_set )attribute (argument_list (keyword_argument (identifier_intensity_map) identifier_intensity_map (identifier_name) identifier_name )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
This callback is invoked when the user selects a new intensity map from the preferences pane.
(module (function_definition (function_name_yaml_parse) function_name_yaml_parse (parameters (identifier_yamlstr) identifier_yamlstr )parameters (block (try_statement (block (return_statement (call (attribute (identifier_json) identifier_json (identifier_loads) identifier_loads )attribute (argument_list (identifier_yamlstr) identifier_yamlstr )argument_list )call )return_statement )block (except_clause (identifier_ValueError) identifier_ValueError (block (expression_statement (call (attribute (attribute (identifier_yaml) identifier_yaml (identifier_SafeLoader) identifier_SafeLoader )attribute (identifier_add_multi_constructor) identifier_add_multi_constructor )attribute (argument_list (string_"!") string_"!" (identifier_intrinsics_multi_constructor) identifier_intrinsics_multi_constructor )argument_list )call )expression_statement (return_statement (call (attribute (identifier_yaml) identifier_yaml (identifier_safe_load) identifier_safe_load )attribute (argument_list (identifier_yamlstr) identifier_yamlstr )argument_list )call )return_statement )block )except_clause )try_statement )block )function_definition )module
Parse a yaml string
(module (function_definition (function_name__remove_person_from_group) function_name__remove_person_from_group (parameters (identifier_person) identifier_person (identifier_group) identifier_group )parameters (block (import_from_statement (dotted_name (identifier_karaage) identifier_karaage (identifier_datastores) identifier_datastores )dotted_name (dotted_name (identifier_remove_accounts_from_group) identifier_remove_accounts_from_group )dotted_name )import_from_statement (import_from_statement (dotted_name (identifier_karaage) identifier_karaage (identifier_datastores) identifier_datastores )dotted_name (dotted_name (identifier_remove_accounts_from_project) identifier_remove_accounts_from_project )dotted_name )import_from_statement (import_from_statement (dotted_name (identifier_karaage) identifier_karaage (identifier_datastores) identifier_datastores )dotted_name (dotted_name (identifier_remove_accounts_from_institute) identifier_remove_accounts_from_institute )dotted_name )import_from_statement (expression_statement (assignment (identifier_a_list) identifier_a_list (attribute (identifier_person) identifier_person (identifier_account_set) identifier_account_set )attribute )assignment )expression_statement (expression_statement (call (identifier_remove_accounts_from_group) identifier_remove_accounts_from_group (argument_list (identifier_a_list) identifier_a_list (identifier_group) identifier_group )argument_list )call )expression_statement (for_statement (identifier_project) identifier_project (call (attribute (attribute (identifier_group) identifier_group (identifier_project_set) identifier_project_set )attribute (identifier_all) identifier_all )attribute (argument_list )argument_list )call (block (expression_statement (call (identifier_remove_accounts_from_project) identifier_remove_accounts_from_project (argument_list (identifier_a_list) identifier_a_list (identifier_project) identifier_project )argument_list )call )expression_statement )block )for_statement (for_statement (identifier_institute) identifier_institute (call (attribute (attribute (identifier_group) identifier_group (identifier_institute_set) identifier_institute_set )attribute (identifier_all) identifier_all )attribute (argument_list )argument_list )call (block (expression_statement (call (identifier_remove_accounts_from_institute) identifier_remove_accounts_from_institute (argument_list (identifier_a_list) identifier_a_list (identifier_institute) identifier_institute )argument_list )call )expression_statement )block )for_statement )block )function_definition )module
Call datastores after removing a person from a group.
(module (function_definition (function_name_jsd) function_name_jsd (parameters (identifier_p) identifier_p (identifier_q) identifier_q )parameters (block (try_statement (block (expression_statement (call (identifier__check_prob_dist) identifier__check_prob_dist (argument_list (identifier_p) identifier_p )argument_list )call )expression_statement (expression_statement (call (identifier__check_prob_dist) identifier__check_prob_dist (argument_list (identifier_q) identifier_q )argument_list )call )expression_statement )block (except_clause (identifier_ValueError) identifier_ValueError (block (return_statement (attribute (identifier_np) identifier_np (identifier_nan) identifier_nan )attribute )return_statement )block )except_clause )try_statement (expression_statement (assignment (identifier_weight) identifier_weight (float_0.5) float_0.5 )assignment )expression_statement (expression_statement (assignment (identifier_m) identifier_m (binary_operator (identifier_weight) identifier_weight (parenthesized_expression (binary_operator (identifier_p) identifier_p (identifier_q) identifier_q )binary_operator )parenthesized_expression )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_result) identifier_result (binary_operator (binary_operator (identifier_weight) identifier_weight (call (identifier_kld) identifier_kld (argument_list (identifier_p) identifier_p (identifier_m) identifier_m )argument_list )call )binary_operator (binary_operator (parenthesized_expression (binary_operator (integer_1) integer_1 (identifier_weight) identifier_weight )binary_operator )parenthesized_expression (call (identifier_kld) identifier_kld (argument_list (identifier_q) identifier_q (identifier_m) identifier_m )argument_list )call )binary_operator )binary_operator )assignment )expression_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Finds the per-column JSD between dataframes p and q Jensen-Shannon divergence of two probability distrubutions pandas dataframes, p and q. These distributions are usually created by running binify() on the dataframe. Parameters ---------- p : pandas.DataFrame An nbins x features DataFrame. q : pandas.DataFrame An nbins x features DataFrame. Returns ------- jsd : pandas.Series Jensen-Shannon divergence of each column with the same names between p and q Raises ------ ValueError If the data provided is not a probability distribution, i.e. it has negative values or its columns do not sum to 1, raise ValueError
(module (function_definition (function_name_get_state_and_verify) function_name_get_state_and_verify (parameters (identifier_self) identifier_self )parameters (block (try_statement (block (expression_statement (assignment (identifier_state) identifier_state (call (identifier_get_state) identifier_get_state (argument_list )argument_list )call )assignment )expression_statement )block (except_clause (as_pattern (identifier_KeyError) identifier_KeyError (as_pattern_target (identifier_ke) identifier_ke )as_pattern_target )as_pattern (block (class_definition (identifier_state) identifier_state (block (expression_statement (assignment (identifier_name) identifier_name (call (identifier_str) identifier_str (argument_list (subscript (attribute (identifier_ke) identifier_ke (identifier_args) identifier_args )attribute (integer_0) integer_0 )subscript )argument_list )call )assignment )expression_statement )block )class_definition )block )except_clause )try_statement (if_statement (comparison_operator (identifier_state) identifier_state (attribute (identifier_self) identifier_self (identifier_ALLOWED_STATES) identifier_ALLOWED_STATES )attribute )comparison_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (concatenated_string (string_f"Run state cherry-picker.state={state.name} in Git config ") string_f"Run state cherry-picker.state={state.name} in Git config " (string_"is not known.\nPerhaps it has been set by a newer ") string_"is not known.\nPerhaps it has been set by a newer " (string_"version of cherry-picker. Try upgrading.\n") string_"version of cherry-picker. Try upgrading.\n" (string_"Valid states are: ") string_"Valid states are: " (string_f'{", ".join(s.name for s in self.ALLOWED_STATES)}. ') string_f'{", ".join(s.name for s in self.ALLOWED_STATES)}. ' (string_"If this looks suspicious, raise an issue at ") string_"If this looks suspicious, raise an issue at " (string_"https://github.com/python/core-workflow/issues/new.\n") string_"https://github.com/python/core-workflow/issues/new.\n" (string_"As the last resort you can reset the runtime state ") string_"As the last resort you can reset the runtime state " (string_"stored in Git config using the following command: ") string_"stored in Git config using the following command: " (string_"`git config --local --remove-section cherry-picker`") string_"`git config --local --remove-section cherry-picker`" )concatenated_string )argument_list )call )raise_statement )block )if_statement (return_statement (identifier_state) identifier_state )return_statement )block )function_definition )module
Return the run progress state stored in the Git config. Raises ValueError if the retrieved state is not of a form that cherry_picker would have stored in the config.
(module (function_definition (function_name_entity_tags_form) function_name_entity_tags_form (parameters (identifier_self) identifier_self (identifier_entity) identifier_entity (default_parameter (identifier_ns) identifier_ns (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_ns) identifier_ns (None) None )comparison_operator (block (expression_statement (assignment (identifier_ns) identifier_ns (call (attribute (identifier_self) identifier_self (identifier_entity_default_ns) identifier_entity_default_ns )attribute (argument_list (identifier_entity) identifier_entity )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_field) identifier_field (call (identifier_TagsField) identifier_TagsField (argument_list (keyword_argument (identifier_label) identifier_label (call (identifier__l) identifier__l (argument_list (string_"Tags") string_"Tags" )argument_list )call )keyword_argument (keyword_argument (identifier_ns) identifier_ns (identifier_ns) identifier_ns )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_cls) identifier_cls (call (identifier_type) identifier_type (argument_list (string_"EntityNSTagsForm") string_"EntityNSTagsForm" (tuple (identifier__TagsForm) identifier__TagsForm )tuple (dictionary (pair (string_"tags") string_"tags" (identifier_field) identifier_field )pair )dictionary )argument_list )call )assignment )expression_statement (return_statement (identifier_cls) identifier_cls )return_statement )block )function_definition )module
Construct a form class with a field for tags in namespace `ns`.
(module (function_definition (function_name_pawns_at) function_name_pawns_at (parameters (identifier_self) identifier_self (identifier_x) identifier_x (identifier_y) identifier_y )parameters (block (for_statement (identifier_pawn) identifier_pawn (call (attribute (attribute (identifier_self) identifier_self (identifier_pawn) identifier_pawn )attribute (identifier_values) identifier_values )attribute (argument_list )argument_list )call (block (if_statement (call (attribute (identifier_pawn) identifier_pawn (identifier_collide_point) identifier_collide_point )attribute (argument_list (identifier_x) identifier_x (identifier_y) identifier_y )argument_list )call (block (expression_statement (yield (identifier_pawn) identifier_pawn )yield )expression_statement )block )if_statement )block )for_statement )block )function_definition )module
Iterate over pawns that collide the given point.
(module (function_definition (function_name_model_funcpointers) function_name_model_funcpointers (parameters (identifier_vk) identifier_vk (identifier_model) identifier_model )parameters (block (expression_statement (assignment (subscript (identifier_model) identifier_model (string_'funcpointers') string_'funcpointers' )subscript (dictionary )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_funcs) identifier_funcs (list_comprehension (identifier_x) identifier_x (for_in_clause (identifier_x) identifier_x (subscript (subscript (subscript (identifier_vk) identifier_vk (string_'registry') string_'registry' )subscript (string_'types') string_'types' )subscript (string_'type') string_'type' )subscript )for_in_clause (if_clause (comparison_operator (call (attribute (identifier_x) identifier_x (identifier_get) identifier_get )attribute (argument_list (string_'@category') string_'@category' )argument_list )call (string_'funcpointer') string_'funcpointer' )comparison_operator )if_clause )list_comprehension )assignment )expression_statement (expression_statement (assignment (identifier_structs) identifier_structs (list_comprehension (identifier_x) identifier_x (for_in_clause (identifier_x) identifier_x (subscript (subscript (subscript (identifier_vk) identifier_vk (string_'registry') string_'registry' )subscript (string_'types') string_'types' )subscript (string_'type') string_'type' )subscript )for_in_clause (if_clause (comparison_operator (call (attribute (identifier_x) identifier_x (identifier_get) identifier_get )attribute (argument_list (string_'@category') string_'@category' )argument_list )call (string_'struct') string_'struct' )comparison_operator )if_clause )list_comprehension )assignment )expression_statement (for_statement (identifier_f) identifier_f (identifier_funcs) identifier_funcs (block (expression_statement (assignment (identifier_pfn_name) identifier_pfn_name (subscript (identifier_f) identifier_f (string_'name') string_'name' )subscript )assignment )expression_statement (for_statement (identifier_s) identifier_s (identifier_structs) identifier_structs (block (if_statement (comparison_operator (string_'member') string_'member' (identifier_s) identifier_s )comparison_operator (block (continue_statement )continue_statement )block )if_statement (for_statement (identifier_m) identifier_m (subscript (identifier_s) identifier_s (string_'member') string_'member' )subscript (block (if_statement (comparison_operator (subscript (identifier_m) identifier_m (string_'type') string_'type' )subscript (identifier_pfn_name) identifier_pfn_name )comparison_operator (block (expression_statement (assignment (identifier_struct_name) identifier_struct_name (subscript (identifier_s) identifier_s (string_'@name') string_'@name' )subscript )assignment )expression_statement )block )if_statement )block )for_statement )block )for_statement (expression_statement (assignment (subscript (subscript (identifier_model) identifier_model (string_'funcpointers') string_'funcpointers' )subscript (identifier_pfn_name) identifier_pfn_name )subscript (identifier_struct_name) identifier_struct_name )assignment )expression_statement )block )for_statement )block )function_definition )module
Fill the model with function pointer model['funcpointers'] = {'pfn_name': 'struct_name'}
(module (function_definition (function_name_get_developer_package) function_name_get_developer_package (parameters (identifier_path) identifier_path (default_parameter (identifier_format) identifier_format (None) None )default_parameter )parameters (block (import_from_statement (dotted_name (identifier_rez) identifier_rez (identifier_developer_package) identifier_developer_package )dotted_name (dotted_name (identifier_DeveloperPackage) identifier_DeveloperPackage )dotted_name )import_from_statement (return_statement (call (attribute (identifier_DeveloperPackage) identifier_DeveloperPackage (identifier_from_path) identifier_from_path )attribute (argument_list (identifier_path) identifier_path (keyword_argument (identifier_format) identifier_format (identifier_format) identifier_format )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Create a developer package. Args: path (str): Path to dir containing package definition file. format (str): Package definition file format, detected if None. Returns: `DeveloperPackage`.
(module (function_definition (function_name_enable_logging) function_name_enable_logging (parameters (identifier_self) identifier_self (identifier_bucket_name) identifier_bucket_name (default_parameter (identifier_object_prefix) identifier_object_prefix (string_"") string_"" )default_parameter )parameters (block (expression_statement (assignment (identifier_info) identifier_info (dictionary (pair (string_"logBucket") string_"logBucket" (identifier_bucket_name) identifier_bucket_name )pair (pair (string_"logObjectPrefix") string_"logObjectPrefix" (identifier_object_prefix) identifier_object_prefix )pair )dictionary )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier__patch_property) identifier__patch_property )attribute (argument_list (string_"logging") string_"logging" (identifier_info) identifier_info )argument_list )call )expression_statement )block )function_definition )module
Enable access logging for this bucket. See https://cloud.google.com/storage/docs/access-logs :type bucket_name: str :param bucket_name: name of bucket in which to store access logs :type object_prefix: str :param object_prefix: prefix for access log filenames
(module (function_definition (function_name_get_assessment_basic_authoring_session_for_bank) function_name_get_assessment_basic_authoring_session_for_bank (parameters (identifier_self) identifier_self (identifier_bank_id) identifier_bank_id (identifier_proxy) identifier_proxy )parameters (block (if_statement (not_operator (call (attribute (identifier_self) identifier_self (identifier_supports_assessment_basic_authoring) identifier_supports_assessment_basic_authoring )attribute (argument_list )argument_list )call )not_operator (block (raise_statement (call (attribute (identifier_errors) identifier_errors (identifier_Unimplemented) identifier_Unimplemented )attribute (argument_list )argument_list )call )raise_statement )block )if_statement (return_statement (call (attribute (identifier_sessions) identifier_sessions (identifier_AssessmentBasicAuthoringSession) identifier_AssessmentBasicAuthoringSession )attribute (argument_list (identifier_bank_id) identifier_bank_id (identifier_proxy) identifier_proxy (attribute (identifier_self) identifier_self (identifier__runtime) identifier__runtime )attribute )argument_list )call )return_statement )block )function_definition )module
Gets the ``OsidSession`` associated with the assessment authoring service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of a bank arg: proxy (osid.proxy.Proxy): a proxy return: (osid.assessment.AssessmentBasicAuthoringSession) - an ``AssessmentBasicAuthoringSession`` raise: NotFound - ``bank_id`` not found raise: NullArgument - ``bank_id`` or ``proxy`` is ``null`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_assessment_basic_authoring()`` or ``supports_visibe_federation()`` is ``false`` *compliance: optional -- This method must be implemented if ``supports_assessment_basic_authoring()`` and ``supports_visibe_federation()`` is ``true``.*
(module (function_definition (function_name_search_location_check) function_name_search_location_check (parameters (identifier_cls) identifier_cls (identifier_location) identifier_location )parameters (block (if_statement (not_operator (parenthesized_expression (boolean_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_location) identifier_location (identifier_Mapping) identifier_Mapping )argument_list )call (comparison_operator (call (identifier_set) identifier_set (argument_list (call (attribute (identifier_location) identifier_location (identifier_keys) identifier_keys )attribute (argument_list )argument_list )call )argument_list )call (identifier__LOCATION_SEARCH_ARGS) identifier__LOCATION_SEARCH_ARGS )comparison_operator )boolean_operator )parenthesized_expression )not_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (binary_operator (string_'Search location should be mapping with keys: %s') string_'Search location should be mapping with keys: %s' (identifier__LOCATION_SEARCH_ARGS) identifier__LOCATION_SEARCH_ARGS )binary_operator )argument_list )call )raise_statement )block )if_statement (expression_statement (call (attribute (identifier_cls) identifier_cls (identifier_location_check) identifier_location_check )attribute (argument_list (subscript (identifier_location) identifier_location (string_'lat') string_'lat' )subscript (subscript (identifier_location) identifier_location (string_'long') string_'long' )subscript )argument_list )call )expression_statement (expression_statement (assignment (identifier_radius) identifier_radius (subscript (identifier_location) identifier_location (string_'radius') string_'radius' )subscript )assignment )expression_statement (if_statement (not_operator (parenthesized_expression (boolean_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_radius) identifier_radius (identifier_number_types) identifier_number_types )argument_list )call (comparison_operator (integer_0) integer_0 (identifier_radius) identifier_radius (integer_20038) integer_20038 )comparison_operator )boolean_operator )parenthesized_expression )not_operator (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (call (attribute (string_"Radius: '{radius}' is invalid") string_"Radius: '{radius}' is invalid" (identifier_format) identifier_format )attribute (argument_list (keyword_argument (identifier_radius) identifier_radius (identifier_radius) identifier_radius )keyword_argument )argument_list )call )argument_list )call )raise_statement )block )if_statement )block )function_definition )module
Core.Client.request_search location parameter should be a dictionary that contains lat, lon and radius floats
(module (function_definition (function_name_get_account_holds) function_name_get_account_holds (parameters (identifier_self) identifier_self (identifier_account_id) identifier_account_id (dictionary_splat_pattern (identifier_kwargs) identifier_kwargs )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_endpoint) identifier_endpoint (call (attribute (string_'/accounts/{}/holds') string_'/accounts/{}/holds' (identifier_format) identifier_format )attribute (argument_list (identifier_account_id) identifier_account_id )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier__send_paginated_message) identifier__send_paginated_message )attribute (argument_list (identifier_endpoint) identifier_endpoint (keyword_argument (identifier_params) identifier_params (identifier_kwargs) identifier_kwargs )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Get holds on an account. This method returns a generator which may make multiple HTTP requests while iterating through it. Holds are placed on an account for active orders or pending withdraw requests. As an order is filled, the hold amount is updated. If an order is canceled, any remaining hold is removed. For a withdraw, once it is completed, the hold is removed. The `type` field will indicate why the hold exists. The hold type is 'order' for holds related to open orders and 'transfer' for holds related to a withdraw. The `ref` field contains the id of the order or transfer which created the hold. Args: account_id (str): Account id to get holds of. kwargs (dict): Additional HTTP request parameters. Returns: generator(list): Hold information for the account. Example:: [ { "id": "82dcd140-c3c7-4507-8de4-2c529cd1a28f", "account_id": "e0b3f39a-183d-453e-b754-0c13e5bab0b3", "created_at": "2014-11-06T10:34:47.123456Z", "updated_at": "2014-11-06T10:40:47.123456Z", "amount": "4.23", "type": "order", "ref": "0a205de4-dd35-4370-a285-fe8fc375a273", }, { ... } ]
(module (function_definition (function_name_add_edges) function_name_add_edges (parameters (identifier_self) identifier_self (identifier_from_idx) identifier_from_idx (identifier_to_idx) identifier_to_idx (default_parameter (identifier_weight) identifier_weight (integer_1) integer_1 )default_parameter (default_parameter (identifier_symmetric) identifier_symmetric (False) False )default_parameter (default_parameter (identifier_copy) identifier_copy (False) False )default_parameter )parameters (block (raise_statement (call (identifier_NotImplementedError) identifier_NotImplementedError (argument_list )argument_list )call )raise_statement )block )function_definition )module
Adds all from->to edges. weight may be a scalar or 1d array. If symmetric=True, also adds to->from edges with the same weights.
(module (function_definition (function_name_volumes) function_name_volumes (parameters (identifier_self) identifier_self )parameters (block (return_statement (list_comprehension (call (identifier_EBSVolume) identifier_EBSVolume (argument_list (identifier_res) identifier_res )argument_list )call (for_in_clause (identifier_res) identifier_res (call (attribute (call (attribute (call (attribute (attribute (identifier_db) identifier_db (identifier_Resource) identifier_Resource )attribute (identifier_join) identifier_join )attribute (argument_list (identifier_ResourceProperty) identifier_ResourceProperty (comparison_operator (attribute (identifier_Resource) identifier_Resource (identifier_resource_id) identifier_resource_id )attribute (attribute (identifier_ResourceProperty) identifier_ResourceProperty (identifier_resource_id) identifier_resource_id )attribute )comparison_operator )argument_list )call (identifier_filter) identifier_filter )attribute (argument_list (comparison_operator (attribute (identifier_Resource) identifier_Resource (identifier_resource_type_id) identifier_resource_type_id )attribute (attribute (call (attribute (identifier_ResourceType) identifier_ResourceType (identifier_get) identifier_get )attribute (argument_list (string_'aws_ebs_volume') string_'aws_ebs_volume' )argument_list )call (identifier_resource_type_id) identifier_resource_type_id )attribute )comparison_operator (comparison_operator (attribute (identifier_ResourceProperty) identifier_ResourceProperty (identifier_name) identifier_name )attribute (string_'attachments') string_'attachments' )comparison_operator (call (attribute (identifier_func) identifier_func (identifier_JSON_CONTAINS) identifier_JSON_CONTAINS )attribute (argument_list (attribute (identifier_ResourceProperty) identifier_ResourceProperty (identifier_value) identifier_value )attribute (call (attribute (identifier_func) identifier_func (identifier_JSON_QUOTE) identifier_JSON_QUOTE )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_id) identifier_id )attribute )argument_list )call )argument_list )call )argument_list )call (identifier_all) identifier_all )attribute (argument_list )argument_list )call )for_in_clause )list_comprehension )return_statement )block )function_definition )module
Returns a list of the volumes attached to the instance Returns: `list` of `EBSVolume`
(module (function_definition (function_name_get_default_options) function_name_get_default_options (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (pattern_list (identifier__) identifier__ (identifier__) identifier__ (identifier_internal_usage) identifier_internal_usage )pattern_list (call (attribute (identifier_self) identifier_self (identifier_get_usage) identifier_get_usage )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_args) identifier_args (call (identifier_docopt) identifier_docopt (argument_list (identifier_internal_usage) identifier_internal_usage (list )list )argument_list )call )assignment )expression_statement (return_statement (dictionary_comprehension (pair (identifier_k) identifier_k (identifier_v) identifier_v )pair (for_in_clause (pattern_list (identifier_k) identifier_k (identifier_v) identifier_v )pattern_list (call (attribute (identifier_args) identifier_args (identifier_items) identifier_items )attribute (argument_list )argument_list )call )for_in_clause (if_clause (call (attribute (identifier_k) identifier_k (identifier_startswith) identifier_startswith )attribute (argument_list (string_'--') string_'--' )argument_list )call )if_clause )dictionary_comprehension )return_statement )block )function_definition )module
Get a dictionary of default options as used with run. Returns ------- dict A dictionary containing option keys of the form '--beat_interval'. Their values are boolean if the option is a flag, otherwise None or its default value.
(module (function_definition (function_name_is_matching) function_name_is_matching (parameters (identifier_cls) identifier_cls (identifier_file_path) identifier_file_path )parameters (block (if_statement (boolean_operator (call (attribute (identifier_file_path) identifier_file_path (identifier_endswith) identifier_endswith )attribute (argument_list (string_".ndata") string_".ndata" )argument_list )call (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_exists) identifier_exists )attribute (argument_list (identifier_file_path) identifier_file_path )argument_list )call )boolean_operator (block (try_statement (block (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_file_path) identifier_file_path (string_"r+b") string_"r+b" )argument_list )call (as_pattern_target (identifier_fp) identifier_fp )as_pattern_target )as_pattern )with_item )with_clause (block (expression_statement (assignment (pattern_list (identifier_local_files) identifier_local_files (identifier_dir_files) identifier_dir_files (identifier_eocd) identifier_eocd )pattern_list (call (identifier_parse_zip) identifier_parse_zip (argument_list (identifier_fp) identifier_fp )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_contains_data) identifier_contains_data (comparison_operator (string_b"data.npy") string_b"data.npy" (identifier_dir_files) identifier_dir_files )comparison_operator )assignment )expression_statement (expression_statement (assignment (identifier_contains_metadata) identifier_contains_metadata (comparison_operator (string_b"metadata.json") string_b"metadata.json" (identifier_dir_files) identifier_dir_files )comparison_operator )assignment )expression_statement (expression_statement (assignment (identifier_file_count) identifier_file_count (binary_operator (identifier_contains_data) identifier_contains_data (identifier_contains_metadata) identifier_contains_metadata )binary_operator )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_dir_files) identifier_dir_files )argument_list )call (identifier_file_count) identifier_file_count )comparison_operator (comparison_operator (identifier_file_count) identifier_file_count (integer_0) integer_0 )comparison_operator )boolean_operator (block (return_statement (False) False )return_statement )block )if_statement (return_statement (True) True )return_statement )block )with_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_e) identifier_e )as_pattern_target )as_pattern (block (expression_statement (call (attribute (identifier_logging) identifier_logging (identifier_error) identifier_error )attribute (argument_list (string_"Exception parsing ndata file: %s") string_"Exception parsing ndata file: %s" (identifier_file_path) identifier_file_path )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_logging) identifier_logging (identifier_error) identifier_error )attribute (argument_list (call (identifier_str) identifier_str (argument_list (identifier_e) identifier_e )argument_list )call )argument_list )call )expression_statement )block )except_clause )try_statement )block )if_statement (return_statement (False) False )return_statement )block )function_definition )module
Return whether the given absolute file path is an ndata file.
(module (function_definition (function_name_create_connection) function_name_create_connection (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_connector) identifier_connector (boolean_operator (attribute (identifier_self) identifier_self (identifier_proxy) identifier_proxy )attribute (attribute (identifier_self) identifier_self (identifier_loop) identifier_loop )attribute )boolean_operator )assignment )expression_statement (return_statement (await (call (attribute (identifier_connector) identifier_connector (identifier_create_connection) identifier_create_connection )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_session_factory) identifier_session_factory )attribute (attribute (identifier_self) identifier_self (identifier_host) identifier_host )attribute (attribute (identifier_self) identifier_self (identifier_port) identifier_port )attribute (dictionary_splat (attribute (identifier_self) identifier_self (identifier_kwargs) identifier_kwargs )attribute )dictionary_splat )argument_list )call )await )return_statement )block )function_definition )module
Initiate a connection.
(module (function_definition (function_name_put_request_payment) function_name_put_request_payment (parameters (identifier_self) identifier_self (identifier_bucket) identifier_bucket (identifier_payer) identifier_payer )parameters (block (expression_statement (assignment (identifier_data) identifier_data (call (attribute (call (identifier_RequestPayment) identifier_RequestPayment (argument_list (identifier_payer) identifier_payer )argument_list )call (identifier_to_xml) identifier_to_xml )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_details) identifier_details (call (attribute (identifier_self) identifier_self (identifier__details) identifier__details )attribute (argument_list (keyword_argument (identifier_method) identifier_method (string_b"PUT") string_b"PUT" )keyword_argument (keyword_argument (identifier_url_context) identifier_url_context (call (attribute (identifier_self) identifier_self (identifier__url_context) identifier__url_context )attribute (argument_list (keyword_argument (identifier_bucket) identifier_bucket (identifier_bucket) identifier_bucket )keyword_argument (keyword_argument (identifier_object_name) identifier_object_name (string_"?requestPayment") string_"?requestPayment" )keyword_argument )argument_list )call )keyword_argument (keyword_argument (identifier_body) identifier_body (identifier_data) identifier_data )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_d) identifier_d (call (attribute (identifier_self) identifier_self (identifier__submit) identifier__submit )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier__query_factory) identifier__query_factory )attribute (argument_list (identifier_details) identifier_details )argument_list )call )argument_list )call )assignment )expression_statement (return_statement (identifier_d) identifier_d )return_statement )block )function_definition )module
Set request payment configuration on bucket to payer. @param bucket: The name of the bucket. @param payer: The name of the payer. @return: A C{Deferred} that will fire with the result of the request.
(module (function_definition (function_name_running) function_name_running (parameters (default_parameter (identifier_concurrent) identifier_concurrent (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_ret) identifier_ret (list )list )assignment )expression_statement (if_statement (identifier_concurrent) identifier_concurrent (block (return_statement (identifier_ret) identifier_ret )return_statement )block )if_statement (expression_statement (assignment (identifier_active) identifier_active (call (subscript (identifier___salt__) identifier___salt__ (string_'saltutil.is_running') string_'saltutil.is_running' )subscript (argument_list (string_'state.*') string_'state.*' )argument_list )call )assignment )expression_statement (for_statement (identifier_data) identifier_data (identifier_active) identifier_active (block (expression_statement (assignment (identifier_err) identifier_err (call (attribute (parenthesized_expression (concatenated_string (string_'The function "{0}" is running as PID {1} and was started at ') string_'The function "{0}" is running as PID {1} and was started at ' (string_'{2} with jid {3}') string_'{2} with jid {3}' )concatenated_string )parenthesized_expression (identifier_format) identifier_format )attribute (argument_list (subscript (identifier_data) identifier_data (string_'fun') string_'fun' )subscript (subscript (identifier_data) identifier_data (string_'pid') string_'pid' )subscript (call (attribute (attribute (attribute (identifier_salt) identifier_salt (identifier_utils) identifier_utils )attribute (identifier_jid) identifier_jid )attribute (identifier_jid_to_time) identifier_jid_to_time )attribute (argument_list (subscript (identifier_data) identifier_data (string_'jid') string_'jid' )subscript )argument_list )call (subscript (identifier_data) identifier_data (string_'jid') string_'jid' )subscript )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_ret) identifier_ret (identifier_append) identifier_append )attribute (argument_list (identifier_err) identifier_err )argument_list )call )expression_statement )block )for_statement (return_statement (identifier_ret) identifier_ret )return_statement )block )function_definition )module
Return a list of strings that contain state return data if a state function is already running. This function is used to prevent multiple state calls from being run at the same time. CLI Example: .. code-block:: bash salt '*' state.running
(module (function_definition (function_name_check) function_name_check (parameters (identifier_line) identifier_line (identifier_queries) identifier_queries )parameters (block (expression_statement (assignment (identifier_line) identifier_line (call (attribute (identifier_line) identifier_line (identifier_strip) identifier_strip )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_spLine) identifier_spLine (call (attribute (call (attribute (identifier_line) identifier_line (identifier_replace) identifier_replace )attribute (argument_list (string_'.') string_'.' (string_' ') string_' ' )argument_list )call (identifier_split) identifier_split )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_matches) identifier_matches (call (attribute (call (identifier_set) identifier_set (argument_list (identifier_spLine) identifier_spLine )argument_list )call (identifier_intersection) identifier_intersection )attribute (argument_list (identifier_queries) identifier_queries )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_matches) identifier_matches )argument_list )call (integer_0) integer_0 )comparison_operator (block (return_statement (expression_list (identifier_matches) identifier_matches (call (attribute (identifier_line) identifier_line (identifier_split) identifier_split )attribute (argument_list (string_'\t') string_'\t' )argument_list )call )expression_list )return_statement )block )if_statement (return_statement (expression_list (identifier_matches) identifier_matches (False) False )expression_list )return_statement )block )function_definition )module
check that at least one of queries is in list, l
(module (function_definition (function_name_to_dict) function_name_to_dict (parameters (identifier_self) identifier_self )parameters (block (return_statement (call (identifier_dict) identifier_dict (generator_expression (tuple (identifier_k) identifier_k (subscript (attribute (identifier_self) identifier_self (identifier___dict__) identifier___dict__ )attribute (identifier_k) identifier_k )subscript )tuple (for_in_clause (identifier_k) identifier_k (attribute (identifier_self) identifier_self (identifier___dict__) identifier___dict__ )attribute )for_in_clause (if_clause (comparison_operator (call (attribute (identifier_k) identifier_k (identifier_find) identifier_find )attribute (argument_list (string_"_") string_"_" )argument_list )call (integer_0) integer_0 )comparison_operator )if_clause )generator_expression )call )return_statement )block )function_definition )module
to_dict will clean all protected and private properties
(module (function_definition (function_name_set_cpu_status) function_name_set_cpu_status (parameters (identifier_self) identifier_self (identifier_status) identifier_status )parameters (block (assert_statement (comparison_operator (identifier_status) identifier_status (attribute (attribute (identifier_snap7) identifier_snap7 (identifier_snap7types) identifier_snap7types )attribute (identifier_cpu_statuses) identifier_cpu_statuses )attribute )comparison_operator (binary_operator (string_'unknown cpu state %s') string_'unknown cpu state %s' (identifier_status) identifier_status )binary_operator )assert_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (binary_operator (string_"setting cpu status to %s") string_"setting cpu status to %s" (identifier_status) identifier_status )binary_operator )argument_list )call )expression_statement (return_statement (call (attribute (attribute (identifier_self) identifier_self (identifier_library) identifier_library )attribute (identifier_Srv_SetCpuStatus) identifier_Srv_SetCpuStatus )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_pointer) identifier_pointer )attribute (identifier_status) identifier_status )argument_list )call )return_statement )block )function_definition )module
Sets the Virtual CPU status.
(module (function_definition (function_name_PDBasXMLwithSymwithPolarH) function_name_PDBasXMLwithSymwithPolarH (parameters (identifier_self) identifier_self (identifier_id) identifier_id )parameters (block (print_statement (identifier__WARNING) identifier__WARNING )print_statement (expression_statement (assignment (identifier_h_s_xml) identifier_h_s_xml (call (attribute (identifier_urllib) identifier_urllib (identifier_urlopen) identifier_urlopen )attribute (argument_list (binary_operator (string_"http://www.cmbi.ru.nl/wiwsd/rest/PDBasXMLwithSymwithPolarH/id/") string_"http://www.cmbi.ru.nl/wiwsd/rest/PDBasXMLwithSymwithPolarH/id/" (identifier_id) identifier_id )binary_operator )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_raw) identifier_raw )attribute (identifier_h_s_xml) identifier_h_s_xml )assignment )expression_statement (expression_statement (assignment (identifier_p) identifier_p (attribute (identifier_self) identifier_self (identifier_parser) identifier_parser )attribute )assignment )expression_statement (expression_statement (assignment (identifier_h_s_smcra) identifier_h_s_smcra (call (attribute (identifier_p) identifier_p (identifier_read) identifier_read )attribute (argument_list (identifier_h_s_xml) identifier_h_s_xml (string_'WHATIF_Output') string_'WHATIF_Output' )argument_list )call )assignment )expression_statement (return_statement (identifier_h_s_smcra) identifier_h_s_smcra )return_statement )block )function_definition )module
Adds Hydrogen Atoms to a Structure.
(module (function_definition (function_name_keys_to_datetime) function_name_keys_to_datetime (parameters (identifier_obj) identifier_obj (list_splat_pattern (identifier_keys) identifier_keys )list_splat_pattern )parameters (block (if_statement (not_operator (identifier_keys) identifier_keys )not_operator (block (return_statement (identifier_obj) identifier_obj )return_statement )block )if_statement (for_statement (identifier_k) identifier_k (identifier_keys) identifier_keys (block (if_statement (comparison_operator (identifier_k) identifier_k (identifier_obj) identifier_obj )comparison_operator (block (continue_statement )continue_statement )block )if_statement (expression_statement (assignment (identifier_v) identifier_v (subscript (identifier_obj) identifier_obj (identifier_k) identifier_k )subscript )assignment )expression_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_v) identifier_v (identifier_string_types) identifier_string_types )argument_list )call )not_operator (block (continue_statement )continue_statement )block )if_statement (expression_statement (assignment (subscript (identifier_obj) identifier_obj (identifier_k) identifier_k )subscript (call (identifier_parse_datetime) identifier_parse_datetime (argument_list (identifier_v) identifier_v )argument_list )call )assignment )expression_statement )block )for_statement (return_statement (identifier_obj) identifier_obj )return_statement )block )function_definition )module
Converts all the keys in an object to DateTime instances. Args: obj (dict): the JSON-like ``dict`` object to modify inplace. keys (str): keys of the object being converted into DateTime instances. Returns: dict: ``obj`` inplace. >>> keys_to_datetime(None) is None True >>> keys_to_datetime({}) {} >>> a = {} >>> id(keys_to_datetime(a)) == id(a) True >>> a = {'one': '2016-06-06T19:41:43.039284', 'two': '2016-06-06T19:41:43.039284'} >>> keys_to_datetime(a) == a True >>> keys_to_datetime(a, 'one')['one'] datetime.datetime(2016, 6, 6, 19, 41, 43, 39284) >>> keys_to_datetime(a, 'one')['two'] '2016-06-06T19:41:43.039284'
(module (function_definition (function_name_get_crawler_stats) function_name_get_crawler_stats (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_"Gathering crawler stats") string_"Gathering crawler stats" )argument_list )call )expression_statement (expression_statement (assignment (identifier_the_dict) identifier_the_dict (dictionary )dictionary )assignment )expression_statement (expression_statement (assignment (subscript (identifier_the_dict) identifier_the_dict (string_'spiders') string_'spiders' )subscript (subscript (call (attribute (identifier_self) identifier_self (identifier_get_spider_stats) identifier_get_spider_stats )attribute (argument_list )argument_list )call (string_'spiders') string_'spiders' )subscript )assignment )expression_statement (expression_statement (assignment (subscript (identifier_the_dict) identifier_the_dict (string_'machines') string_'machines' )subscript (subscript (call (attribute (identifier_self) identifier_self (identifier_get_machine_stats) identifier_get_machine_stats )attribute (argument_list )argument_list )call (string_'machines') string_'machines' )subscript )assignment )expression_statement (expression_statement (assignment (subscript (identifier_the_dict) identifier_the_dict (string_'queue') string_'queue' )subscript (subscript (call (attribute (identifier_self) identifier_self (identifier_get_queue_stats) identifier_get_queue_stats )attribute (argument_list )argument_list )call (string_'queues') string_'queues' )subscript )assignment )expression_statement (return_statement (identifier_the_dict) identifier_the_dict )return_statement )block )function_definition )module
Gather crawler stats @return: A dict of stats
(module (function_definition (function_name__assert_validators) function_name__assert_validators (parameters (identifier_self) identifier_self (identifier_validators) identifier_validators )parameters (block (for_statement (identifier_validator) identifier_validator (call (identifier_sorted) identifier_sorted (argument_list (identifier_validators) identifier_validators (keyword_argument (identifier_key) identifier_key (lambda (lambda_parameters (identifier_validator) identifier_validator )lambda_parameters (attribute (identifier_validator) identifier_validator (identifier_insertion_index) identifier_insertion_index )attribute )lambda )keyword_argument )argument_list )call (block (try_statement (block (expression_statement (call (attribute (identifier_validator) identifier_validator (identifier_verify) identifier_verify )attribute (argument_list (identifier_self) identifier_self )argument_list )call )expression_statement )block (except_clause (as_pattern (attribute (identifier__exceptions) identifier__exceptions (identifier_ValidationError) identifier_ValidationError )attribute (as_pattern_target (identifier_e) identifier_e )as_pattern_target )as_pattern (block (expression_statement (assignment (identifier_message) identifier_message (call (attribute (identifier_validator) identifier_validator (identifier_print_flags_with_values) identifier_print_flags_with_values )attribute (argument_list (identifier_self) identifier_self )argument_list )call )assignment )expression_statement (raise_statement (call (attribute (identifier__exceptions) identifier__exceptions (identifier_IllegalFlagValueError) identifier_IllegalFlagValueError )attribute (argument_list (binary_operator (string_'%s: %s') string_'%s: %s' (tuple (identifier_message) identifier_message (call (identifier_str) identifier_str (argument_list (identifier_e) identifier_e )argument_list )call )tuple )binary_operator )argument_list )call )raise_statement )block )except_clause )try_statement )block )for_statement )block )function_definition )module
Asserts if all validators in the list are satisfied. It asserts validators in the order they were created. Args: validators: Iterable(validators.Validator), validators to be verified. Raises: AttributeError: Raised if validators work with a non-existing flag. IllegalFlagValueError: Raised if validation fails for at least one validator.
(module (function_definition (function_name_start) function_name_start (parameters (identifier_st_reg_number) identifier_st_reg_number )parameters (block (expression_statement (assignment (identifier_divisor) identifier_divisor (integer_11) integer_11 )assignment )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_st_reg_number) identifier_st_reg_number )argument_list )call (integer_9) integer_9 )comparison_operator (block (return_statement (False) False )return_statement )block )if_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_st_reg_number) identifier_st_reg_number )argument_list )call (integer_9) integer_9 )comparison_operator (block (return_statement (False) False )return_statement )block )if_statement (expression_statement (assignment (identifier_sum_total) identifier_sum_total (integer_0) integer_0 )assignment )expression_statement (expression_statement (assignment (identifier_peso) identifier_peso (integer_9) integer_9 )assignment )expression_statement (for_statement (identifier_i) identifier_i (call (identifier_range) identifier_range (argument_list (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_st_reg_number) identifier_st_reg_number )argument_list )call (integer_1) integer_1 )binary_operator )argument_list )call (block (expression_statement (assignment (identifier_sum_total) identifier_sum_total (binary_operator (identifier_sum_total) identifier_sum_total (binary_operator (call (identifier_int) identifier_int (argument_list (subscript (identifier_st_reg_number) identifier_st_reg_number (identifier_i) identifier_i )subscript )argument_list )call (identifier_peso) identifier_peso )binary_operator )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_peso) identifier_peso (binary_operator (identifier_peso) identifier_peso (integer_1) integer_1 )binary_operator )assignment )expression_statement )block )for_statement (expression_statement (assignment (identifier_rest_division) identifier_rest_division (binary_operator (identifier_sum_total) identifier_sum_total (identifier_divisor) identifier_divisor )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_digit) identifier_digit (binary_operator (identifier_divisor) identifier_divisor (identifier_rest_division) identifier_rest_division )binary_operator )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_digit) identifier_digit (integer_10) integer_10 )comparison_operator (comparison_operator (identifier_digit) identifier_digit (integer_11) integer_11 )comparison_operator )boolean_operator (block (expression_statement (assignment (identifier_digit) identifier_digit (integer_0) integer_0 )assignment )expression_statement )block )if_statement (return_statement (comparison_operator (identifier_digit) identifier_digit (call (identifier_int) identifier_int (argument_list (subscript (identifier_st_reg_number) identifier_st_reg_number (binary_operator (call (identifier_len) identifier_len (argument_list (identifier_st_reg_number) identifier_st_reg_number )argument_list )call (integer_1) integer_1 )binary_operator )subscript )argument_list )call )comparison_operator )return_statement )block )function_definition )module
Checks the number valiaty for the Sergipe state
(module (function_definition (function_name_getvalue) function_name_getvalue (parameters (identifier_self) identifier_self )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_strategy) identifier_strategy )attribute (integer_0) integer_0 )comparison_operator (block (return_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__delegate) identifier__delegate )attribute (identifier_getvalue) identifier_getvalue )attribute (argument_list )argument_list )call )return_statement )block )if_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__delegate) identifier__delegate )attribute (identifier_flush) identifier_flush )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__delegate) identifier__delegate )attribute (identifier_seek) identifier_seek )attribute (argument_list (integer_0) integer_0 )argument_list )call )expression_statement (expression_statement (assignment (identifier_value) identifier_value (call (attribute (attribute (identifier_self) identifier_self (identifier__delegate) identifier__delegate )attribute (identifier_read) identifier_read )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_value) identifier_value (attribute (identifier_six) identifier_six (identifier_binary_type) identifier_binary_type )attribute )argument_list )call )not_operator (block (expression_statement (assignment (identifier_value) identifier_value (call (attribute (identifier_value) identifier_value (identifier_encode) identifier_encode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (identifier_value) identifier_value )return_statement )block )function_definition )module
Get value of file. Work around for second strategy. Always returns bytes
(module (function_definition (function_name_copy) function_name_copy (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_other) identifier_other (call (identifier_Version) identifier_Version (argument_list (None) None )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_other) identifier_other (identifier_tokens) identifier_tokens )attribute (subscript (attribute (identifier_self) identifier_self (identifier_tokens) identifier_tokens )attribute (slice (colon) colon )slice )subscript )assignment )expression_statement (expression_statement (assignment (attribute (identifier_other) identifier_other (identifier_seps) identifier_seps )attribute (subscript (attribute (identifier_self) identifier_self (identifier_seps) identifier_seps )attribute (slice (colon) colon )slice )subscript )assignment )expression_statement (return_statement (identifier_other) identifier_other )return_statement )block )function_definition )module
Returns a copy of the version.
(module (function_definition (function_name__fix_dynamic_class_lookup) function_name__fix_dynamic_class_lookup (parameters (identifier_cls) identifier_cls (identifier_pstfx) identifier_pstfx )parameters (block (expression_statement (assignment (identifier_extnm) identifier_extnm (binary_operator (binary_operator (binary_operator (string_'_') string_'_' (attribute (identifier_cls) identifier_cls (identifier___name__) identifier___name__ )attribute )binary_operator (string_'_') string_'_' )binary_operator (identifier_pstfx) identifier_pstfx )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_mdl) identifier_mdl (subscript (attribute (identifier_sys) identifier_sys (identifier_modules) identifier_modules )attribute (attribute (identifier_cls) identifier_cls (identifier___module__) identifier___module__ )attribute )subscript )assignment )expression_statement (expression_statement (call (identifier_setattr) identifier_setattr (argument_list (identifier_mdl) identifier_mdl (identifier_extnm) identifier_extnm (identifier_cls) identifier_cls )argument_list )call )expression_statement (if_statement (call (identifier_hasattr) identifier_hasattr (argument_list (identifier_cls) identifier_cls (string_'__qualname__') string_'__qualname__' )argument_list )call (block (expression_statement (assignment (attribute (identifier_cls) identifier_cls (identifier___qualname__) identifier___qualname__ )attribute (identifier_extnm) identifier_extnm )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (attribute (identifier_cls) identifier_cls (identifier___name__) identifier___name__ )attribute (identifier_extnm) identifier_extnm )assignment )expression_statement )block )else_clause )if_statement )block )function_definition )module
Fix name lookup problem that prevents pickling of dynamically defined classes. Parameters ---------- cls : class Dynamically generated class to which fix is to be applied pstfx : string Postfix that can be used to identify dynamically generated classes that are equivalent by construction
(module (function_definition (function_name_dump) function_name_dump (parameters (identifier_self) identifier_self (identifier_f) identifier_f (default_parameter (identifier_indent) identifier_indent (string_'') string_'' )default_parameter )parameters (block (expression_statement (call (identifier_print) identifier_print (argument_list (call (attribute (parenthesized_expression (binary_operator (string_"%s&%s %s") string_"%s&%s %s" (tuple (identifier_indent) identifier_indent (attribute (identifier_self) identifier_self (identifier___name) identifier___name )attribute (attribute (identifier_self) identifier_self (identifier_section_parameters) identifier_section_parameters )attribute )tuple )binary_operator )parenthesized_expression (identifier_rstrip) identifier_rstrip )attribute (argument_list )argument_list )call (keyword_argument (identifier_file) identifier_file (identifier_f) identifier_f )keyword_argument )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_dump_children) identifier_dump_children )attribute (argument_list (identifier_f) identifier_f (identifier_indent) identifier_indent )argument_list )call )expression_statement (expression_statement (call (identifier_print) identifier_print (argument_list (binary_operator (string_"%s&END %s") string_"%s&END %s" (tuple (identifier_indent) identifier_indent (attribute (identifier_self) identifier_self (identifier___name) identifier___name )attribute )tuple )binary_operator (keyword_argument (identifier_file) identifier_file (identifier_f) identifier_f )keyword_argument )argument_list )call )expression_statement )block )function_definition )module
Dump this section and its children to a file-like object
(module (function_definition (function_name__build_category_tree) function_name__build_category_tree (parameters (identifier_slug) identifier_slug (default_parameter (identifier_reference) identifier_reference (None) None )default_parameter (default_parameter (identifier_items) identifier_items (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_items) identifier_items (None) None )comparison_operator (block (expression_statement (assignment (identifier_items) identifier_items (list )list )assignment )expression_statement )block )if_statement (for_statement (identifier_key) identifier_key (identifier_reference) identifier_reference (block (expression_statement (assignment (identifier_category) identifier_category (subscript (identifier_reference) identifier_reference (identifier_key) identifier_key )subscript )assignment )expression_statement (if_statement (comparison_operator (subscript (identifier_category) identifier_category (string_"parent") string_"parent" )subscript (identifier_slug) identifier_slug )comparison_operator (block (expression_statement (assignment (identifier_children) identifier_children (call (identifier__build_category_tree) identifier__build_category_tree (argument_list (subscript (identifier_category) identifier_category (string_"nicename") string_"nicename" )subscript (keyword_argument (identifier_reference) identifier_reference (identifier_reference) identifier_reference )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_category) identifier_category (string_"children") string_"children" )subscript (identifier_children) identifier_children )assignment )expression_statement (expression_statement (call (attribute (identifier_items) identifier_items (identifier_append) identifier_append )attribute (argument_list (identifier_category) identifier_category )argument_list )call )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_items) identifier_items )return_statement )block )function_definition )module
Builds a recursive tree with category relations as children.
(module (function_definition (function_name__update_display) function_name__update_display (parameters (identifier_self) identifier_self (default_parameter (identifier_event) identifier_event (None) None )default_parameter )parameters (block (try_statement (block (if_statement (attribute (identifier_self) identifier_self (identifier__showvalue) identifier__showvalue )attribute (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_display_value) identifier_display_value )attribute (argument_list (call (attribute (attribute (identifier_self) identifier_self (identifier_scale) identifier_scale )attribute (identifier_get) identifier_get )attribute (argument_list )argument_list )call )argument_list )call )expression_statement )block )if_statement (if_statement (attribute (identifier_self) identifier_self (identifier__tickinterval) identifier__tickinterval )attribute (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_place_ticks) identifier_place_ticks )attribute (argument_list )argument_list )call )expression_statement )block )if_statement )block (except_clause (identifier_IndexError) identifier_IndexError (block (pass_statement )pass_statement )block )except_clause )try_statement )block )function_definition )module
Redisplay the ticks and the label so that they adapt to the new size of the scale.
(module (function_definition (function_name_apply_obb) function_name_apply_obb (parameters (identifier_self) identifier_self )parameters (block (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (attribute (identifier_self) identifier_self (identifier_root) identifier_root )attribute )argument_list )call (integer_1) integer_1 )comparison_operator (block (expression_statement (assignment (pattern_list (identifier_matrix) identifier_matrix (identifier_bounds) identifier_bounds )pattern_list (call (attribute (identifier_polygons) identifier_polygons (identifier_polygon_obb) identifier_polygon_obb )attribute (argument_list (subscript (attribute (identifier_self) identifier_self (identifier_polygons_closed) identifier_polygons_closed )attribute (subscript (attribute (identifier_self) identifier_self (identifier_root) identifier_root )attribute (integer_0) integer_0 )subscript )subscript )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_apply_transform) identifier_apply_transform )attribute (argument_list (identifier_matrix) identifier_matrix )argument_list )call )expression_statement (return_statement (identifier_matrix) identifier_matrix )return_statement )block (else_clause (block (raise_statement (call (identifier_ValueError) identifier_ValueError (argument_list (string_'Not implemented for multibody geometry') string_'Not implemented for multibody geometry' )argument_list )call )raise_statement )block )else_clause )if_statement )block )function_definition )module
Transform the current path so that its OBB is axis aligned and OBB center is at the origin.
(module (function_definition (function_name_save_agent_profile) function_name_save_agent_profile (parameters (identifier_self) identifier_self (identifier_profile) identifier_profile )parameters (block (expression_statement (assignment (identifier_request) identifier_request (call (identifier_HTTPRequest) identifier_HTTPRequest (argument_list (keyword_argument (identifier_method) identifier_method (string_"PUT") string_"PUT" )keyword_argument (keyword_argument (identifier_resource) identifier_resource (string_"agents/profile") string_"agents/profile" )keyword_argument (keyword_argument (identifier_content) identifier_content (attribute (identifier_profile) identifier_profile (identifier_content) identifier_content )attribute )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_profile) identifier_profile (identifier_content_type) identifier_content_type )attribute (None) None )comparison_operator (block (expression_statement (assignment (subscript (attribute (identifier_request) identifier_request (identifier_headers) identifier_headers )attribute (string_"Content-Type") string_"Content-Type" )subscript (attribute (identifier_profile) identifier_profile (identifier_content_type) identifier_content_type )attribute )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (subscript (attribute (identifier_request) identifier_request (identifier_headers) identifier_headers )attribute (string_"Content-Type") string_"Content-Type" )subscript (string_"application/octet-stream") string_"application/octet-stream" )assignment )expression_statement )block )else_clause )if_statement (if_statement (comparison_operator (attribute (identifier_profile) identifier_profile (identifier_etag) identifier_etag )attribute (None) None )comparison_operator (block (expression_statement (assignment (subscript (attribute (identifier_request) identifier_request (identifier_headers) identifier_headers )attribute (string_"If-Match") string_"If-Match" )subscript (attribute (identifier_profile) identifier_profile (identifier_etag) identifier_etag )attribute )assignment )expression_statement )block )if_statement (expression_statement (assignment (attribute (identifier_request) identifier_request (identifier_query_params) identifier_query_params )attribute (dictionary (pair (string_"profileId") string_"profileId" (attribute (identifier_profile) identifier_profile (identifier_id) identifier_id )attribute )pair (pair (string_"agent") string_"agent" (call (attribute (attribute (identifier_profile) identifier_profile (identifier_agent) identifier_agent )attribute (identifier_to_json) identifier_to_json )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_version) identifier_version )attribute )argument_list )call )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_lrs_response) identifier_lrs_response (call (attribute (identifier_self) identifier_self (identifier__send_request) identifier__send_request )attribute (argument_list (identifier_request) identifier_request )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_lrs_response) identifier_lrs_response (identifier_content) identifier_content )attribute (identifier_profile) identifier_profile )assignment )expression_statement (return_statement (identifier_lrs_response) identifier_lrs_response )return_statement )block )function_definition )module
Save an agent profile doc to the LRS :param profile: Agent profile doc to be saved :type profile: :class:`tincan.documents.agent_profile_document.AgentProfileDocument` :return: LRS Response object with the saved agent profile doc as content :rtype: :class:`tincan.lrs_response.LRSResponse`
(module (function_definition (function_name_gatherBy) function_name_gatherBy (parameters (identifier_self) identifier_self (identifier_func) identifier_func )parameters (block (expression_statement (string_'Generate only rows for which the given func returns True.') string_'Generate only rows for which the given func returns True.' )expression_statement (for_statement (identifier_i) identifier_i (call (identifier_rotate_range) identifier_rotate_range (argument_list (call (identifier_len) identifier_len (argument_list (attribute (identifier_self) identifier_self (identifier_rows) identifier_rows )attribute )argument_list )call (attribute (identifier_self) identifier_self (identifier_cursorRowIndex) identifier_cursorRowIndex )attribute )argument_list )call (block (try_statement (block (expression_statement (assignment (identifier_r) identifier_r (subscript (attribute (identifier_self) identifier_self (identifier_rows) identifier_rows )attribute (identifier_i) identifier_i )subscript )assignment )expression_statement (if_statement (call (identifier_func) identifier_func (argument_list (identifier_r) identifier_r )argument_list )call (block (expression_statement (yield (identifier_r) identifier_r )yield )expression_statement )block )if_statement )block (except_clause (identifier_Exception) identifier_Exception (block (pass_statement )pass_statement )block )except_clause )try_statement )block )for_statement )block )function_definition )module
Generate only rows for which the given func returns True.
(module (function_definition (function_name_would_move_be_promotion) function_name_would_move_be_promotion (parameters (identifier_self) identifier_self )parameters (block (return_statement (boolean_operator (parenthesized_expression (boolean_operator (comparison_operator (attribute (attribute (identifier_self) identifier_self (identifier__end_loc) identifier__end_loc )attribute (identifier_rank) identifier_rank )attribute (integer_0) integer_0 )comparison_operator (not_operator (attribute (identifier_self) identifier_self (identifier_color) identifier_color )attribute )not_operator )boolean_operator )parenthesized_expression (line_continuation_\) line_continuation_\ (parenthesized_expression (boolean_operator (comparison_operator (attribute (attribute (identifier_self) identifier_self (identifier__end_loc) identifier__end_loc )attribute (identifier_rank) identifier_rank )attribute (integer_7) integer_7 )comparison_operator (attribute (identifier_self) identifier_self (identifier_color) identifier_color )attribute )boolean_operator )parenthesized_expression )boolean_operator )return_statement )block )function_definition )module
Finds if move from current location would be a promotion
(module (function_definition (function_name_exists) function_name_exists (parameters (identifier_self) identifier_self (identifier_key) identifier_key (default_parameter (identifier_fresh) identifier_fresh (False) False )default_parameter )parameters (block (expression_statement (assignment (identifier_key) identifier_key (call (attribute (identifier_key) identifier_key (identifier_upper) identifier_upper )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_key) identifier_key (attribute (identifier_self) identifier_self (identifier__deleted) identifier__deleted )attribute )comparison_operator (block (return_statement (False) False )return_statement )block )if_statement (return_statement (comparison_operator (call (attribute (identifier_self) identifier_self (identifier_get) identifier_get )attribute (argument_list (identifier_key) identifier_key (keyword_argument (identifier_fresh) identifier_fresh (identifier_fresh) identifier_fresh )keyword_argument (keyword_argument (identifier_default) identifier_default (identifier_missing) identifier_missing )keyword_argument )argument_list )call (identifier_missing) identifier_missing )comparison_operator )return_statement )block )function_definition )module
Check if key exists :param key: the name of setting variable :param fresh: if key should be taken from source direclty :return: Boolean
(module (function_definition (function_name_set_logger) function_name_set_logger (parameters (identifier_self) identifier_self (default_parameter (identifier_log_level) identifier_log_level (attribute (identifier_logging) identifier_logging (identifier_INFO) identifier_INFO )attribute )default_parameter )parameters (block (expression_statement (call (attribute (identifier_logging) identifier_logging (identifier_basicConfig) identifier_basicConfig )attribute (argument_list (keyword_argument (identifier_format) identifier_format (string_'%(asctime)s - %(levelname)s - %(name)s - %(message)s') string_'%(asctime)s - %(levelname)s - %(name)s - %(message)s' )keyword_argument (keyword_argument (identifier_level) identifier_level (identifier_log_level) identifier_log_level )keyword_argument (keyword_argument (identifier_stream) identifier_stream (attribute (identifier_sys) identifier_sys (identifier_stderr) identifier_stderr )attribute )keyword_argument )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_logger) identifier_logger )attribute (call (attribute (identifier_logging) identifier_logging (identifier_getLogger) identifier_getLogger )attribute (argument_list (identifier___name__) identifier___name__ )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (call (attribute (identifier_logging) identifier_logging (identifier_getLogger) identifier_getLogger )attribute (argument_list (string_'requests') string_'requests' )argument_list )call (identifier_setLevel) identifier_setLevel )attribute (argument_list (attribute (identifier_logging) identifier_logging (identifier_WARNING) identifier_WARNING )attribute )argument_list )call )expression_statement )block )function_definition )module
Configure the logger with log_level.
(module (function_definition (function_name_asdict) function_name_asdict (parameters (identifier_self) identifier_self )parameters (type (generic_type (identifier_Dict) identifier_Dict (type_parameter (type (identifier_str) identifier_str )type (type (generic_type (identifier_Union) identifier_Union (type_parameter (type (identifier_Dict) identifier_Dict )type (type (generic_type (identifier_Union) identifier_Union (type_parameter (type (identifier_str) identifier_str )type (type (identifier_Dict) identifier_Dict )type )type_parameter )generic_type )type )type_parameter )generic_type )type )type_parameter )generic_type )type (block (return_statement (dictionary (pair (string_"service") string_"service" (attribute (attribute (identifier_self) identifier_self (identifier_service) identifier_service )attribute (identifier_name) identifier_name )attribute )pair (dictionary_splat (call (attribute (attribute (identifier_self) identifier_self (identifier_signature) identifier_signature )attribute (identifier_serialize) identifier_serialize )attribute (argument_list )argument_list )call )dictionary_splat )dictionary )return_statement )block )function_definition )module
Return a dictionary describing the method. This can be used to dump the information into a JSON file.
(module (function_definition (function_name_decode) function_name_decode (parameters (identifier_obj) identifier_obj (identifier_content_type) identifier_content_type )parameters (block (try_statement (block (expression_statement (assignment (identifier_decoder) identifier_decoder (subscript (identifier__decoders_map) identifier__decoders_map (identifier_content_type) identifier_content_type )subscript )assignment )expression_statement (return_statement (call (identifier_decoder) identifier_decoder (argument_list (identifier_obj) identifier_obj )argument_list )call )return_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (raise_statement (call (attribute (identifier__errors) identifier__errors (identifier_UnsupportedFormatError) identifier_UnsupportedFormatError )attribute (argument_list (identifier_content_type) identifier_content_type )argument_list )call )raise_statement )block )except_clause )try_statement )block )function_definition )module
Decode an object ton a one of the default content types to a numpy array. Args: obj (object): to be decoded. content_type (str): content type to be used. Returns: np.array: decoded object.
(module (function_definition (function_name_AddMonths) function_name_AddMonths (parameters (identifier_start_date) identifier_start_date (identifier_months) identifier_months )parameters (block (expression_statement (assignment (identifier_current_date) identifier_current_date (identifier_start_date) identifier_start_date )assignment )expression_statement (expression_statement (assignment (identifier_i) identifier_i (integer_0) integer_0 )assignment )expression_statement (while_statement (comparison_operator (identifier_i) identifier_i (identifier_months) identifier_months )comparison_operator (block (expression_statement (assignment (identifier_month_days) identifier_month_days (subscript (call (attribute (identifier_calendar) identifier_calendar (identifier_monthrange) identifier_monthrange )attribute (argument_list (attribute (identifier_current_date) identifier_current_date (identifier_year) identifier_year )attribute (attribute (identifier_current_date) identifier_current_date (identifier_month) identifier_month )attribute )argument_list )call (integer_1) integer_1 )subscript )assignment )expression_statement (expression_statement (augmented_assignment (identifier_current_date) identifier_current_date (call (identifier_timedelta) identifier_timedelta (argument_list (keyword_argument (identifier_days) identifier_days (identifier_month_days) identifier_month_days )keyword_argument )argument_list )call )augmented_assignment )expression_statement (expression_statement (augmented_assignment (identifier_i) identifier_i (integer_1) integer_1 )augmented_assignment )expression_statement )block )while_statement (return_statement (identifier_current_date) identifier_current_date )return_statement )block )function_definition )module
A simple convenience utility for adding months to a given start date. This increments the months by adding the number of days in the current month to the current month, for each month. Args: start_date: date The date months are being added to. months: int The number of months to add. Returns: A date equal to the start date incremented by the given number of months.
(module (function_definition (function_name__check_uuid_fmt) function_name__check_uuid_fmt (parameters (identifier_self) identifier_self )parameters (block (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_uuid_fmt) identifier_uuid_fmt )attribute (attribute (identifier_UUIDField) identifier_UUIDField (identifier_FORMATS) identifier_FORMATS )attribute )comparison_operator (block (raise_statement (call (identifier_FieldValueRangeException) identifier_FieldValueRangeException (argument_list (call (attribute (string_"Unsupported uuid_fmt ({})") string_"Unsupported uuid_fmt ({})" (identifier_format) identifier_format )attribute (argument_list (attribute (identifier_self) identifier_self (identifier_uuid_fmt) identifier_uuid_fmt )attribute )argument_list )call )argument_list )call )raise_statement )block )if_statement )block )function_definition )module
Checks .uuid_fmt, and raises an exception if it is not valid.
(module (function_definition (function_name_setOverlayRaw) function_name_setOverlayRaw (parameters (identifier_self) identifier_self (identifier_ulOverlayHandle) identifier_ulOverlayHandle (identifier_pvBuffer) identifier_pvBuffer (identifier_unWidth) identifier_unWidth (identifier_unHeight) identifier_unHeight (identifier_unDepth) identifier_unDepth )parameters (block (expression_statement (assignment (identifier_fn) identifier_fn (attribute (attribute (identifier_self) identifier_self (identifier_function_table) identifier_function_table )attribute (identifier_setOverlayRaw) identifier_setOverlayRaw )attribute )assignment )expression_statement (expression_statement (assignment (identifier_result) identifier_result (call (identifier_fn) identifier_fn (argument_list (identifier_ulOverlayHandle) identifier_ulOverlayHandle (identifier_pvBuffer) identifier_pvBuffer (identifier_unWidth) identifier_unWidth (identifier_unHeight) identifier_unHeight (identifier_unDepth) identifier_unDepth )argument_list )call )assignment )expression_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Separate interface for providing the data as a stream of bytes, but there is an upper bound on data that can be sent. This function can only be called by the overlay's renderer process.
(module (function_definition (function_name_mv) function_name_mv (parameters (identifier_hdfs_src) identifier_hdfs_src (identifier_hdfs_dst) identifier_hdfs_dst )parameters (block (expression_statement (assignment (identifier_cmd) identifier_cmd (binary_operator (string_"hadoop fs -mv %s %s") string_"hadoop fs -mv %s %s" (tuple (identifier_hdfs_src) identifier_hdfs_src (identifier_hdfs_dst) identifier_hdfs_dst )tuple )binary_operator )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_rcode) identifier_rcode (identifier_stdout) identifier_stdout (identifier_stderr) identifier_stderr )pattern_list (call (identifier__checked_hadoop_fs_command) identifier__checked_hadoop_fs_command (argument_list (identifier_cmd) identifier_cmd )argument_list )call )assignment )expression_statement )block )function_definition )module
Move a file on hdfs :param hdfs_src: Source (str) :param hdfs_dst: Destination (str) :raises: IOError: If unsuccessful
(module (function_definition (function_name_make_analogous_scheme) function_name_make_analogous_scheme (parameters (identifier_self) identifier_self (default_parameter (identifier_angle) identifier_angle (integer_30) integer_30 )default_parameter (default_parameter (identifier_mode) identifier_mode (string_'ryb') string_'ryb' )default_parameter )parameters (block (expression_statement (assignment (pattern_list (identifier_h) identifier_h (identifier_s) identifier_s (identifier_l) identifier_l )pattern_list (attribute (identifier_self) identifier_self (identifier___hsl) identifier___hsl )attribute )assignment )expression_statement (if_statement (comparison_operator (identifier_mode) identifier_mode (string_'ryb') string_'ryb' )comparison_operator (block (expression_statement (assignment (identifier_h) identifier_h (call (identifier_rgb_to_ryb) identifier_rgb_to_ryb (argument_list (identifier_h) identifier_h )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (augmented_assignment (identifier_h) identifier_h (integer_360) integer_360 )augmented_assignment )expression_statement (expression_statement (assignment (identifier_h1) identifier_h1 (binary_operator (parenthesized_expression (binary_operator (identifier_h) identifier_h (identifier_angle) identifier_angle )binary_operator )parenthesized_expression (integer_360) integer_360 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_h2) identifier_h2 (binary_operator (parenthesized_expression (binary_operator (identifier_h) identifier_h (identifier_angle) identifier_angle )binary_operator )parenthesized_expression (integer_360) integer_360 )binary_operator )assignment )expression_statement (if_statement (comparison_operator (identifier_mode) identifier_mode (string_'ryb') string_'ryb' )comparison_operator (block (expression_statement (assignment (identifier_h1) identifier_h1 (call (identifier_ryb_to_rgb) identifier_ryb_to_rgb (argument_list (identifier_h1) identifier_h1 )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_h2) identifier_h2 (call (identifier_ryb_to_rgb) identifier_ryb_to_rgb (argument_list (identifier_h2) identifier_h2 )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (tuple (call (identifier_Color) identifier_Color (argument_list (tuple (identifier_h1) identifier_h1 (identifier_s) identifier_s (identifier_l) identifier_l )tuple (string_'hsl') string_'hsl' (attribute (identifier_self) identifier_self (identifier___a) identifier___a )attribute (attribute (identifier_self) identifier_self (identifier___wref) identifier___wref )attribute )argument_list )call (call (identifier_Color) identifier_Color (argument_list (tuple (identifier_h2) identifier_h2 (identifier_s) identifier_s (identifier_l) identifier_l )tuple (string_'hsl') string_'hsl' (attribute (identifier_self) identifier_self (identifier___a) identifier___a )attribute (attribute (identifier_self) identifier_self (identifier___wref) identifier___wref )attribute )argument_list )call )tuple )return_statement )block )function_definition )module
Return two colors analogous to this one. Args: :angle: The angle between the hues of the created colors and this one. :mode: Select which color wheel to use for the generation (ryb/rgb). Returns: A tuple of grapefruit.Colors analogous to this one. >>> c1 = Color.from_hsl(30, 1, 0.5) >>> c2, c3 = c1.make_analogous_scheme(angle=60, mode='rgb') >>> c2.hsl (330.0, 1.0, 0.5) >>> c3.hsl (90.0, 1.0, 0.5) >>> c2, c3 = c1.make_analogous_scheme(angle=10, mode='rgb') >>> c2.hsl (20.0, 1.0, 0.5) >>> c3.hsl (40.0, 1.0, 0.5)
(module (function_definition (function_name_get_cust_cols) function_name_get_cust_cols (parameters (identifier_path) identifier_path )parameters (block (expression_statement (assignment (identifier_required_keys) identifier_required_keys (list (string_"title") string_"title" (string_"id") string_"id" (string_"sType") string_"sType" (string_"visible") string_"visible" )list )assignment )expression_statement (with_statement (with_clause (with_item (as_pattern (call (identifier_open) identifier_open (argument_list (identifier_path) identifier_path (string_'r') string_'r' )argument_list )call (as_pattern_target (identifier_f) identifier_f )as_pattern_target )as_pattern )with_item )with_clause (block (try_statement (block (expression_statement (assignment (identifier_cust_cols) identifier_cust_cols (call (attribute (identifier_ast) identifier_ast (identifier_literal_eval) identifier_literal_eval )attribute (argument_list (call (attribute (identifier_f) identifier_f (identifier_read) identifier_read )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement )block (except_clause (as_pattern (identifier_Exception) identifier_Exception (as_pattern_target (identifier_err) identifier_err )as_pattern_target )as_pattern (block (expression_statement (call (attribute (attribute (identifier_sys) identifier_sys (identifier_stderr) identifier_stderr )attribute (identifier_write) identifier_write )attribute (argument_list (call (attribute (string_"Invalid custom columns file: {}\n") string_"Invalid custom columns file: {}\n" (identifier_format) identifier_format )attribute (argument_list (identifier_path) identifier_path )argument_list )call )argument_list )call )expression_statement (expression_statement (call (attribute (attribute (identifier_sys) identifier_sys (identifier_stderr) identifier_stderr )attribute (identifier_write) identifier_write )attribute (argument_list (call (attribute (string_"{}\n") string_"{}\n" (identifier_format) identifier_format )attribute (argument_list (identifier_err) identifier_err )argument_list )call )argument_list )call )expression_statement (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 )except_clause )try_statement )block )with_statement (for_statement (identifier_col) identifier_col (identifier_cust_cols) identifier_cust_cols (block (for_statement (identifier_required_key) identifier_required_key (identifier_required_keys) identifier_required_keys (block (if_statement (comparison_operator (identifier_required_key) identifier_required_key (identifier_col) identifier_col )comparison_operator (block (expression_statement (call (attribute (attribute (identifier_sys) identifier_sys (identifier_stderr) identifier_stderr )attribute (identifier_write) identifier_write )attribute (argument_list (call (attribute (concatenated_string (string_"Missing required key '{}' in custom ") string_"Missing required key '{}' in custom " (string_"column {}\n") string_"column {}\n" )concatenated_string (identifier_format) identifier_format )attribute (argument_list (identifier_required_key) identifier_required_key (identifier_col) identifier_col )argument_list )call )argument_list )call )expression_statement (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 (if_statement (boolean_operator (comparison_operator (string_"jsonxs") string_"jsonxs" (identifier_col) identifier_col )comparison_operator (comparison_operator (string_"tpl") string_"tpl" (identifier_col) identifier_col )comparison_operator )boolean_operator (block (expression_statement (call (attribute (attribute (identifier_sys) identifier_sys (identifier_stderr) identifier_stderr )attribute (identifier_write) identifier_write )attribute (argument_list (call (attribute (concatenated_string (string_"You need to specify 'jsonxs' or 'tpl' ") string_"You need to specify 'jsonxs' or 'tpl' " (string_"for custom column {}\n") string_"for custom column {}\n" )concatenated_string (identifier_format) identifier_format )attribute (argument_list (identifier_col) identifier_col )argument_list )call )argument_list )call )expression_statement (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 )for_statement )block )for_statement (return_statement (identifier_cust_cols) identifier_cust_cols )return_statement )block )function_definition )module
Load custom column definitions.
(module (function_definition (function_name_ok) function_name_ok (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (pattern_list (identifier_rgb) identifier_rgb (identifier_hsv) identifier_hsv (identifier_hexa) identifier_hexa )pattern_list (call (attribute (attribute (identifier_self) identifier_self (identifier_square) identifier_square )attribute (identifier_get) identifier_get )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (attribute (identifier_self) identifier_self (identifier_alpha_channel) identifier_alpha_channel )attribute (block (expression_statement (assignment (identifier_hexa) identifier_hexa (call (attribute (attribute (identifier_self) identifier_self (identifier_hexa) identifier_hexa )attribute (identifier_get) identifier_get )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (augmented_assignment (identifier_rgb) identifier_rgb (tuple (call (attribute (attribute (identifier_self) identifier_self (identifier_alpha) identifier_alpha )attribute (identifier_get) identifier_get )attribute (argument_list )argument_list )call )tuple )augmented_assignment )expression_statement )block )if_statement (expression_statement (assignment (attribute (identifier_self) identifier_self (identifier_color) identifier_color )attribute (expression_list (identifier_rgb) identifier_rgb (identifier_hsv) identifier_hsv (identifier_hexa) identifier_hexa )expression_list )assignment )expression_statement (expression_statement (call (attribute (identifier_self) identifier_self (identifier_destroy) identifier_destroy )attribute (argument_list )argument_list )call )expression_statement )block )function_definition )module
Validate color selection and destroy dialog.
(module (function_definition (function_name_create_config) function_name_create_config (parameters (identifier_self) identifier_self (identifier_name) identifier_name (identifier_data) identifier_data (default_parameter (identifier_labels) identifier_labels (None) None )default_parameter )parameters (block (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_data) identifier_data (identifier_bytes) identifier_bytes )argument_list )call )not_operator (block (expression_statement (assignment (identifier_data) identifier_data (call (attribute (identifier_data) identifier_data (identifier_encode) identifier_encode )attribute (argument_list (string_'utf-8') string_'utf-8' )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_data) identifier_data (call (attribute (identifier_base64) identifier_base64 (identifier_b64encode) identifier_b64encode )attribute (argument_list (identifier_data) identifier_data )argument_list )call )assignment )expression_statement (if_statement (attribute (identifier_six) identifier_six (identifier_PY3) identifier_PY3 )attribute (block (expression_statement (assignment (identifier_data) identifier_data (call (attribute (identifier_data) identifier_data (identifier_decode) identifier_decode )attribute (argument_list (string_'ascii') string_'ascii' )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_body) identifier_body (dictionary (pair (string_'Data') string_'Data' (identifier_data) identifier_data )pair (pair (string_'Name') string_'Name' (identifier_name) identifier_name )pair (pair (string_'Labels') string_'Labels' (identifier_labels) identifier_labels )pair )dictionary )assignment )expression_statement (expression_statement (assignment (identifier_url) identifier_url (call (attribute (identifier_self) identifier_self (identifier__url) identifier__url )attribute (argument_list (string_'/configs/create') string_'/configs/create' )argument_list )call )assignment )expression_statement (return_statement (call (attribute (identifier_self) identifier_self (identifier__result) identifier__result )attribute (argument_list (call (attribute (identifier_self) identifier_self (identifier__post_json) identifier__post_json )attribute (argument_list (identifier_url) identifier_url (keyword_argument (identifier_data) identifier_data (identifier_body) identifier_body )keyword_argument )argument_list )call (True) True )argument_list )call )return_statement )block )function_definition )module
Create a config Args: name (string): Name of the config data (bytes): Config data to be stored labels (dict): A mapping of labels to assign to the config Returns (dict): ID of the newly created config
(module (function_definition (function_name_getClient) function_name_getClient (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_client) identifier_client (call (attribute (call (attribute (call (attribute (identifier_self) identifier_self (identifier_Schema) identifier_Schema )attribute (argument_list )argument_list )call (identifier_getField) identifier_getField )attribute (argument_list (string_'Client') string_'Client' )argument_list )call (identifier_get) identifier_get )attribute (argument_list (identifier_self) identifier_self )argument_list )call )assignment )expression_statement (if_statement (identifier_client) identifier_client (block (return_statement (identifier_client) identifier_client )return_statement )block )if_statement (expression_statement (assignment (identifier_client) identifier_client (attribute (identifier_self) identifier_self (identifier_aq_parent) identifier_aq_parent )attribute )assignment )expression_statement (if_statement (call (attribute (identifier_IClient) identifier_IClient (identifier_providedBy) identifier_providedBy )attribute (argument_list (identifier_client) identifier_client )argument_list )call (block (return_statement (identifier_client) identifier_client )return_statement )block )if_statement )block )function_definition )module
Retrieves the Client for which the current Batch is attached to Tries to retrieve the Client from the Schema property, but if not found, searches for linked ARs and retrieve the Client from the first one. If the Batch has no client, returns None.
(module (function_definition (function_name__get_home) function_name__get_home (parameters )parameters (block (try_statement (block (if_statement (boolean_operator (attribute (identifier_six) identifier_six (identifier_PY2) identifier_PY2 )attribute (comparison_operator (attribute (identifier_sys) identifier_sys (identifier_platform) identifier_platform )attribute (string_'win32') string_'win32' )comparison_operator )boolean_operator (block (expression_statement (assignment (identifier_path) identifier_path (call (attribute (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_expanduser) identifier_expanduser )attribute (argument_list (string_b"~") string_b"~" )argument_list )call (identifier_decode) identifier_decode )attribute (argument_list (call (attribute (identifier_sys) identifier_sys (identifier_getfilesystemencoding) identifier_getfilesystemencoding )attribute (argument_list )argument_list )call )argument_list )call )assignment )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_path) identifier_path (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_expanduser) identifier_expanduser )attribute (argument_list (string_"~") string_"~" )argument_list )call )assignment )expression_statement )block )else_clause )if_statement )block (except_clause (identifier_ImportError) identifier_ImportError (block (pass_statement )pass_statement )block )except_clause (else_clause (block (if_statement (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isdir) identifier_isdir )attribute (argument_list (identifier_path) identifier_path )argument_list )call (block (return_statement (identifier_path) identifier_path )return_statement )block )if_statement )block )else_clause )try_statement (for_statement (identifier_evar) identifier_evar (tuple (string_'HOME') string_'HOME' (string_'USERPROFILE') string_'USERPROFILE' (string_'TMP') string_'TMP' )tuple (block (expression_statement (assignment (identifier_path) identifier_path (call (attribute (attribute (identifier_os) identifier_os (identifier_environ) identifier_environ )attribute (identifier_get) identifier_get )attribute (argument_list (identifier_evar) identifier_evar )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_path) identifier_path (None) None )comparison_operator (call (attribute (attribute (identifier_os) identifier_os (identifier_path) identifier_path )attribute (identifier_isdir) identifier_isdir )attribute (argument_list (identifier_path) identifier_path )argument_list )call )boolean_operator (block (return_statement (identifier_path) identifier_path )return_statement )block )if_statement )block )for_statement (return_statement (None) None )return_statement )block )function_definition )module
Find user's home directory if possible. Otherwise, returns None. :see: http://mail.python.org/pipermail/python-list/2005-February/325395.html This function is copied from matplotlib version 1.4.3, Jan 2016
(module (function_definition (function_name_get_mor_by_property) function_name_get_mor_by_property (parameters (identifier_service_instance) identifier_service_instance (identifier_object_type) identifier_object_type (identifier_property_value) identifier_property_value (default_parameter (identifier_property_name) identifier_property_name (string_'name') string_'name' )default_parameter (default_parameter (identifier_container_ref) identifier_container_ref (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_object_list) identifier_object_list (call (identifier_get_mors_with_properties) identifier_get_mors_with_properties (argument_list (identifier_service_instance) identifier_service_instance (identifier_object_type) identifier_object_type (keyword_argument (identifier_property_list) identifier_property_list (list (identifier_property_name) identifier_property_name )list )keyword_argument (keyword_argument (identifier_container_ref) identifier_container_ref (identifier_container_ref) identifier_container_ref )keyword_argument )argument_list )call )assignment )expression_statement (for_statement (identifier_obj) identifier_obj (identifier_object_list) identifier_object_list (block (expression_statement (assignment (identifier_obj_id) identifier_obj_id (call (attribute (call (attribute (identifier_six) identifier_six (identifier_text_type) identifier_text_type )attribute (argument_list (call (attribute (identifier_obj) identifier_obj (identifier_get) identifier_get )attribute (argument_list (string_'object') string_'object' (string_'') string_'' )argument_list )call )argument_list )call (identifier_strip) identifier_strip )attribute (argument_list (string_'\'"') string_'\'"' )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (subscript (identifier_obj) identifier_obj (identifier_property_name) identifier_property_name )subscript (identifier_property_value) identifier_property_value )comparison_operator (comparison_operator (identifier_property_value) identifier_property_value (identifier_obj_id) identifier_obj_id )comparison_operator )boolean_operator (block (return_statement (subscript (identifier_obj) identifier_obj (string_'object') string_'object' )subscript )return_statement )block )if_statement )block )for_statement (return_statement (None) None )return_statement )block )function_definition )module
Returns the first managed object reference having the specified property value. service_instance The Service Instance from which to obtain managed object references. object_type The type of content for which to obtain managed object references. property_value The name of the property for which to obtain the managed object reference. property_name An object property used to return the specified object reference results. Defaults to ``name``. container_ref An optional reference to the managed object to search under. Can either be an object of type Folder, Datacenter, ComputeResource, Resource Pool or HostSystem. If not specified, default behaviour is to search under the inventory rootFolder.
(module (function_definition (function_name__unpack) function_name__unpack (parameters (identifier_self) identifier_self (identifier_content) identifier_content )parameters (block (if_statement (attribute (identifier_self) identifier_self (identifier_compressor) identifier_compressor )attribute (block (try_statement (block (expression_statement (assignment (identifier_content) identifier_content (call (attribute (attribute (identifier_self) identifier_self (identifier_compressor) identifier_compressor )attribute (identifier_decompress) identifier_decompress )attribute (argument_list (identifier_content) identifier_content )argument_list )call )assignment )expression_statement )block (except_clause (identifier_CompressError) identifier_CompressError (block (pass_statement )pass_statement )block )except_clause )try_statement )block )if_statement (if_statement (attribute (identifier_self) identifier_self (identifier_serializer) identifier_serializer )attribute (block (expression_statement (assignment (identifier_content) identifier_content (call (attribute (attribute (identifier_self) identifier_self (identifier_serializer) identifier_serializer )attribute (identifier_deserialize) identifier_deserialize )attribute (argument_list (identifier_content) identifier_content )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (identifier_content) identifier_content )return_statement )block )function_definition )module
unpack cache using serializer and compressor
(module (function_definition (function_name_clear) function_name_clear (parameters (identifier_self) identifier_self (default_parameter (identifier_objtype) identifier_objtype (list )list )default_parameter )parameters (block (expression_statement (identifier_r) identifier_r )expression_statement (if_statement (comparison_operator (call (identifier_len) identifier_len (argument_list (identifier_objtype) identifier_objtype )argument_list )call (integer_0) integer_0 )comparison_operator (block (expression_statement (call (attribute (call (identifier_super) identifier_super (argument_list )argument_list )call (identifier_clear) identifier_clear )attribute (argument_list )argument_list )call )expression_statement )block (else_clause (block (expression_statement (assignment (identifier_names) identifier_names (list_comprehension (attribute (identifier_obj) identifier_obj (identifier_name) identifier_name )attribute (for_in_clause (identifier_obj) identifier_obj (identifier_self) identifier_self )for_in_clause )list_comprehension )assignment )expression_statement (for_statement (identifier_name) identifier_name (identifier_names) identifier_names (block (try_statement (block (expression_statement (assignment (identifier_obj) identifier_obj (subscript (identifier_self) identifier_self (identifier_name) identifier_name )subscript )assignment )expression_statement (for_statement (identifier_t) identifier_t (identifier_objtype) identifier_objtype (block (if_statement (call (attribute (identifier_obj) identifier_obj (identifier__isa) identifier__isa )attribute (argument_list (identifier_t) identifier_t )argument_list )call (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_purge_object) identifier_purge_object )attribute (argument_list (identifier_obj) identifier_obj )argument_list )call )expression_statement )block )if_statement )block )for_statement )block (except_clause (identifier_KeyError) identifier_KeyError (block (pass_statement )pass_statement )block )except_clause )try_statement )block )for_statement )block )else_clause )if_statement )block )function_definition )module
r""" Clears objects from the project entirely or selectively, depdening on the received arguments. Parameters ---------- objtype : list of strings A list containing the object type(s) to be removed. If no types are specified, then all objects are removed. To clear only objects of a specific type, use *'network'*, *'geometry'*, *'phase'*, *'physics'*, or *'algorithm'*. It's also possible to use abbreviations, like *'geom'*.
(module (function_definition (function_name_create_user) function_name_create_user (parameters (identifier_self) identifier_self (identifier_claims) identifier_claims )parameters (block (expression_statement (assignment (identifier_username_claim) identifier_username_claim (attribute (identifier_settings) identifier_settings (identifier_USERNAME_CLAIM) identifier_USERNAME_CLAIM )attribute )assignment )expression_statement (expression_statement (assignment (identifier_usermodel) identifier_usermodel (call (identifier_get_user_model) identifier_get_user_model (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (pattern_list (identifier_user) identifier_user (identifier_created) identifier_created )pattern_list (call (attribute (attribute (identifier_usermodel) identifier_usermodel (identifier_objects) identifier_objects )attribute (identifier_get_or_create) identifier_get_or_create )attribute (argument_list (dictionary_splat (dictionary (pair (attribute (identifier_usermodel) identifier_usermodel (identifier_USERNAME_FIELD) identifier_USERNAME_FIELD )attribute (subscript (identifier_claims) identifier_claims (identifier_username_claim) identifier_username_claim )subscript )pair )dictionary )dictionary_splat )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (identifier_created) identifier_created (not_operator (attribute (identifier_user) identifier_user (identifier_password) identifier_password )attribute )not_operator )boolean_operator (block (expression_statement (call (attribute (identifier_user) identifier_user (identifier_set_unusable_password) identifier_set_unusable_password )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (call (attribute (string_"User '{}' has been created.") string_"User '{}' has been created." (identifier_format) identifier_format )attribute (argument_list (subscript (identifier_claims) identifier_claims (identifier_username_claim) identifier_username_claim )subscript )argument_list )call )argument_list )call )expression_statement )block )if_statement (return_statement (identifier_user) identifier_user )return_statement )block )function_definition )module
Create the user if it doesn't exist yet Args: claims (dict): claims from the access token Returns: django.contrib.auth.models.User: A Django user
(module (function_definition (function_name_NewFromJSON) function_name_NewFromJSON (parameters (identifier_data) identifier_data )parameters (block (expression_statement (assignment (identifier_s) identifier_s (call (identifier_Shake) identifier_Shake (argument_list (keyword_argument (identifier_id) identifier_id (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'id') string_'id' (None) None )argument_list )call )keyword_argument (keyword_argument (identifier_name) identifier_name (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'name') string_'name' (None) None )argument_list )call )keyword_argument (keyword_argument (identifier_url) identifier_url (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'url') string_'url' (None) None )argument_list )call )keyword_argument (keyword_argument (identifier_thumbnail_url) identifier_thumbnail_url (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'thumbnail_url') string_'thumbnail_url' (None) None )argument_list )call )keyword_argument (keyword_argument (identifier_description) identifier_description (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'description') string_'description' (None) None )argument_list )call )keyword_argument (keyword_argument (identifier_type) identifier_type (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'type') string_'type' (None) None )argument_list )call )keyword_argument (keyword_argument (identifier_created_at) identifier_created_at (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'created_at') string_'created_at' (None) None )argument_list )call )keyword_argument (keyword_argument (identifier_updated_at) identifier_updated_at (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'updated_at') string_'updated_at' (None) None )argument_list )call )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'owner') string_'owner' (None) None )argument_list )call (block (expression_statement (assignment (attribute (identifier_s) identifier_s (identifier_owner) identifier_owner )attribute (call (attribute (identifier_User) identifier_User (identifier_NewFromJSON) identifier_NewFromJSON )attribute (argument_list (call (attribute (identifier_data) identifier_data (identifier_get) identifier_get )attribute (argument_list (string_'owner') string_'owner' (None) None )argument_list )call )argument_list )call )assignment )expression_statement )block )if_statement (return_statement (identifier_s) identifier_s )return_statement )block )function_definition )module
Create a new Shake instance from a JSON dict. Args: data (dict): JSON dictionary representing a Shake. Returns: A Shake instance.
(module (function_definition (function_name_from_design_day_properties) function_name_from_design_day_properties (parameters (identifier_cls) identifier_cls (identifier_name) identifier_name (identifier_day_type) identifier_day_type (identifier_location) identifier_location (identifier_analysis_period) identifier_analysis_period (identifier_dry_bulb_max) identifier_dry_bulb_max (identifier_dry_bulb_range) identifier_dry_bulb_range (identifier_humidity_type) identifier_humidity_type (identifier_humidity_value) identifier_humidity_value (identifier_barometric_p) identifier_barometric_p (identifier_wind_speed) identifier_wind_speed (identifier_wind_dir) identifier_wind_dir (identifier_sky_model) identifier_sky_model (identifier_sky_properties) identifier_sky_properties )parameters (block (expression_statement (assignment (identifier_dry_bulb_condition) identifier_dry_bulb_condition (call (identifier_DryBulbCondition) identifier_DryBulbCondition (argument_list (identifier_dry_bulb_max) identifier_dry_bulb_max (identifier_dry_bulb_range) identifier_dry_bulb_range )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_humidity_condition) identifier_humidity_condition (call (identifier_HumidityCondition) identifier_HumidityCondition (argument_list (identifier_humidity_type) identifier_humidity_type (identifier_humidity_value) identifier_humidity_value (identifier_barometric_p) identifier_barometric_p )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_wind_condition) identifier_wind_condition (call (identifier_WindCondition) identifier_WindCondition (argument_list (identifier_wind_speed) identifier_wind_speed (identifier_wind_dir) identifier_wind_dir )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_sky_model) identifier_sky_model (string_'ASHRAEClearSky') string_'ASHRAEClearSky' )comparison_operator (block (expression_statement (assignment (identifier_sky_condition) identifier_sky_condition (call (attribute (identifier_OriginalClearSkyCondition) identifier_OriginalClearSkyCondition (identifier_from_analysis_period) identifier_from_analysis_period )attribute (argument_list (identifier_analysis_period) identifier_analysis_period (subscript (identifier_sky_properties) identifier_sky_properties (integer_0) integer_0 )subscript )argument_list )call )assignment )expression_statement )block (elif_clause (comparison_operator (identifier_sky_model) identifier_sky_model (string_'ASHRAETau') string_'ASHRAETau' )comparison_operator (block (expression_statement (assignment (identifier_sky_condition) identifier_sky_condition (call (attribute (identifier_RevisedClearSkyCondition) identifier_RevisedClearSkyCondition (identifier_from_analysis_period) identifier_from_analysis_period )attribute (argument_list (identifier_analysis_period) identifier_analysis_period (subscript (identifier_sky_properties) identifier_sky_properties (integer_0) integer_0 )subscript (subscript (identifier_sky_properties) identifier_sky_properties (unary_operator (integer_1) integer_1 )unary_operator )subscript )argument_list )call )assignment )expression_statement )block )elif_clause )if_statement (return_statement (call (identifier_cls) identifier_cls (argument_list (identifier_name) identifier_name (identifier_day_type) identifier_day_type (identifier_location) identifier_location (identifier_dry_bulb_condition) identifier_dry_bulb_condition (identifier_humidity_condition) identifier_humidity_condition (identifier_wind_condition) identifier_wind_condition (identifier_sky_condition) identifier_sky_condition )argument_list )call )return_statement )block )function_definition )module
Create a design day object from various key properties. Args: name: A text string to set the name of the design day day_type: Choose from 'SummerDesignDay', 'WinterDesignDay' or other EnergyPlus days location: Location for the design day analysis_period: Analysis period for the design day dry_bulb_max: Maximum dry bulb temperature over the design day (in C). dry_bulb_range: Dry bulb range over the design day (in C). humidity_type: Type of humidity to use. Choose from Wetbulb, Dewpoint, HumidityRatio, Enthalpy humidity_value: The value of the condition above. barometric_p: Barometric pressure in Pa. wind_speed: Wind speed over the design day in m/s. wind_dir: Wind direction over the design day in degrees. sky_model: Type of solar model to use. Choose from ASHRAEClearSky, ASHRAETau sky_properties: A list of properties describing the sky above. For ASHRAEClearSky this is a single value for clearness For ASHRAETau, this is the tau_beam and tau_diffuse
(module (function_definition (function_name_get_query) function_name_get_query (parameters (identifier_self) identifier_self (default_parameter (identifier_query_params) identifier_query_params (None) None )default_parameter )parameters (block (if_statement (comparison_operator (identifier_query_params) identifier_query_params (None) None )comparison_operator (block (expression_statement (assignment (identifier_query_params) identifier_query_params (dictionary )dictionary )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_query) identifier_query (string_'') string_'' )assignment )expression_statement (expression_statement (assignment (subscript (identifier_query_params) identifier_query_params (string_'idSite') string_'idSite' )subscript (attribute (identifier_self) identifier_self (identifier_site_id) identifier_site_id )attribute )assignment )expression_statement (if_statement (comparison_operator (attribute (identifier_self) identifier_self (identifier_api_token) identifier_api_token )attribute (None) None )comparison_operator (block (expression_statement (assignment (subscript (identifier_query_params) identifier_query_params (string_'token_auth') string_'token_auth' )subscript (attribute (identifier_self) identifier_self (identifier_api_token) identifier_api_token )attribute )assignment )expression_statement )block )if_statement (for_statement (pattern_list (identifier_key) identifier_key (identifier_value) identifier_value )pattern_list (call (attribute (identifier_query_params) identifier_query_params (identifier_iteritems) identifier_iteritems )attribute (argument_list )argument_list )call (block (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_value) identifier_value (identifier_list) identifier_list )argument_list )call (block (expression_statement (assignment (identifier_value) identifier_value (call (attribute (string_',') string_',' (identifier_join) identifier_join )attribute (argument_list (identifier_value) identifier_value )argument_list )call )assignment )expression_statement )block )if_statement (expression_statement (augmented_assignment (identifier_query) identifier_query (call (attribute (string_'{}={}&') string_'{}={}&' (identifier_format) identifier_format )attribute (argument_list (call (identifier_str) identifier_str (argument_list (identifier_key) identifier_key )argument_list )call (call (identifier_str) identifier_str (argument_list (identifier_value) identifier_value )argument_list )call )argument_list )call )augmented_assignment )expression_statement )block )for_statement (return_statement (subscript (identifier_query) identifier_query (slice (colon) colon (unary_operator (integer_1) integer_1 )unary_operator )slice )subscript )return_statement )block )function_definition )module
Return a query string
(module (function_definition (function_name_to_type) function_name_to_type (parameters (identifier_cls) identifier_cls (identifier_typename) identifier_typename )parameters (block (expression_statement (assignment (identifier_NAME_TYPES) identifier_NAME_TYPES (dictionary_comprehension (pair (subscript (attribute (identifier_cls) identifier_cls (identifier_TYPE_NAMES) identifier_TYPE_NAMES )attribute (identifier_x) identifier_x )subscript (identifier_x) identifier_x )pair (for_in_clause (identifier_x) identifier_x (attribute (identifier_cls) identifier_cls (identifier_TYPE_NAMES) identifier_TYPE_NAMES )attribute )for_in_clause )dictionary_comprehension )assignment )expression_statement (return_statement (call (attribute (identifier_NAME_TYPES) identifier_NAME_TYPES (identifier_get) identifier_get )attribute (argument_list (identifier_typename) identifier_typename (None) None )argument_list )call )return_statement )block )function_definition )module
Converts a type ID to name. On error returns None
(module (function_definition (function_name_MAH) function_name_MAH (parameters (identifier_z) identifier_z (identifier_zi) identifier_zi (identifier_Mi) identifier_Mi (dictionary_splat_pattern (identifier_cosmo) identifier_cosmo )dictionary_splat_pattern )parameters (block (expression_statement (assignment (identifier_z) identifier_z (call (attribute (identifier_np) identifier_np (identifier_array) identifier_array )attribute (argument_list (identifier_z) identifier_z (keyword_argument (identifier_ndmin) identifier_ndmin (integer_1) integer_1 )keyword_argument (keyword_argument (identifier_dtype) identifier_dtype (identifier_float) identifier_float )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_dMdt_array) identifier_dMdt_array (call (attribute (identifier_np) identifier_np (identifier_empty_like) identifier_empty_like )attribute (argument_list (identifier_z) identifier_z )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_Mz_array) identifier_Mz_array (call (attribute (identifier_np) identifier_np (identifier_empty_like) identifier_empty_like )attribute (argument_list (identifier_z) identifier_z )argument_list )call )assignment )expression_statement (for_statement (pattern_list (identifier_i_ind) identifier_i_ind (identifier_zval) identifier_zval )pattern_list (call (identifier_enumerate) identifier_enumerate (argument_list (identifier_z) identifier_z )argument_list )call (block (expression_statement (assignment (pattern_list (identifier_dMdt) identifier_dMdt (identifier_Mz) identifier_Mz )pattern_list (call (identifier_acc_rate) identifier_acc_rate (argument_list (identifier_zval) identifier_zval (identifier_zi) identifier_zi (identifier_Mi) identifier_Mi (dictionary_splat (identifier_cosmo) identifier_cosmo )dictionary_splat )argument_list )call )assignment )expression_statement (expression_statement (assignment (subscript (identifier_dMdt_array) identifier_dMdt_array (identifier_i_ind) identifier_i_ind )subscript (identifier_dMdt) identifier_dMdt )assignment )expression_statement (expression_statement (assignment (subscript (identifier_Mz_array) identifier_Mz_array (identifier_i_ind) identifier_i_ind )subscript (identifier_Mz) identifier_Mz )assignment )expression_statement )block )for_statement (return_statement (tuple (identifier_dMdt_array) identifier_dMdt_array (identifier_Mz_array) identifier_Mz_array )tuple )return_statement )block )function_definition )module
Calculate mass accretion history by looping function acc_rate over redshift steps 'z' for halo of mass 'Mi' at redshift 'zi' Parameters ---------- z : float / numpy array Redshift to output MAH over. Note zi<z always zi : float Redshift Mi : float Halo mass at redshift 'zi' cosmo : dict Dictionary of cosmological parameters, similar in format to: {'N_nu': 0,'Y_He': 0.24, 'h': 0.702, 'n': 0.963,'omega_M_0': 0.275, 'omega_b_0': 0.0458,'omega_lambda_0': 0.725,'omega_n_0': 0.0, 'sigma_8': 0.816, 't_0': 13.76, 'tau': 0.088,'z_reion': 10.6} Returns ------- (dMdt, Mz) : float / numpy arrays of equivalent size to 'z' Accretion rate [Msol/yr], halo mass [Msol] at redshift 'z'
(module (function_definition (function_name__generic_format) function_name__generic_format (parameters (identifier_self) identifier_self (identifier_raid_config) identifier_raid_config (default_parameter (identifier_controller) identifier_controller (None) None )default_parameter )parameters (block (expression_statement (assignment (identifier_logical_drives) identifier_logical_drives (subscript (identifier_raid_config) identifier_raid_config (string_"LogicalDrives") string_"LogicalDrives" )subscript )assignment )expression_statement (expression_statement (assignment (identifier_logical_disks) identifier_logical_disks (list )list )assignment )expression_statement (expression_statement (assignment (identifier_controller) identifier_controller (identifier_controller) identifier_controller )assignment )expression_statement (for_statement (identifier_ld) identifier_ld (identifier_logical_drives) identifier_logical_drives (block (expression_statement (assignment (identifier_prop) identifier_prop (dictionary (pair (string_'size_gb') string_'size_gb' (subscript (identifier_ld) identifier_ld (string_'CapacityGiB') string_'CapacityGiB' )subscript )pair (pair (string_'raid_level') string_'raid_level' (call (attribute (subscript (identifier_ld) identifier_ld (string_'Raid') string_'Raid' )subscript (identifier_strip) identifier_strip )attribute (argument_list (string_'Raid') string_'Raid' )argument_list )call )pair (pair (string_'root_device_hint') string_'root_device_hint' (dictionary (pair (string_'wwn') string_'wwn' (binary_operator (string_'0x') string_'0x' (subscript (identifier_ld) identifier_ld (string_'VolumeUniqueIdentifier') string_'VolumeUniqueIdentifier' )subscript )binary_operator )pair )dictionary )pair (pair (string_'controller') string_'controller' (identifier_controller) identifier_controller )pair (pair (string_'physical_disks') string_'physical_disks' (subscript (identifier_ld) identifier_ld (string_'DataDrives') string_'DataDrives' )subscript )pair (pair (string_'volume_name') string_'volume_name' (subscript (identifier_ld) identifier_ld (string_'LogicalDriveName') string_'LogicalDriveName' )subscript )pair )dictionary )assignment )expression_statement (expression_statement (call (attribute (identifier_logical_disks) identifier_logical_disks (identifier_append) identifier_append )attribute (argument_list (identifier_prop) identifier_prop )argument_list )call )expression_statement )block )for_statement (return_statement (identifier_logical_disks) identifier_logical_disks )return_statement )block )function_definition )module
Convert redfish data of current raid config to generic format. :param raid_config: Raid configuration dictionary :param controller: Array controller model in post_create read else None :returns: current raid config.
(module (function_definition (function_name__hasExplicitOid) function_name__hasExplicitOid (parameters (identifier_store) identifier_store (identifier_table) identifier_table )parameters (block (return_statement (call (identifier_any) identifier_any (generator_expression (comparison_operator (subscript (identifier_info) identifier_info (integer_1) integer_1 )subscript (string_'oid') string_'oid' )comparison_operator (for_in_clause (identifier_info) identifier_info (call (attribute (identifier_store) identifier_store (identifier_querySchemaSQL) identifier_querySchemaSQL )attribute (argument_list (call (attribute (string_'PRAGMA *DATABASE*.table_info({})') string_'PRAGMA *DATABASE*.table_info({})' (identifier_format) identifier_format )attribute (argument_list (identifier_table) identifier_table )argument_list )call )argument_list )call )for_in_clause )generator_expression )call )return_statement )block )function_definition )module
Does the given table have an explicit oid column?
(module (function_definition (function_name_do_reset_ids) function_name_do_reset_ids (parameters (identifier_concatenated_meta_df) identifier_concatenated_meta_df (identifier_data_df) identifier_data_df (identifier_concat_direction) identifier_concat_direction )parameters (block (if_statement (comparison_operator (identifier_concat_direction) identifier_concat_direction (string_"horiz") string_"horiz" )comparison_operator (block (assert_statement (call (attribute (attribute (identifier_concatenated_meta_df) identifier_concatenated_meta_df (identifier_index) identifier_index )attribute (identifier_equals) identifier_equals )attribute (argument_list (attribute (identifier_data_df) identifier_data_df (identifier_columns) identifier_columns )attribute )argument_list )call (parenthesized_expression (string_"cids in concatenated_meta_df do not agree with cids in data_df.") string_"cids in concatenated_meta_df do not agree with cids in data_df." )parenthesized_expression )assert_statement (expression_statement (call (identifier_reset_ids_in_meta_df) identifier_reset_ids_in_meta_df (argument_list (identifier_concatenated_meta_df) identifier_concatenated_meta_df )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_data_df) identifier_data_df (identifier_columns) identifier_columns )attribute (call (attribute (identifier_pd) identifier_pd (identifier_Index) identifier_Index )attribute (argument_list (attribute (attribute (identifier_concatenated_meta_df) identifier_concatenated_meta_df (identifier_index) identifier_index )attribute (identifier_values) identifier_values )attribute )argument_list )call )assignment )expression_statement )block (elif_clause (comparison_operator (identifier_concat_direction) identifier_concat_direction (string_"vert") string_"vert" )comparison_operator (block (assert_statement (call (attribute (attribute (identifier_concatenated_meta_df) identifier_concatenated_meta_df (identifier_index) identifier_index )attribute (identifier_equals) identifier_equals )attribute (argument_list (attribute (identifier_data_df) identifier_data_df (identifier_index) identifier_index )attribute )argument_list )call (parenthesized_expression (string_"rids in concatenated_meta_df do not agree with rids in data_df.") string_"rids in concatenated_meta_df do not agree with rids in data_df." )parenthesized_expression )assert_statement (expression_statement (call (identifier_reset_ids_in_meta_df) identifier_reset_ids_in_meta_df (argument_list (identifier_concatenated_meta_df) identifier_concatenated_meta_df )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_data_df) identifier_data_df (identifier_index) identifier_index )attribute (call (attribute (identifier_pd) identifier_pd (identifier_Index) identifier_Index )attribute (argument_list (attribute (attribute (identifier_concatenated_meta_df) identifier_concatenated_meta_df (identifier_index) identifier_index )attribute (identifier_values) identifier_values )attribute )argument_list )call )assignment )expression_statement )block )elif_clause )if_statement )block )function_definition )module
Reset ids in concatenated metadata and data dfs to unique integers and save the old ids in a metadata column. Note that the dataframes are modified in-place. Args: concatenated_meta_df (pandas df) data_df (pandas df) concat_direction (string): 'horiz' or 'vert' Returns: None (dfs modified in-place)
(module (function_definition (function_name_send_frame) function_name_send_frame (parameters (identifier_self) identifier_self (identifier_frame) identifier_frame )parameters (block (if_statement (attribute (identifier_self) identifier_self (identifier_get_mask_key) identifier_get_mask_key )attribute (block (expression_statement (assignment (attribute (identifier_frame) identifier_frame (identifier_get_mask_key) identifier_get_mask_key )attribute (attribute (identifier_self) identifier_self (identifier_get_mask_key) identifier_get_mask_key )attribute )assignment )expression_statement )block )if_statement (expression_statement (assignment (identifier_data) identifier_data (call (attribute (identifier_frame) identifier_frame (identifier_format) identifier_format )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_length) identifier_length (call (identifier_len) identifier_len (argument_list (identifier_data) identifier_data )argument_list )call )assignment )expression_statement (expression_statement (call (identifier_trace) identifier_trace (argument_list (binary_operator (string_"send: ") string_"send: " (call (identifier_repr) identifier_repr (argument_list (identifier_data) identifier_data )argument_list )call )binary_operator )argument_list )call )expression_statement (with_statement (with_clause (with_item (attribute (identifier_self) identifier_self (identifier_lock) identifier_lock )attribute )with_item )with_clause (block (while_statement (identifier_data) identifier_data (block (expression_statement (assignment (identifier_l) identifier_l (call (attribute (identifier_self) identifier_self (identifier__send) identifier__send )attribute (argument_list (identifier_data) identifier_data )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_data) identifier_data (subscript (identifier_data) identifier_data (slice (identifier_l) identifier_l (colon) colon )slice )subscript )assignment )expression_statement )block )while_statement )block )with_statement (return_statement (identifier_length) identifier_length )return_statement )block )function_definition )module
Send the data frame. frame: frame data created by ABNF.create_frame >>> ws = create_connection("ws://echo.websocket.org/") >>> frame = ABNF.create_frame("Hello", ABNF.OPCODE_TEXT) >>> ws.send_frame(frame) >>> cont_frame = ABNF.create_frame("My name is ", ABNF.OPCODE_CONT, 0) >>> ws.send_frame(frame) >>> cont_frame = ABNF.create_frame("Foo Bar", ABNF.OPCODE_CONT, 1) >>> ws.send_frame(frame)
(module (function_definition (function_name_serialize_seeds) function_name_serialize_seeds (parameters (identifier_seeds) identifier_seeds (identifier_block) identifier_block )parameters (block (for_statement (identifier_seed_dict) identifier_seed_dict (attribute (identifier_block) identifier_block (identifier_seeds) identifier_seeds )attribute (block (expression_statement (assignment (identifier_seed) identifier_seed (call (attribute (identifier_etree) identifier_etree (identifier_SubElement) identifier_SubElement )attribute (argument_list (identifier_seeds) identifier_seeds (string_'seed') string_'seed' )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (identifier_seed) identifier_seed (identifier_set) identifier_set )attribute (argument_list (string_'option') string_'option' (call (identifier_unicode) identifier_unicode (argument_list (binary_operator (call (attribute (identifier_seed_dict) identifier_seed_dict (identifier_get) identifier_get )attribute (argument_list (string_'answer') string_'answer' (integer_0) integer_0 )argument_list )call (integer_1) integer_1 )binary_operator )argument_list )call )argument_list )call )expression_statement (expression_statement (assignment (attribute (identifier_seed) identifier_seed (identifier_text) identifier_text )attribute (call (attribute (identifier_seed_dict) identifier_seed_dict (identifier_get) identifier_get )attribute (argument_list (string_'rationale') string_'rationale' (string_'') string_'' )argument_list )call )assignment )expression_statement )block )for_statement )block )function_definition )module
Serialize the seeds in peer instruction XBlock to xml Args: seeds (lxml.etree.Element): The <seeds> XML element. block (PeerInstructionXBlock): The XBlock with configuration to serialize. Returns: None
(module (function_definition (function_name_keys_to_values) function_name_keys_to_values (parameters (identifier_self) identifier_self (identifier_keys) identifier_keys )parameters (block (expression_statement (string_"Return the items in the keystore with keys in `keys`.") string_"Return the items in the keystore with keys in `keys`." )expression_statement (return_statement (call (identifier_dict) identifier_dict (generator_expression (tuple (identifier_k) identifier_k (identifier_v) identifier_v )tuple (for_in_clause (pattern_list (identifier_k) identifier_k (identifier_v) identifier_v )pattern_list (call (attribute (attribute (identifier_self) identifier_self (identifier_data) identifier_data )attribute (identifier_items) identifier_items )attribute (argument_list )argument_list )call )for_in_clause (if_clause (comparison_operator (identifier_k) identifier_k (identifier_keys) identifier_keys )comparison_operator )if_clause )generator_expression )call )return_statement )block )function_definition )module
Return the items in the keystore with keys in `keys`.
(module (function_definition (function_name_copy) function_name_copy (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_vs) identifier_vs (call (identifier_ValueSet) identifier_ValueSet (argument_list (keyword_argument (identifier_bits) identifier_bits (attribute (identifier_self) identifier_self (identifier_bits) identifier_bits )attribute )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_vs) identifier_vs (identifier__regions) identifier__regions )attribute (call (attribute (attribute (identifier_self) identifier_self (identifier__regions) identifier__regions )attribute (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_vs) identifier_vs (identifier__region_base_addrs) identifier__region_base_addrs )attribute (call (attribute (attribute (identifier_self) identifier_self (identifier__region_base_addrs) identifier__region_base_addrs )attribute (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (attribute (identifier_vs) identifier_vs (identifier__reversed) identifier__reversed )attribute (attribute (identifier_self) identifier_self (identifier__reversed) identifier__reversed )attribute )assignment )expression_statement (expression_statement (assignment (attribute (identifier_vs) identifier_vs (identifier__si) identifier__si )attribute (call (attribute (attribute (identifier_self) identifier_self (identifier__si) identifier__si )attribute (identifier_copy) identifier_copy )attribute (argument_list )argument_list )call )assignment )expression_statement (return_statement (identifier_vs) identifier_vs )return_statement )block )function_definition )module
Make a copy of self and return. :return: A new ValueSet object. :rtype: ValueSet
(module (function_definition (function_name_visit_BoolOp) function_name_visit_BoolOp (parameters (identifier_self) identifier_self (identifier_node) identifier_node )parameters (block (return_statement (call (identifier_sum) identifier_sum (argument_list (generator_expression (call (attribute (identifier_self) identifier_self (identifier_visit) identifier_visit )attribute (argument_list (identifier_value) identifier_value )argument_list )call (for_in_clause (identifier_value) identifier_value (attribute (identifier_node) identifier_node (identifier_values) identifier_values )attribute )for_in_clause )generator_expression (list )list )argument_list )call )return_statement )block )function_definition )module
Return type may come from any boolop operand.
(module (function_definition (function_name_dimers) function_name_dimers (parameters (identifier_primer1) identifier_primer1 (identifier_primer2) identifier_primer2 (default_parameter (identifier_concentrations) identifier_concentrations (list (float_5e-7) float_5e-7 (float_3e-11) float_3e-11 )list )default_parameter )parameters (block (expression_statement (assignment (identifier_nupack) identifier_nupack (call (attribute (attribute (identifier_coral) identifier_coral (identifier_analysis) identifier_analysis )attribute (identifier_NUPACK) identifier_NUPACK )attribute (argument_list (list (call (attribute (identifier_primer1) identifier_primer1 (identifier_primer) identifier_primer )attribute (argument_list )argument_list )call (call (attribute (identifier_primer2) identifier_primer2 (identifier_primer) identifier_primer )attribute (argument_list )argument_list )call (call (attribute (call (attribute (identifier_primer1) identifier_primer1 (identifier_primer) identifier_primer )attribute (argument_list )argument_list )call (identifier_reverse_complement) identifier_reverse_complement )attribute (argument_list )argument_list )call (call (attribute (call (attribute (identifier_primer2) identifier_primer2 (identifier_primer) identifier_primer )attribute (argument_list )argument_list )call (identifier_reverse_complement) identifier_reverse_complement )attribute (argument_list )argument_list )call )list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_primer_concs) identifier_primer_concs (binary_operator (list (subscript (identifier_concentrations) identifier_concentrations (integer_0) integer_0 )subscript )list (integer_2) integer_2 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_template_concs) identifier_template_concs (binary_operator (list (subscript (identifier_concentrations) identifier_concentrations (integer_1) integer_1 )subscript )list (integer_2) integer_2 )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_concs) identifier_concs (binary_operator (identifier_primer_concs) identifier_primer_concs (identifier_template_concs) identifier_template_concs )binary_operator )assignment )expression_statement (expression_statement (assignment (identifier_nupack_concs) identifier_nupack_concs (call (attribute (identifier_nupack) identifier_nupack (identifier_concentrations) identifier_concentrations )attribute (argument_list (integer_2) integer_2 (keyword_argument (identifier_conc) identifier_conc (identifier_concs) identifier_concs )keyword_argument )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_dimer_conc) identifier_dimer_conc (subscript (subscript (identifier_nupack_concs) identifier_nupack_concs (string_'concentrations') string_'concentrations' )subscript (integer_5) integer_5 )subscript )assignment )expression_statement (return_statement (binary_operator (identifier_dimer_conc) identifier_dimer_conc (subscript (identifier_concs) identifier_concs (integer_0) integer_0 )subscript )binary_operator )return_statement )block )function_definition )module
Calculate expected fraction of primer dimers. :param primer1: Forward primer. :type primer1: coral.DNA :param primer2: Reverse primer. :type primer2: coral.DNA :param template: DNA template. :type template: coral.DNA :param concentrations: list of concentrations for primers and the template. Defaults are those for PCR with 1kb template. :type concentrations: list :returns: Fraction of dimers versus the total amount of primer added. :rtype: float
(module (function_definition (function_name__handle_entity) function_name__handle_entity (parameters (identifier_self) identifier_self (identifier_token) identifier_token )parameters (block (expression_statement (assignment (identifier_token) identifier_token (call (attribute (attribute (identifier_self) identifier_self (identifier__tokens) identifier__tokens )attribute (identifier_pop) identifier_pop )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_token) identifier_token (attribute (identifier_tokens) identifier_tokens (identifier_HTMLEntityNumeric) identifier_HTMLEntityNumeric )attribute )argument_list )call (block (expression_statement (assignment (identifier_token) identifier_token (call (attribute (attribute (identifier_self) identifier_self (identifier__tokens) identifier__tokens )attribute (identifier_pop) identifier_pop )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_token) identifier_token (attribute (identifier_tokens) identifier_tokens (identifier_HTMLEntityHex) identifier_HTMLEntityHex )attribute )argument_list )call (block (expression_statement (assignment (identifier_text) identifier_text (call (attribute (attribute (identifier_self) identifier_self (identifier__tokens) identifier__tokens )attribute (identifier_pop) identifier_pop )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__tokens) identifier__tokens )attribute (identifier_pop) identifier_pop )attribute (argument_list )argument_list )call )expression_statement (return_statement (call (identifier_HTMLEntity) identifier_HTMLEntity (argument_list (attribute (identifier_text) identifier_text (identifier_text) identifier_text )attribute (keyword_argument (identifier_named) identifier_named (False) False )keyword_argument (keyword_argument (identifier_hexadecimal) identifier_hexadecimal (True) True )keyword_argument (keyword_argument (identifier_hex_char) identifier_hex_char (attribute (identifier_token) identifier_token (identifier_char) identifier_char )attribute )keyword_argument )argument_list )call )return_statement )block )if_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__tokens) identifier__tokens )attribute (identifier_pop) identifier_pop )attribute (argument_list )argument_list )call )expression_statement (return_statement (call (identifier_HTMLEntity) identifier_HTMLEntity (argument_list (attribute (identifier_token) identifier_token (identifier_text) identifier_text )attribute (keyword_argument (identifier_named) identifier_named (False) False )keyword_argument (keyword_argument (identifier_hexadecimal) identifier_hexadecimal (False) False )keyword_argument )argument_list )call )return_statement )block )if_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__tokens) identifier__tokens )attribute (identifier_pop) identifier_pop )attribute (argument_list )argument_list )call )expression_statement (return_statement (call (identifier_HTMLEntity) identifier_HTMLEntity (argument_list (attribute (identifier_token) identifier_token (identifier_text) identifier_text )attribute (keyword_argument (identifier_named) identifier_named (True) True )keyword_argument (keyword_argument (identifier_hexadecimal) identifier_hexadecimal (False) False )keyword_argument )argument_list )call )return_statement )block )function_definition )module
Handle a case where an HTML entity is at the head of the tokens.
(module (function_definition (function_name_unlink_parent_dir) function_name_unlink_parent_dir (parameters (typed_parameter (identifier_path) identifier_path (type (identifier_Path) identifier_Path )type )typed_parameter )parameters (type (None) None )type (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_info) identifier_info )attribute (argument_list (string_f"unlink {str(path)}") string_f"unlink {str(path)}" )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_path) identifier_path (identifier_unlink) identifier_unlink )attribute (argument_list )argument_list )call )expression_statement (expression_statement (assignment (identifier_parent_path) identifier_parent_path (attribute (identifier_path) identifier_path (identifier_parent) identifier_parent )attribute )assignment )expression_statement (try_statement (block (expression_statement (call (attribute (identifier_parent_path) identifier_parent_path (identifier_rmdir) identifier_rmdir )attribute (argument_list )argument_list )call )expression_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_info) identifier_info )attribute (argument_list (string_f"rmdir {str(parent_path)}") string_f"rmdir {str(parent_path)}" )argument_list )call )expression_statement )block (except_clause (as_pattern (identifier_OSError) identifier_OSError (as_pattern_target (identifier_oe) identifier_oe )as_pattern_target )as_pattern (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (string_f"Did not remove {str(parent_path)}: {str(oe)}") string_f"Did not remove {str(parent_path)}: {str(oe)}" )argument_list )call )expression_statement )block )except_clause )try_statement )block )function_definition )module
Remove a file and if the dir is empty remove it
(module (function_definition (function_name_validate_meta) function_name_validate_meta (parameters (identifier_meta) identifier_meta )parameters (block (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_meta) identifier_meta (tuple (identifier_dict) identifier_dict )tuple )argument_list )call )not_operator (block (raise_statement (call (identifier_TypeError) identifier_TypeError (argument_list (string_'Model Meta "linguist" must be a dict') string_'Model Meta "linguist" must be a dict' )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_required_keys) identifier_required_keys (tuple (string_"identifier") string_"identifier" (string_"fields") string_"fields" )tuple )assignment )expression_statement (for_statement (identifier_key) identifier_key (identifier_required_keys) identifier_required_keys (block (if_statement (comparison_operator (identifier_key) identifier_key (identifier_meta) identifier_meta )comparison_operator (block (raise_statement (call (identifier_KeyError) identifier_KeyError (argument_list (string_'Model Meta "linguist" dict requires %s to be defined') string_'Model Meta "linguist" dict requires %s to be defined' (identifier_key) identifier_key )argument_list )call )raise_statement )block )if_statement )block )for_statement (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (subscript (identifier_meta) identifier_meta (string_"fields") string_"fields" )subscript (tuple (identifier_list) identifier_list (identifier_tuple) identifier_tuple )tuple )argument_list )call )not_operator (block (raise_statement (call (identifier_ImproperlyConfigured) identifier_ImproperlyConfigured (argument_list (string_"Linguist Meta's fields attribute must be a list or tuple") string_"Linguist Meta's fields attribute must be a list or tuple" )argument_list )call )raise_statement )block )if_statement )block )function_definition )module
Validates Linguist Meta attribute.
(module (function_definition (function_name__consume_add_and_get_tag) function_name__consume_add_and_get_tag (parameters (identifier_self) identifier_self (identifier_consume_rpc_result) identifier_consume_rpc_result )parameters (block (expression_statement (assignment (identifier_consumer_tag) identifier_consumer_tag (subscript (identifier_consume_rpc_result) identifier_consume_rpc_result (string_'consumer_tag') string_'consumer_tag' )subscript )assignment )expression_statement (expression_statement (call (attribute (attribute (identifier_self) identifier_self (identifier__channel) identifier__channel )attribute (identifier_add_consumer_tag) identifier_add_consumer_tag )attribute (argument_list (identifier_consumer_tag) identifier_consumer_tag )argument_list )call )expression_statement (return_statement (identifier_consumer_tag) identifier_consumer_tag )return_statement )block )function_definition )module
Add the tag to the channel and return it. :param dict consume_rpc_result: :rtype: str
(module (function_definition (function_name_process_post_category) function_name_process_post_category (parameters (identifier_self) identifier_self (identifier_bulk_mode) identifier_bulk_mode (identifier_api_category) identifier_api_category )parameters (block (expression_statement (assignment (identifier_category) identifier_category (None) None )assignment )expression_statement (if_statement (identifier_bulk_mode) identifier_bulk_mode (block (expression_statement (assignment (identifier_category) identifier_category (call (attribute (subscript (attribute (identifier_self) identifier_self (identifier_ref_data_map) identifier_ref_data_map )attribute (string_"categories") string_"categories" )subscript (identifier_get) identifier_get )attribute (argument_list (subscript (identifier_api_category) identifier_api_category (string_"ID") string_"ID" )subscript )argument_list )call )assignment )expression_statement )block )if_statement (if_statement (not_operator (identifier_category) identifier_category )not_operator (block (expression_statement (assignment (pattern_list (identifier_category) identifier_category (identifier_created) identifier_created )pattern_list (call (attribute (attribute (identifier_Category) identifier_Category (identifier_objects) identifier_objects )attribute (identifier_get_or_create) identifier_get_or_create )attribute (argument_list (keyword_argument (identifier_site_id) identifier_site_id (attribute (identifier_self) identifier_self (identifier_site_id) identifier_site_id )attribute )keyword_argument (keyword_argument (identifier_wp_id) identifier_wp_id (subscript (identifier_api_category) identifier_api_category (string_"ID") string_"ID" )subscript )keyword_argument (keyword_argument (identifier_defaults) identifier_defaults (call (attribute (identifier_self) identifier_self (identifier_api_object_data) identifier_api_object_data )attribute (argument_list (string_"category") string_"category" (identifier_api_category) identifier_api_category )argument_list )call )keyword_argument )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (identifier_category) identifier_category (not_operator (identifier_created) identifier_created )not_operator )boolean_operator (block (expression_statement (call (attribute (identifier_self) identifier_self (identifier_update_existing_category) identifier_update_existing_category )attribute (argument_list (identifier_category) identifier_category (identifier_api_category) identifier_api_category )argument_list )call )expression_statement )block )if_statement (if_statement (identifier_category) identifier_category (block (expression_statement (assignment (subscript (subscript (attribute (identifier_self) identifier_self (identifier_ref_data_map) identifier_ref_data_map )attribute (string_"categories") string_"categories" )subscript (subscript (identifier_api_category) identifier_api_category (string_"ID") string_"ID" )subscript )subscript (identifier_category) identifier_category )assignment )expression_statement )block )if_statement )block )if_statement (return_statement (identifier_category) identifier_category )return_statement )block )function_definition )module
Create or update a Category related to a post. :param bulk_mode: If True, minimize db operations by bulk creating post objects :param api_category: the API data for the Category :return: the Category object
(module (function_definition (function_name_ij_jlk_to_ilk) function_name_ij_jlk_to_ilk (parameters (identifier_A) identifier_A (identifier_B) identifier_B )parameters (block (return_statement (call (attribute (call (attribute (identifier_A) identifier_A (identifier_dot) identifier_dot )attribute (argument_list (call (attribute (identifier_B) identifier_B (identifier_reshape) identifier_reshape )attribute (argument_list (subscript (attribute (identifier_B) identifier_B (identifier_shape) identifier_shape )attribute (integer_0) integer_0 )subscript (unary_operator (integer_1) integer_1 )unary_operator )argument_list )call )argument_list )call (identifier_reshape) identifier_reshape )attribute (argument_list (subscript (attribute (identifier_A) identifier_A (identifier_shape) identifier_shape )attribute (integer_0) integer_0 )subscript (subscript (attribute (identifier_B) identifier_B (identifier_shape) identifier_shape )attribute (integer_1) integer_1 )subscript (subscript (attribute (identifier_B) identifier_B (identifier_shape) identifier_shape )attribute (integer_2) integer_2 )subscript )argument_list )call )return_statement )block )function_definition )module
Faster version of einsum 'ij,jlk->ilk'
(module (function_definition (function_name_get_validator_change) function_name_get_validator_change (parameters (identifier_cls) identifier_cls (identifier_bigchain) identifier_bigchain )parameters (block (expression_statement (assignment (identifier_latest_block) identifier_latest_block (call (attribute (identifier_bigchain) identifier_bigchain (identifier_get_latest_block) identifier_get_latest_block )attribute (argument_list )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_latest_block) identifier_latest_block (None) None )comparison_operator (block (return_statement (None) None )return_statement )block )if_statement (return_statement (call (attribute (identifier_bigchain) identifier_bigchain (identifier_get_validator_change) identifier_get_validator_change )attribute (argument_list (subscript (identifier_latest_block) identifier_latest_block (string_'height') string_'height' )subscript )argument_list )call )return_statement )block )function_definition )module
Return the validator set from the most recent approved block :return: { 'height': <block_height>, 'validators': <validator_set> }
(module (function_definition (function_name_empty) function_name_empty (parameters (identifier_self) identifier_self )parameters (block (return_statement (call (identifier_any) identifier_any (generator_expression (comparison_operator (call (identifier_len) identifier_len (argument_list (call (attribute (identifier_self) identifier_self (identifier__get_axis) identifier__get_axis )attribute (argument_list (identifier_a) identifier_a )argument_list )call )argument_list )call (integer_0) integer_0 )comparison_operator (for_in_clause (identifier_a) identifier_a (attribute (identifier_self) identifier_self (identifier__AXIS_ORDERS) identifier__AXIS_ORDERS )attribute )for_in_clause )generator_expression )call )return_statement )block )function_definition )module
Indicator whether DataFrame is empty. True if DataFrame is entirely empty (no items), meaning any of the axes are of length 0. Returns ------- bool If DataFrame is empty, return True, if not return False. See Also -------- Series.dropna DataFrame.dropna Notes ----- If DataFrame contains only NaNs, it is still not considered empty. See the example below. Examples -------- An example of an actual empty DataFrame. Notice the index is empty: >>> df_empty = pd.DataFrame({'A' : []}) >>> df_empty Empty DataFrame Columns: [A] Index: [] >>> df_empty.empty True If we only have NaNs in our DataFrame, it is not considered empty! We will need to drop the NaNs to make the DataFrame empty: >>> df = pd.DataFrame({'A' : [np.nan]}) >>> df A 0 NaN >>> df.empty False >>> df.dropna().empty True
(module (function_definition (function_name__model_to_dict) function_name__model_to_dict (parameters (identifier_obj) identifier_obj )parameters (block (expression_statement (assignment (identifier_result) identifier_result (call (identifier__properties_model_to_dict) identifier__properties_model_to_dict (argument_list (attribute (identifier_obj) identifier_obj (identifier_properties) identifier_properties )attribute )argument_list )call )assignment )expression_statement (for_statement (identifier_attribute) identifier_attribute (tuple (string_'metadata') string_'metadata' (string_'snapshot') string_'snapshot' )tuple (block (try_statement (block (expression_statement (assignment (identifier_value) identifier_value (call (identifier_getattr) identifier_getattr (argument_list (identifier_obj) identifier_obj (identifier_attribute) identifier_attribute )argument_list )call )assignment )expression_statement )block (except_clause (identifier_AttributeError) identifier_AttributeError (block (continue_statement )continue_statement )block )except_clause )try_statement (if_statement (identifier_value) identifier_value (block (expression_statement (assignment (subscript (identifier_result) identifier_result (identifier_attribute) identifier_attribute )subscript (identifier_value) identifier_value )assignment )expression_statement )block )if_statement )block )for_statement (return_statement (identifier_result) identifier_result )return_statement )block )function_definition )module
Convert object model to dict. Args: obj: Object model. Returns: dict: Converted model.
(module (function_definition (function_name_backend_routing) function_name_backend_routing (parameters (identifier_self) identifier_self (identifier_context) identifier_context )parameters (block (expression_statement (call (identifier_satosa_logging) identifier_satosa_logging (argument_list (identifier_logger) identifier_logger (attribute (identifier_logging) identifier_logging (identifier_DEBUG) identifier_DEBUG )attribute (binary_operator (string_"Routing to backend: %s ") string_"Routing to backend: %s " (attribute (identifier_context) identifier_context (identifier_target_backend) identifier_target_backend )attribute )binary_operator (attribute (identifier_context) identifier_context (identifier_state) identifier_state )attribute )argument_list )call )expression_statement (expression_statement (assignment (identifier_backend) identifier_backend (subscript (subscript (attribute (identifier_self) identifier_self (identifier_backends) identifier_backends )attribute (attribute (identifier_context) identifier_context (identifier_target_backend) identifier_target_backend )attribute )subscript (string_"instance") string_"instance" )subscript )assignment )expression_statement (expression_statement (assignment (subscript (attribute (identifier_context) identifier_context (identifier_state) identifier_state )attribute (identifier_STATE_KEY) identifier_STATE_KEY )subscript (attribute (identifier_context) identifier_context (identifier_target_frontend) identifier_target_frontend )attribute )assignment )expression_statement (return_statement (identifier_backend) identifier_backend )return_statement )block )function_definition )module
Returns the targeted backend and an updated state :type context: satosa.context.Context :rtype satosa.backends.base.BackendModule :param context: The request context :return: backend
(module (function_definition (function_name_get_api_field_data) function_name_get_api_field_data (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_field) identifier_field (call (attribute (identifier_self) identifier_self (identifier_setup_field) identifier_setup_field )attribute (argument_list )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_d) identifier_d (dictionary (pair (string_'class') string_'class' (attribute (attribute (identifier_field) identifier_field (identifier___class__) identifier___class__ )attribute (identifier___name__) identifier___name__ )attribute )pair (pair (string_'widget') string_'widget' (dictionary (pair (string_'class') string_'class' (attribute (attribute (attribute (identifier_field) identifier_field (identifier_widget) identifier_widget )attribute (identifier___class__) identifier___class__ )attribute (identifier___name__) identifier___name__ )attribute )pair )dictionary )pair )dictionary )assignment )expression_statement (try_statement (block (expression_statement (assignment (subscript (identifier_d) identifier_d (string_'input_type') string_'input_type' )subscript (attribute (attribute (identifier_field) identifier_field (identifier_widget) identifier_widget )attribute (identifier_input_type) identifier_input_type )attribute )assignment )expression_statement )block (except_clause (identifier_AttributeError) identifier_AttributeError (block (expression_statement (assignment (subscript (identifier_d) identifier_d (string_'input_type') string_'input_type' )subscript (None) None )assignment )expression_statement )block )except_clause )try_statement (return_statement (identifier_d) identifier_d )return_statement )block )function_definition )module
Field data to serialize for use on front-end side, for example will include choices available for a choice field
(module (function_definition (function_name___update_throughput) function_name___update_throughput (parameters (identifier_table_name) identifier_table_name (identifier_key_name) identifier_key_name (identifier_read_units) identifier_read_units (identifier_write_units) identifier_write_units )parameters (block (try_statement (block (expression_statement (assignment (identifier_current_ru) identifier_current_ru (call (attribute (identifier_dynamodb) identifier_dynamodb (identifier_get_provisioned_table_read_units) identifier_get_provisioned_table_read_units )attribute (argument_list (identifier_table_name) identifier_table_name )argument_list )call )assignment )expression_statement (expression_statement (assignment (identifier_current_wu) identifier_current_wu (call (attribute (identifier_dynamodb) identifier_dynamodb (identifier_get_provisioned_table_write_units) identifier_get_provisioned_table_write_units )attribute (argument_list (identifier_table_name) identifier_table_name )argument_list )call )assignment )expression_statement )block (except_clause (identifier_JSONResponseError) identifier_JSONResponseError (block (raise_statement )raise_statement )block )except_clause )try_statement (try_statement (block (expression_statement (assignment (identifier_table_status) identifier_table_status (call (attribute (identifier_dynamodb) identifier_dynamodb (identifier_get_table_status) identifier_get_table_status )attribute (argument_list (identifier_table_name) identifier_table_name )argument_list )call )assignment )expression_statement )block (except_clause (identifier_JSONResponseError) identifier_JSONResponseError (block (raise_statement )raise_statement )block )except_clause )try_statement (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_debug) identifier_debug )attribute (argument_list (call (attribute (string_'{0} - Table status is {1}') string_'{0} - Table status is {1}' (identifier_format) identifier_format )attribute (argument_list (identifier_table_name) identifier_table_name (identifier_table_status) identifier_table_status )argument_list )call )argument_list )call )expression_statement (if_statement (comparison_operator (identifier_table_status) identifier_table_status (string_'ACTIVE') string_'ACTIVE' )comparison_operator (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_warning) identifier_warning )attribute (argument_list (call (attribute (concatenated_string (string_'{0} - Not performing throughput changes when table ') string_'{0} - Not performing throughput changes when table ' (string_'is {1}') string_'is {1}' )concatenated_string (identifier_format) identifier_format )attribute (argument_list (identifier_table_name) identifier_table_name (identifier_table_status) identifier_table_status )argument_list )call )argument_list )call )expression_statement (return_statement )return_statement )block )if_statement (if_statement (call (identifier_get_table_option) identifier_get_table_option (argument_list (identifier_key_name) identifier_key_name (string_'always_decrease_rw_together') string_'always_decrease_rw_together' )argument_list )call (block (expression_statement (assignment (pattern_list (identifier_read_units) identifier_read_units (identifier_write_units) identifier_write_units )pattern_list (call (identifier___calculate_always_decrease_rw_values) identifier___calculate_always_decrease_rw_values (argument_list (identifier_table_name) identifier_table_name (identifier_read_units) identifier_read_units (identifier_current_ru) identifier_current_ru (identifier_write_units) identifier_write_units (identifier_current_wu) identifier_current_wu )argument_list )call )assignment )expression_statement (if_statement (boolean_operator (comparison_operator (identifier_read_units) identifier_read_units (identifier_current_ru) identifier_current_ru )comparison_operator (comparison_operator (identifier_write_units) identifier_write_units (identifier_current_wu) identifier_current_wu )comparison_operator )boolean_operator (block (expression_statement (call (attribute (identifier_logger) identifier_logger (identifier_info) identifier_info )attribute (argument_list (call (attribute (string_'{0} - No changes to perform') string_'{0} - No changes to perform' (identifier_format) identifier_format )attribute (argument_list (identifier_table_name) identifier_table_name )argument_list )call )argument_list )call )expression_statement (return_statement )return_statement )block )if_statement )block )if_statement (expression_statement (call (attribute (identifier_dynamodb) identifier_dynamodb (identifier_update_table_provisioning) identifier_update_table_provisioning )attribute (argument_list (identifier_table_name) identifier_table_name (identifier_key_name) identifier_key_name (call (identifier_int) identifier_int (argument_list (identifier_read_units) identifier_read_units )argument_list )call (call (identifier_int) identifier_int (argument_list (identifier_write_units) identifier_write_units )argument_list )call )argument_list )call )expression_statement )block )function_definition )module
Update throughput on the DynamoDB table :type table_name: str :param table_name: Name of the DynamoDB table :type key_name: str :param key_name: Configuration option key name :type read_units: int :param read_units: New read unit provisioning :type write_units: int :param write_units: New write unit provisioning
(module (function_definition (function_name_num_species) function_name_num_species (parameters (identifier_self) identifier_self )parameters (block (expression_statement (assignment (identifier_all_headers) identifier_all_headers (call (identifier_reduce) identifier_reduce (argument_list (lambda (lambda_parameters (identifier_x) identifier_x (identifier_y) identifier_y )lambda_parameters (binary_operator (call (identifier_set) identifier_set (argument_list (identifier_x) identifier_x )argument_list )call (call (identifier_set) identifier_set (argument_list (identifier_y) identifier_y )argument_list )call )binary_operator )lambda (generator_expression (call (attribute (identifier_rec) identifier_rec (identifier_get_names) identifier_get_names )attribute (argument_list )argument_list )call (for_in_clause (identifier_rec) identifier_rec (attribute (identifier_self) identifier_self (identifier_records) identifier_records )attribute )for_in_clause )generator_expression )argument_list )call )assignment )expression_statement (return_statement (call (identifier_len) identifier_len (argument_list (identifier_all_headers) identifier_all_headers )argument_list )call )return_statement )block )function_definition )module
Returns the number of species found over all records
(module (function_definition (function_name_consumer_partitions_for_topic) function_name_consumer_partitions_for_topic (parameters (identifier_consumer) identifier_consumer (identifier_topic) identifier_topic )parameters (block (expression_statement (assignment (identifier_topic_partitions) identifier_topic_partitions (list )list )assignment )expression_statement (expression_statement (assignment (identifier_partitions) identifier_partitions (call (attribute (identifier_consumer) identifier_consumer (identifier_partitions_for_topic) identifier_partitions_for_topic )attribute (argument_list (identifier_topic) identifier_topic )argument_list )call )assignment )expression_statement (if_statement (comparison_operator (identifier_partitions) identifier_partitions (None) None )comparison_operator (block (for_statement (identifier_partition) identifier_partition (identifier_partitions) identifier_partitions (block (expression_statement (call (attribute (identifier_topic_partitions) identifier_topic_partitions (identifier_append) identifier_append )attribute (argument_list (call (identifier_TopicPartition) identifier_TopicPartition (argument_list (identifier_topic) identifier_topic (identifier_partition) identifier_partition )argument_list )call )argument_list )call )expression_statement )block )for_statement )block (else_clause (block (expression_statement (call (attribute (identifier_logging) identifier_logging (identifier_error) identifier_error )attribute (argument_list (call (attribute (string_"No partitions found for topic {}. Maybe it doesn't exist?") string_"No partitions found for topic {}. Maybe it doesn't exist?" (identifier_format) identifier_format )attribute (argument_list (identifier_topic) identifier_topic )argument_list )call )argument_list )call )expression_statement )block )else_clause )if_statement (return_statement (identifier_topic_partitions) identifier_topic_partitions )return_statement )block )function_definition )module
Returns a list of all TopicPartitions for a given topic. Arguments: consumer: an initialized KafkaConsumer topic: a topic name to fetch TopicPartitions for :returns: list(TopicPartition): A list of TopicPartitions that belong to the given topic
(module (function_definition (function_name__config) function_name__config (parameters )parameters (block (expression_statement (assignment (identifier_status_url) identifier_status_url (boolean_operator (call (subscript (identifier___salt__) identifier___salt__ (string_'config.get') string_'config.get' )subscript (argument_list (string_'nagios.status_url') string_'nagios.status_url' )argument_list )call (line_continuation_\) line_continuation_\ (call (subscript (identifier___salt__) identifier___salt__ (string_'config.get') string_'config.get' )subscript (argument_list (string_'nagios:status_url') string_'nagios:status_url' )argument_list )call )boolean_operator )assignment )expression_statement (if_statement (not_operator (identifier_status_url) identifier_status_url )not_operator (block (raise_statement (call (identifier_CommandExecutionError) identifier_CommandExecutionError (argument_list (string_'Missing Nagios URL in the configuration.') string_'Missing Nagios URL in the configuration.' )argument_list )call )raise_statement )block )if_statement (expression_statement (assignment (identifier_username) identifier_username (boolean_operator (call (subscript (identifier___salt__) identifier___salt__ (string_'config.get') string_'config.get' )subscript (argument_list (string_'nagios.username') string_'nagios.username' )argument_list )call (line_continuation_\) line_continuation_\ (call (subscript (identifier___salt__) identifier___salt__ (string_'config.get') string_'config.get' )subscript (argument_list (string_'nagios:username') string_'nagios:username' )argument_list )call )boolean_operator )assignment )expression_statement (expression_statement (assignment (identifier_password) identifier_password (boolean_operator (call (subscript (identifier___salt__) identifier___salt__ (string_'config.get') string_'config.get' )subscript (argument_list (string_'nagios.password') string_'nagios.password' )argument_list )call (line_continuation_\) line_continuation_\ (call (subscript (identifier___salt__) identifier___salt__ (string_'config.get') string_'config.get' )subscript (argument_list (string_'nagios:password') string_'nagios:password' )argument_list )call )boolean_operator )assignment )expression_statement (return_statement (dictionary (pair (string_'url') string_'url' (identifier_status_url) identifier_status_url )pair (pair (string_'username') string_'username' (identifier_username) identifier_username )pair (pair (string_'password') string_'password' (identifier_password) identifier_password )pair )dictionary )return_statement )block )function_definition )module
Get configuration items for URL, Username and Password
(module (function_definition (function_name_scramble_string) function_name_scramble_string (parameters (identifier_self) identifier_self (identifier_length) identifier_length )parameters (block (return_statement (conditional_expression (call (attribute (identifier_fake) identifier_fake (identifier_text) identifier_text )attribute (argument_list (identifier_length) identifier_length )argument_list )call (comparison_operator (identifier_length) identifier_length (integer_5) integer_5 )comparison_operator (call (attribute (string_'') string_'' (identifier_join) identifier_join )attribute (argument_list (list_comprehension (call (attribute (identifier_fake) identifier_fake (identifier_random_letter) identifier_random_letter )attribute (argument_list )argument_list )call (for_in_clause (identifier_n) identifier_n (call (identifier_range) identifier_range (argument_list (integer_0) integer_0 (identifier_length) identifier_length )argument_list )call )for_in_clause )list_comprehension )argument_list )call )conditional_expression )return_statement )block )function_definition )module
Return random string
(module (function_definition (function_name_filter_embeddings) function_name_filter_embeddings (parameters (identifier_embeddings) identifier_embeddings (identifier_vocab) identifier_vocab (identifier_dim) identifier_dim )parameters (block (if_statement (not_operator (call (identifier_isinstance) identifier_isinstance (argument_list (identifier_embeddings) identifier_embeddings (identifier_dict) identifier_dict )argument_list )call )not_operator (block (return_statement )return_statement )block )if_statement (expression_statement (assignment (identifier__embeddings) identifier__embeddings (call (attribute (identifier_np) identifier_np (identifier_zeros) identifier_zeros )attribute (argument_list (list (call (identifier_len) identifier_len (argument_list (identifier_vocab) identifier_vocab )argument_list )call (identifier_dim) identifier_dim )list )argument_list )call )assignment )expression_statement (for_statement (identifier_word) identifier_word (identifier_vocab) identifier_vocab (block (if_statement (comparison_operator (identifier_word) identifier_word (identifier_embeddings) identifier_embeddings )comparison_operator (block (expression_statement (assignment (identifier_word_idx) identifier_word_idx (subscript (identifier_vocab) identifier_vocab (identifier_word) identifier_word )subscript )assignment )expression_statement (expression_statement (assignment (subscript (identifier__embeddings) identifier__embeddings (identifier_word_idx) identifier_word_idx )subscript (subscript (identifier_embeddings) identifier_embeddings (identifier_word) identifier_word )subscript )assignment )expression_statement )block )if_statement )block )for_statement (return_statement (identifier__embeddings) identifier__embeddings )return_statement )block )function_definition )module
Loads word vectors in numpy array. Args: embeddings (dict): a dictionary of numpy array. vocab (dict): word_index lookup table. Returns: numpy array: an array of word embeddings.